Summary: | No errors on non-existent symbol in constructor | ||
---|---|---|---|
Product: | gcc | Reporter: | So Townsend <so.townsend> |
Component: | c++ | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 4.6.2 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | ||
Attachments: | Example of problem |
Comment on attachment 26183 [details] Example of problem >#include <iostream> > >class Foo >{ >public: > Foo() > { > Foo(a); > } > > Foo(int x) > { > } >}; > >int main() >{ > Foo f; > return 0; >} that doesn't call a constructor, it declares an object called a, so is identical to: Foo() { Foo a; } which causes an infinite recursion well, sorry, it does call a constructor, but it calls the same one (the default cosntructor) it doesn't call the other constructor "with a non-existent symbol" |
Created attachment 26183 [details] Example of problem Creating a class with a constructor that calls another construct with a non existent symbol yields a segfault and no compile time errors or warnings. Both -std=C++0x and standard compilation have the same issue.