summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/friend35.C
blob: b150ccdab8941987753e9c4cd82b4fca029a185e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// { dg-do compile }

// Origin: Giovanni Bajo <giovannibajo@libero.it>

// PR c++/4403: Incorrect friend class chosen during instantiation.

template <typename T>
struct A
{
  struct F;
};
 
template <typename T>
struct B : A<T>
{
  friend struct F;
private:
  int priv;
};
 
struct F
{
  void func(void)
  {
    B<int> b;
    b.priv = 0;
  }
};