|
1 |
| -// RUN: %clang_cc1 -std=c++17 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify -fms-extensions -fexceptions -fcxx-exceptions -DTEST1 |
2 |
| -// RUN: %clang_cc1 -std=c++98 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify=expected,precxx17 -fms-extensions -fexceptions -fcxx-exceptions -DTEST1 |
3 |
| -// RUN: %clang_cc1 -std=c++11 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify=expected,precxx17 -fms-extensions -fexceptions -fcxx-exceptions -DTEST1 |
4 |
| -// RUN: %clang_cc1 -std=c++14 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify=expected,precxx17 -fexceptions -fcxx-exceptions -DTEST2 |
5 |
| -// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -std=c++11 -fms-compatibility -verify -DTEST3 |
| 1 | +// RUN: %clang_cc1 -std=c++17 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify=expected,ms-union-ext -fms-extensions -fexceptions -fcxx-exceptions -DTEST1 |
| 2 | +// RUN: %clang_cc1 -std=c++98 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify=expected,precxx17,ms-union-ext -fms-extensions -fexceptions -fcxx-exceptions -DTEST1 |
| 3 | +// RUN: %clang_cc1 -std=c++11 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify=expected,precxx17,ms-union-ext -fms-extensions -fexceptions -fcxx-exceptions -DTEST1 |
| 4 | +// RUN: %clang_cc1 -std=c++14 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify=expected,precxx17,ms-union-ext-disabled -fexceptions -fcxx-exceptions -DTEST2 |
| 5 | +// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -std=c++11 -fms-compatibility -verify=expected,ms-union-ext -DTEST3 |
| 6 | +// RUN: %clang_cc1 -std=c++17 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -verify=ms-union-ext -fms-extensions -fms-compatibility-version=18.00 |
| 7 | +// RUN: %clang_cc1 -std=c++17 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -verify=ms-union-ext-disabled -fms-extensions -fms-compatibility-version=19.00 |
6 | 8 |
|
7 | 9 | #if TEST1
|
8 | 10 |
|
@@ -384,11 +386,6 @@ void TestSP9() {
|
384 | 386 | c3.h(); // Overloaded unary op operand
|
385 | 387 | }
|
386 | 388 |
|
387 |
| -union u { |
388 |
| - int *i1; |
389 |
| - int &i2; // expected-warning {{union member 'i2' has reference type 'int &', which is a Microsoft extension}} |
390 |
| -}; |
391 |
| - |
392 | 389 | // Property getter using reference.
|
393 | 390 | struct SP11 {
|
394 | 391 | __declspec(property(get=GetV)) int V;
|
@@ -619,9 +616,12 @@ template<typename T> struct A {};
|
619 | 616 | template<typename T> struct B : A<A<T>> { A<T>::C::D d; }; // expected-warning {{implicit 'typename' is a C++20 extension}}
|
620 | 617 | }
|
621 | 618 |
|
622 |
| -#else |
623 |
| - |
624 |
| -#error Unknown test mode |
625 |
| - |
626 | 619 | #endif
|
627 | 620 |
|
| 621 | +union u { |
| 622 | + int *i1; |
| 623 | + |
| 624 | + // ms-union-ext-warning@+2 {{union member 'i2' has reference type 'int &', which is a Microsoft extension}} |
| 625 | + // ms-union-ext-disabled-error@+1 {{union member 'i2' has reference type 'int &'}} |
| 626 | + int &i2; |
| 627 | +}; |
0 commit comments