+2003-08-07 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/5767
+ * parser.c (cp_parser_class_name): Return immediately when scope
+ is error_mark_node.
+
2003-08-07 Aldy Hernandez <aldyh@redhat.com>
* cp/Make-lang.in (cp/call.o): Add dependency for target.h.
/* PARSER->SCOPE can be cleared when parsing the template-arguments
to a template-id, so we save it here. */
scope = parser->scope;
+ if (scope == error_mark_node)
+ return error_mark_node;
+
/* Any name names a type if we're following the `typename' keyword
in a qualified name where the enclosing scope is type-dependent. */
typename_p = (typename_keyword_p && scope && TYPE_P (scope)
+2003-08-07 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/5767
+ * g++.dg/parse/crash11.C: New test.
+
2003-08-06 Alexandre Oliva <aoliva@redhat.com>
* gcc.dg/cpp/spacing1.c: Update.
--- /dev/null
+// { dg-do compile }
+
+// Origin: priesnit@math.uni-goettingen.de
+
+// PR c++/5767: ICE parsing typename with invalid scope.
+
+template <template <typename> class TP>
+struct A
+{
+ template <typename T>
+ struct Template
+ {
+ typedef typename TP<T>::Type Type;
+ };
+};
+template <template <typename> class TP>
+struct B
+{
+ template <typename T>
+ struct Template
+ {
+ typedef typename A<A<TP>::Template>
+ ::template Template<T>::Type Type; { dg-error "mismatch|class template|unqualified-id" }
+ };
+};
+template <typename T>
+struct C
+{
+ typedef void Type;
+};
+int main()
+{
+ typedef B<C>::Template<void>::Type Type; { dg-error "init-declarator|;" }
+}