<div dir="ltr">Hi,<div>I would like to ask about the difference in behavior of C++11 explicit constructors, between Clang/LLVM 3.4 and current trunk version (3.5). The following:</div><div><br></div><div><div><div> #include <stdio.h></div>
<div> struct Inner {</div><div> explicit Inner() {}</div><div> };</div><div> struct Outer {</div><div> Inner member;</div><div> };</div><div> int main() {</div><div> Outer s = {};</div><div> printf("%p\n", &s); // just to silence "unused variable" warning</div>
<div> return 0;</div><div> }</div></div></div><div><br></div><div>compiles fine with Clang 3.4 using "clang++ -std=c++11 -Wall -Wpedantic", however using trunk version, this gives me "chosen constructor is explicit in copy-initialization" error. Is this the right (intended) behavior? How can you zero-initialize such an object? I mean "Outer s = Outer{}" doesn't compile either.</div>
<div><br></div><div>Thanks,</div><div>Kuba</div><div><br></div></div>