diff options
author | Richard Trieu <rtrieu@google.com> | 2016-03-31 04:18:07 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2016-03-31 04:18:07 +0000 |
commit | 1c7237ae619d3d1d455f48a601e72c2795f81e40 (patch) | |
tree | 709ff8e14d7d52e9748fe12a21a49e16c7e0fa32 /clang/lib | |
parent | 936a2b09f366267454b7cff9ffb9e76240137bf8 (diff) | |
download | bcm5719-llvm-1c7237ae619d3d1d455f48a601e72c2795f81e40.tar.gz bcm5719-llvm-1c7237ae619d3d1d455f48a601e72c2795f81e40.zip |
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
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 43195bd64ff..ee39401d48a 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -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()) |