[clang] [Clang] [Sema] Error on reference types inside a union with msvc 1900+ (PR #102851)
Max Winkler via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 14 18:23:07 PDT 2024
================
@@ -619,6 +616,20 @@ template<typename T> struct A {};
template<typename T> struct B : A<A<T>> { A<T>::C::D d; }; // expected-warning {{implicit 'typename' is a C++20 extension}}
}
+#elif TEST4
+
+union u {
+ int *i1;
+ int &i2; // expected-warning {{union member 'i2' has reference type 'int &', which is a Microsoft extension}}
+};
+
+#elif TEST5
+
+union u {
+ int *i1;
+ int &i2; // expected-error {{union member 'i2' has reference type 'int &'}}
+};
+
----------------
MaxEW707 wrote:
The more you know. Putting this into my notes. I'll get this cleaned up :).
https://github.com/llvm/llvm-project/pull/102851
More information about the cfe-commits
mailing list