summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/struct1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/struct1.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/struct1.C42
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/struct1.C b/gcc/testsuite/g++.old-deja/g++.other/struct1.C
new file mode 100644
index 000000000..699d524b9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/struct1.C
@@ -0,0 +1,42 @@
+// { dg-do assemble }
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 3 Jun 1999 <nathan@acm.org>
+
+// Duplicate definitions are wrong, we should just cough
+// politely, but we used to die horribly.
+
+class Y // { dg-error "" } previous definition
+{
+};
+class Y // { dg-error "" } redefinition
+{
+};
+
+template<class T> class X // { dg-error "" } previous definition
+{
+};
+template<class T> class X // { dg-error "" } redefinition
+{
+};
+
+template<class T> class X<T *> // { dg-error "" } previous definition
+{
+};
+template<class T> class X<T *> // { dg-error "" } redefinition
+{
+};
+
+template<> class X<int> // { dg-error "" } previous definition
+{
+};
+template<> class X<int> // { dg-error "" } redefinition
+{
+};
+
+template<> class X<int *> // { dg-error "" } previous definition
+{
+};
+template<> class X<int *> // { dg-error "" } redefinition
+{
+};