diff options
Diffstat (limited to 'contrib/llvm-project/clang/lib/Sema/SemaExprMember.cpp')
-rw-r--r-- | contrib/llvm-project/clang/lib/Sema/SemaExprMember.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/llvm-project/clang/lib/Sema/SemaExprMember.cpp b/contrib/llvm-project/clang/lib/Sema/SemaExprMember.cpp index 473eea55bb6b..2abec3d86a27 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaExprMember.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaExprMember.cpp @@ -253,7 +253,9 @@ static void diagnoseInstanceReference(Sema &SemaRef, SemaRef.Diag(Loc, diag::err_member_call_without_object) << Range << /*static*/ 0; else { - const auto *Callee = dyn_cast<CXXMethodDecl>(Rep); + if (const auto *Tpl = dyn_cast<FunctionTemplateDecl>(Rep)) + Rep = Tpl->getTemplatedDecl(); + const auto *Callee = cast<CXXMethodDecl>(Rep); auto Diag = SemaRef.Diag(Loc, diag::err_member_call_without_object) << Range << Callee->isExplicitObjectMemberFunction(); if (!Replacement.empty()) |