[clang] [clang] Add source range to 'use of undeclared identifier' diagnostics (PR #117671)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 26 01:42:42 PST 2024


Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/117671 at github.com>


================
@@ -487,14 +487,17 @@ static bool checkRangeForMacroArgExpansion(CharSourceRange Range,
 /// macro argument expansion as Loc.
 static bool checkRangesForMacroArgExpansion(FullSourceLoc Loc,
                                             ArrayRef<CharSourceRange> Ranges) {
+  // llvm::errs() << __PRETTY_FUNCTION__ << '\n';
   assert(Loc.isMacroID() && "Must be a macro expansion!");
 
   SmallVector<CharSourceRange, 4> SpellingRanges;
-  mapDiagnosticRanges(Loc, Ranges, SpellingRanges);
+  // mapDiagnosticRanges(Loc, Ranges, SpellingRanges);
+  // llvm::errs() << "Spelling Ranges: " << SpellingRanges.size() << '\n';
 
   // Count all valid ranges.
-  unsigned ValidCount =
-      llvm::count_if(Ranges, [](const auto &R) { return R.isValid(); });
+  unsigned ValidCount = 0;
+      // llvm::count_if(Ranges, [](const auto &R) { return R.isValid(); });
+  // llvm::errs() << "ValidCount: " << ValidCount << '\n';
----------------
tbaederr wrote:

That was just a test commit, but didn't end up working out anyway. :(

https://github.com/llvm/llvm-project/pull/117671


More information about the cfe-commits mailing list