aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/access16.C
blob: bb7ebccb8b587763087a4a153bc69cde08a0978f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// PR c++/23842

struct S;
extern S *p;
template <class T> int f(T*, int y = ((T*)p)->x) {
	return y;
}
struct S {
private:
  int x;
  template <class U> friend int f(U*, int);
};
int g() {
  return f(p);
}