From: Douglas Gregor Date: Thu, 9 Feb 2012 08:15:36 +0000 (+0000) Subject: Add a test for the non-aggregaticity of lambda types per C++11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e545d95bc92157f9f124d95aa2ed66d691d2028;p=clang Add a test for the non-aggregaticity of lambda types per C++11 [expr.prim.lambda]. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150164 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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 index 0000000000..103f79d015 --- /dev/null +++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p3.cpp @@ -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}} +}