diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2000-06-26 11:07:20 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2000-06-26 11:07:20 +0000 |
commit | 51a5a5e0ef45835252405b53fe36c4f594c16b63 (patch) | |
tree | a7af437d969a46399d450598d091450f1e8058df /gcc | |
parent | 0404d86f340f43e55c2a62a59462311fbaef3d57 (diff) | |
download | gcc-51a5a5e0ef45835252405b53fe36c4f594c16b63.zip gcc-51a5a5e0ef45835252405b53fe36c4f594c16b63.tar.gz gcc-51a5a5e0ef45835252405b53fe36c4f594c16b63.tar.bz2 |
syntax1.C: New test.
* g++.old-deja/g++.pt/syntax1.C: New test.
* g++.old-deja/g++.pt/syntax2.C: New test.
* g++.old-deja/g++.other/syntax3.C: New test.
* g++.old-deja/g++.other/syntax4.C: New test.
From-SVN: r34708
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/syntax3.C | 21 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/syntax4.C | 26 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/syntax1.C | 26 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/syntax2.C | 27 |
5 files changed, 107 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d1a4dde..24233c1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2000-06-26 Nathan Sidwell <nathan@codesourcery.com> + + * g++.old-deja/g++.pt/syntax1.C: New test. + * g++.old-deja/g++.pt/syntax2.C: New test. + * g++.old-deja/g++.other/syntax3.C: New test. + * g++.old-deja/g++.other/syntax4.C: New test. + 2000-06-25 Zack Weinberg <zack@wolery.cumb.org> * gcc.dg/20000623-1.c: Prototype exit and abort. diff --git a/gcc/testsuite/g++.old-deja/g++.other/syntax3.C b/gcc/testsuite/g++.old-deja/g++.other/syntax3.C new file mode 100644 index 0000000..9869333 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/syntax3.C @@ -0,0 +1,21 @@ +// Build don't link: + +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 22 June 2000 <nathan@codesourcery.com> + +// Origin GNATS bug report 262 from Jeremy Sanders <jss@ast.cam.ac.uk> +// and several others. With templates, it's very easy to say something +// erroneous like +// template class X::X<whatever> +// The culprit +// ... class X::X ... +// caused us to ICE as we got confused about pushing and popping scopes. + +class X +{ + public: + X(); +}; + +class X::X () {} // ERROR - parse error +X::X () {} diff --git a/gcc/testsuite/g++.old-deja/g++.other/syntax4.C b/gcc/testsuite/g++.old-deja/g++.other/syntax4.C new file mode 100644 index 0000000..ee8e1a9 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/syntax4.C @@ -0,0 +1,26 @@ +// Build don't link: + +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 22 June 2000 <nathan@codesourcery.com> + +// Origin GNATS bug report 262 from Jeremy Sanders <jss@ast.cam.ac.uk> +// and several others. With templates, it's very easy to say something +// erroneous like +// template class X::X<whatever> +// The culprit +// ... class X::X ... +// caused us to ICE as we got confused about pushing and popping scopes. + +class X { + X (); +}; + +class Y { + public: + typedef ::X W; + class Z; +}; + +class Y::Z {}; +class Y::W () {} // ERROR - parse error +Y::W::X () {} diff --git a/gcc/testsuite/g++.old-deja/g++.pt/syntax1.C b/gcc/testsuite/g++.old-deja/g++.pt/syntax1.C new file mode 100644 index 0000000..787df52 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/syntax1.C @@ -0,0 +1,26 @@ +// Build don't link: + +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 22 June 2000 <nathan@codesourcery.com> + +// Origin GNATS bug report 262 from Jeremy Sanders <jss@ast.cam.ac.uk> +// and several others. With templates, it's very easy to say something +// erroneous like +// template class X::X<whatever> +// The culprit +// ... class X::X ... +// caused us to ICE as we got confused about pushing and popping scopes. + + + +class Y +{ + public: + template <class T> Y(T &); +}; +template <class T> Y::Y(T &) {} + +template class Y::Y (int); // ERROR - parse error +template Y::Y (int); // ERROR - template-id does not match +template Y::Y (int &); + diff --git a/gcc/testsuite/g++.old-deja/g++.pt/syntax2.C b/gcc/testsuite/g++.old-deja/g++.pt/syntax2.C new file mode 100644 index 0000000..78e356c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/syntax2.C @@ -0,0 +1,27 @@ +// Build don't link: + +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 22 June 2000 <nathan@codesourcery.com> + +// Origin GNATS bug report 262 from Jeremy Sanders <jss@ast.cam.ac.uk> +// and several others. With templates, it's very easy to say something +// erroneous like +// template class X::X<whatever> +// The culprit +// ... class X::X ... +// caused us to ICE as we got confused about pushing and popping scopes. + +template <class T> class image +{ +public: + template <class U> image(const image<U> ©); +}; + +template <class T> template <class U> image<T>::image(const image<U> ©) +{ +} + +template class image<double>; +template class image<double>::image (const image<int> &); // ERROR - parse error +template class image<double>::image (image<int>); // ERROR - specified as declarator-id +template image<double>::image (const image<int> &); |