[clang] [Clang][NFC] Remove CallExpr::CreateTemporary (PR #130919)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 12 00:54:34 PDT 2025
================
@@ -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();
----------------
cor3ntin wrote:
`getArg(0)` already has an assertion (and I don;t like having both an assertion and an if)
https://github.com/llvm/llvm-project/pull/130919
More information about the cfe-commits
mailing list