================
@@ -1639,11 +1639,19 @@ SourceLocation CallExpr::getBeginLoc() const {
if (const auto *OCE = dyn_cast<CXXOperatorCallExpr>(this))
return OCE->getBeginLoc();
+ if (const auto *Method =
+ dyn_cast_if_present<const CXXMethodDecl>(getCalleeDecl());
----------------
HighCommander4 wrote:
> heh I think there is some opportunities to merge the slightly different if
> statements (for the explicit and not explicit cases) but it would be a minor
> improvement so I'll will approve that
Ah, I see.
I considered doing something like this:
```c++
bool UseFirstArgLoc = false;
if (/* is explicit object */)
UseFirstArgLoc = true;
SourceLocation begin = getCallee()->getBeginLoc();
if ((begin.isInvalid() || UseFirstArgLoc) && getNumArgs() > 0 && getArg(0))
begin = getArg(0)->getBeginLoc();
return begin;
```
But this needlessly evaluates `getCallee()->getBeginLoc()` in the explicit
case, so I opted not to do this.
https://github.com/llvm/llvm-project/pull/117841
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits