+2004-12-10 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/18731
+ * parser.c (cp_parser_class_head): Reject typedef-name in class head.
+
2004-12-09 Matt Austern <austern@apple.com>
PR c++/18514
else if (nested_name_specifier)
{
tree scope;
+
+ /* Reject typedef-names in class heads. */
+ if (!DECL_IMPLICIT_TYPEDEF_P (type))
+ {
+ error ("invalid class name in declaration of %qD", type);
+ type = NULL_TREE;
+ goto done;
+ }
+
/* Figure out in what scope the declaration is being placed. */
scope = current_scope ();
/* If that scope does not contain the scope in which the
+2004-12-10 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/18731
+ * g++.dg/parser/struct-1.C: New test.
+ * g++.dg/parser/struct-2.C: New test.
+ * g++.dg/parser/struct-3.C: New test.
+
2004-12-09 Richard Henderson <rth@redhat.com>
* gcc.dg/loop-3.c: Don't use i386 tuning for amd64.
--- /dev/null
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+// PR c++/18731
+
+template<typename T> struct T::A {}; // { dg-error "invalid class name" }
--- /dev/null
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+// PR c++/18731
+
+template<typename T> struct A
+{
+ struct T::B {}; // { dg-error "invalid class name" }
+};
--- /dev/null
+// 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" }