diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-10 03:25:07 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-10 03:25:07 +0000 |
commit | 3dff251da1bf2ca1339190b98307fb67fe872318 (patch) | |
tree | 92fb23d2c68a2cf47a22421ac976b85024c2b003 /clang/test/Parser/cxx0x-attributes.cpp | |
parent | 4463399b0da32b232c7c0c5a669cf4d24187b826 (diff) | |
download | bcm5719-llvm-3dff251da1bf2ca1339190b98307fb67fe872318.tar.gz bcm5719-llvm-3dff251da1bf2ca1339190b98307fb67fe872318.zip |
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.
llvm-svn: 154381
Diffstat (limited to 'clang/test/Parser/cxx0x-attributes.cpp')
-rw-r--r-- | clang/test/Parser/cxx0x-attributes.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/test/Parser/cxx0x-attributes.cpp b/clang/test/Parser/cxx0x-attributes.cpp index b20873509b6..bf73e0845a6 100644 --- a/clang/test/Parser/cxx0x-attributes.cpp +++ b/clang/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}} +} |