[PATCH] D150191: [clang][Diagnostics] Provide a source range for 'use of undeclared identifier' diagnostics

2023-05-15 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder abandoned this revision. tbaeder added a comment. Abandoning this. The code in question was dead before as far as I can tell, since the `Ranges` list was always empty. I can't add this without regressing any of the existing tests. CHANGES SINCE LAST ACTION

[PATCH] D150191: [clang][Diagnostics] Provide a source range for 'use of undeclared identifier' diagnostics

2023-05-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:2187 else - SemaRef.Diag(TypoLoc, DiagnosticID) << Typo; + SemaRef.Diag(TypoRange.getEnd(), DiagnosticID) << Typo; return; tbaeder wrote: > aaron.ballman wrote: > >

[PATCH] D150191: [clang][Diagnostics] Provide a source range for 'use of undeclared identifier' diagnostics

2023-05-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:2187 else - SemaRef.Diag(TypoLoc, DiagnosticID) << Typo; + SemaRef.Diag(TypoRange.getEnd(), DiagnosticID) << Typo; return; aaron.ballman wrote: > tbaeder wrote: > > I'm

[PATCH] D150191: [clang][Diagnostics] Provide a source range for 'use of undeclared identifier' diagnostics

2023-05-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:2187 else - SemaRef.Diag(TypoLoc, DiagnosticID) << Typo; + SemaRef.Diag(TypoRange.getEnd(), DiagnosticID) << Typo; return; tbaeder wrote: > I'm not passing the

[PATCH] D150191: [clang][Diagnostics] Provide a source range for 'use of undeclared identifier' diagnostics

2023-05-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 521236. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150191/new/ https://reviews.llvm.org/D150191 Files: clang/include/clang/Sema/Lookup.h clang/lib/Sema/SemaExpr.cpp clang/test/Misc/reduced-diags-macros-backtrace.cpp Index:

[PATCH] D150191: [clang][Diagnostics] Provide a source range for 'use of undeclared identifier' diagnostics

2023-05-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:2187 else - SemaRef.Diag(TypoLoc, DiagnosticID) << Typo; + SemaRef.Diag(TypoRange.getEnd(), DiagnosticID) << Typo; return; I'm not passing the `TypoRange` here now, which

[PATCH] D150191: [clang][Diagnostics] Provide a source range for 'use of undeclared identifier' diagnostics

2023-05-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 521215. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150191/new/ https://reviews.llvm.org/D150191 Files: clang/include/clang/Sema/Lookup.h clang/lib/Sema/SemaExpr.cpp Index: clang/lib/Sema/SemaExpr.cpp

[PATCH] D150191: [clang][Diagnostics] Provide a source range for 'use of undeclared identifier' diagnostics

2023-05-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Right, I expect (hope?) precommit CI to fail, but I'm stuck at an airport right now so I'll leave tests for when I'm back home. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150191/new/ https://reviews.llvm.org/D150191

[PATCH] D150191: [clang][Diagnostics] Provide a source range for 'use of undeclared identifier' diagnostics

2023-05-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. The changes are reasonable but should have test coverage. We test source ranges with `-fdiagnostics-print-source-range-info` as in https://github.com/llvm/llvm-project/blob/929a8c9f72dc405779a8aaf82304efdb7f1ab5e4/clang/test/Misc/diag-greatergreater.cpp#L4

[PATCH] D150191: [clang][Diagnostics] Provide a source range for 'use of undeclared identifier' diagnostics

2023-05-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: cjdb, aaron.ballman, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Just a small improvement. Before: array.cpp:1279:9: error: use of