aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/attr-optnone.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/attr-optnone.cpp')
-rw-r--r--test/SemaCXX/attr-optnone.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaCXX/attr-optnone.cpp b/test/SemaCXX/attr-optnone.cpp
index 58776caf7ae6..c8e85eec3711 100644
--- a/test/SemaCXX/attr-optnone.cpp
+++ b/test/SemaCXX/attr-optnone.cpp
@@ -71,3 +71,11 @@ struct B2 {
static void bar();
};
+// Verify that we can handle the [[_Clang::optnone]] and
+// [[__clang__::optnone]] spellings, as well as [[clang::__optnone__]].
+[[_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();
+[[_Clang::__optnone__]] int foo6();
+
+[[_Clang::optnone]] int foo7; // expected-warning {{'optnone' attribute only applies to functions}}