OSDN Git Service

2010-01-08 Tobias Burnus <burnus@net-b.de
[pf3gnuchains/gcc-fork.git] / gcc / cp / rtti.c
index c7af74a..0f7225f 100644 (file)
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3.  If not see
 
 #include "config.h"
 #include "system.h"
+#include "intl.h"
 #include "coretypes.h"
 #include "tm.h"
 #include "tree.h"
@@ -128,13 +129,13 @@ static void
 push_abi_namespace (void)
 {
   push_nested_namespace (abi_node);
-  push_visibility ("default");
+  push_visibility ("default", 2);
 }
 
 static void
 pop_abi_namespace (void)
 {
-  pop_visibility ();
+  pop_visibility (2);
   pop_nested_namespace (abi_node);
 }
 
@@ -187,7 +188,7 @@ build_headof (tree exp)
   index = build_int_cst (NULL_TREE,
                         -2 * TARGET_VTABLE_DATA_ENTRY_DISTANCE);
 
-  offset = build_vtbl_ref (cp_build_indirect_ref (exp, NULL, 
+  offset = build_vtbl_ref (cp_build_indirect_ref (exp, RO_NULL, 
                                                   tf_warning_or_error), 
                            index);
 
@@ -245,6 +246,8 @@ get_tinfo_decl_dynamic (tree exp)
   if (error_operand_p (exp))
     return error_mark_node;
 
+  exp = resolve_nondeduced_context (exp);
+
   /* peel back references, so they match.  */
   type = non_reference (TREE_TYPE (exp));
 
@@ -274,7 +277,7 @@ get_tinfo_decl_dynamic (tree exp)
     /* Otherwise return the type_info for the static type of the expr.  */
     t = get_tinfo_ptr (TYPE_MAIN_VARIANT (type));
 
-  return cp_build_indirect_ref (t, NULL, tf_warning_or_error);
+  return cp_build_indirect_ref (t, RO_NULL, tf_warning_or_error);
 }
 
 static bool
@@ -480,7 +483,7 @@ get_typeid (tree type)
   if (!type)
     return error_mark_node;
 
-  return cp_build_indirect_ref (get_tinfo_ptr (type), NULL, 
+  return cp_build_indirect_ref (get_tinfo_ptr (type), RO_NULL, 
                                 tf_warning_or_error);
 }
 
@@ -523,18 +526,18 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain)
     case REFERENCE_TYPE:
       if (! MAYBE_CLASS_TYPE_P (TREE_TYPE (type)))
        {
-         errstr = "target is not pointer or reference to class";
+         errstr = _("target is not pointer or reference to class");
          goto fail;
        }
       if (!COMPLETE_TYPE_P (complete_type (TREE_TYPE (type))))
        {
-         errstr = "target is not pointer or reference to complete type";
+         errstr = _("target is not pointer or reference to complete type");
          goto fail;
        }
       break;
 
     default:
-      errstr = "target is not pointer or reference";
+      errstr = _("target is not pointer or reference");
       goto fail;
     }
 
@@ -545,17 +548,17 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain)
 
       if (TREE_CODE (exprtype) != POINTER_TYPE)
        {
-         errstr = "source is not a pointer";
+         errstr = _("source is not a pointer");
          goto fail;
        }
       if (! MAYBE_CLASS_TYPE_P (TREE_TYPE (exprtype)))
        {
-         errstr = "source is not a pointer to class";
+         errstr = _("source is not a pointer to class");
          goto fail;
        }
       if (!COMPLETE_TYPE_P (complete_type (TREE_TYPE (exprtype))))
        {
-         errstr = "source is a pointer to incomplete type";
+         errstr = _("source is a pointer to incomplete type");
          goto fail;
        }
     }
@@ -568,12 +571,12 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain)
 
       if (! MAYBE_CLASS_TYPE_P (TREE_TYPE (exprtype)))
        {
-         errstr = "source is not of class type";
+         errstr = _("source is not of class type");
          goto fail;
        }
       if (!COMPLETE_TYPE_P (complete_type (TREE_TYPE (exprtype))))
        {
-         errstr = "source is of incomplete class type";
+         errstr = _("source is of incomplete class type");
          goto fail;
        }
 
@@ -586,7 +589,7 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain)
   if (!at_least_as_qualified_p (TREE_TYPE (type),
                                TREE_TYPE (exprtype)))
     {
-      errstr = "conversion casts away constness";
+      errstr = _("conversion casts away constness");
       goto fail;
     }
 
@@ -746,7 +749,7 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain)
        }
     }
   else
-    errstr = "source type is not polymorphic";
+    errstr = _("source type is not polymorphic");
 
  fail:
   if (complain & tf_error)
@@ -1448,6 +1451,7 @@ emit_support_tinfos (void)
     &long_integer_type_node, &long_unsigned_type_node,
     &long_long_integer_type_node, &long_long_unsigned_type_node,
     &float_type_node, &double_type_node, &long_double_type_node,
+    &dfloat32_type_node, &dfloat64_type_node, &dfloat128_type_node,
     0
   };
   int ix;