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

Oleksandr Tarasiuk via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 10 05:20:52 PDT 2026


================
@@ -416,29 +416,24 @@ struct A<float*> {
 };
 
 class C {
-  int private_int;
+  int private_int; // #cwg1862-C-private_int
 
   template<class T>
   friend struct A<T>::B;
-  // expected-warning at -1 {{dependent nested name specifier 'A<T>' for friend class declaration is not supported; turning off access control for 'C'}}
 
   template<class T>
   friend void A<T>::f();
-  // expected-warning at -1 {{dependent nested name specifier 'A<T>' for friend class declaration is not supported; turning off access control for 'C'}}
 
-  // FIXME: this is ill-formed, because A<T>​::​D does not end with a simple-template-id
   template<class T>
   friend void A<T>::D::g();
-  // expected-warning at -1 {{dependent nested name specifier 'A<T>::D' for friend class declaration is not supported; turning off access control for 'C'}}
+  // expected-error at -1 {{friend declaration does not name a member of a class template specialization}}
----------------
a-tarasyuk wrote:

@Endilll You're not too late - this party is still active :). I updated the diagnostic. Does this look okay?

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


More information about the cfe-commits mailing list