================
@@ -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 
&'}}
+};
+
----------------
AaronBallman wrote:

A better way to do this is to use one conditional block and use different 
`-verify` prefixes so that we don't have to duplicate the code (it makes it 
more clear what's going on with the tests). 
https://github.com/llvm/llvm-project/blob/main/clang/test/Sema/empty-init.c is 
an example of how to do this.

https://github.com/llvm/llvm-project/pull/102851
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to