Commit 009425e1 by Jason Merrill

error.c (dump_type_real): Handle NAMESPACE_DECL.

	* error.c (dump_type_real): Handle NAMESPACE_DECL.
	* parse.y (base_class.1): Avoid crash on error.
	* decl.c (make_typename_type): If context is a namespace, the code
	is in error.

From-SVN: r22342
parent 1ba15a03
1998-09-09 Jason Merrill <jason@yorick.cygnus.com>
* error.c (dump_type_real): Handle NAMESPACE_DECL.
* parse.y (base_class.1): Avoid crash on error.
1998-09-08 Martin von Lwis <loewis@informatik.hu-berlin.de>
* decl.c (make_typename_type): If context is a namespace, the code
is in error.
1998-09-08 Mumit Khan <khan@xraylith.wisc.edu> 1998-09-08 Mumit Khan <khan@xraylith.wisc.edu>
* parse.y (nomods_initdcl0): Set up the parser stack correctly. * parse.y (nomods_initdcl0): Set up the parser stack correctly.
......
...@@ -4782,6 +4782,15 @@ make_typename_type (context, name) ...@@ -4782,6 +4782,15 @@ make_typename_type (context, name)
fullname = name; fullname = name;
if (TREE_CODE (context) == NAMESPACE_DECL)
{
/* We can get here from typename_sub0 in the explicit_template_type
expansion. Just fail. */
cp_error ("no class template named `%#T' in `%#T'",
name, context);
return error_mark_node;
}
if (TREE_CODE (name) == TEMPLATE_ID_EXPR) if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
{ {
name = TREE_OPERAND (name, 0); name = TREE_OPERAND (name, 0);
......
...@@ -211,6 +211,7 @@ dump_type_real (t, v, canonical_name) ...@@ -211,6 +211,7 @@ dump_type_real (t, v, canonical_name)
case TYPE_DECL: case TYPE_DECL:
case TEMPLATE_DECL: case TEMPLATE_DECL:
case NAMESPACE_DECL:
dump_decl (t, v); dump_decl (t, v);
break; break;
......
...@@ -6207,7 +6207,7 @@ case 510: ...@@ -6207,7 +6207,7 @@ case 510:
break;} break;}
case 511: case 511:
#line 2276 "parse.y" #line 2276 "parse.y"
{ yyval.ttype = TYPE_MAIN_DECL (yyvsp[0].ttype); ; { if (yyval.ttype != error_mark_node) yyval.ttype = TYPE_MAIN_DECL (yyvsp[0].ttype); ;
break;} break;}
case 513: case 513:
#line 2279 "parse.y" #line 2279 "parse.y"
......
...@@ -2273,7 +2273,7 @@ base_class: ...@@ -2273,7 +2273,7 @@ base_class:
base_class.1: base_class.1:
typename_sub typename_sub
{ $$ = TYPE_MAIN_DECL ($1); } { if ($$ != error_mark_node) $$ = TYPE_MAIN_DECL ($1); }
| nonnested_type | nonnested_type
| SIGOF '(' expr ')' | SIGOF '(' expr ')'
{ {
......
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