aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx0x-attributes.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-04-10 03:25:07 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-04-10 03:25:07 +0000
commitc56298d87a9df507805a548d7d515e8b511df2c0 (patch)
treebd9d2feb4342dc9d8f7dc063b99b0e6be9ab29d0 /test/Parser/cxx0x-attributes.cpp
parent6ee326af4e77e6f05973486097884d7431f2108d (diff)
Parsing of C++11 attributes:
* Alternative tokens (such as 'compl') are treated as identifiers in attribute names. * An attribute-list can start with a comma. * An ellipsis may not be used with either of our currently-supported C++11 attributes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154381 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx0x-attributes.cpp')
-rw-r--r--test/Parser/cxx0x-attributes.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/Parser/cxx0x-attributes.cpp b/test/Parser/cxx0x-attributes.cpp
index b20873509b..bf73e0845a 100644
--- a/test/Parser/cxx0x-attributes.cpp
+++ b/test/Parser/cxx0x-attributes.cpp
@@ -11,6 +11,9 @@ int array_attr [1] [[]];
alignas(8) int aligned_attr;
[[test::valid(for 42 [very] **** '+' symbols went on a trip; the end.)]]
int garbage_attr;
+[[,,,static, class, namespace,, inline, constexpr, mutable,, bi\
+tand, bitor::compl(!.*_ Cx.!U^*R),,,]] int more_garbage_attr;
+[[u8"invalid!"]] int invalid_string_attr; // expected-error {{expected ']'}}
void fn_attr () [[]];
void noexcept_fn_attr () noexcept [[]];
struct MemberFnOrder {
@@ -21,7 +24,7 @@ extern "C++" [[]] int extern_attr;
template <typename T> [[]] void template_attr ();
[[]] [[]] int [[]] [[]] multi_attr [[]] [[]];
-int comma_attr [[,]]; // expected-error {{expected identifier}}
+int comma_attr [[,]];
int scope_attr [[foo::]]; // expected-error {{expected identifier}}
int (paren_attr) [[]]; // expected-error {{an attribute list cannot appear here}}
unsigned [[]] int attr_in_decl_spec; // expected-error {{expected unqualified-id}}
@@ -70,3 +73,7 @@ void foo () {
[[]] return;
}
+
+template<typename...Ts> void variadic() {
+ void bar [[noreturn...]] (); // expected-error {{attribute 'noreturn' cannot be used as an attribute pack}}
+}