cp-tree.h (start_decl): Update prototype.

a
Thu Apr  9 22:16:57 1998  Per Bothner  <bothner@cygnus.com>
        * cp-tree.h (start_decl):  Update prototype.
        * decl.c (start_decl):  Like the C version, new parameters
        for the attributes.  Call cplus_decl_attributes here,
        (pushdecl):  Like C version, do build_type_copy if TYPE_DECL,
        (grokdeclarator):  Pass NULL for new start_decl arguments.
        * pt.c (tsubst_expr):  Likewise.
        * parse.y:  Merge cplus_decl_attribute calls into start_decl calls.
	* typeck.c (common_type): Check TYPE_MAIN_VARIANT.
	* lex.c (build_lang_decl): Add lang_name_java.
	* class.c (push_lang_context): Add lang_name_java.
	* method.c (build_mangled_name): Check for is_java_type.
Thu Apr  9 22:16:57 1998  Benjamin Kosnik  <bkoz@loony.cygnus.com>
	* decl.c (grokdeclarator): Check TYPE_MAIN_VARIANT.
	* call.c (build_scoped_method_call): Check for TREE_CODE for
	VOID_TYPE instead of type ==  void_type_node.
	(build_method_call): Ditto.
	* decl.c (lookup_name_real): Ditto.
	(grokdeclarator): Ditto.
	(start_decl): Ditto.
	(grokparms): Ditto.
	(start_function): Ditto.
	(finish_function): Ditto.
	(start_method): Ditto.
also fixes g++/15415

From-SVN: r19072
This commit is contained in:
Benjamin Kosnik 1998-04-09 20:36:49 +00:00
parent a177473334
commit fcad5cf5e8
3 changed files with 34 additions and 5 deletions

View File

@ -1,3 +1,31 @@
Thu Apr 9 22:16:57 1998 Per Bothner <bothner@cygnus.com>
* cp-tree.h (start_decl): Update prototype.
* decl.c (start_decl): Like the C version, new parameters
for the attributes. Call cplus_decl_attributes here,
(pushdecl): Like C version, do build_type_copy if TYPE_DECL,
(grokdeclarator): Pass NULL for new start_decl arguments.
* pt.c (tsubst_expr): Likewise.
* parse.y: Merge cplus_decl_attribute calls into start_decl calls.
* typeck.c (common_type): Check TYPE_MAIN_VARIANT.
* lex.c (build_lang_decl): Add lang_name_java.
* class.c (push_lang_context): Add lang_name_java.
* method.c (build_mangled_name): Check for is_java_type.
Thu Apr 9 22:16:57 1998 Benjamin Kosnik <bkoz@loony.cygnus.com>
* decl.c (grokdeclarator): Check TYPE_MAIN_VARIANT.
* call.c (build_scoped_method_call): Check for TREE_CODE for
VOID_TYPE instead of type == void_type_node.
(build_method_call): Ditto.
* decl.c (lookup_name_real): Ditto.
(grokdeclarator): Ditto.
(start_decl): Ditto.
(grokparms): Ditto.
(start_function): Ditto.
(finish_function): Ditto.
(start_method): Ditto.
Thu Apr 9 00:18:44 1998 Dave Brolley (brolley@cygnus.com)
* lex.c (finput): New variable.

View File

@ -358,7 +358,7 @@ enum cplus_tree_code {
};
#undef DEFTREECODE
enum languages { lang_c, lang_cplusplus };
enum languages { lang_c, lang_cplusplus, lang_java };
/* Macros to make error reporting functions' lives easier. */
#define TYPE_IDENTIFIER(NODE) (DECL_NAME (TYPE_NAME (NODE)))
@ -1646,7 +1646,8 @@ extern tree previous_class_type;
extern tree current_class_ref;
extern int current_class_depth;
extern tree current_lang_name, lang_name_cplusplus, lang_name_c;
extern tree current_lang_name;
extern tree lang_name_cplusplus, lang_name_c, lang_name_java;
/* Points to the name of that function. May not be the DECL_NAME
of CURRENT_FUNCTION_DECL due to overloading */
@ -2162,7 +2163,7 @@ extern tree define_function
void (*) (tree), char *));
extern void shadow_tag PROTO((tree));
extern tree groktypename PROTO((tree));
extern tree start_decl PROTO((tree, tree, int));
extern tree start_decl PROTO((tree, tree, int, tree, tree));
extern void start_decl_1 PROTO((tree));
extern void cp_finish_decl PROTO((tree, tree, tree, int, int));
extern void finish_decl PROTO((tree, tree, tree));

View File

@ -529,8 +529,8 @@ common_type (t1, t2)
case RECORD_TYPE:
case UNION_TYPE:
my_friendly_assert (TYPE_MAIN_VARIANT (t1) == t1
&& TYPE_MAIN_VARIANT (t2) == t2, 306);
t1 = TYPE_MAIN_VARIANT (t1);
t2 = TYPE_MAIN_VARIANT (t2);
if (DERIVED_FROM_P (t1, t2) && binfo_or_else (t1, t2))
return build_type_attribute_variant (t1, attributes);