diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/template/overload11.C')
-rw-r--r-- | gcc/testsuite/g++.dg/template/overload11.C | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/overload11.C b/gcc/testsuite/g++.dg/template/overload11.C new file mode 100644 index 000000000..d7b0a7c9f --- /dev/null +++ b/gcc/testsuite/g++.dg/template/overload11.C @@ -0,0 +1,27 @@ +// PR c++/39413 +// We don't need to instantiate Wrapper<int> to check the +// foo(const Thingy&) overload. + +template <class T> struct Incomplete; + +template <typename T> class Wrapper +{ + Incomplete<T> i; +}; + +template <typename T> struct Thingy +{ + Thingy(); + Thingy(const Wrapper<T>& v); + + template <typename X> void foo(const Thingy<X>&); + void foo(const Thingy&); +}; + +int main() +{ + Thingy<int> ap1; + Thingy<float> bp1; + + ap1.foo(bp1); +} |