Commit 7e2067ca by Jason Merrill Committed by Jason Merrill

typeck2.c (process_init_constructor): Use same_type_p.

	* typeck2.c (process_init_constructor): Use same_type_p.
Fixes 834Y21a
	* decl.c (check_tag_decl): Don't warn about null decl inside a
	class.
Fixes _113Y11a

From-SVN: r23982
parent 9f3d9e46
1998-11-29 Jason Merrill <jason@yorick.cygnus.com> 1998-11-29 Jason Merrill <jason@yorick.cygnus.com>
* typeck2.c (process_init_constructor): Use same_type_p.
* decl.c (check_tag_decl): Don't warn about null decl inside a
class.
* pt.c (unify, case OFFSET_TYPE): Pass down 'strict' rather than * pt.c (unify, case OFFSET_TYPE): Pass down 'strict' rather than
UNIFY_ALLOW_NONE. UNIFY_ALLOW_NONE.
(convert_nontype_argument): Use TYPE_PTRMEMFUNC_FN_TYPE. (convert_nontype_argument): Use TYPE_PTRMEMFUNC_FN_TYPE.
......
...@@ -6462,7 +6462,6 @@ check_tag_decl (declspecs) ...@@ -6462,7 +6462,6 @@ check_tag_decl (declspecs)
tree declspecs; tree declspecs;
{ {
int found_type = 0; int found_type = 0;
int friendp = 0;
tree ob_modifier = NULL_TREE; tree ob_modifier = NULL_TREE;
register tree link; register tree link;
register tree t = NULL_TREE; register tree t = NULL_TREE;
...@@ -6486,8 +6485,6 @@ check_tag_decl (declspecs) ...@@ -6486,8 +6485,6 @@ check_tag_decl (declspecs)
if (current_class_type == NULL_TREE if (current_class_type == NULL_TREE
|| current_scope () != current_class_type) || current_scope () != current_class_type)
ob_modifier = value; ob_modifier = value;
else
friendp = 1;
} }
else if (value == ridpointers[(int) RID_STATIC] else if (value == ridpointers[(int) RID_STATIC]
|| value == ridpointers[(int) RID_EXTERN] || value == ridpointers[(int) RID_EXTERN]
...@@ -6504,12 +6501,11 @@ check_tag_decl (declspecs) ...@@ -6504,12 +6501,11 @@ check_tag_decl (declspecs)
if (found_type > 1) if (found_type > 1)
error ("multiple types in one declaration"); error ("multiple types in one declaration");
if (t == NULL_TREE) /* Inside a class, we might be in a friend or access declaration.
{ Until we have a good way of detecting the latter, don't warn. */
if (! friendp) if (t == NULL_TREE && ! current_class_type)
pedwarn ("declaration does not declare anything"); pedwarn ("declaration does not declare anything");
} else if (t && ANON_UNION_TYPE_P (t))
else if (ANON_UNION_TYPE_P (t))
/* Anonymous unions are objects, so they can have specifiers. */; /* Anonymous unions are objects, so they can have specifiers. */;
else if (ob_modifier) else if (ob_modifier)
{ {
......
...@@ -925,8 +925,9 @@ process_init_constructor (type, init, elts) ...@@ -925,8 +925,9 @@ process_init_constructor (type, init, elts)
tree tail1 = tail; tree tail1 = tail;
next1 = digest_init (TREE_TYPE (type), next1 = digest_init (TREE_TYPE (type),
TREE_VALUE (tail), &tail1); TREE_VALUE (tail), &tail1);
my_friendly_assert (TYPE_MAIN_VARIANT (TREE_TYPE (type)) my_friendly_assert
== TYPE_MAIN_VARIANT (TREE_TYPE (next1)), (same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (type)),
TYPE_MAIN_VARIANT (TREE_TYPE (next1))),
981123); 981123);
my_friendly_assert (tail1 == 0 my_friendly_assert (tail1 == 0
|| TREE_CODE (tail1) == TREE_LIST, 319); || TREE_CODE (tail1) == TREE_LIST, 319);
......
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