Home | History | Annotate | Download | only in Parser
      1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -std=c++11 %s
      2 
      3 class C {
      4 
      5   void f() {
      6     int foo, bar;
      7 
      8     // fail to parse as a lambda introducer, so we get objc message parsing errors instead
      9     [foo,+] {}; // expected-error {{expected expression}}
     10 
     11     []; // expected-error {{expected body of lambda expression}}
     12     [=,foo+] {}; // expected-error {{expected ',' or ']' in lambda capture list}}
     13     [&this] {}; // expected-error {{cannot take the address of an rvalue of type 'C *'}}
     14     [] {}; 
     15     [=] (int i) {}; 
     16     [&] (int) mutable -> void {}; 
     17     [foo,bar] () { return 3; }; 
     18     [=,&foo] () {}; 
     19     [this] () {}; 
     20   }
     21 
     22 };
     23 
     24