forked from OSchip/llvm-project
Don't look for a destructor in a dependent type. Fixes PR7198.
llvm-svn: 104445
This commit is contained in:
parent
0c6f539564
commit
024d80e571
|
@ -4795,7 +4795,7 @@ bool Sema::InitializeVarWithConstructor(VarDecl *VD,
|
|||
void Sema::FinalizeVarWithDestructor(VarDecl *VD, const RecordType *Record) {
|
||||
CXXRecordDecl *ClassDecl = cast<CXXRecordDecl>(Record->getDecl());
|
||||
if (!ClassDecl->isInvalidDecl() && !VD->isInvalidDecl() &&
|
||||
!ClassDecl->hasTrivialDestructor()) {
|
||||
!ClassDecl->hasTrivialDestructor() && !ClassDecl->isDependentContext()) {
|
||||
CXXDestructorDecl *Destructor = ClassDecl->getDestructor(Context);
|
||||
MarkDeclarationReferenced(VD->getLocation(), Destructor);
|
||||
CheckDestructorAccess(VD->getLocation(), Destructor,
|
||||
|
|
|
@ -24,3 +24,19 @@ namespace PR6045 {
|
|||
(void)(k % member);
|
||||
}
|
||||
}
|
||||
|
||||
namespace PR7198 {
|
||||
struct A
|
||||
{
|
||||
~A() { }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct B {
|
||||
struct C : A {};
|
||||
void f()
|
||||
{
|
||||
C c = C();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue