aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg
diff options
context:
space:
mode:
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>2004-12-10 16:04:22 +0000
committerVolker Reichelt <reichelt@gcc.gnu.org>2004-12-10 16:04:22 +0000
commit9bf0e5888c1217afef058dbb59cb5d7824c4bba2 (patch)
tree9de3b8f1275d3a5a4b767de6d6f4b524b720fcf9 /gcc/testsuite/g++.dg
parent417c735c222642f006a3ab29655bf20664b64f32 (diff)
downloadgcc-9bf0e5888c1217afef058dbb59cb5d7824c4bba2.zip
gcc-9bf0e5888c1217afef058dbb59cb5d7824c4bba2.tar.gz
gcc-9bf0e5888c1217afef058dbb59cb5d7824c4bba2.tar.bz2
re PR c++/18731 (ICE on invalid template declaration)
PR c++/18731 * parser.c (cp_parser_class_head): Reject typedef-name in class head. * g++.dg/parser/struct-1.C: New test. * g++.dg/parser/struct-2.C: New test. * g++.dg/parser/struct-3.C: New test. From-SVN: r91993
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r--gcc/testsuite/g++.dg/parse/struct-1.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/struct-2.C7
-rw-r--r--gcc/testsuite/g++.dg/parse/struct-3.C10
3 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/parse/struct-1.C b/gcc/testsuite/g++.dg/parse/struct-1.C
new file mode 100644
index 0000000..6e0d93a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/struct-1.C
@@ -0,0 +1,4 @@
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+// PR c++/18731
+
+template<typename T> struct T::A {}; // { dg-error "invalid class name" }
diff --git a/gcc/testsuite/g++.dg/parse/struct-2.C b/gcc/testsuite/g++.dg/parse/struct-2.C
new file mode 100644
index 0000000..b63045b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/struct-2.C
@@ -0,0 +1,7 @@
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+// PR c++/18731
+
+template<typename T> struct A
+{
+ struct T::B {}; // { dg-error "invalid class name" }
+};
diff --git a/gcc/testsuite/g++.dg/parse/struct-3.C b/gcc/testsuite/g++.dg/parse/struct-3.C
new file mode 100644
index 0000000..8e73ce4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/struct-3.C
@@ -0,0 +1,10 @@
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+// PR c++/18731
+
+struct A
+{
+ struct B;
+ typedef B C;
+};
+
+struct A::C {}; // { dg-error "invalid class name" }