summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/spec3.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/spec3.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/spec3.C38
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec3.C b/gcc/testsuite/g++.old-deja/g++.pt/spec3.C
new file mode 100644
index 000000000..cce36d273
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/spec3.C
@@ -0,0 +1,38 @@
+// { dg-do run }
+extern "C" void abort();
+
+class X
+{
+ public:
+ virtual int f() const = 0;
+};
+
+template <class T>
+class Y: public X
+{
+ public:
+ virtual int f() const;
+};
+
+template <class T>
+int Y<T>::f() const
+{
+ abort();
+ return 0;
+}
+
+template <>
+int Y<bool>::f() const;
+
+template <>
+int Y<bool>::f() const
+{
+ return 0;
+}
+
+int main()
+{
+ Y<bool> yb;
+
+ yb.f();
+}