Fix crashes when creating global instances of polymorphic classes without fields
Reviewed at http://llvm-reviews.chandlerc.com/D1795 llvm-svn: 191839
This commit is contained in:
parent
6df39438af
commit
40c585a568
|
@ -96,7 +96,8 @@ static void EmitDeclDestroy(CodeGenFunction &CGF, const VarDecl &D,
|
|||
CXXDestructorDecl *dtor = record->getDestructor();
|
||||
|
||||
function = CGM.GetAddrOfCXXDestructor(dtor, Dtor_Complete);
|
||||
argument = addr;
|
||||
argument = llvm::ConstantExpr::getBitCast(
|
||||
addr, CGF.getTypes().ConvertType(type)->getPointerTo());
|
||||
|
||||
// Otherwise, the standard logic requires a helper function.
|
||||
} else {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -emit-llvm-only %s -std=c++11
|
||||
// RUN: %clang_cc1 -emit-llvm-only -fno-use-cxa-atexit %s -std=c++11
|
||||
// RUN: %clang_cc1 -cxx-abi microsoft -fno-rtti -emit-llvm-only %s -std=c++11
|
||||
|
||||
// PR13479: don't crash with -fno-exceptions.
|
||||
namespace {
|
||||
|
|
Loading…
Reference in New Issue