Remove the "unsupported" error for lambda expressions. It's annoying,
and rapidly becoming untrue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150165 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index c8b783c..94798d0 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -4099,7 +4099,6 @@
 def err_return_in_constructor_handler : Error<
   "return in the catch of a function try block of a constructor is illegal">;
 
-def err_lambda_unsupported : Error<"lambda expressions are not supported yet">;
 def err_capture_more_than_once : Error<
   "%0 can appear only once in a capture list">;
 def err_reference_capture_with_reference_default : Error<
diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp
index afc4d5d..d59018d 100644
--- a/lib/Sema/SemaLambda.cpp
+++ b/lib/Sema/SemaLambda.cpp
@@ -379,7 +379,5 @@
     break;
   }
 
-  Diag(StartLoc, diag::err_lambda_unsupported);
-
   return MaybeBindToTemporary(Lambda);
 }
diff --git a/test/CXX/class/class.local/p1-0x.cpp b/test/CXX/class/class.local/p1-0x.cpp
index b8e1f68..49125f5 100644
--- a/test/CXX/class/class.local/p1-0x.cpp
+++ b/test/CXX/class/class.local/p1-0x.cpp
@@ -7,7 +7,7 @@
     int& x2 = x; // expected-error{{reference to local variable 'x' declared in enclosing function 'f'}}
     int cc = c;
   };
