зеркало из https://github.com/microsoft/clang-1.git
PR10566: Make sure codegen for deleting an pointer to an incomplete type actually works.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136703 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
2b81910618
Коммит
aebab72698
|
@ -1206,7 +1206,7 @@ static void EmitObjectDelete(CodeGenFunction &CGF,
|
|||
const CXXDestructorDecl *Dtor = 0;
|
||||
if (const RecordType *RT = ElementType->getAs<RecordType>()) {
|
||||
CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
|
||||
if (!RD->hasTrivialDestructor()) {
|
||||
if (RD->hasDefinition() && !RD->hasTrivialDestructor()) {
|
||||
Dtor = RD->getDestructor();
|
||||
|
||||
if (Dtor->isVirtual()) {
|
||||
|
|
|
@ -125,9 +125,11 @@ namespace test4 {
|
|||
|
||||
namespace test5 {
|
||||
struct Incomplete;
|
||||
// CHECK: define void @_ZN5test523array_delete_incompleteEPNS_10IncompleteE
|
||||
void array_delete_incomplete(Incomplete *p) {
|
||||
// CHECK: define void @_ZN5test523array_delete_incompleteEPNS_10IncompleteES1_
|
||||
void array_delete_incomplete(Incomplete *p1, Incomplete *p2) {
|
||||
// CHECK: call void @_ZdlPv
|
||||
delete p1;
|
||||
// CHECK: call void @_ZdaPv
|
||||
delete [] p;
|
||||
delete [] p2;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче