Commit 576e5b39 authored by Salman Javed's avatar Salman Javed Committed by Tom Stellard
Browse files

[clang-tidy] Fix #55134 (regression introduced by 5da7c040)

5da7c040 introduced a regression in the NOLINT macro checking loop, replacing the
call to `getImmediateExpansionRange().getBegin()` with
`getImmediateMacroCallerLoc()`, which has similar but subtly different
behaviour.

The consequence is that NOLINTs cannot suppress diagnostics when they are
attached to a token that came from a macro **argument**, rather than elsewhere
in the macro expansion.

Revert to pre-patch behaviour and add test cases to cover this issue.

Differential Revision: https://reviews.llvm.org/D126138

(cherry picked from commit 9ff4f2df)
parent 99b5eb2d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment