summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
blob: 58fa76635262b2656fc31ac5cf0e249ff76bd047 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// RUN: %clang_cc1 -std=c++11 %s -Wunused -verify


struct X {
  X(const X&) = delete; // expected-note{{explicitly marked deleted}}
  X(X&);
};

void test_capture(X x) {
  [x] { }(); // okay: non-const copy ctor

  [x] {
    [x] { // expected-error{{call to deleted constructor of 'const X'}}
    }();
  }();
}
OpenPOWER on IntegriCloud