[cfe-dev] Clang fails to compile
David Blaikie via cfe-dev
cfe-dev at lists.llvm.org
Thu Oct 31 10:39:17 PDT 2019
GCC also rejects this: https://godbolt.org/z/O7FSC6
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?
On Thu, Oct 31, 2019 at 9:18 AM kamlesh kumar via cfe-dev <
cfe-dev at lists.llvm.org> wrote:
> Hi Devs,
> Consider below testcase
>
> $cat test.cpp
>
> struct A
> {
> struct B
> {
> double m = 0.;
> };
> void f(double d, const B &b = B{}) {}
> };
>
> ==============
>
> clang fails fails to compile above tescase ,while it goes smooth with
> icc and msvc.
> is clang doing right?
>
> ./Kamlesh
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20191031/98686bd3/attachment.html>
More information about the cfe-dev
mailing list