summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/attr-optnone.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/attr-optnone.cpp')
-rw-r--r--clang/test/SemaCXX/attr-optnone.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/attr-optnone.cpp b/clang/test/SemaCXX/attr-optnone.cpp
index 58776caf7ae..1e02653b95e 100644
--- a/clang/test/SemaCXX/attr-optnone.cpp
+++ b/clang/test/SemaCXX/attr-optnone.cpp
@@ -71,3 +71,9 @@ struct B2 {
static void bar();
};
+// Verify that we can handle the [[_Clang::optnone]] and
+// [[__clang__::optnone]] spellings.
+[[_Clang::optnone]] int foo3();
+[[__clang__::optnone]] int foo4(); // expected-warning {{'__clang__' is a predefined macro name, not an attribute scope specifier; did you mean '_Clang' instead?}}
+
+[[_Clang::optnone]] int foo5; // expected-warning {{'optnone' attribute only applies to functions}}
OpenPOWER on IntegriCloud