diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-12 00:01:07 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-12 00:01:07 +0000 |
commit | e8d69b7fc98d612afc74bab7eda457646fc06900 (patch) | |
tree | 91c1a41107b8bb61ebaec1bddfc450992aefb461 /clang/test/Parser/cxx0x-lambda-expressions.cpp | |
parent | 5876656c5e7aff902ebbb3fdc3232262a2034a02 (diff) | |
download | llvm-e8d69b7fc98d612afc74bab7eda457646fc06900.zip llvm-e8d69b7fc98d612afc74bab7eda457646fc06900.tar.gz llvm-e8d69b7fc98d612afc74bab7eda457646fc06900.tar.bz2 |
Allow GNU-style attributes on lambda expressions.
llvm-svn: 203628
Diffstat (limited to 'clang/test/Parser/cxx0x-lambda-expressions.cpp')
-rw-r--r-- | clang/test/Parser/cxx0x-lambda-expressions.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/test/Parser/cxx0x-lambda-expressions.cpp b/clang/test/Parser/cxx0x-lambda-expressions.cpp index e4151dc..9ce24cb 100644 --- a/clang/test/Parser/cxx0x-lambda-expressions.cpp +++ b/clang/test/Parser/cxx0x-lambda-expressions.cpp @@ -67,6 +67,7 @@ class C { void attributes() { [] [[]] {}; // expected-error {{lambda requires '()' before attribute specifier}} + [] __attribute__((noreturn)) {}; // expected-error {{lambda requires '()' before attribute specifier}} []() [[]] mutable {}; // expected-error {{expected body of lambda expression}} @@ -75,5 +76,10 @@ class C { []() mutable [[]] -> void {}; []() mutable noexcept [[]] -> void {}; -} + // Testing GNU-style attributes on lambdas -- the attribute is specified + // before the mutable specifier instead of after (unlike C++11). + []() __attribute__((noreturn)) mutable { while(1); }; + []() mutable + __attribute__((noreturn)) { while(1); }; // expected-error {{expected body of lambda expression}} + } }; |