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
392
392
return false ;
393
393
}
394
394
395
+ bool VisitAttributedStmt (const AttributedStmt *AS) {
396
+ // Ignore attributes.
397
+ return Visit (AS->getSubStmt ());
398
+ }
399
+
395
400
bool VisitCompoundStmt (const CompoundStmt *CS) {
396
401
// A compound statement is allowed as long each individual sub-statement
397
402
// is trivial.
Original file line number Diff line number Diff line change @@ -376,6 +376,7 @@ class RefCounted {
376
376
};
377
377
void trivial68 () { point pt = { 1.0 }; }
378
378
unsigned trivial69 () { return offsetof (RefCounted, children); }
379
+ DerivedNumber* trivial70 () { [[clang::suppress]] return static_cast <DerivedNumber*>(number); }
379
380
380
381
static RefCounted& singleton () {
381
382
static RefCounted s_RefCounted;
@@ -564,6 +565,7 @@ class UnrelatedClass {
564
565
getFieldTrivial ().trivial67 ()->trivial6 (); // no-warning
565
566
getFieldTrivial ().trivial68 (); // no-warning
566
567
getFieldTrivial ().trivial69 (); // no-warning
568
+ getFieldTrivial ().trivial70 (); // no-warning
567
569
568
570
RefCounted::singleton ().trivial18 (); // no-warning
569
571
RefCounted::singleton ().someFunction (); // no-warning
You can’t perform that action at this time.
0 commit comments