diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-02-14 21:20:44 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-02-14 21:20:44 +0000 |
commit | 53393f23d8b767f976427a6d45b310bf37dd91c4 (patch) | |
tree | 2ebf1f5c8b333d93257a55f54b5a7ce11e0c743a /test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp | |
parent | 1d0c9a8d0573d1f670f484cc17aa94f06be971a5 (diff) |
Check the return type of lambda expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150503 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp')
-rw-r--r-- | test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp index cff0c09950..586825f053 100644 --- a/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp +++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p4.cpp @@ -41,3 +41,11 @@ X infer_X_return_type_fail(X x) { return x; // expected-error{{return type 'const X' must match previous return type 'X' when block literal has unspecified explicit return type}} }(5); } + +struct Incomplete; // expected-note{{forward declaration of 'Incomplete'}} +void test_result_type(int N) { + auto l1 = [] () -> Incomplete { }; // expected-error{{incomplete result type 'Incomplete' in lambda expression}} + + typedef int vla[N]; + auto l2 = [] () -> vla { }; // expected-error{{function cannot return array type 'vla' (aka 'int [N]')}} +} |