rsmith added a comment.

In http://reviews.llvm.org/D16552#346678, @thakis wrote:

> Will do, thanks! In "If the implicit default constructor initializes all 
> subobjects, no initializer should be required", is "initializes all 
> subobjects meant recursively?


I think so, or more specifically, the implicit initialization would need to be 
valid if each member were itself `const`.

>   struct Inner {

>     Inner() = default;

>     int i;  // not initialized, but Inner has a default ctor

>   };

>   

>   struct S {

>     Inner inner;

>   };

>   

>   const S s;

> 


This would be ill-formed because `S::S()` would notionally default-initialize 
`s.inner` of type `const Inner`, which would notionally default-initialize 
`s.inner.i` of type `const int`, which would be ill-formed.


http://reviews.llvm.org/D16552



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to