[clang-tidy] Fix confusable identifiers interaction with DeclContext
authorserge-sans-paille <sguelton@redhat.com>
Tue, 28 Jun 2022 08:34:46 +0000 (10:34 +0200)
committerserge-sans-paille <sguelton@redhat.com>
Tue, 5 Jul 2022 06:56:26 +0000 (08:56 +0200)
commit7a550212e8ff5552b0bd10d0c1af459a55c36234
treecac561f53d5222c9ce66081dbfd7d8bf0ce97568
parentf27672924e369fc4c6a2f0fe31502e5a1a2ec593
[clang-tidy] Fix confusable identifiers interaction with DeclContext

Properly checks enclosing DeclContext, and add the related test case.
It would be great to be able to use Sema to check conflicting scopes, but that's
not something clang-tidy seems to be able to do :-/

Fix #56221

Differential Revision: https://reviews.llvm.org/D128715
clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp
clang-tools-extra/test/clang-tidy/checkers/misc/confusable-identifiers.cpp