File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
cpp/common/src/codingstandards/cpp Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -14,15 +14,21 @@ module MacroUnwrapper<ResultType ResultElement> {
1414 * Gets a macro invocation that applies to the result element.
1515 */
1616 private MacroInvocation getAMacroInvocation ( ResultElement re ) {
17- result .getAnExpandedElement ( ) = re
17+ result .getAnAffectedElement ( ) = re
1818 }
1919
2020 /**
2121 * Gets the primary macro invocation that generated the result element.
22+ *
23+ * Does not hold for cases where the result element is located at a macro argument site.
2224 */
2325 MacroInvocation getPrimaryMacroInvocation ( ResultElement re ) {
2426 exists ( MacroInvocation mi |
2527 mi = getAMacroInvocation ( re ) and
28+ // Only report cases where the element is not located at the macro expansion site
29+ // This means we'll report results in macro arguments in the macro argument
30+ // location, not within the macro itself
31+ mi .getLocation ( ) .getStartColumn ( ) = re .getLocation ( ) .getStartColumn ( ) and
2632 // No other more specific macro that expands to element
2733 not exists ( MacroInvocation otherMi |
2834 otherMi = getAMacroInvocation ( re ) and otherMi .getParentInvocation ( ) = mi
You can’t perform that action at this time.
0 commit comments