forked from OSchip/llvm-project
Fix PR6648 by not creating a temporary with the type of a
CXXExprWithTemporaries. Not emitting the expression as an aggregate might be the right thing to do, but is orthogonal. Emitting it as an scalar expression will still try to create a temporary for the incomplete type of the CXXExprWithTemporaries and fail. llvm-svn: 99134
This commit is contained in:
parent
c91f200c17
commit
46b7987f85
|
@ -500,10 +500,6 @@ AggExprEmitter::VisitCXXConstructExpr(const CXXConstructExpr *E) {
|
|||
void AggExprEmitter::VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E) {
|
||||
llvm::Value *Val = DestPtr;
|
||||
|
||||
if (!Val) {
|
||||
// Create a temporary variable.
|
||||
Val = CGF.CreateMemTemp(E->getType(), "tmp");
|
||||
}
|
||||
CGF.EmitCXXExprWithTemporaries(E, Val, VolatileDest, IsInitializer);
|
||||
}
|
||||
|
||||
|
|
|
@ -288,3 +288,16 @@ void g() {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
namespace PR6648 {
|
||||
struct B {
|
||||
~B();
|
||||
};
|
||||
B foo;
|
||||
struct D;
|
||||
D& zed(B);
|
||||
void foobar() {
|
||||
// CHECK: call %"struct.PR6648::D"* @_ZN6PR66483zedENS_1BE
|
||||
zed(foo);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue