Douglas Gregor | 28be7c5 | 2012-02-10 23:38:02 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++11 %s -Wunused -verify |
| 2 | |
| 3 | |
| 4 | struct X { |
| 5 | X(const X&) = delete; // expected-note{{explicitly marked deleted}} |
| 6 | X(X&); |
| 7 | }; |
| 8 | |
| 9 | void test_capture(X x) { |
| 10 | [x] { }(); // okay: non-const copy ctor |
| 11 | |
| 12 | [x] { |
| 13 | [x] { // expected-error{{call to deleted constructor of 'const X'}} |
| 14 | }(); |
| 15 | }(); |
Douglas Gregor | 812d8f6 | 2012-02-18 05:51:20 +0000 | [diff] [blame^] | 16 | |
| 17 | int a; |
| 18 | [=]{ [&] { int&x = a; }(); }(); // expected-error{{binding of reference to type 'int' to a value of type 'const int' drops qualifiers}} |
Douglas Gregor | 28be7c5 | 2012-02-10 23:38:02 +0000 | [diff] [blame] | 19 | } |