| Faisal Vali | 7c9f3ca | 2013-09-27 16:45:48 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -std=c++1y %s -verify |
| Faisal Vali | 2b391ab | 2013-09-26 19:54:12 +0000 | [diff] [blame] | 2 | |
| 3 | namespace lambda_capturing { |
| 4 | // FIXME: Once return type deduction is implemented for generic lambdas |
| 5 | // this will need to be updated. |
| 6 | void test() { |
| 7 | int i = 10; |
| Faisal Vali | 571df12 | 2013-09-29 08:45:24 +0000 | [diff] [blame] | 8 | { |
| 9 | auto L = [=](auto a) -> int { //expected-error{{unimplemented}} |
| 10 | return i + a; |
| 11 | }; |
| 12 | L(3); |
| 13 | } |
| 14 | { |
| 15 | auto L = [i](auto a) -> int { //expected-error{{unimplemented}} |
| 16 | return i + a; |
| 17 | }; |
| 18 | L(3); |
| 19 | } |
| 20 | { |
| 21 | auto L = [i = i](auto a) -> int { //expected-error{{unimplemented}} |
| 22 | return i + a; |
| 23 | }; |
| 24 | L(3); |
| 25 | } |
| 26 | |
| 27 | |
| Faisal Vali | 2b391ab | 2013-09-26 19:54:12 +0000 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | } |
| 31 | |