<div dir="ltr">GCC also rejects this: <a href="https://godbolt.org/z/O7FSC6">https://godbolt.org/z/O7FSC6</a><br><br>So I'm leaning towards Clang/GCC probably being correct - but CC'ing Richard Smith: I would've thought the enclosing class of 'm' would be B, and so the default member initializer wasn't needed before the end of /that/ enclosing class. But I guess I'm wrong here?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 31, 2019 at 9:18 AM kamlesh kumar via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Devs,<br>
Consider below testcase<br>
<br>
$cat test.cpp<br>
<br>
struct A<br>
{<br>
struct B<br>
{<br>
double m = 0.;<br>
};<br>
void f(double d, const B &b = B{}) {}<br>
};<br>
<br>
==============<br>
<br>
clang fails fails to compile above tescase ,while it goes smooth with<br>
icc and msvc.<br>
is clang doing right?<br>
<br>
./Kamlesh<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>