------- Comment #1 from fang at csl dot cornell dot edu  2006-09-13 03:00 
-------
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.  

Note, if you write just :

struct s {
  const int i;
};

// This, however, doesn't give any diagnostics until an instance of s is
declared.  

s foo;

struct.cc:7: error: structure 'foo' with uninitialized const members

Now, I'd need to lookup the standard to determine whether or not a diagnostic
is appropriate...


-- 

fang at csl dot cornell dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fang at csl dot cornell dot
                   |                            |edu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29043

Reply via email to