diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/lookup/two-stage4.C')
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/two-stage4.C | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/lookup/two-stage4.C b/gcc/testsuite/g++.dg/lookup/two-stage4.C new file mode 100644 index 000000000..bbb44afa0 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/two-stage4.C @@ -0,0 +1,20 @@ + +// Contributed by Douglas Gregor <doug.gregor@gmail.com> + +template<class T> struct wrap {}; + +template<typename T> bool& operator==(wrap<T>, wrap<T>); + +template<typename T> +void g(T, wrap<wrap<int> > x) +{ + bool& b = x == x; // { dg-bogus "invalid initialization of reference" "" { xfail *-*-*} } +} + +template<typename T> int& operator==(wrap<wrap<T> >, wrap<wrap<T> >); + +void h() +{ + wrap<wrap<int> > x; + g(17, x); +} |