]> granicus.if.org Git - clang/commitdiff
Add simple semantic test for C++11 [expr.prim.lambda]p16, which covers recursive...
authorDouglas Gregor <dgregor@apple.com>
Fri, 10 Feb 2012 23:38:02 +0000 (23:38 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 10 Feb 2012 23:38:02 +0000 (23:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150283 91177308-0d34-0410-b5e6-96231b3b80d8

test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp [new file with mode: 0644]

diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
new file mode 100644 (file)
index 0000000..58fa766
--- /dev/null
@@ -0,0 +1,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'}}
+    }();
+  }();
+}