view gcc/testsuite/g++.dg/template/friend63.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

// PR c++/71738

template < class > struct S
{
  template < class > struct A
  { 
    template < class > struct B
    {
      template <class Z>
      void operator=(Z) { S::i = 0; }
    };
  };

  // Note that this friend declaration is useless, since nested classes are
  // already friends of their enclosing class.
  template < class X >
  template < class Y >
  template < class Z >
  friend void A < X >::B < Y >::operator= (Z);

private:
  static int i;
};

int main()
{
  S<int>::A<int>::B<int> b;
  b = 0;
}