Skip to content

Commit 24b9f37

Browse files
committed
Exclude compiler-generated RAII destructor calls
1 parent 79b679c commit 24b9f37

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cpp/misra/src/rules/RULE-21-6-3/AdvancedMemoryManagementUsed.ql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ class NonStandardDeleteOrDeleteArrayOperator extends CustomOperatorNewOrDelete {
6868
}
6969
}
7070

71+
class ExplicitDestructorCall extends DestructorCall {
72+
ExplicitDestructorCall() { not this.isCompilerGenerated() }
73+
}
74+
7175
from Element element, string message
7276
where
7377
not isExcluded(element, Memory6Package::advancedMemoryManagementUsedQuery()) and
@@ -87,7 +91,7 @@ where
8791
or
8892
(
8993
element instanceof VacuousDestructorCall or
90-
element instanceof DestructorCall
94+
element instanceof ExplicitDestructorCall
9195
) and
9296
message = "This expression is a call to a destructor."
9397
or

0 commit comments

Comments
 (0)