diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2018-10-24 12:26:23 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2018-10-24 12:26:23 +0000 |
commit | ad672ffb643c646ca7680c765342bd58252ecdbe (patch) | |
tree | 983949541e2d1345350ca5f6f01833b6db7a09da /clang/test/Preprocessor/has_attribute.cpp | |
parent | c4a995c8e05bd63932677ee30e4f4cfd6623eaff (diff) | |
download | bcm5719-llvm-ad672ffb643c646ca7680c765342bd58252ecdbe.tar.gz bcm5719-llvm-ad672ffb643c646ca7680c765342bd58252ecdbe.zip |
Support accepting __gnu__ as a scoped attribute namespace that aliases to gnu.
This is useful in libstdc++ to avoid clashes with identifiers in the user's namespace.
llvm-svn: 345132
Diffstat (limited to 'clang/test/Preprocessor/has_attribute.cpp')
-rw-r--r-- | clang/test/Preprocessor/has_attribute.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/clang/test/Preprocessor/has_attribute.cpp b/clang/test/Preprocessor/has_attribute.cpp index 2cfa005fb09..53d1fb07b9e 100644 --- a/clang/test/Preprocessor/has_attribute.cpp +++ b/clang/test/Preprocessor/has_attribute.cpp @@ -18,17 +18,21 @@ // The attribute name can be bracketed with double underscores. // CHECK: has_clang_fallthrough_2 #if __has_cpp_attribute(clang::__fallthrough__) - int has_clang_fallthrough_2(); -#endif - -// The scope cannot be bracketed with double underscores. -// CHECK: does_not_have___clang___fallthrough -#if !__has_cpp_attribute(__clang__::fallthrough) - int does_not_have___clang___fallthrough(); -#endif - -// Test that C++11, target-specific attributes behave properly. - + int has_clang_fallthrough_2();
+#endif
+
+// The scope cannot be bracketed with double underscores unless it is for gnu.
+// CHECK: does_not_have___clang___fallthrough
+#if !__has_cpp_attribute(__clang__::fallthrough)
+ int does_not_have___clang___fallthrough();
+#endif
+// CHECK: has_gnu_const
+#if __has_cpp_attribute(__gnu__::__const__)
+ int has_gnu_const();
+#endif
+
+// Test that C++11, target-specific attributes behave properly.
+
// CHECK: does_not_have_mips16 #if !__has_cpp_attribute(gnu::mips16) int does_not_have_mips16(); |