PR c++/18729
* parser.c (cp_parser_class_name): Check decl's type is not
error_mark_node.
testsuite:
PR C++/18729
* g++.dg/parse/crash20.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91566
138bc75d-0d04-0410-961f-
82ee72b054a4
2004-12-01 Nathan Sidwell <nathan@codesourcery.com>
+ PR c++/18729
+ * parser.c (cp_parser_class_name): Check decl's type is not
+ error_mark_node.
+
PR c++/17431
* call.c (standard_conversion): Add FLAGS parameter. Do not allow
derived to base conversion when checking constructor
decl = TYPE_NAME (make_typename_type (scope, decl, tag_type, tf_error));
else if (decl == error_mark_node
|| TREE_CODE (decl) != TYPE_DECL
+ || TREE_TYPE (decl) == error_mark_node
|| !IS_AGGR_TYPE (TREE_TYPE (decl)))
{
cp_parser_error (parser, "expected class-name");
2004-12-01 Nathan Sidwell <nathan@codesourcery.com>
+ PR C++/18729
+ * g++.dg/parse/crash20.C: New.
+
PR c++/17431
* g++.dg/overload/arg1.C: New.
* g++.dg/overload/arg2.C: New.
--- /dev/null
+// { dg-do compile }
+
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 1 Dec 2004 <nathan@codesourcery.com>
+
+// PR 18729: ICE on ill formed
+// Origin: Volker Reichelt <reichelt@gcc.gnu.org>
+
+template<typename T> struct A
+{
+ typedef typename T::X Y; // { dg-error "not a class" "" }
+};
+
+A<int>::Y y; // { dg-error "instantiated from here" "" }