-  (void)[]() mutable { // expected-error {{not supported yet}}
+  (void)[]() mutable {
     int x = 3; // expected-note{{'x' declared here}}
     struct C {
       int& x2 = x; // expected-error{{reference to local variable 'x' declared in enclosing lambda expression}}
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.cpp
index 2ed738d..ba2b70e 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.cpp
@@ -2,9 +2,7 @@
 
 void block_capture_errors() {
   __block int var; // expected-note 2{{'var' declared here}}
-  (void)[var] { }; // expected-error{{__block variable 'var' cannot be captured in a lambda}} \
-  // expected-error{{lambda expressions are not supported yet}}
+  (void)[var] { }; // expected-error{{__block variable 'var' cannot be captured in a lambda}}
 
-  (void)[=] { var = 17; }; // expected-error{{__block variable 'var' cannot be captured in a lambda}} \
-  // expected-error{{lambda expressions are not supported yet}}
+  (void)[=] { var = 17; }; // expected-error{{__block variable 'var' cannot be captured in a lambda}}
 }
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p10.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p10.cpp
index 6f09c53..b596bd5 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p10.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p10.cpp
@@ -17,10 +17,9 @@
 
   void explicit_capture() {
     int variable; // expected-note {{declared here}}
-    (void)[&Overload] () {}; // expected-error {{does not name a variable}} expected-error {{not supported yet}}
-    (void)[&GlobalVar] () {}; // expected-error {{does not have automatic storage duration}} expected-error {{not supported yet}}
-    (void)[&AmbiguousVar] () {}; // expected-error {{reference to 'AmbiguousVar' is ambiguous}} expected-error {{not supported yet}}
-    (void)[&Variable] () {}; // expected-error {{use of undeclared identifier 'Variable'; did you mean 'variable'}} \
-    // expected-error{{lambda expressions are not supported yet}}
+    (void)[&Overload] () {}; // expected-error {{does not name a variable}} 
+    (void)[&GlobalVar] () {}; // expected-error {{does not have automatic storage duration}} 
+    (void)[&AmbiguousVar] () {}; // expected-error {{reference to 'AmbiguousVar' is ambiguous}} 
+    (void)[&Variable] () {}; // expected-error {{use of undeclared identifier 'Variable'; did you mean 'variable'}}
   }
 };
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
index 2dcaa5d..ad603e1 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
@@ -8,10 +8,8 @@
 
 void capture_by_copy(NonCopyable nc, NonCopyable &ncr) {
   // FIXME: error messages should talk about capture
-  (void)[nc] { }; // expected-error{{field of type 'NonCopyable' has private copy constructor}} \
-             // expected-error{{lambda expressions are not supported yet}}
-  (void)[ncr] { }; // expected-error{{field of type 'NonCopyable' has private copy constructor}} \
-             // expected-error{{lambda expressions are not supported yet}}
+  (void)[nc] { }; // expected-error{{field of type 'NonCopyable' has private copy constructor}}
+  (void)[ncr] { }; // expected-error{{field of type 'NonCopyable' has private copy constructor}}
 }
 
 struct NonTrivial {
@@ -28,7 +26,7 @@
 };
 
 void capture_with_default_args(CopyCtorDefault cct) {
-  (void)[=] () -> void { cct.foo(); }; // expected-error{{lambda expressions are not supported yet}}
+  (void)[=] () -> void { cct.foo(); };
 }
 
 struct ExpectedArrayLayout {
@@ -37,7 +35,7 @@
 
 void capture_array() {
   CopyCtorDefault array[3];
-  auto x = [=]() -> void { // expected-error{{lambda expressions are not supported yet}}
+  auto x = [=]() -> void {
     capture(array[0]);
   };
   static_assert(sizeof(x) == sizeof(ExpectedArrayLayout), "layout mismatch");
@@ -51,7 +49,7 @@
 };
 
 void test_layout(char a, short b) {
-  auto x = [=] () -> void { // expected-error{{lambda expressions are not supported yet}}
+  auto x = [=] () -> void {
     capture(a);
     capture(b);
   };
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p15.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p15.cpp
index 605265b..c4deba9 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p15.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p15.cpp
@@ -6,7 +6,7 @@
 
 void capture_by_ref(NonCopyable nc, NonCopyable &ncr) {
   int array[3];
-  (void)[&nc] () -> void {}; // expected-error{{lambda expressions are not supported yet}}
-  (void)[&ncr] () -> void {}; // expected-error{{lambda expressions are not supported yet}}
-  (void)[&array] () -> void {}; // expected-error{{lambda expressions are not supported yet}}
+  (void)[&nc] () -> void {};
+  (void)[&ncr] () -> void {}; 
+  (void)[&array] () -> void {};
 }
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p2.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p2.cpp
index 48c00aa..c6ed308 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p2.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p2.cpp
@@ -2,9 +2,8 @@
 
 // prvalue
 void prvalue() {
-  auto&& x = []()->void { }; // expected-error{{lambda expressions are not supported yet}}
-  auto& y = []()->void { }; // expected-error{{cannot bind to a temporary of type}} \
-  // expected-error{{lambda expressions are not supported yet}}
+  auto&& x = []()->void { };
+  auto& y = []()->void { }; // expected-error{{cannot bind to a temporary of type}}
 }
 
 namespace std {
@@ -16,11 +15,9 @@
 };
 
 void unevaluated_operand(P &p, int i) {
-  int i2 = sizeof([]()->void{}()); // expected-error{{lambda expression in an unevaluated operand}} \
-  // expected-error{{lambda expressions are not supported yet}}
-  const std::type_info &ti1 = typeid([&]() -> P& { return p; }()); // expected-error{{lambda expressions are not supported yet}}
-  const std::type_info &ti2 = typeid([&]() -> int { return i; }());  // expected-error{{lambda expression in an unevaluated operand}} \
-  // expected-error{{lambda expressions are not supported yet}}
+  int i2 = sizeof([]()->void{}()); // expected-error{{lambda expression in an unevaluated operand}}
+  const std::type_info &ti1 = typeid([&]() -> P& { return p; }());
+  const std::type_info &ti2 = typeid([&]() -> int { return i; }());  // expected-error{{lambda expression in an unevaluated operand}}
 }
 
 template<typename T>
@@ -36,13 +33,10 @@
 void odr_used(P &p, Boom<int> boom_int, Boom<float> boom_float,
               Boom<double> boom_double) {
   const std::type_info &ti1
-    = typeid([=,&p]() -> P& { boom_int.tickle(); return p; }()); // expected-error{{lambda expressions are not supported yet}} \
-  // expected-note{{in instantiation of member function 'Boom<int>::Boom' requested here}}
+    = typeid([=,&p]() -> P& { boom_int.tickle(); return p; }()); // expected-note{{in instantiation of member function 'Boom<int>::Boom' requested here}}
   const std::type_info &ti2
     = typeid([=]() -> int { boom_float.tickle(); return 0; }()); // expected-error{{lambda expression in an unevaluated operand}} \
-  // expected-error{{lambda expressions are not supported yet}} \
   // expected-note{{in instantiation of member function 'Boom<float>::Boom' requested here}}
 
-  auto foo = [=]() -> int { boom_double.tickle(); return 0; }; // expected-error{{lambda expressions are not supported yet}} \
-  // expected-note{{in instantiation of member function 'Boom<double>::Boom' requested here}}
+  auto foo = [=]() -> int { boom_double.tickle(); return 0; }; // expected-note{{in instantiation of member function 'Boom<double>::Boom' requested here}}
 }
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p3.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p3.cpp
index 103f79d..562f92a 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p3.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p3.cpp
@@ -1,7 +1,6 @@
 // RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
 
 void test_nonaggregate(int i) {
-  auto lambda = [i]() -> void {}; // expected-error{{lambda expressions are not supported yet}} \
-  // expected-note 3{{candidate constructor}}
+  auto lambda = [i]() -> void {}; // expected-note 3{{candidate constructor}}
   decltype(lambda) foo = { 1 }; // expected-error{{no matching constructor}}
 }
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp
index 93ba6f6..ff6e7b4 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp
@@ -1,7 +1,6 @@
 // RUN: %clang_cc1 -std=c++11 %s -verify
 
 int test_default_args() {
-  (void)[](int i = 5,  // expected-error{{default arguments can only be specified for parameters in a function declaration}} \
-                 // expected-error{{lambda expressions are not supported yet}}
+  (void)[](int i = 5,  // expected-error{{default arguments can only be specified for parameters in a function declaration}}
      int j = 17) {}; // expected-error{{default arguments can only be specified for parameters in a function declaration}}
 }
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp
index e816426..21c8e22 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp
@@ -2,8 +2,7 @@
 
 // Check that analysis-based warnings work in lambda bodies.
 void analysis_based_warnings() {
-  (void)[]() -> int { }; // expected-warning{{control reaches end of non-void function}} \
-  // expected-error{{lambda expressions are not supported yet}}
+  (void)[]() -> int { }; // expected-warning{{control reaches end of non-void function}}
 }
 
 // Check that we get the right types of captured variables (the
@@ -12,32 +11,32 @@
 float &check_const_int(const int&);
 
 void test_capture_constness(int i, const int ic) {
-  (void)[i,ic] ()->void { // expected-error{{lambda expressions are not supported yet}}
+  (void)[i,ic] ()->void {
     float &fr1 = check_const_int(i);
     float &fr2 = check_const_int(ic);
   }; 
 
-  (void)[=] ()->void { // expected-error{{lambda expressions are not supported yet}}
+  (void)[=] ()->void {
     float &fr1 = check_const_int(i);
     float &fr2 = check_const_int(ic);
   }; 
 
-  (void)[i,ic] () mutable ->void { // expected-error{{lambda expressions are not supported yet}}
+  (void)[i,ic] () mutable ->void {
     int &ir = check_const_int(i);
     float &fr = check_const_int(ic);
   };
 
-  (void)[=] () mutable ->void { // expected-error{{lambda expressions are not supported yet}}
+  (void)[=] () mutable ->void {
     int &ir = check_const_int(i);
     float &fr = check_const_int(ic);
   };
 
-  (void)[&i,&ic] ()->void { // expected-error{{lambda expressions are not supported yet}}
+  (void)[&i,&ic] ()->void {
     int &ir = check_const_int(i);
     float &fr = check_const_int(ic);
   };
 
-  (void)[&] ()->void { // expected-error{{lambda expressions are not supported yet}}
+  (void)[&] ()->void {
     int &ir = check_const_int(i);
     float &fr = check_const_int(ic);
   };
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
index 53d2c75..8f524e0 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p8.cpp
@@ -4,13 +4,13 @@
   void explicit_capture() {
     int foo;
 
-    (void)[foo, foo] () {}; // expected-error {{'foo' can appear only once}} expected-error {{not supported yet}}
-    (void)[this, this] () {}; // expected-error {{'this' can appear only once}} expected-error {{not supported yet}}
-    (void)[=, foo] () {}; // expected-error {{'&' must precede a capture when}} expected-error {{not supported yet}}
-    (void)[=, &foo] () {}; // expected-error {{not supported yet}}
-    (void)[=, this] () {}; // expected-error {{'this' cannot appear}} expected-error {{not supported yet}}
-    (void)[&, foo] () {}; // expected-error {{not supported yet}}
-    (void)[&, &foo] () {}; // expected-error {{'&' cannot precede a capture when}} expected-error {{not supported yet}}
-    (void)[&, this] () {}; // expected-error {{not supported yet}}
+    (void)[foo, foo] () {}; // expected-error {{'foo' can appear only once}}
+    (void)[this, this] () {}; // expected-error {{'this' can appear only once}}
+    (void)[=, foo] () {}; // expected-error {{'&' must precede a capture when}}
+    (void)[=, &foo] () {};
+    (void)[=, this] () {}; // expected-error {{'this' cannot appear}}
+    (void)[&, foo] () {};
+    (void)[&, &foo] () {}; // expected-error {{'&' cannot precede a capture when}} 
+    (void)[&, this] () {};
   }
 };
diff --git a/test/Parser/cxx0x-lambda-expressions.cpp b/test/Parser/cxx0x-lambda-expressions.cpp
index 07a4701..aa2a9cf 100644
--- a/test/Parser/cxx0x-lambda-expressions.cpp
+++ b/test/Parser/cxx0x-lambda-expressions.cpp
@@ -12,13 +12,13 @@
     [&this] {}; // expected-error {{'this' cannot be captured by reference}}
     [&,] {}; // expected-error {{expected variable name or 'this' in lambda capture list}}
     [=,] {}; // expected-error {{expected variable name or 'this' in lambda capture list}}
-    [] {}; // expected-error {{lambda expressions are not supported yet}}
-    [=] (int i) {}; // expected-error {{lambda expressions are not supported yet}}
-    [&] (int) mutable -> void {}; // expected-error {{lambda expressions are not supported yet}}
-    [foo,bar] () { return 3; }; // expected-error {{lambda expressions are not supported yet}}
-    [=,&foo] () {}; // expected-error {{lambda expressions are not supported yet}}
-    [&,foo] () {}; // expected-error {{lambda expressions are not supported yet}}
-    [this] () {}; // expected-error {{lambda expressions are not supported yet}}
+    [] {}; 
+    [=] (int i) {}; 
+    [&] (int) mutable -> void {}; 
+    [foo,bar] () { return 3; }; 
+    [=,&foo] () {}; 
+    [&,foo] () {}; 
+    [this] () {}; 
 
     return 1;
   }
diff --git a/test/Parser/objcxx0x-lambda-expressions.mm b/test/Parser/objcxx0x-lambda-expressions.mm
index b37f525..1eab15b 100644
--- a/test/Parser/objcxx0x-lambda-expressions.mm
+++ b/test/Parser/objcxx0x-lambda-expressions.mm
@@ -11,12 +11,12 @@
     []; // expected-error {{expected body of lambda expression}}
     [=,foo+] {}; // expected-error {{expected ',' or ']' in lambda capture list}}
     [&this] {}; // expected-error {{address expression must be an lvalue}}
-    [] {}; // expected-error {{lambda expressions are not supported yet}}
-    [=] (int i) {}; // expected-error {{lambda expressions are not supported yet}}
-    [&] (int) mutable -> void {}; // expected-error {{lambda expressions are not supported yet}}
-    [foo,bar] () { return 3; }; // expected-error {{lambda expressions are not supported yet}}
-    [=,&foo] () {}; // expected-error {{lambda expressions are not supported yet}}
-    [this] () {}; // expected-error {{lambda expressions are not supported yet}}
+    [] {}; 
+    [=] (int i) {}; 
+    [&] (int) mutable -> void {}; 
+    [foo,bar] () { return 3; }; 
+    [=,&foo] () {}; 
+    [this] () {}; 
   }
 
 };
diff --git a/test/SemaCXX/lambda-expressions.cpp b/test/SemaCXX/lambda-expressions.cpp
index a414fc9..afdff99 100644
--- a/test/SemaCXX/lambda-expressions.cpp
+++ b/test/SemaCXX/lambda-expressions.cpp
@@ -11,76 +11,76 @@
     virtual C& Overload(float);
 
     void ImplicitThisCapture() {
-      [](){(void)Member;}; // expected-error {{'this' cannot be implicitly captured in this context}} expected-error {{not supported yet}}
-      [&](){(void)Member;}; // expected-error {{not supported yet}}
-      // 'this' captures below don't actually work yet
-      [this](){(void)Member;}; // expected-error{{lambda expressions are not supported yet}}
-      [this]{[this]{};}; // expected-error 2{{lambda expressions are not supported yet}}
-      []{[this]{};};// expected-error {{'this' cannot be implicitly captured in this context}} expected-error 2 {{not supported yet}}
-      []{Overload(3);}; // expected-error {{not supported yet}}
-      []{Overload();}; // expected-error {{'this' cannot be implicitly captured in this context}} expected-error {{not supported yet}}
-      []{(void)typeid(Overload());};// expected-error {{not supported yet}}
-      []{(void)typeid(Overload(.5f));};// expected-error {{'this' cannot be implicitly captured in this context}} expected-error {{not supported yet}}
+      [](){(void)Member;}; // expected-error {{'this' cannot be implicitly captured in this context}}
+      [&](){(void)Member;};
+
+      [this](){(void)Member;};
+      [this]{[this]{};};
+      []{[this]{};};// expected-error {{'this' cannot be implicitly captured in this context}}
+      []{Overload(3);}; 
+      []{Overload();}; // expected-error {{'this' cannot be implicitly captured in this context}} 
+      []{(void)typeid(Overload());};
+      []{(void)typeid(Overload(.5f));};// expected-error {{'this' cannot be implicitly captured in this context}} 
     }
   };
 
   void f() {
-    [this] () {}; // expected-error {{'this' cannot be captured in this context}} expected-error {{not supported yet}}
+    [this] () {}; // expected-error {{'this' cannot be captured in this context}} 
   }
 }
 
 namespace ReturnDeduction {
   void test() {
-    [](){ return 1; }; // expected-error {{not supported yet}}
-    [](){ return 1; }; // expected-error {{not supported yet}}
-    [](){ return ({return 1; 1;}); }; // expected-error {{not supported yet}}
-    [](){ return ({return 'c'; 1;}); }; // expected-error {{not supported yet}} expected-error {{must match previous return type}}
-    []()->int{ return 'c'; return 1; }; // expected-error {{not supported yet}}
-    [](){ return 'c'; return 1; }; // expected-error {{not supported yet}} expected-error {{must match previous return type}}
-    []() { return; return (void)0; }; // expected-error {{not supported yet}}
+    [](){ return 1; }; 
+    [](){ return 1; }; 
+    [](){ return ({return 1; 1;}); }; 
+    [](){ return ({return 'c'; 1;}); }; // expected-error {{must match previous return type}}
+    []()->int{ return 'c'; return 1; }; 
+    [](){ return 'c'; return 1; };  // expected-error {{must match previous return type}}
+    []() { return; return (void)0; }; 
     // FIXME: Need to check structure of lambda body 
-    [](){ return 1; return 1; }; // expected-error {{not supported yet}}
+    [](){ return 1; return 1; }; 
   }
 }
 
 namespace ImplicitCapture {
   void test() {
     int a = 0; // expected-note 5 {{declared}}
-    []() { return a; }; // expected-error {{variable 'a' cannot be implicitly captured in a lambda with no capture-default specified}} expected-note {{begins here}} expected-error {{not supported yet}} 
-    [&]() { return a; }; // expected-error {{not supported yet}}
-    [=]() { return a; }; // expected-error {{not supported yet}}
-    [=]() { int* b = &a; }; // expected-error {{cannot initialize a variable of type 'int *' with an rvalue of type 'const int *'}} expected-error {{not supported yet}}
-    [=]() { return [&]() { return a; }; }; // expected-error 2 {{not supported yet}}
-    []() { return [&]() { return a; }; }; // expected-error {{variable 'a' cannot be implicitly captured in a lambda with no capture-default specified}} expected-note {{lambda expression begins here}} expected-error 2 {{not supported yet}}
-    []() { return ^{ return a; }; };// expected-error {{variable 'a' cannot be implicitly captured in a lambda with no capture-default specified}} expected-note {{lambda expression begins here}} expected-error {{not supported yet}}
-    []() { return [&a] { return a; }; }; // expected-error 2 {{variable 'a' cannot be implicitly captured in a lambda with no capture-default specified}} expected-note 2 {{lambda expression begins here}} expected-error 2 {{not supported yet}}
-    [=]() { return [&a] { return a; }; }; // expected-error 2 {{not supported yet}}
+    []() { return a; }; // expected-error {{variable 'a' cannot be implicitly captured in a lambda with no capture-default specified}} expected-note {{begins here}}  
+    [&]() { return a; }; 
+    [=]() { return a; }; 
+    [=]() { int* b = &a; }; // expected-error {{cannot initialize a variable of type 'int *' with an rvalue of type 'const int *'}} 
+    [=]() { return [&]() { return a; }; };
+    []() { return [&]() { return a; }; }; // expected-error {{variable 'a' cannot be implicitly captured in a lambda with no capture-default specified}} expected-note {{lambda expression begins here}} 
+    []() { return ^{ return a; }; };// expected-error {{variable 'a' cannot be implicitly captured in a lambda with no capture-default specified}} expected-note {{lambda expression begins here}} 
+    []() { return [&a] { return a; }; }; // expected-error 2 {{variable 'a' cannot be implicitly captured in a lambda with no capture-default specified}} expected-note 2 {{lambda expression begins here}} 
+    [=]() { return [&a] { return a; }; }; // 
 
     const int b = 2;
-    []() { return b; }; // expected-error {{not supported yet}}
+    []() { return b; }; 
 
     union { // expected-note {{declared}}
       int c;
       float d;
     };
     d = 3;
-    [=]() { return c; }; // expected-error {{unnamed variable cannot be implicitly captured in a lambda expression}} expected-error {{not supported yet}}
+    [=]() { return c; }; // expected-error {{unnamed variable cannot be implicitly captured in a lambda expression}} 
 
     __block int e; // expected-note 3 {{declared}}
-    [&]() { return e; }; // expected-error {{__block variable 'e' cannot be captured in a lambda expression}} expected-error {{not supported yet}}
-    [&e]() { return e; }; // expected-error 2 {{__block variable 'e' cannot be captured in a lambda expression}} expected-error {{not supported yet}}
+    [&]() { return e; }; // expected-error {{__block variable 'e' cannot be captured in a lambda expression}} 
+    [&e]() { return e; }; // expected-error 2 {{__block variable 'e' cannot be captured in a lambda expression}} 
 
     int f[10]; // expected-note {{declared}}
-    [&]() { return f[2]; };  // expected-error {{not supported yet}}
-    (void) ^{ return []() { return f[2]; }; }; // expected-error {{cannot refer to declaration with an array type inside block}} expected-error {{not supported yet}}
+    [&]() { return f[2]; };  
+    (void) ^{ return []() { return f[2]; }; }; // expected-error {{cannot refer to declaration with an array type inside block}} 
 
     struct G { G(); G(G&); int a; }; // expected-note 6 {{not viable}}
     G g;
-    [=]() { const G* gg = &g; return gg->a; }; // expected-error {{not supported yet}}
-    [=]() { return [=]{ const G* gg = &g; return gg->a; }(); }; // expected-error {{no matching constructor for initialization of 'const ImplicitCapture::G'}} expected-error 2 {{not supported yet}}
-    (void)^{ return [=]{ const G* gg = &g; return gg->a; }(); }; // expected-error 2 {{no matching constructor for initialization of 'const ImplicitCapture::G'}} expected-error {{not supported yet}}
+    [=]() { const G* gg = &g; return gg->a; }; 
+    [=]() { return [=]{ const G* gg = &g; return gg->a; }(); }; // expected-error {{no matching constructor for initialization of 'const ImplicitCapture::G'}} 
+    (void)^{ return [=]{ const G* gg = &g; return gg->a; }(); }; // expected-error 2 {{no matching constructor for initialization of 'const ImplicitCapture::G'}} 
 
     const int h = a; // expected-note {{declared}}
-    []() { return h; }; // expected-error {{variable 'h' cannot be implicitly captured in a lambda with no capture-default specified}} expected-note {{lambda expression begins here}} expected-error {{not supported yet}}
+    []() { return h; }; // expected-error {{variable 'h' cannot be implicitly captured in a lambda with no capture-default specified}} expected-note {{lambda expression begins here}} 
   }
 }