@@ -17,18 +17,25 @@ module MacroUnwrapper<ResultType ResultElement> {
1717 result .getAnAffectedElement ( ) = re
1818 }
1919
20+ private MacroInvocation getASubsumedMacroInvocation ( ResultElement re ) {
21+ result = getAMacroInvocation ( re ) and
22+ // Only report cases where the element is not located at the macro expansion site
23+ // This means we'll report results in macro arguments in the macro argument
24+ // location, not within the macro itself.
25+ //
26+ // Do not join start column values.
27+ pragma [ only_bind_out ] ( result .getLocation ( ) .getStartColumn ( ) ) =
28+ pragma [ only_bind_out ] ( re .getLocation ( ) .getStartColumn ( ) )
29+ }
30+
2031 /**
2132 * Gets the primary macro invocation that generated the result element.
2233 *
2334 * Does not hold for cases where the result element is located at a macro argument site.
2435 */
2536 MacroInvocation getPrimaryMacroInvocation ( ResultElement re ) {
2637 exists ( MacroInvocation mi |
27- 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
38+ mi = getASubsumedMacroInvocation ( re ) and
3239 // No other more specific macro that expands to element
3340 not exists ( MacroInvocation otherMi |
3441 otherMi = getAMacroInvocation ( re ) and otherMi .getParentInvocation ( ) = mi
0 commit comments