[clang] [clang][AST] Handle dependent representation of call to function with explicit object parameter in CallExpr::getBeginLoc() (PR #126868)
Younan Zhang via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 12 00:13:04 PST 2025
================
@@ -1648,8 +1648,11 @@ SourceLocation CallExpr::getBeginLoc() const {
if (const auto *Method =
dyn_cast_if_present<const CXXMethodDecl>(getCalleeDecl());
Method && Method->isExplicitObjectMemberFunction()) {
- assert(getNumArgs() > 0 && getArg(0));
- return getArg(0)->getBeginLoc();
+ if (!isTypeDependent()) {
----------------
zyn0217 wrote:
Can we move the `isTypeDependent()` check up to the point where we check `isExplicitObjectMemberFunction()`, and add a FIXME explaining why this only applies to non-dependent call expressions?
i.e.
```cpp
// FIXME: Dependent call expressions are not handled because ...
if (!isTypeDependent()) {
...
}
```
https://github.com/llvm/llvm-project/pull/126868
More information about the cfe-commits
mailing list