зеркало из https://github.com/microsoft/clang-1.git
Fix assert on temporary std::initializer_list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182615 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
ce93356e27
Коммит
e69fb20435
|
@ -1159,12 +1159,13 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
|
||||||
if (E->hadArrayRangeDesignator())
|
if (E->hadArrayRangeDesignator())
|
||||||
CGF.ErrorUnsupported(E, "GNU array range designator extension");
|
CGF.ErrorUnsupported(E, "GNU array range designator extension");
|
||||||
|
|
||||||
|
AggValueSlot Dest = EnsureSlot(E->getType());
|
||||||
|
|
||||||
if (E->initializesStdInitializerList()) {
|
if (E->initializesStdInitializerList()) {
|
||||||
EmitStdInitializerList(Dest.getAddr(), E);
|
EmitStdInitializerList(Dest.getAddr(), E);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
AggValueSlot Dest = EnsureSlot(E->getType());
|
|
||||||
LValue DestLV = CGF.MakeAddrLValue(Dest.getAddr(), E->getType(),
|
LValue DestLV = CGF.MakeAddrLValue(Dest.getAddr(), E->getType(),
|
||||||
Dest.getAlignment());
|
Dest.getAlignment());
|
||||||
|
|
||||||
|
|
|
@ -275,3 +275,13 @@ namespace rdar13325066 {
|
||||||
for (X x : { x1, x2 }) { }
|
for (X x : { x1, x2 }) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace dtors {
|
||||||
|
struct S {
|
||||||
|
S();
|
||||||
|
~S();
|
||||||
|
};
|
||||||
|
void f() {
|
||||||
|
std::initializer_list<S>{ S(), S() };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче