[cfe-commits] r150283 - /cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
Douglas Gregor
dgregor at apple.com
Fri Feb 10 15:38:03 PST 2012
Author: dgregor
Date: Fri Feb 10 17:38:02 2012
New Revision: 150283
URL: http://llvm.org/viewvc/llvm-project?rev=150283&view=rev
Log:
Add simple semantic test for C++11 [expr.prim.lambda]p16, which covers recursive capture. This is far more interesting for IRgen.
Added:
cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp (with props)
Added: cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp?rev=150283&view=auto
==============================================================================
--- cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp (added)
+++ cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp Fri Feb 10 17:38:02 2012
@@ -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'}}
+ }();
+ }();
+}
Propchange: cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the cfe-commits
mailing list