File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
lib/StaticAnalyzer/Checkers/WebKit
test/Analysis/Checkers/WebKit Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -392,6 +392,11 @@ class TrivialFunctionAnalysisVisitor
392392 return false ;
393393 }
394394
395+ bool VisitAttributedStmt (const AttributedStmt *AS) {
396+ // Ignore attributes.
397+ return Visit (AS->getSubStmt ());
398+ }
399+
395400 bool VisitCompoundStmt (const CompoundStmt *CS) {
396401 // A compound statement is allowed as long each individual sub-statement
397402 // is trivial.
Original file line number Diff line number Diff line change @@ -376,6 +376,7 @@ class RefCounted {
376376 };
377377 void trivial68 () { point pt = { 1.0 }; }
378378 unsigned trivial69 () { return offsetof (RefCounted, children); }
379+ DerivedNumber* trivial70 () { [[clang::suppress]] return static_cast <DerivedNumber*>(number); }
379380
380381 static RefCounted& singleton () {
381382 static RefCounted s_RefCounted;
@@ -564,6 +565,7 @@ class UnrelatedClass {
564565 getFieldTrivial ().trivial67 ()->trivial6 (); // no-warning
565566 getFieldTrivial ().trivial68 (); // no-warning
566567 getFieldTrivial ().trivial69 (); // no-warning
568+ getFieldTrivial ().trivial70 (); // no-warning
567569
568570 RefCounted::singleton ().trivial18 (); // no-warning
569571 RefCounted::singleton ().someFunction (); // no-warning
You can’t perform that action at this time.
0 commit comments