]> granicus.if.org Git - clang/commitdiff
Add a test for the non-aggregaticity of lambda types per C++11
authorDouglas Gregor <dgregor@apple.com>
Thu, 9 Feb 2012 08:15:36 +0000 (08:15 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 9 Feb 2012 08:15:36 +0000 (08:15 +0000)
[expr.prim.lambda].

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150164 91177308-0d34-0410-b5e6-96231b3b80d8

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

diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p3.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p3.cpp
new file mode 100644 (file)
index 0000000..103f79d
--- /dev/null
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
+
+void test_nonaggregate(int i) {
+  auto lambda = [i]() -> void {}; // expected-error{{lambda expressions are not supported yet}} \
+  // expected-note 3{{candidate constructor}}
+  decltype(lambda) foo = { 1 }; // expected-error{{no matching constructor}}
+}