p16.cpp revision 8e9314fd846936ce04b92b2b72c6aba2cffab916
1// RUN: %clang_cc1 -std=c++11 %s -Wunused -verify
2
3
4struct X {
5  X(const X&) = delete; // expected-note{{explicitly marked deleted}}
6  X(X&);
7};
8
9void 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  }();
16}
17