]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cp-tree.h (UNKNOWN_TYPE): Remove.
authorJason Merrill <jason@redhat.com>
Thu, 13 May 2010 05:04:14 +0000 (01:04 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 13 May 2010 05:04:14 +0000 (01:04 -0400)
* 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

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/error.c
gcc/cp/name-lookup.c
gcc/cp/rtti.c
gcc/cp/semantics.c
gcc/cp/typeck2.c

index 5f0569ad07be3d689ab96b0de9eae0d1d8075ec5..a1b055093645b5759d1459820534827335f631a2 100644 (file)
@@ -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.
index 87f8111f15fece47d6cf46819ef21fb50584a108..88db80faae8a4790d23e4c67350dfd048810d981 100644 (file)
@@ -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");
index 6b35fb97ebc089ab6c214d9791d2d42e8f1bc0bd..a28a2e30fdab83f73249363c942dfae234b6c9f1 100644 (file)
@@ -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)
index 4aa34418020080296ebab1144e40e7baf3d97397..5f280ce2cc72de5a1b800b353c15b4fb60476e72 100644 (file)
@@ -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");
 
   {
index 3a03790c338047de6f57660016bf8518466a8996..8595719651a9c6e342b5e4b2a0d9da23ce7ec517 100644 (file)
@@ -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:
index ebc689b00fb988efb7268c3c038cfc9e8448bb0e..845faf37462a0f877db4f35b5fe4730dcda0c412 100644 (file)
@@ -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.  */
index 9a7faec852bc3b4242dafff25abb97887b703cbf..a36851ddd885cc08d856af12f21bff74a4ff5e69 100644 (file)
@@ -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)
index 135de46abe74971a779f224e2dd68d5a5d6bd037..47f3897c8d1351d6e66278dddc8052c807c9f714 100644 (file)
@@ -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)
index 444ba731b14d4940c5e7f8d2c9e2966d3b554d31..d61ec0a6fad53c2bba4be0bef5f6e7ca7cd683b2 100644 (file)
@@ -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)