[all-commits] [llvm/llvm-project] 9ff4f2: [clang-tidy] Fix #55134 (regression introduced by ...

Salman Javed via All-commits all-commits at lists.llvm.org
Tue May 24 16:33:01 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9ff4f2dfea632d63e3a57a88a2faa634aae5c772
      https://github.com/llvm/llvm-project/commit/9ff4f2dfea632d63e3a57a88a2faa634aae5c772
  Author: Salman Javed <mail at salmanjaved.org>
  Date:   2022-05-25 (Wed, 25 May 2022)

  Changed paths:
    M clang-tools-extra/clang-tidy/NoLintDirectiveHandler.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/test/clang-tidy/infrastructure/nolint.cpp

  Log Message:
  -----------
  [clang-tidy] Fix #55134 (regression introduced by 5da7c04)

5da7c04 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




More information about the All-commits mailing list