Commit fbfc8363 by Jason Merrill Committed by Jason Merrill

cp-tree.h (UNKNOWN_TYPE): Remove.

	* cp-tree.h (UNKNOWN_TYPE): Remove.
	* decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
	* error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
	* typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
	* class.c (instantiate_type): Check unknown_type_node rather than
	UNKNOWN_TYPE.
	* name-lookup.c (maybe_push_decl): Likewise.
	* rtti.c (get_tinfo_decl_dynamic): Likewise.
	(get_typeid): Likewise.
	* semantics.c (finish_offsetof): Likewise.

From-SVN: r159349
parent 07eea34e
2010-05-12 Jason Merrill <jason@redhat.com> 2010-05-12 Jason Merrill <jason@redhat.com>
* cp-tree.h (UNKNOWN_TYPE): Remove.
* decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
* error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
* typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
* class.c (instantiate_type): Check unknown_type_node rather than
UNKNOWN_TYPE.
* name-lookup.c (maybe_push_decl): Likewise.
* rtti.c (get_tinfo_decl_dynamic): Likewise.
(get_typeid): Likewise.
* semantics.c (finish_offsetof): Likewise.
PR c++/20669 PR c++/20669
* call.c (add_template_candidate_real): If deduction fails, still * call.c (add_template_candidate_real): If deduction fails, still
add the template as a non-viable candidate. add the template as a non-viable candidate.
......
...@@ -6398,7 +6398,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) ...@@ -6398,7 +6398,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
flags &= ~tf_ptrmem_ok; flags &= ~tf_ptrmem_ok;
if (TREE_CODE (lhstype) == UNKNOWN_TYPE) if (lhstype == unknown_type_node)
{ {
if (flags & tf_error) if (flags & tf_error)
error ("not enough type information"); error ("not enough type information");
......
...@@ -3344,8 +3344,6 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter) ...@@ -3344,8 +3344,6 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
#define ANON_UNION_TYPE_P(NODE) \ #define ANON_UNION_TYPE_P(NODE) \
(TREE_CODE (NODE) == UNION_TYPE && ANON_AGGR_TYPE_P (NODE)) (TREE_CODE (NODE) == UNION_TYPE && ANON_AGGR_TYPE_P (NODE))
#define UNKNOWN_TYPE LANG_TYPE
/* Define fields and accessors for nodes representing declared names. */ /* Define fields and accessors for nodes representing declared names. */
#define TYPE_WAS_ANONYMOUS(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->was_anonymous) #define TYPE_WAS_ANONYMOUS(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->was_anonymous)
......
...@@ -3452,7 +3452,7 @@ cxx_init_decl_processing (void) ...@@ -3452,7 +3452,7 @@ cxx_init_decl_processing (void)
/* C++ extensions */ /* C++ extensions */
unknown_type_node = make_node (UNKNOWN_TYPE); unknown_type_node = make_node (LANG_TYPE);
record_unknown_type (unknown_type_node, "unknown type"); record_unknown_type (unknown_type_node, "unknown type");
/* Indirecting an UNKNOWN_TYPE node yields an UNKNOWN_TYPE node. */ /* Indirecting an UNKNOWN_TYPE node yields an UNKNOWN_TYPE node. */
...@@ -3463,7 +3463,7 @@ cxx_init_decl_processing (void) ...@@ -3463,7 +3463,7 @@ cxx_init_decl_processing (void)
TYPE_POINTER_TO (unknown_type_node) = unknown_type_node; TYPE_POINTER_TO (unknown_type_node) = unknown_type_node;
TYPE_REFERENCE_TO (unknown_type_node) = unknown_type_node; TYPE_REFERENCE_TO (unknown_type_node) = unknown_type_node;
init_list_type_node = make_node (UNKNOWN_TYPE); init_list_type_node = make_node (LANG_TYPE);
record_unknown_type (init_list_type_node, "init list"); record_unknown_type (init_list_type_node, "init list");
{ {
......
...@@ -333,11 +333,13 @@ dump_type (tree t, int flags) ...@@ -333,11 +333,13 @@ dump_type (tree t, int flags)
switch (TREE_CODE (t)) switch (TREE_CODE (t))
{ {
case UNKNOWN_TYPE: case LANG_TYPE:
if (t == init_list_type_node) if (t == init_list_type_node)
pp_string (cxx_pp, M_("<brace-enclosed initializer list>")); pp_string (cxx_pp, M_("<brace-enclosed initializer list>"));
else else if (t == unknown_type_node)
pp_string (cxx_pp, M_("<unresolved overloaded function type>")); pp_string (cxx_pp, M_("<unresolved overloaded function type>"));
else
gcc_unreachable ();
break; break;
case TREE_LIST: case TREE_LIST:
...@@ -698,7 +700,7 @@ dump_type_prefix (tree t, int flags) ...@@ -698,7 +700,7 @@ dump_type_prefix (tree t, int flags)
case TYPE_DECL: case TYPE_DECL:
case TREE_VEC: case TREE_VEC:
case UNION_TYPE: case UNION_TYPE:
case UNKNOWN_TYPE: case LANG_TYPE:
case VOID_TYPE: case VOID_TYPE:
case TYPENAME_TYPE: case TYPENAME_TYPE:
case COMPLEX_TYPE: case COMPLEX_TYPE:
...@@ -801,7 +803,7 @@ dump_type_suffix (tree t, int flags) ...@@ -801,7 +803,7 @@ dump_type_suffix (tree t, int flags)
case TYPE_DECL: case TYPE_DECL:
case TREE_VEC: case TREE_VEC:
case UNION_TYPE: case UNION_TYPE:
case UNKNOWN_TYPE: case LANG_TYPE:
case VOID_TYPE: case VOID_TYPE:
case TYPENAME_TYPE: case TYPENAME_TYPE:
case COMPLEX_TYPE: case COMPLEX_TYPE:
......
...@@ -1133,7 +1133,7 @@ maybe_push_decl (tree decl) ...@@ -1133,7 +1133,7 @@ maybe_push_decl (tree decl)
possible. */ possible. */
&& TREE_CODE (DECL_CONTEXT (decl)) != NAMESPACE_DECL) && TREE_CODE (DECL_CONTEXT (decl)) != NAMESPACE_DECL)
|| (TREE_CODE (decl) == TEMPLATE_DECL && !namespace_bindings_p ()) || (TREE_CODE (decl) == TEMPLATE_DECL && !namespace_bindings_p ())
|| TREE_CODE (type) == UNKNOWN_TYPE || type == unknown_type_node
/* The declaration of a template specialization does not affect /* The declaration of a template specialization does not affect
the functions available for overload resolution, so we do not the functions available for overload resolution, so we do not
call pushdecl. */ call pushdecl. */
......
...@@ -255,7 +255,8 @@ get_tinfo_decl_dynamic (tree exp) ...@@ -255,7 +255,8 @@ get_tinfo_decl_dynamic (tree exp)
type = TYPE_MAIN_VARIANT (type); type = TYPE_MAIN_VARIANT (type);
/* For UNKNOWN_TYPEs call complete_type_or_else to get diagnostics. */ /* For UNKNOWN_TYPEs call complete_type_or_else to get diagnostics. */
if (CLASS_TYPE_P (type) || TREE_CODE (type) == UNKNOWN_TYPE) if (CLASS_TYPE_P (type) || type == unknown_type_node
|| type == init_list_type_node)
type = complete_type_or_else (type, exp); type = complete_type_or_else (type, exp);
if (!type) if (!type)
...@@ -482,7 +483,8 @@ get_typeid (tree type) ...@@ -482,7 +483,8 @@ get_typeid (tree type)
type = TYPE_MAIN_VARIANT (type); type = TYPE_MAIN_VARIANT (type);
/* For UNKNOWN_TYPEs call complete_type_or_else to get diagnostics. */ /* For UNKNOWN_TYPEs call complete_type_or_else to get diagnostics. */
if (CLASS_TYPE_P (type) || TREE_CODE (type) == UNKNOWN_TYPE) if (CLASS_TYPE_P (type) || type == unknown_type_node
|| type == init_list_type_node)
type = complete_type_or_else (type, NULL_TREE); type = complete_type_or_else (type, NULL_TREE);
if (!type) if (!type)
......
...@@ -3210,7 +3210,7 @@ finish_offsetof (tree expr) ...@@ -3210,7 +3210,7 @@ finish_offsetof (tree expr)
} }
if (TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE if (TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE
|| TREE_CODE (TREE_TYPE (expr)) == METHOD_TYPE || TREE_CODE (TREE_TYPE (expr)) == METHOD_TYPE
|| TREE_CODE (TREE_TYPE (expr)) == UNKNOWN_TYPE) || TREE_TYPE (expr) == unknown_type_node)
{ {
if (TREE_CODE (expr) == COMPONENT_REF if (TREE_CODE (expr) == COMPONENT_REF
|| TREE_CODE (expr) == COMPOUND_EXPR) || TREE_CODE (expr) == COMPOUND_EXPR)
......
...@@ -515,7 +515,8 @@ cxx_incomplete_type_diagnostic (const_tree value, const_tree type, ...@@ -515,7 +515,8 @@ cxx_incomplete_type_diagnostic (const_tree value, const_tree type,
"invalid use of dependent type %qT", type); "invalid use of dependent type %qT", type);
break; break;
case UNKNOWN_TYPE: case LANG_TYPE:
gcc_assert (type == unknown_type_node);
if (value && TREE_CODE (value) == COMPONENT_REF) if (value && TREE_CODE (value) == COMPONENT_REF)
goto bad_member; goto bad_member;
else if (value && TREE_CODE (value) == ADDR_EXPR) else if (value && TREE_CODE (value) == ADDR_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