aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-04-11 04:01:28 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-04-11 04:01:28 +0000
commit6ce48a70ace62eb0eaf7b2769d05c5f13b7c7b6c (patch)
tree310b1017ddd95837784986b6a49f1962f417fb59 /test
parent9793428697f01b139443b7a0a882ea5dd1967e56 (diff)
Support C++11 attributes at the start of a parameter-declaration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154476 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Parser/cxx0x-attributes.cpp4
-rw-r--r--test/Parser/objcxx11-attributes.mm12
2 files changed, 16 insertions, 0 deletions
diff --git a/test/Parser/cxx0x-attributes.cpp b/test/Parser/cxx0x-attributes.cpp
index bf73e0845a..f97995e975 100644
--- a/test/Parser/cxx0x-attributes.cpp
+++ b/test/Parser/cxx0x-attributes.cpp
@@ -71,6 +71,10 @@ void foo () {
(void)s.arr[ [] { return 0; }() ]; // expected-error {{C++11 only allows consecutive left square brackets when introducing an attribute}}
int n = __builtin_offsetof(S, arr[ [] { return 0; }() ]); // expected-error {{C++11 only allows consecutive left square brackets when introducing an attribute}}
+ void bar [[noreturn]] ([[]] int i, [[]] int j);
+ using FuncType = void ([[]] int);
+ void baz([[]]...); // expected-error {{expected parameter declarator}}
+
[[]] return;
}
diff --git a/test/Parser/objcxx11-attributes.mm b/test/Parser/objcxx11-attributes.mm
index fead1d1b46..0875b66e21 100644
--- a/test/Parser/objcxx11-attributes.mm
+++ b/test/Parser/objcxx11-attributes.mm
@@ -34,6 +34,18 @@ void f(X *noreturn) {
[[int(), noreturn]];
[[class, test(foo 'x' bar),,,]];
[[bitand, noreturn]];
+
+ [[noreturn]]int(e)();
+
+ // A function taking a noreturn function.
+ int(f)([[noreturn]] int());
+ f(e);
+
+ // Variables initialized by a message send.
+ int(g)([[noreturn getSelf] getSize]);
+ int(h)([[noreturn]{return noreturn;}() getSize]);
+
+ int i = g + h;
}
template<typename...Ts> void f(Ts ...x) {