OSDN Git Service

* cp-tree.h (UNKNOWN_TYPE): Remove.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 13 May 2010 05:04:14 +0000 (05:04 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:07:17 +0000 (14:07 +0900)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159349 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/error.c
gcc/cp/rtti.c
gcc/cp/semantics.c

index 5f0569a..a1b0550 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 6b35fb9..a28a2e3 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 4aa3441..5f280ce 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 28c45f2..8595719 100644 (file)
@@ -1,7 +1,7 @@
 /* Call-backs for C++ error reporting.
    This code is non-reentrant.
-   Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003,
-   2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
+   2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
    This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify
@@ -24,14 +24,13 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "cp-tree.h"
+#include "real.h"
 #include "toplev.h"
 #include "flags.h"
 #include "diagnostic.h"
-#include "tree-diagnostic.h"
 #include "langhooks-def.h"
 #include "intl.h"
 #include "cxx-pretty-print.h"
-#include "tree-pretty-print.h"
 #include "pointer-set.h"
 
 #define pp_separate_with_comma(PP) pp_cxx_separate_with (PP, ',')
@@ -340,10 +339,7 @@ dump_type (tree t, int flags)
       else if (t == unknown_type_node)
        pp_string (cxx_pp, M_("<unresolved overloaded function type>"));
       else
-       {
-         pp_cxx_cv_qualifier_seq (cxx_pp, t);
-         pp_cxx_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t));
-       }
+       gcc_unreachable ();
       break;
 
     case TREE_LIST:
@@ -2576,7 +2572,7 @@ cp_print_error_function (diagnostic_context *context,
     {
       const char *old_prefix = context->printer->prefix;
       const char *file = LOCATION_FILE (diagnostic->location);
-      tree abstract_origin = diagnostic_abstract_origin (diagnostic);
+      tree abstract_origin = diagnostic->abstract_origin;
       char *new_prefix = (file && abstract_origin == NULL)
                         ? file_name_as_prefix (file) : NULL;
 
@@ -2934,10 +2930,6 @@ cp_printer (pretty_printer *pp, text_info *text, const char *spec,
     case 'T': result = type_to_string (next_tree, verbose);    break;
     case 'V': result = cv_to_string (next_tree, verbose);      break;
 
-    case 'K':
-      percent_K_format (text);
-      return true;
-
     default:
       return false;
     }
index 9a7faec..a36851d 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 135de46..47f3897 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)