Skip to content

Commit c3480ca

Browse files
committed
[Clang] use begin member expression location for CallExpr with deducing this
1 parent 026af9e commit c3480ca

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

clang/lib/Sema/SemaOverload.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15565,7 +15565,7 @@ ExprResult Sema::BuildCallToMemberFunction(Scope *S, Expr *MemExprE,
1556515565
// Build the actual expression node.
1556615566
ExprResult FnExpr =
1556715567
CreateFunctionRefExpr(*this, Method, FoundDecl, MemExpr,
15568-
HadMultipleCandidates, MemExpr->getExprLoc());
15568+
HadMultipleCandidates, MemExpr->getBeginLoc());
1556915569
if (FnExpr.isInvalid())
1557015570
return ExprError();
1557115571

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++2b -ast-dump %s | FileCheck -strict-whitespace %s
2+
3+
namespace GH116928 {
4+
struct S {
5+
int f(this S&);
6+
};
7+
8+
int main() {
9+
S s;
10+
int x = s.f();
11+
// CHECK: CallExpr 0x{{[^ ]*}} <col:11, col:15> 'int
12+
// CHECK-NEXT: |-ImplicitCastExpr 0x{{[^ ]*}} <col:11> 'int (*)(S &)' <FunctionToPointerDecay>
13+
// CHECK-NEXT: | `-DeclRefExpr 0x{{[^ ]*}} <col:11> 'int (S &)' lvalue CXXMethod 0x{{[^ ]*}} 'f' 'int (S &)'
14+
}
15+
}

0 commit comments

Comments
 (0)