* 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
+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 Löwis <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>
* parse.y (nomods_initdcl0): Set up the parser stack correctly.
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)
{
name = TREE_OPERAND (name, 0);
case TYPE_DECL:
case TEMPLATE_DECL:
+ case NAMESPACE_DECL:
dump_decl (t, v);
break;
break;}
case 511:
#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;}
case 513:
#line 2279 "parse.y"
base_class.1:
typename_sub
- { $$ = TYPE_MAIN_DECL ($1); }
+ { if ($$ != error_mark_node) $$ = TYPE_MAIN_DECL ($1); }
| nonnested_type
| SIGOF '(' expr ')'
{