aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-05-13 01:04:14 -0400
committerJason Merrill <jason@gcc.gnu.org>2010-05-13 01:04:14 -0400
commitfbfc8363a378a676d5ab71fc44edf0b8f681ffa0 (patch)
tree6e2bf1018c014867d845d936d25929da98f58eb2 /gcc/cp
parent07eea34ee659da5c9960ad524dcf291b60003557 (diff)
downloadgcc-fbfc8363a378a676d5ab71fc44edf0b8f681ffa0.zip
gcc-fbfc8363a378a676d5ab71fc44edf0b8f681ffa0.tar.gz
gcc-fbfc8363a378a676d5ab71fc44edf0b8f681ffa0.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog11
-rw-r--r--gcc/cp/class.c2
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/decl.c4
-rw-r--r--gcc/cp/error.c10
-rw-r--r--gcc/cp/name-lookup.c2
-rw-r--r--gcc/cp/rtti.c6
-rw-r--r--gcc/cp/semantics.c2
-rw-r--r--gcc/cp/typeck2.c3
9 files changed, 28 insertions, 14 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5f0569a..a1b0550 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 87f8111..88db80f 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -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");
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 6b35fb9..a28a2e3 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -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)
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 4aa3441..5f280ce 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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");
{
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 3a03790..8595719 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -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:
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index ebc689b..845faf3 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -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. */
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 9a7faec..a36851d 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -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)
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 135de46..47f3897c 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -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)
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 444ba73..d61ec0a 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -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)