Commit 07c65e00 by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/18729 (ICE on invalid typedef)

cp:
	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.

From-SVN: r91566
parent f8e7ffa6
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
......
......@@ -12232,6 +12232,7 @@ cp_parser_class_name (cp_parser *parser,
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.
......
// { 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" "" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment