https://bugs.llvm.org/show_bug.cgi?id=42336
Richard Smith <richard-l...@metafoo.co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|NEW |RESOLVED
--- Comment #1 from Richard Smith <richard-l...@metafoo.co.uk> ---
[First case]
> clang accepts the code, but gcc reject it:
GCC's diagnostic is wrong here. The problem is that only a constexpr or const
integral data member can be initialized in a class definition. It looks like
GCC correctly detects the problem but then issues the wrong diagnostic in this
case.
It looks like clang doesn't diagnose that problem until the class is
instantiated if the initializer of the member is type-dependent (but it does
diagnose it in that case). Both Clang's and GCC's behaviors are conforming --
there is no requirement to diagnose invalid templates that are never
instantiated.
[Second case]
> gcc accepts it, but clang rejects it:
This is ill-formed. In this case, Clang rejects it in the template definition,
but GCC doesn't reject it until instantiation. Again, both behaviors are
conforming.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs