Douglas Gregor | 7f99f43 | 2012-02-09 01:02:27 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify -std=c++11 %s |
Douglas Gregor | ae7902c | 2011-08-04 15:30:47 +0000 | [diff] [blame] | 2 | |
| 3 | class C { |
| 4 | |
| 5 | int f() { |
| 6 | int foo, bar; |
| 7 | |
| 8 | []; // expected-error {{expected body of lambda expression}} |
| 9 | [+] {}; // expected-error {{expected variable name or 'this' in lambda capture list}} |
| 10 | [foo+] {}; // expected-error {{expected ',' or ']' in lambda capture list}} |
| 11 | [foo,&this] {}; // expected-error {{'this' cannot be captured by reference}} |
| 12 | [&this] {}; // expected-error {{'this' cannot be captured by reference}} |
Richard Trieu | 2fe9b7f | 2011-12-15 00:38:15 +0000 | [diff] [blame] | 13 | [&,] {}; // expected-error {{expected variable name or 'this' in lambda capture list}} |
| 14 | [=,] {}; // expected-error {{expected variable name or 'this' in lambda capture list}} |
Eli Friedman | dc3b723 | 2012-01-04 02:40:39 +0000 | [diff] [blame] | 15 | [] {}; // expected-error {{lambda expressions are not supported yet}} |
| 16 | [=] (int i) {}; // expected-error {{lambda expressions are not supported yet}} |
| 17 | [&] (int) mutable -> void {}; // expected-error {{lambda expressions are not supported yet}} |
| 18 | [foo,bar] () { return 3; }; // expected-error {{lambda expressions are not supported yet}} |
| 19 | [=,&foo] () {}; // expected-error {{lambda expressions are not supported yet}} |
| 20 | [&,foo] () {}; // expected-error {{lambda expressions are not supported yet}} |
| 21 | [this] () {}; // expected-error {{lambda expressions are not supported yet}} |
Douglas Gregor | ae7902c | 2011-08-04 15:30:47 +0000 | [diff] [blame] | 22 | |
| 23 | return 1; |
| 24 | } |
| 25 | |
| 26 | }; |
| 27 | |