[Bug c++/58317] Calling a method while preparing to call the constructor should be illegal

2013-09-07 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58317 --- Comment #5 from Jonathan Wakely redi at gcc dot gnu.org --- (In reply to Oleg Smolsky from comment #2) Hey Jonathan, here is a simpler and more natural way to rewrite your example: struct A { static int f() { return 0; } A(int) { }

[Bug c++/58317] Calling a method while preparing to call the constructor should be illegal

2013-09-06 Thread oleg at smolsky dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58317 --- Comment #2 from Oleg Smolsky oleg at smolsky dot net --- Hey Jonathan, here is a simpler and more natural way to rewrite your example: struct A { static int f() { return 0; } A(int) { } }; int main() { A a(A::f()); // it is

[Bug c++/58317] Calling a method while preparing to call the constructor should be illegal

2013-09-06 Thread oleg at smolsky dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58317 --- Comment #3 from Oleg Smolsky oleg at smolsky dot net --- Also, clang gives a warning: struct A { int f() const { return 1000; } A(int arg) : member(arg) { } int member; }; namespace { int func(const A a) { return a.f(); } } int

[Bug c++/58317] Calling a method while preparing to call the constructor should be illegal

2013-09-06 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58317 --- Comment #4 from Paolo Carlini paolo.carlini at oracle dot com --- If the actual topic is warning for self-initialization, or something like that, we have one or even two bugs already in Bugzilla ;)

[Bug c++/58317] Calling a method while preparing to call the constructor should be illegal

2013-09-05 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58317 Jonathan Wakely redi at gcc dot gnu.org changed: What|Removed |Added Keywords||diagnostic