summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/MicrosoftCompatibility.c12
-rw-r--r--clang/test/Sema/MicrosoftExtensions.c10
-rw-r--r--clang/test/SemaCXX/MicrosoftCompatibility-cxx98.cpp8
-rw-r--r--clang/test/SemaCXX/MicrosoftExtensions.cpp5
-rw-r--r--clang/test/SemaTemplate/enum-forward.cpp2
5 files changed, 21 insertions, 16 deletions
diff --git a/clang/test/Sema/MicrosoftCompatibility.c b/clang/test/Sema/MicrosoftCompatibility.c
new file mode 100644
index 00000000000..c26c3039fde
--- /dev/null
+++ b/clang/test/Sema/MicrosoftCompatibility.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-compatibility
+
+enum ENUM1; // expected-warning {{forward references to 'enum' types are a Microsoft extension}}
+enum ENUM1 var1 = 3;
+enum ENUM1* var2 = 0;
+
+
+enum ENUM2 {
+ ENUM2_a = (enum ENUM2) 4,
+ ENUM2_b = 0x9FFFFFFF, // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
+ ENUM2_c = 0x100000000 // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
+};
diff --git a/clang/test/Sema/MicrosoftExtensions.c b/clang/test/Sema/MicrosoftExtensions.c
index a08aeab99b8..a4a8acd78e8 100644
--- a/clang/test/Sema/MicrosoftExtensions.c
+++ b/clang/test/Sema/MicrosoftExtensions.c
@@ -21,16 +21,6 @@ struct D {
};
-enum ENUM1; // expected-warning {{forward references to 'enum' types are a Microsoft extension}}
-enum ENUM1 var1 = 3;
-enum ENUM1* var2 = 0;
-
-
-enum ENUM2 {
- ENUM2_a = (enum ENUM2) 4,
- ENUM2_b = 0x9FFFFFFF, // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
- ENUM2_c = 0x100000000 // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
-};
diff --git a/clang/test/SemaCXX/MicrosoftCompatibility-cxx98.cpp b/clang/test/SemaCXX/MicrosoftCompatibility-cxx98.cpp
new file mode 100644
index 00000000000..0c7d354c306
--- /dev/null
+++ b/clang/test/SemaCXX/MicrosoftCompatibility-cxx98.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -std=c++98 -Wmicrosoft -verify -fms-compatibility -fexceptions -fcxx-exceptions
+
+
+//MSVC allows forward enum declaration
+enum ENUM; // expected-warning {{forward references to 'enum' types are a Microsoft extension}}
+ENUM *var = 0;
+ENUM var2 = (ENUM)3;
+enum ENUM1* var3 = 0;// expected-warning {{forward references to 'enum' types are a Microsoft extension}}
diff --git a/clang/test/SemaCXX/MicrosoftExtensions.cpp b/clang/test/SemaCXX/MicrosoftExtensions.cpp
index 93da08f1f20..0b72cd3e1fc 100644
--- a/clang/test/SemaCXX/MicrosoftExtensions.cpp
+++ b/clang/test/SemaCXX/MicrosoftExtensions.cpp
@@ -92,11 +92,6 @@ void m1() {
h1(&M::subtractP);
}
-//MSVC allows forward enum declaration
-enum ENUM; // expected-warning {{forward references to 'enum' types are a Microsoft extension}}
-ENUM *var = 0;
-ENUM var2 = (ENUM)3;
-enum ENUM1* var3 = 0;// expected-warning {{forward references to 'enum' types are a Microsoft extension}}
diff --git a/clang/test/SemaTemplate/enum-forward.cpp b/clang/test/SemaTemplate/enum-forward.cpp
index 3a4f05c0baa..b25c21fc463 100644
--- a/clang/test/SemaTemplate/enum-forward.cpp
+++ b/clang/test/SemaTemplate/enum-forward.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fms-extensions %s
+// RUN: %clang_cc1 -fsyntax-only -fms-compatibility %s
template<typename T>
struct X {
OpenPOWER on IntegriCloud