Douglas Gregor | f0d4951 | 2012-02-10 23:30:22 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -std=c++11 %s -Wunused -verify |
| 2 | |
| 3 | void f2() { |
| 4 | int i = 1; |
| 5 | void g1(int = ([i]{ return i; })()); // expected-error{{lambda expression in default argument cannot capture any entity}} |
| 6 | void g2(int = ([i]{ return 0; })()); // expected-error{{lambda expression in default argument cannot capture any entity}} |
| 7 | void g3(int = ([=]{ return i; })()); // expected-error{{lambda expression in default argument cannot capture any entity}} |
| 8 | void g4(int = ([=]{ return 0; })()); |
| 9 | void g5(int = ([]{ return sizeof i; })()); |
| 10 | } |