Add support for Microsoft __if_exists, __if_not_exists extension at class scope.
Example:
typedef int TYPE;
class C {
__if_exists(TYPE) {
TYPE a;
}
__if_not_exists(TYPE) {
this will never be parsed.
}
};
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132052 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/MicrosoftExtensions.cpp b/test/Parser/MicrosoftExtensions.cpp
index adf93b6..3a72ea0 100644
--- a/test/Parser/MicrosoftExtensions.cpp
+++ b/test/Parser/MicrosoftExtensions.cpp
@@ -168,7 +168,7 @@
__int64 x7 = __int64(0);
-
+namespace If_exists_test {
class IF_EXISTS {
private:
@@ -210,6 +210,31 @@
int var244;
}
+class IF_EXISTS_CLASS_TEST {
+ __if_exists(IF_EXISTS::Type) {
+ // __if_exists, __if_not_exists can nest
+ __if_not_exists(IF_EXISTS::Type_not) {
+ int var123;
+ }
+ int var23;
+ }
+
+ __if_exists(IF_EXISTS::Type_not) {
+ this wont compile.
+ }
+
+ __if_not_exists(IF_EXISTS::Type) {
+ this wont compile.
+ }
+
+ __if_not_exists(IF_EXISTS::Type_not) {
+ int var244;
+ }
+};
+
+}
+
+
int __identifier(generic) = 3;
class inline_definition_pure_spec {