================
@@ -1655,14 +1645,8 @@ SourceLocation CallExpr::getBeginLoc() const {
if (!isTypeDependent()) {
if (const auto *Method =
dyn_cast_if_present<const CXXMethodDecl>(getCalleeDecl());
- Method && Method->isExplicitObjectMemberFunction()) {
- // Note: while we typically expect the call to have a first argument
- // here, we can't assert it because in some cases it does not, e.g.
- // calls created with CallExpr::CreateTemporary() during overload
- // resolution.
- if (getNumArgs() > 0 && getArg(0))
- return getArg(0)->getBeginLoc();
- }
+ Method && Method->isExplicitObjectMemberFunction())
+ return getArg(0)->getBeginLoc();
----------------
zyn0217 wrote:
I think we can revert that to
```cpp
bool HasFirstArg = getNumArgs() > 0 && getArg(0);
assert(HasFirstArg);
if (HasFirstArg)
return getArg(0)->getBeginLoc();
```
so at least we have an assertion here. WDYT?
https://github.com/llvm/llvm-project/pull/130919
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits