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) { }
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
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
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 ;)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58317
Jonathan Wakely redi at gcc dot gnu.org changed:
What|Removed |Added
Keywords||diagnostic