Give implicitly-defined default constructors and destructors empty
bodies, from Martin Vejnar! llvm-svn: 114329
This commit is contained in:
parent
ea9fc18163
commit
7319327007
|
@ -4458,10 +4458,14 @@ void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation,
|
|||
Diag(CurrentLocation, diag::note_member_synthesized_at)
|
||||
<< CXXConstructor << Context.getTagDeclType(ClassDecl);
|
||||
Constructor->setInvalidDecl();
|
||||
} else {
|
||||
Constructor->setUsed();
|
||||
MarkVTableUsed(CurrentLocation, ClassDecl);
|
||||
return;
|
||||
}
|
||||
|
||||
SourceLocation Loc = Constructor->getLocation();
|
||||
Constructor->setBody(new (Context) CompoundStmt(Context, 0, 0, Loc, Loc));
|
||||
|
||||
Constructor->setUsed();
|
||||
MarkVTableUsed(CurrentLocation, ClassDecl);
|
||||
}
|
||||
|
||||
CXXDestructorDecl *Sema::DeclareImplicitDestructor(CXXRecordDecl *ClassDecl) {
|
||||
|
@ -4569,6 +4573,9 @@ void Sema::DefineImplicitDestructor(SourceLocation CurrentLocation,
|
|||
return;
|
||||
}
|
||||
|
||||
SourceLocation Loc = Destructor->getLocation();
|
||||
Destructor->setBody(new (Context) CompoundStmt(Context, 0, 0, Loc, Loc));
|
||||
|
||||
Destructor->setUsed();
|
||||
MarkVTableUsed(CurrentLocation, ClassDecl);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue