[clang] [clang] Add tests for Core issues about friend templates (PR #94288)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 3 17:09:00 PDT 2024


================
@@ -121,6 +145,21 @@ derived d2(42, 9);
 #endif
 }
 
+namespace cwg1945 { // cwg1945: no
+template<typename T> struct A {
+  class B {
+    class C {};
+  };
+};
+class X {
+  static int x;
+  // FIXME: this is ill-formed, because A<T>::B::C does not end with a simple-template-id
+  template <typename T>
+  friend class A<T>::B::C;
+  // expected-warning at -1 {{dependent nested name specifier 'A<T>::B::' for friend class declaration is not supported; turning off access control for 'X'}}
+};
+} // namespace cwg1918
----------------
shafik wrote:

```suggestion
} // namespace cwg1945
```

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


More information about the cfe-commits mailing list