]> granicus.if.org Git - clang/commitdiff
Add a __has_extension check for '#pragma clang attribute' as an external-declaration
authorErik Pilkington <erik.pilkington@gmail.com>
Wed, 20 Mar 2019 19:26:37 +0000 (19:26 +0000)
committerErik Pilkington <erik.pilkington@gmail.com>
Wed, 20 Mar 2019 19:26:37 +0000 (19:26 +0000)
This was added in r356075.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356600 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Features.def
test/Parser/pragma-attribute-context.cpp

index b171365efcea26bc6a0de481244f229afa08bea8..c97cbc59bc6a2b87886433a34bea2a68b3940a48 100644 (file)
@@ -247,6 +247,7 @@ EXTENSION(cxx_variable_templates, LangOpts.CPlusPlus)
 // Miscellaneous language extensions
 EXTENSION(overloadable_unmarked, true)
 EXTENSION(pragma_clang_attribute_namespaces, true)
+EXTENSION(pragma_clang_attribute_external_declaration, true)
 
 #undef EXTENSION
 #undef FEATURE
index 3ec5a67f4c351140dfbebcc02cea0e68b30b9683..d893f18335e083f5f6ce8c81abec9c7005a5c07a 100644 (file)
@@ -1,6 +1,10 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9.0.0 -verify -std=c++11 %s
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9.0.0 -xobjective-c++ -verify -std=c++11 %s
 
+#if !__has_extension(pragma_clang_attribute_external_declaration)
+#error
+#endif
+
 #define BEGIN_PRAGMA _Pragma("clang attribute push (__attribute__((availability(macos, introduced=1000))), apply_to=function)")
 #define END_PRAGMA _Pragma("clang attribute pop")