[clang-tools-extra] a413a40 - [clang-tidy][NFC] Remove another ad-hoc exclusion for system headers (#190094)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 2 13:52:52 PDT 2026
Author: Victor Chernyakin
Date: 2026-04-02T20:52:47Z
New Revision: a413a40150275f61b99c52f66b063e2a66eb6c8b
URL: https://github.com/llvm/llvm-project/commit/a413a40150275f61b99c52f66b063e2a66eb6c8b
DIFF: https://github.com/llvm/llvm-project/commit/a413a40150275f61b99c52f66b063e2a66eb6c8b.diff
LOG: [clang-tidy][NFC] Remove another ad-hoc exclusion for system headers (#190094)
This is another ad-hoc approach made obsolete by #151035.
Added:
Modified:
clang-tools-extra/clang-tidy/portability/StdAllocatorConstCheck.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-tidy/portability/StdAllocatorConstCheck.cpp b/clang-tools-extra/clang-tidy/portability/StdAllocatorConstCheck.cpp
index ff58505e8f87c..b2cd846278479 100644
--- a/clang-tools-extra/clang-tidy/portability/StdAllocatorConstCheck.cpp
+++ b/clang-tools-extra/clang-tidy/portability/StdAllocatorConstCheck.cpp
@@ -54,13 +54,7 @@ void StdAllocatorConstCheck::registerMatchers(MatchFinder *Finder) {
void StdAllocatorConstCheck::check(const MatchFinder::MatchResult &Result) {
const auto *T = Result.Nodes.getNodeAs<TypeLoc>("type_loc");
- if (!T)
- return;
- // Exclude TypeLoc matches in STL headers.
- if (isSystem(Result.Context->getSourceManager().getFileCharacteristic(
- T->getBeginLoc())))
- return;
-
+ assert(T);
diag(T->getBeginLoc(),
"container using std::allocator<const T> is a deprecated libc++ "
"extension; remove const for compatibility with other standard "
More information about the cfe-commits
mailing list