Skip to content

Commit 460fb26

Browse files
committed
Reinstate macro instantiation results
1 parent a02baeb commit 460fb26

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

c/misra/src/rules/RULE-8-13/PointerShouldPointToConstTypeWhenPossible.ql

-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ class NonConstPointerVariableCandidate extends Variable {
3131
// In a type declared locally
3232
this.(Field).getDeclaringType+().getEnclosingFunction() = a.getEnclosingFunction()
3333
) and
34-
// Avoid elements in macro expansions, as they cannot be equated across copies
35-
not this.isInMacroExpansion() and
3634
exists(PointerOrArrayType type |
3735
// include only pointers which point to a const-qualified type
3836
this.getType() = type and

cpp/common/src/codingstandards/cpp/alertreporting/HoldsForAllCopies.qll

+1-3
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,9 @@ module HoldsForAllCopies<CandidateElementSig CandidateElement, ElementSetSig Ele
8585
string filepath, int startline, int startcolumn, int endline, int endcolumn
8686
) {
8787
exists(CandidateElement s |
88-
// Only consider candidates where we can match up the location
89-
isNotWithinMacroExpansion(s) and
9088
hasLocation(s, filepath, startline, startcolumn, endline, endcolumn) and
9189
// All relevant elements that occur at the same location are candidates
92-
forex(RelevantElement relevantElement | s = relevantElement.getCandidateElement() |
90+
forall(RelevantElement relevantElement | s = relevantElement.getCandidateElement() |
9391
relevantElement instanceof CandidateElement
9492
)
9593
)

0 commit comments

Comments
 (0)