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
This commit is contained in:
parent
07eea34ee6
commit
fbfc8363a3
@ -1,5 +1,16 @@
|
||||
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
|
||||
* call.c (add_template_candidate_real): If deduction fails, still
|
||||
add the template as a non-viable candidate.
|
||||
|
@ -6398,7 +6398,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
|
||||
|
||||
flags &= ~tf_ptrmem_ok;
|
||||
|
||||
if (TREE_CODE (lhstype) == UNKNOWN_TYPE)
|
||||
if (lhstype == unknown_type_node)
|
||||
{
|
||||
if (flags & tf_error)
|
||||
error ("not enough type information");
|
||||
|
@ -3344,8 +3344,6 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
|
||||
#define ANON_UNION_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 TYPE_WAS_ANONYMOUS(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->was_anonymous)
|
||||
|
@ -3452,7 +3452,7 @@ cxx_init_decl_processing (void)
|
||||
|
||||
/* C++ extensions */
|
||||
|
||||
unknown_type_node = make_node (UNKNOWN_TYPE);
|
||||
unknown_type_node = make_node (LANG_TYPE);
|
||||
record_unknown_type (unknown_type_node, "unknown type");
|
||||
|
||||
/* Indirecting an UNKNOWN_TYPE node yields an UNKNOWN_TYPE node. */
|
||||
@ -3463,7 +3463,7 @@ cxx_init_decl_processing (void)
|
||||
TYPE_POINTER_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");
|
||||
|
||||
{
|
||||
|
@ -333,11 +333,13 @@ dump_type (tree t, int flags)
|
||||
|
||||
switch (TREE_CODE (t))
|
||||
{
|
||||
case UNKNOWN_TYPE:
|
||||
case LANG_TYPE:
|
||||
if (t == init_list_type_node)
|
||||
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>"));
|
||||
else
|
||||
gcc_unreachable ();
|
||||
break;
|
||||
|
||||
case TREE_LIST:
|
||||
@ -698,7 +700,7 @@ dump_type_prefix (tree t, int flags)
|
||||
case TYPE_DECL:
|
||||
case TREE_VEC:
|
||||
case UNION_TYPE:
|
||||
case UNKNOWN_TYPE:
|
||||
case LANG_TYPE:
|
||||
case VOID_TYPE:
|
||||
case TYPENAME_TYPE:
|
||||
case COMPLEX_TYPE:
|
||||
@ -801,7 +803,7 @@ dump_type_suffix (tree t, int flags)
|
||||
case TYPE_DECL:
|
||||
case TREE_VEC:
|
||||
case UNION_TYPE:
|
||||
case UNKNOWN_TYPE:
|
||||
case LANG_TYPE:
|
||||
case VOID_TYPE:
|
||||
case TYPENAME_TYPE:
|
||||
case COMPLEX_TYPE:
|
||||
|
@ -1133,7 +1133,7 @@ maybe_push_decl (tree decl)
|
||||
possible. */
|
||||
&& TREE_CODE (DECL_CONTEXT (decl)) != NAMESPACE_DECL)
|
||||
|| (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 functions available for overload resolution, so we do not
|
||||
call pushdecl. */
|
||||
|
@ -255,7 +255,8 @@ get_tinfo_decl_dynamic (tree exp)
|
||||
type = TYPE_MAIN_VARIANT (type);
|
||||
|
||||
/* 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);
|
||||
|
||||
if (!type)
|
||||
@ -482,7 +483,8 @@ get_typeid (tree type)
|
||||
type = TYPE_MAIN_VARIANT (type);
|
||||
|
||||
/* 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);
|
||||
|
||||
if (!type)
|
||||
|
@ -3210,7 +3210,7 @@ finish_offsetof (tree expr)
|
||||
}
|
||||
if (TREE_CODE (TREE_TYPE (expr)) == FUNCTION_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
|
||||
|| TREE_CODE (expr) == COMPOUND_EXPR)
|
||||
|
@ -515,7 +515,8 @@ cxx_incomplete_type_diagnostic (const_tree value, const_tree type,
|
||||
"invalid use of dependent type %qT", type);
|
||||
break;
|
||||
|
||||
case UNKNOWN_TYPE:
|
||||
case LANG_TYPE:
|
||||
gcc_assert (type == unknown_type_node);
|
||||
if (value && TREE_CODE (value) == COMPONENT_REF)
|
||||
goto bad_member;
|
||||
else if (value && TREE_CODE (value) == ADDR_EXPR)
|
||||
|
Loading…
Reference in New Issue
Block a user