Fix assertion failure with auto and nested initializer list; PR14272.
llvm-svn: 167506
This commit is contained in:
parent
7d6ee3e1b4
commit
e43109557c
|
@ -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())
|
||||
|
|
|
@ -187,3 +187,7 @@ namespace rdar11948732 {
|
|||
XCtorInit xc = { xi, xi };
|
||||
}
|
||||
}
|
||||
|
||||
namespace PR14272 {
|
||||
auto x { { 0, 0 } }; // expected-error {{cannot deduce actual type for variable 'x' with type 'auto' from initializer list}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue