[clang] [Clang] support friend declarations with a dependent nested-name-specifier (PR #191268)

Oleksandr Tarasiuk via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 29 07:24:20 PDT 2026


================
@@ -3247,14 +3224,39 @@ Decl *TemplateDeclInstantiator::VisitCXXMethodDecl(
 
   DeclarationNameInfo NameInfo
     = SemaRef.SubstDeclarationNameInfo(D->getNameInfo(), TemplateArgs);
+  if (!NameInfo.getName())
+    return nullptr;
+
+  CXXMethodDecl *Method = nullptr;
+  SourceLocation StartLoc = D->getInnerLocStart();
+
+  SmallVector<ParmVarDecl *, 4> Params;
+  TypeSourceInfo *TInfo = SubstFunctionType(D, Params);
+  if (!TInfo)
+    return nullptr;
+
----------------
a-tarasyuk wrote:

@cor3ntin, this was originally added during my experiments to prevent substituting the method type after declaration-name substitution failed. It isn’t needed for this patch, so I’ve restored the original ordering.

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


More information about the cfe-commits mailing list