summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/memtemp5.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/memtemp5.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memtemp5.C25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp5.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp5.C
new file mode 100644
index 000000000..faff68714
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp5.C
@@ -0,0 +1,25 @@
+// { dg-do link }
+// GROUPS passed templates membertemplates
+extern "C" int printf(const char*, ...);
+
+struct S {
+ template <class T>
+ void operator+(T);
+};
+
+
+template <class T>
+void S::operator+(T)
+{
+ printf("Hello, world.\n");
+}
+
+
+
+int main()
+{
+ S s;
+ s + 3;
+ s + s;
+ s.operator+("Hi");
+}