aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaFunctionEffects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaFunctionEffects.cpp')
-rw-r--r--clang/lib/Sema/SemaFunctionEffects.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaFunctionEffects.cpp b/clang/lib/Sema/SemaFunctionEffects.cpp
index 4b63eb7..12cc029 100644
--- a/clang/lib/Sema/SemaFunctionEffects.cpp
+++ b/clang/lib/Sema/SemaFunctionEffects.cpp
@@ -1302,6 +1302,14 @@ private:
return true;
}
+ bool TraverseCXXRecordDecl(CXXRecordDecl *D) override {
+ // Completely skip local struct/class/union declarations since their
+ // methods would otherwise be incorrectly interpreted as part of the
+ // function we are currently traversing. The initial Sema pass will have
+ // already recorded any nonblocking methods needing analysis.
+ return true;
+ }
+
bool TraverseConstructorInitializer(CXXCtorInitializer *Init) override {
ViolationSite PrevVS = VSite;
if (Init->isAnyMemberInitializer())