r203602 - Improving test coverage for lambda expressions with attribute specifiers.

Aaron Ballman aaron at aaronballman.com
Tue Mar 11 13:32:36 PDT 2014


Author: aaronballman
Date: Tue Mar 11 15:32:35 2014
New Revision: 203602

URL: http://llvm.org/viewvc/llvm-project?rev=203602&view=rev
Log:
Improving test coverage for lambda expressions with attribute specifiers.

Modified:
    cfe/trunk/test/Parser/cxx0x-lambda-expressions.cpp

Modified: cfe/trunk/test/Parser/cxx0x-lambda-expressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx0x-lambda-expressions.cpp?rev=203602&r1=203601&r2=203602&view=diff
==============================================================================
--- cfe/trunk/test/Parser/cxx0x-lambda-expressions.cpp (original)
+++ cfe/trunk/test/Parser/cxx0x-lambda-expressions.cpp Tue Mar 11 15:32:35 2014
@@ -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 {};
+
+}
 };





More information about the cfe-commits mailing list