================
@@ -253,6 +253,8 @@ static void diagnoseInstanceReference(Sema &SemaRef,
     SemaRef.Diag(Loc, diag::err_member_call_without_object)
         << Range << /*static*/ 0;
   else {
+    if (auto *Tpl = dyn_cast<FunctionTemplateDecl>(Rep))
+      Rep = Tpl->getTemplatedDecl();
     const auto *Callee = dyn_cast<CXXMethodDecl>(Rep);
----------------
tbaederr wrote:

Since `Callee` must be non-null after the cast, shouldn't we use `cast<>` 
instead of `dyn_cast` here?

https://github.com/llvm/llvm-project/pull/75913
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to