------- Comment #2 from andrew dot stubbs at st dot com 2006-09-13 09:23 ------- (In reply to comment #1) > As you've written it, class C doesn't have any non-static members. Struct > C::s > hasn't been declared as a member object of C. const int i is a member of > C::s, > not C, so C() without member initializers should be acceptable.
How about this example: struct S { const int i; }; class C { public: C() { } S s; }; void f() { C c; S s; } This fails at the line `S s;' in f(), but the `C c;' line is accepted silently. The standard says the requirement applies to data-members *containing* a member of const-qualified type. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29043