Commit 07674418 by Mike Stump

merge in some last minute changes from jason, for jason.

From-SVN: r10544
parent be89f7bd
Fri Nov 3 17:58:52 1995 Mike Stump <mrs@cygnus.com>
* Version 2.7.1 released.
Thu Nov 2 17:02:47 1995 Jason Merrill <jason@yorick.cygnus.com>
* call.c (convert_harshness): Handle references to arrays.
Fri Oct 27 14:20:21 1995 Jason Merrill <jason@yorick.cygnus.com>
* typeck.c (comp_target_types): Check multi-level pointer
conversions in both directions.
Tue Oct 17 21:39:05 1995 Jason Merrill <jason@yorick.cygnus.com>
* parse.y (explicit_instantiation): Fix 'extern template' with no
return type.
Mon Oct 16 14:35:20 1995 Jason Merrill <jason@yorick.cygnus.com>
* parse.y (explicit_instantiation): Support automatic instantiation
of constructors.
(named_class_head_*): Support out-of-class definition of nested
types.
Wed Oct 11 12:20:56 1995 Mike Stump <mrs@cygnus.com> Wed Oct 11 12:20:56 1995 Mike Stump <mrs@cygnus.com>
* search.c (envelope_add_decl): New routine. Fix so that * search.c (envelope_add_decl): New routine. Fix so that
......
...@@ -194,7 +194,12 @@ convert_harshness (type, parmtype, parm) ...@@ -194,7 +194,12 @@ convert_harshness (type, parmtype, parm)
ttr = intype; ttr = intype;
/* Maybe handle conversion to base here? */ if (TREE_CODE (ttl) == ARRAY_TYPE && TREE_CODE (ttr) == ARRAY_TYPE)
{
if (comptypes (ttl, ttr, 1))
return ZERO_RETURN (h);
return EVIL_RETURN (h);
}
h = convert_harshness (ttl, ttr, NULL_TREE); h = convert_harshness (ttl, ttr, NULL_TREE);
if (penalty && h.code == 0) if (penalty && h.code == 0)
......
...@@ -233,6 +233,7 @@ empty_parms () ...@@ -233,6 +233,7 @@ empty_parms ()
%type <ttype> fn.def2 return_id %type <ttype> fn.def2 return_id
%type <itype> ctor_initializer_opt %type <itype> ctor_initializer_opt
%type <ttype> named_class_head named_class_head_sans_basetype %type <ttype> named_class_head named_class_head_sans_basetype
%type <ttype> named_complex_class_head_sans_basetype
%type <ttype> unnamed_class_head %type <ttype> unnamed_class_head
%type <ttype> class_head base_class_list %type <ttype> class_head base_class_list
%type <itype> base_class_access_list %type <itype> base_class_access_list
...@@ -820,11 +821,15 @@ explicit_instantiation: ...@@ -820,11 +821,15 @@ explicit_instantiation:
| TEMPLATE typed_declspecs declarator | TEMPLATE typed_declspecs declarator
{ tree specs = strip_attrs ($2); { tree specs = strip_attrs ($2);
do_function_instantiation (specs, $3, NULL_TREE); } do_function_instantiation (specs, $3, NULL_TREE); }
| TEMPLATE notype_declarator
{ do_function_instantiation (NULL_TREE, $2, NULL_TREE); }
| SCSPEC TEMPLATE specialization template_instantiation | SCSPEC TEMPLATE specialization template_instantiation
{ do_type_instantiation ($4 ? $4 : $3, $1); } { do_type_instantiation ($4 ? $4 : $3, $1); }
| SCSPEC TEMPLATE typed_declspecs declarator | SCSPEC TEMPLATE typed_declspecs declarator
{ tree specs = strip_attrs ($3); { tree specs = strip_attrs ($3);
do_function_instantiation (specs, $4, $1); } do_function_instantiation (specs, $4, $1); }
| SCSPEC TEMPLATE notype_declarator
{ do_function_instantiation (NULL_TREE, $3, $1); }
; ;
template_type: template_type:
...@@ -2286,10 +2291,6 @@ specialization: ...@@ -2286,10 +2291,6 @@ specialization:
named_class_head_sans_basetype: named_class_head_sans_basetype:
aggr identifier aggr identifier
{ current_aggr = $$; $$ = $2; } { current_aggr = $$; $$ = $2; }
| aggr complex_type_name
{ current_aggr = $$; $$ = $2; }
| aggr template_type %prec EMPTY
{ current_aggr = $$; $$ = $2; }
| specialization | specialization
; ;
...@@ -2306,6 +2307,13 @@ named_class_head_sans_basetype_defn: ...@@ -2306,6 +2307,13 @@ named_class_head_sans_basetype_defn:
{ yyungetc (':', 1); goto aggr2; } { yyungetc (':', 1); goto aggr2; }
; ;
named_complex_class_head_sans_basetype:
aggr nested_name_specifier identifier
{ current_aggr = $$; $$ = $3; }
| aggr template_type %prec EMPTY
{ current_aggr = $$; $$ = $2; }
;
do_xref_defn: /* empty */ %prec EMPTY do_xref_defn: /* empty */ %prec EMPTY
{ $<ttype>$ = xref_tag (current_aggr, $<ttype>0, NULL_TREE, 0); } { $<ttype>$ = xref_tag (current_aggr, $<ttype>0, NULL_TREE, 0); }
; ;
...@@ -2320,6 +2328,12 @@ named_class_head: ...@@ -2320,6 +2328,12 @@ named_class_head:
if ($3) if ($3)
xref_basetypes (current_aggr, $1, $<ttype>2, $3); xref_basetypes (current_aggr, $1, $<ttype>2, $3);
} }
| named_complex_class_head_sans_basetype maybe_base_class_list
{
$$ = TREE_TYPE ($1);
if ($2)
xref_basetypes (current_aggr, $1, TREE_TYPE ($1), $2);
}
; ;
unnamed_class_head: aggr '{' unnamed_class_head: aggr '{'
......
...@@ -808,7 +808,13 @@ comp_target_types (ttl, ttr, nptrs) ...@@ -808,7 +808,13 @@ comp_target_types (ttl, ttr, nptrs)
return -1; return -1;
else if (TREE_CODE (ttl) == POINTER_TYPE else if (TREE_CODE (ttl) == POINTER_TYPE
|| TREE_CODE (ttl) == ARRAY_TYPE) || TREE_CODE (ttl) == ARRAY_TYPE)
return comp_ptr_ttypes (ttl, ttr); {
if (comp_ptr_ttypes (ttl, ttr))
return 1;
else if (comp_ptr_ttypes (ttr, ttl))
return -1;
return 0;
}
} }
/* Const and volatile mean something different for function types, /* Const and volatile mean something different for function types,
...@@ -6134,9 +6140,9 @@ build_modify_expr (lhs, modifycode, rhs) ...@@ -6134,9 +6140,9 @@ build_modify_expr (lhs, modifycode, rhs)
newrhs = build_cplus_new (lhstype, newrhs, 0); newrhs = build_cplus_new (lhstype, newrhs, 0);
/* Can't initialize directly from a TARGET_EXPR, since that would /* Can't initialize directly from a TARGET_EXPR, since that would
cause the lhs to be constructed twice. So we force the cause the lhs to be constructed twice, and possibly result in
TARGET_EXPR to be expanded. expand_expr should really do this accidental self-initialization. So we force the TARGET_EXPR to be
by itself. */ expanded. expand_expr should really do this by itself. */
if (TREE_CODE (newrhs) == TARGET_EXPR) if (TREE_CODE (newrhs) == TARGET_EXPR)
newrhs = expand_target_expr (newrhs); newrhs = expand_target_expr (newrhs);
} }
......
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