[clang] [clang-tools-extra] [clang] Compute accurate begin location for CallExpr with explicit object parameter (PR #117841)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 28 21:06:54 PST 2024


HighCommander4 wrote:

Updated to add a clangd test that fails with the previous fix approach.

> A more general implementation of `CallExpr::getBeginLoc` that occurs to me is: return the earlier of the callee's begin loc and the first argument's (if present) begin loc.

I did not do this because accurately determining which of two `SourceLocation`s is earlier requires calling `SourceManager::isBeforeInTranslationUnit()`, and a `SourceManager` does not seem to be available in `CallExpr::getBeginLoc()`.

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


More information about the cfe-commits mailing list