summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLambda.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-02-02 23:58:56 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-02-02 23:58:56 +0000
commit59b982e1be3af0a1c6dc1564a9df8123404359cc (patch)
treedb19f9b8dbb6894f72dadd88f218011add7776c9 /clang/lib/Sema/SemaLambda.cpp
parent0d473d12fef8c7e1f0843bab2a74583b2f5da1f5 (diff)
downloadbcm5719-llvm-59b982e1be3af0a1c6dc1564a9df8123404359cc.tar.gz
bcm5719-llvm-59b982e1be3af0a1c6dc1564a9df8123404359cc.zip
PR24989: Stop trying to use the C++11 rules for lambda return type inference in
C++14 generic lambdas. It conflicts with the C++14 return type deduction mechanism, and results in us failing to actually deduce the lambda's return type in some cases. llvm-svn: 259609
Diffstat (limited to 'clang/lib/Sema/SemaLambda.cpp')
-rw-r--r--clang/lib/Sema/SemaLambda.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp
index 884add26e43..1a62f0dfcba 100644
--- a/clang/lib/Sema/SemaLambda.cpp
+++ b/clang/lib/Sema/SemaLambda.cpp
@@ -617,6 +617,8 @@ void Sema::deduceClosureReturnType(CapturingScopeInfo &CSI) {
assert(CSI.HasImplicitReturnType);
// If it was ever a placeholder, it had to been deduced to DependentTy.
assert(CSI.ReturnType.isNull() || !CSI.ReturnType->isUndeducedType());
+ assert((!isa<LambdaScopeInfo>(CSI) || !getLangOpts().CPlusPlus14) &&
+ "lambda expressions use auto deduction in C++14 onwards");
// C++ core issue 975:
// If a lambda-expression does not include a trailing-return-type,
OpenPOWER on IntegriCloud