OSDN Git Service

2012-12-15 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / lookup / two-stage4.C
1
2 // Contributed by Douglas Gregor <doug.gregor@gmail.com>
3
4 template<class T> struct wrap {};
5
6 template<typename T> bool& operator==(wrap<T>, wrap<T>);
7
8 template<typename T>
9 void g(T, wrap<wrap<int> > x)
10 {
11   bool& b = x == x; // { dg-bogus "invalid initialization of reference" "" { xfail *-*-*} }
12 }
13
14 template<typename T> int& operator==(wrap<wrap<T> >, wrap<wrap<T> >);
15
16 void h()
17 {
18   wrap<wrap<int> > x;
19   g(17, x);
20 }