From: Paul Burchard Date: Wed, 25 Aug 1999 21:48:16 +0000 (+0000) Subject: lss-001.C, [...]: New tests. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f362bcef805a7e50a7bda082b7c21037523ae410;p=gcc.git lss-001.C, [...]: New tests. * g++.old-deja/g++.pt/lss-001.C, lss-002.C, lss-003.C, lss-004.C, lss-005.C, lss-006.C, lss-007.C, lss-008.C, lss-009.C, lss-010.C, lss-011.C: New tests. From-SVN: r28874 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1c13f9f6df1..6ef6a6440ce 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +1999-08-25 Paul Burchard + + * g++.old-deja/g++.pt/lss-001.C, lss-002.C, lss-003.C, lss-004.C, + lss-005.C, lss-006.C, lss-007.C, lss-008.C, lss-009.C, lss-010.C, + lss-011.C: New tests. + 1999-08-25 Nathan Sidwell * g++.old-deja/g++.other/decl5.C: New test. diff --git a/gcc/testsuite/g++.old-deja/g++.pt/lss-001.C b/gcc/testsuite/g++.old-deja/g++.pt/lss-001.C new file mode 100644 index 00000000000..9b4bda53cef --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/lss-001.C @@ -0,0 +1,15 @@ +// Build don't link: +// crash test - + +// by Paul Burchard , Level Set Systems, Inc. +// Copyright (C) 1999 Free Software Foundation + +template +class X { + class Y : public T {}; // ERROR - invalid base type + Y y; +}; +int main() { + X x; // ERROR - (instantiated from here) +} + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/lss-002.C b/gcc/testsuite/g++.old-deja/g++.pt/lss-002.C new file mode 100644 index 00000000000..562f43081ee --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/lss-002.C @@ -0,0 +1,26 @@ +// Build don't link: + +// by Paul Burchard , Level Set Systems, Inc. +// Copyright (C) 1999 Free Software Foundation + +template +class A { +}; +template +class B { +}; + +template class AA> // gets bogus error - `template template class A' previously declared here +class C { + class D { + }; + D d; + class E : public B { + }; + E e; +}; + +int main() { + C c; // gets bogus error - redefinition of `template template class A' +} + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/lss-003.C b/gcc/testsuite/g++.old-deja/g++.pt/lss-003.C new file mode 100644 index 00000000000..29fcea1935d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/lss-003.C @@ -0,0 +1,8 @@ +// Build don't link: +// crash test - + +// by Paul Burchard , Level Set Systems, Inc. +// Copyright (C) 1999 Free Software Foundation + +typedef std::vector::iterator iter; // ERROR - syntax error before `::' + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/lss-004.C b/gcc/testsuite/g++.old-deja/g++.pt/lss-004.C new file mode 100644 index 00000000000..ef8f0480774 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/lss-004.C @@ -0,0 +1,16 @@ +// Build don't link: +// crash test - XFAIL *-*-* + +// by Paul Burchard , Level Set Systems, Inc. +// Copyright (C) 1999 Free Software Foundation + +class Q { + template + class X { + }; +}; +template class> +class Y { +}; +Y y1; + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/lss-005.C b/gcc/testsuite/g++.old-deja/g++.pt/lss-005.C new file mode 100644 index 00000000000..47a587f76b8 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/lss-005.C @@ -0,0 +1,16 @@ +// Build don't link: +// crash test - XFAIL *-*-* + +// by Paul Burchard , Level Set Systems, Inc. +// Copyright (C) 1999 Free Software Foundation + +class Q { + template + class X { + }; +}; +template class> +class Y { +}; +Y y; // ERROR - typename out of template context + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/lss-006.C b/gcc/testsuite/g++.old-deja/g++.pt/lss-006.C new file mode 100644 index 00000000000..a57ad17fef1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/lss-006.C @@ -0,0 +1,16 @@ +// Build don't link: +// crash test - XFAIL *-*-* + +// by Paul Burchard , Level Set Systems, Inc. +// Copyright (C) 1999 Free Software Foundation + +class Q { + template + class X { + }; +}; +template class> +class Y { +}; +Q::template X x; // ERROR - template syntax + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/lss-007.C b/gcc/testsuite/g++.old-deja/g++.pt/lss-007.C new file mode 100644 index 00000000000..cf2336f754b --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/lss-007.C @@ -0,0 +1,18 @@ +// Build don't link: +// crash test - XFAIL *-*-* +// regression test - + +// by Paul Burchard , Level Set Systems, Inc. +// Copyright (C) 1999 Free Software Foundation + +template +struct X { + X(A) { + } +}; +template +struct Y { + static X x(A(1)); // ERROR - ANSI C++ forbids in-class initialization of non-const static member `x' +}; +Y y; + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/lss-008.C b/gcc/testsuite/g++.old-deja/g++.pt/lss-008.C new file mode 100644 index 00000000000..56dab46736c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/lss-008.C @@ -0,0 +1,16 @@ +// Build don't link: +// crash test - XFAIL *-*-* + +// by Paul Burchard , Level Set Systems, Inc. +// Copyright (C) 1999 Free Software Foundation + +struct Q { + template + class X { + }; + template class XX = X> // gets bogus error - (original definition appeared here) + class Y { + }; // gets bogus error - redefinition of default argument for `template XX' + Y<> y; +}; + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/lss-009.C b/gcc/testsuite/g++.old-deja/g++.pt/lss-009.C new file mode 100644 index 00000000000..7cc027a4859 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/lss-009.C @@ -0,0 +1,17 @@ +// Build don't link: +// crash test - XFAIL *-*-* + +// by Paul Burchard , Level Set Systems, Inc. +// Copyright (C) 1999 Free Software Foundation + +class Q { + template + class X { + }; +}; +template class XX> +class Y { + XX x_; +}; +Y y; + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/lss-010.C b/gcc/testsuite/g++.old-deja/g++.pt/lss-010.C new file mode 100644 index 00000000000..15dcca77c57 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/lss-010.C @@ -0,0 +1,19 @@ +// Build don't link: +// regression test - + +// by Paul Burchard , Level Set Systems, Inc. +// Copyright (C) 1999 Free Software Foundation +// related to bug report by Leon Bottou + +struct A { + template + struct B { + }; + template + struct C { + B b; // gets bogus error - B is not a template + // but removing wrapper A gets rid of complaint + // also, replacing B with A::B also gets rid of complaint + }; +}; + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/lss-011.C b/gcc/testsuite/g++.old-deja/g++.pt/lss-011.C new file mode 100644 index 00000000000..be97e9f7b6c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/lss-011.C @@ -0,0 +1,20 @@ +// Build don't link: +// crash test - XFAIL *-*-* +// regression test - + +// simplified from bug report by Leon Bottou +// by Paul Burchard , Level Set Systems, Inc. +// Copyright (C) 1999 Free Software Foundation + +struct A { + template + struct B { + T x; + }; + template + struct C : B { + C() {} + }; +}; + +