diff --git a/clang-tools-extra/clang-tidy/portability/StdAllocatorConstCheck.cpp b/clang-tools-extra/clang-tidy/portability/StdAllocatorConstCheck.cpp index ff58505e8f87..b2cd84627847 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("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 is a deprecated libc++ " "extension; remove const for compatibility with other standard "