llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang-tools-extra Author: Kazu Hirata (kazutakahirata) <details> <summary>Changes</summary> --- Full diff: https://github.com/llvm/llvm-project/pull/127444.diff 1 Files Affected: - (modified) clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp (+4-4) ``````````diff diff --git a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp index 6a467910521f5..3d3a79d8eaf21 100644 --- a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp @@ -199,10 +199,10 @@ void IncludeModernizePPCallbacks::InclusionDirective( // 2. Insert `using namespace std;` to the beginning of TU. // 3. Do nothing and let the user deal with the migration himself. SourceLocation DiagLoc = FilenameRange.getBegin(); - if (CStyledHeaderToCxx.count(FileName) != 0) { - IncludesToBeProcessed.emplace_back( - IncludeMarker{CStyledHeaderToCxx[FileName], FileName, - FilenameRange.getAsRange(), DiagLoc}); + if (auto It = CStyledHeaderToCxx.find(FileName); + It != CStyledHeaderToCxx.end()) { + IncludesToBeProcessed.emplace_back(IncludeMarker{ + It->second, FileName, FilenameRange.getAsRange(), DiagLoc}); } else if (DeleteHeaders.count(FileName) != 0) { IncludesToBeProcessed.emplace_back( // NOLINTNEXTLINE(modernize-use-emplace) - false-positive `````````` </details> https://github.com/llvm/llvm-project/pull/127444 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits