summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx0x-lambda-expressions.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-01-09 05:10:55 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-01-09 05:10:55 +0000
commite01c466c679d939f09a4b1d9f65085f90bf40ea4 (patch)
treeb347c32c4513f532e1ad12ac7bebcfddc0df16a2 /clang/test/Parser/cxx0x-lambda-expressions.cpp
parent76a4b95ad84a0fd23e34982cfb1b40b39ca2fb4d (diff)
downloadbcm5719-llvm-e01c466c679d939f09a4b1d9f65085f90bf40ea4.tar.gz
bcm5719-llvm-e01c466c679d939f09a4b1d9f65085f90bf40ea4.zip
Parse: Don't crash when trailing return type is missing
Sema::CheckParmsForFunctionDef can't cope with a null TypeSourceInfo. Don't let the AST contain the malformed lambda. This fixes PR22122. llvm-svn: 225505
Diffstat (limited to 'clang/test/Parser/cxx0x-lambda-expressions.cpp')
-rw-r--r--clang/test/Parser/cxx0x-lambda-expressions.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx0x-lambda-expressions.cpp b/clang/test/Parser/cxx0x-lambda-expressions.cpp
index 8cfe7f3b02d..4bcc60c73c1 100644
--- a/clang/test/Parser/cxx0x-lambda-expressions.cpp
+++ b/clang/test/Parser/cxx0x-lambda-expressions.cpp
@@ -91,3 +91,10 @@ class C {
__attribute__((noreturn)) { while(1); }; // expected-error {{expected body of lambda expression}}
}
};
+
+template <typename>
+void PR22122() {
+ [](int) -> {}; // expected-error {{expected a type}}
+}
+
+template void PR22122<int>();
OpenPOWER on IntegriCloud