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

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Thu May 14 07:37:40 PDT 2026


================
@@ -18069,6 +18069,34 @@ Decl *Sema::BuildStaticAssertDeclaration(SourceLocation StaticAssertLoc,
   return Decl;
 }
 
+bool Sema::CheckDependentFriend(SourceLocation Loc, NestedNameSpecifier NNS,
+                                TemplateParameterList *FPL) {
+  if (!NNS || !FPL || FPL->size() == 0)
+    return false;
+
+  if (NNS.isDependent()) {
----------------
mizvekov wrote:

Nit: Maybe just throw !NNS.isDependent() into the if above, flattening this function? That can replace the `!NNS` check.

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


More information about the cfe-commits mailing list