From 51a5a5e0ef45835252405b53fe36c4f594c16b63 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 26 Jun 2000 11:07:20 +0000 Subject: [PATCH] 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 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/g++.old-deja/g++.other/syntax3.C | 21 ++++++++++++++++++++ gcc/testsuite/g++.old-deja/g++.other/syntax4.C | 26 +++++++++++++++++++++++++ gcc/testsuite/g++.old-deja/g++.pt/syntax1.C | 26 +++++++++++++++++++++++++ gcc/testsuite/g++.old-deja/g++.pt/syntax2.C | 27 ++++++++++++++++++++++++++ 5 files changed, 107 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/syntax3.C create mode 100644 gcc/testsuite/g++.old-deja/g++.other/syntax4.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/syntax1.C create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/syntax2.C 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 + + * 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 * 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 + +// Origin GNATS bug report 262 from Jeremy Sanders +// and several others. With templates, it's very easy to say something +// erroneous like +// template class X::X +// 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 + +// Origin GNATS bug report 262 from Jeremy Sanders +// and several others. With templates, it's very easy to say something +// erroneous like +// template class X::X +// 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 + +// Origin GNATS bug report 262 from Jeremy Sanders +// and several others. With templates, it's very easy to say something +// erroneous like +// template class X::X +// The culprit +// ... class X::X ... +// caused us to ICE as we got confused about pushing and popping scopes. + + + +class Y +{ + public: + template Y(T &); +}; +template 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 + +// Origin GNATS bug report 262 from Jeremy Sanders +// and several others. With templates, it's very easy to say something +// erroneous like +// template class X::X +// The culprit +// ... class X::X ... +// caused us to ICE as we got confused about pushing and popping scopes. + +template class image +{ +public: + template image(const image ©); +}; + +template template image::image(const image ©) +{ +} + +template class image; +template class image::image (const image &); // ERROR - parse error +template class image::image (image); // ERROR - specified as declarator-id +template image::image (const image &); -- 2.7.4