diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/memtemp9.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/memtemp9.C | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp9.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp9.C new file mode 100644 index 000000000..5522d94f9 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp9.C @@ -0,0 +1,22 @@ +// { dg-do link } +// GROUPS passed templates membertemplates +extern "C" int printf(const char*, ...); + +struct S { + template <class T> + operator T(); +}; + +template <class T> +S::operator T() +{ + printf("Hello, world.\n"); + return T(); +} + +int main() +{ + S s; + + int i = s.operator int(); +} |