diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-11-06 23:56:42 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-11-06 23:56:42 +0000 |
commit | 70a01898008a90007866f15c4d9d53ba00b0d203 (patch) | |
tree | bd6d9b19b02bdd507aacf06973c863dda7963ae9 /lib/Sema/SemaTemplateDeduction.cpp | |
parent | 9e60371ba07faa2f173ab614ceaad0332518c8dc (diff) |
Fix assertion failure with auto and nested initializer list; PR14272.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167506 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateDeduction.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateDeduction.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp index 6b58087819..98e22c0b65 100644 --- a/lib/Sema/SemaTemplateDeduction.cpp +++ b/lib/Sema/SemaTemplateDeduction.cpp @@ -3649,10 +3649,11 @@ Sema::DeduceAutoType(TypeSourceInfo *Type, Expr *&Init, return DAR_Failed; } - QualType DeducedType = Deduced[0].getAsType(); - if (DeducedType.isNull()) + if (Deduced[0].getKind() != TemplateArgument::Type) return DAR_Failed; + QualType DeducedType = Deduced[0].getAsType(); + if (InitList) { DeducedType = BuildStdInitializerList(DeducedType, Loc); if (DeducedType.isNull()) |