summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateDeduction.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard@metafoo.co.uk>2019-12-19 15:18:59 -0800
committerRichard Smith <richard@metafoo.co.uk>2019-12-19 15:20:10 -0800
commitf4a45c2ce4ce2a7a33d5773048682e65f348a486 (patch)
tree5006bf3f2050e83a5f1cc9996ffce05bac7efcb5 /clang/lib/Sema/SemaTemplateDeduction.cpp
parentb284005072122fe4af879725e3c8090009f89ca0 (diff)
downloadbcm5719-llvm-f4a45c2ce4ce2a7a33d5773048682e65f348a486.tar.gz
bcm5719-llvm-f4a45c2ce4ce2a7a33d5773048682e65f348a486.zip
Fix crash on init-capture packs where the type of the initializer is non-dependent.
Diffstat (limited to 'clang/lib/Sema/SemaTemplateDeduction.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateDeduction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index 327447746c3..46d92313827 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -4453,7 +4453,8 @@ Sema::DeduceAutoType(TypeLoc Type, Expr *&Init, QualType &Result,
/*.IsPack = */ (bool)Type.getAs<PackExpansionTypeLoc>()};
if (!DependentDeductionDepth &&
- (Type.getType()->isDependentType() || Init->isTypeDependent())) {
+ (Type.getType()->isDependentType() || Init->isTypeDependent() ||
+ Init->containsUnexpandedParameterPack())) {
Result = SubstituteDeducedTypeTransform(*this, DependentResult).Apply(Type);
assert(!Result.isNull() && "substituting DependentTy can't fail");
return DAR_Succeeded;
OpenPOWER on IntegriCloud