]> granicus.if.org Git - clang/commitdiff
Improving test coverage for lambda expressions with attribute specifiers.
authorAaron Ballman <aaron@aaronballman.com>
Tue, 11 Mar 2014 20:32:35 +0000 (20:32 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Tue, 11 Mar 2014 20:32:35 +0000 (20:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203602 91177308-0d34-0410-b5e6-96231b3b80d8

test/Parser/cxx0x-lambda-expressions.cpp

index 6d39a730478aab9341529f2341d3a3284515f164..e4151dc8888f4fb0fa0ea7fe4d8e6d3eca36b7b3 100644 (file)
@@ -24,7 +24,6 @@ class C {
     [] () -> class C { return C(); };
     [] () -> enum E { return e; };
 
-    [] [[fake_ident]] { while (1) ; }; // expected-error {{lambda requires '()' before attribute specifier}} expected-warning {{unknown attribute 'fake_ident' ignored}}
     [] -> int { return 0; }; // expected-error{{lambda requires '()' before return type}}
     [] mutable -> int { return 0; }; // expected-error{{lambda requires '()' before 'mutable'}}
     [](int) -> {}; // PR13652 expected-error {{expected a type}}
@@ -65,4 +64,16 @@ class C {
       return x + 2;
     } ();
   }
+
+  void attributes() {
+    [] [[]] {}; // expected-error {{lambda requires '()' before attribute specifier}}
+    []() [[]]
+      mutable {}; // expected-error {{expected body of lambda expression}}
+
+    []() [[]] {};
+    []() [[]] -> void {};
+    []() mutable [[]] -> void {};
+    []() mutable noexcept [[]] -> void {};
+
+}
 };