diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/memtemp11.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/memtemp11.C | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp11.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp11.C new file mode 100644 index 000000000..8e8c3c1ac --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp11.C @@ -0,0 +1,27 @@ +// { dg-do link } +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +struct S +{ + template <class U> + S(U u, int i) {} + + template <class T> + T foo(T t) + { + printf("Hello, world.\n"); + return t; + } +}; + + +int main() +{ + S s(3, 4); + int i = s.foo(3); + s.foo("hello"); + s.foo(s); + + S s2("hello", 5); +} |