aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.old-deja/g++.ns/koenig3.C
blob: 58b1d571efc033c579d8688402b8e0d421824a32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// { dg-do run  }
//Check association of member pointer in overload resolution.
struct A {
	int m_val;
	friend int operator ->* (A & other, int A::*pm)
		{ return 31; }
};

int A::*pi = & A::m_val;

int
main(void)
{
	A c;
	c.m_val = 42;
	int j = c ->* pi;

	if (j == 31)
		return 0;
	else
		return 1;
}