[clang] [Clang] Diagnose invalid non-dependent calls in dependent contexts. (PR #190965)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 13 06:17:00 PDT 2026


================
@@ -4171,8 +4171,11 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto,
                      const Expr *ThisArg, ArrayRef<const Expr *> Args,
                      bool IsMemberFunction, SourceLocation Loc,
                      SourceRange Range, VariadicCallType CallType) {
-  // FIXME: We should check as much as we can in the template definition.
-  if (CurContext->isDependentContext())
+
+  if ((ThisArg && ThisArg->isInstantiationDependent()) ||
----------------
erichkeane wrote:

Do we have to be worried about the callee being dependent? Or more correctly, the expression to get the callee?  Not really clever enough on an early monday to come up with one :D 

https://github.com/llvm/llvm-project/pull/190965


More information about the cfe-commits mailing list