Fix -Wdynamic-class-memaccess to skip invalid classes.
This warning sometimes will infinitely recurse on CXXRecordDecl's from ill-formed recursive classes that have fields of themselves. Skip processing these classes to prevent this from happening. Fixes https://llvm.org/bugs/show_bug.cgi?id=27142 llvm-svn: 264991
This commit is contained in:
@@ -5611,7 +5611,7 @@ static const CXXRecordDecl *getContainedDynamicClass(QualType T,
|
||||
|
||||
const CXXRecordDecl *RD = Ty->getAsCXXRecordDecl();
|
||||
RD = RD ? RD->getDefinition() : nullptr;
|
||||
if (!RD)
|
||||
if (!RD || RD->isInvalidDecl())
|
||||
return nullptr;
|
||||
|
||||
if (RD->isDynamicClass())
|
||||
|
||||
Reference in New Issue
Block a user