================ @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -std=c++14 -verify -fcxx-exceptions -Werror=c++14-extensions -Werror=c++20-extensions %s + +template <class> struct C { + union { + int i; + }; + constexpr C() {} // expected-error {{constexpr union constructor that does not initialize any member is a C++20 extension}} +}; +constexpr C<int> c; + +template <class> class D { + union { + int i; + }; +public: + constexpr D() {} // expected-error {{constexpr union constructor that does not initialize any member is a C++20 extension}} +}; +constexpr D<int> d; ---------------- shafik wrote:
Please add a newline at the end of the file. https://github.com/llvm/llvm-project/pull/81042 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits