diff options
author | Francois Pichet <pichet2000@gmail.com> | 2011-05-25 10:19:49 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2011-05-25 10:19:49 +0000 |
commit | 8f981d5964a4d189aeb3ffb07c0c290066c618b8 (patch) | |
tree | 8b548b4eedbafad6d2fbcf9da64bccfcc1f319e4 /clang/test/Parser/MicrosoftExtensions.cpp | |
parent | 308a5344315834a8540b532ed74bdce27db3d70f (diff) | |
download | bcm5719-llvm-8f981d5964a4d189aeb3ffb07c0c290066c618b8.tar.gz bcm5719-llvm-8f981d5964a4d189aeb3ffb07c0c290066c618b8.zip |
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.
}
};
llvm-svn: 132052
Diffstat (limited to 'clang/test/Parser/MicrosoftExtensions.cpp')
-rw-r--r-- | clang/test/Parser/MicrosoftExtensions.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/clang/test/Parser/MicrosoftExtensions.cpp b/clang/test/Parser/MicrosoftExtensions.cpp index adf93b62d1a..3a72ea0234c 100644 --- a/clang/test/Parser/MicrosoftExtensions.cpp +++ b/clang/test/Parser/MicrosoftExtensions.cpp @@ -168,7 +168,7 @@ __interface MicrosoftInterface { __int64 x7 = __int64(0); - +namespace If_exists_test { class IF_EXISTS { private: @@ -210,6 +210,31 @@ __if_not_exists(IF_EXISTS::Type_not) { 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 { |