OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / cp / search.c
index 77d63da..66bbb13 100644 (file)
@@ -97,7 +97,7 @@ struct lookup_base_data_s
 static tree
 dfs_lookup_base (tree binfo, void *data_)
 {
-  struct lookup_base_data_s *data = data_;
+  struct lookup_base_data_s *data = (struct lookup_base_data_s *) data_;
 
   if (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), data->base))
     {
@@ -306,7 +306,7 @@ struct dcast_data_s
 static tree
 dfs_dcast_hint_pre (tree binfo, void *data_)
 {
-  struct dcast_data_s *data = data_;
+  struct dcast_data_s *data = (struct dcast_data_s *) data_;
 
   if (BINFO_VIRTUAL_P (binfo))
     data->virt_depth++;
@@ -334,7 +334,7 @@ dfs_dcast_hint_pre (tree binfo, void *data_)
 static tree
 dfs_dcast_hint_post (tree binfo, void *data_)
 {
-  struct dcast_data_s *data = data_;
+  struct dcast_data_s *data = (struct dcast_data_s *) data_;
 
   if (BINFO_VIRTUAL_P (binfo))
     data->virt_depth--;
@@ -872,8 +872,12 @@ accessible_p (tree type, tree decl, bool consider_local_p)
   /* In a template declaration, we cannot be sure whether the
      particular specialization that is instantiated will be a friend
      or not.  Therefore, all access checks are deferred until
-     instantiation.  */
-  if (processing_template_decl)
+     instantiation.  However, PROCESSING_TEMPLATE_DECL is set in the
+     parameter list for a template (because we may see dependent types
+     in default arguments for template parameters), and access
+     checking should be performed in the outermost parameter list.  */ 
+  if (processing_template_decl 
+      && (!processing_template_parmlist || processing_template_decl > 1))
     return 1;
 
   if (!TYPE_P (type))
@@ -1839,9 +1843,9 @@ check_final_overrider (tree overrider, tree basefn)
            fail = 2;
          else
            {
-             cp_warning_at ("deprecated covariant return type for %q#D",
+             warning (0, "deprecated covariant return type for %q+#D",
                             overrider);
-             cp_warning_at ("  overriding %q#D", basefn);
+             warning (0, "  overriding %q+#D", basefn);
            }
        }
       else
@@ -1855,14 +1859,13 @@ check_final_overrider (tree overrider, tree basefn)
     {
       if (fail == 1)
        {
-         cp_error_at ("invalid covariant return type for %q#D", overrider);
-         cp_error_at ("  overriding %q#D", basefn);
+         error ("invalid covariant return type for %q+#D", overrider);
+         error ("  overriding %q+#D", basefn);
        }
       else
        {
-         cp_error_at ("conflicting return type specified for %q#D",
-                      overrider);
-         cp_error_at ("  overriding %q#D", basefn);
+         error ("conflicting return type specified for %q+#D", overrider);
+         error ("  overriding %q+#D", basefn);
        }
       DECL_INVALID_OVERRIDER_P (overrider) = 1;
       return 0;
@@ -1871,8 +1874,8 @@ check_final_overrider (tree overrider, tree basefn)
   /* Check throw specifier is at least as strict.  */
   if (!comp_except_specs (base_throw, over_throw, 0))
     {
-      cp_error_at ("looser throw specifier for %q#F", overrider);
-      cp_error_at ("  overriding %q#F", basefn);
+      error ("looser throw specifier for %q+#F", overrider);
+      error ("  overriding %q+#F", basefn);
       DECL_INVALID_OVERRIDER_P (overrider) = 1;
       return 0;
     }
@@ -1965,8 +1968,8 @@ look_for_overrides_r (tree type, tree fndecl)
        {
          /* A static member function cannot match an inherited
             virtual member function.  */
-         cp_error_at ("%q#D cannot be declared", fndecl);
-         cp_error_at ("  since %q#D declared in base class", fn);
+         error ("%q+#D cannot be declared", fndecl);
+         error ("  since %q+#D declared in base class", fn);
        }
       else
        {
@@ -2039,6 +2042,10 @@ maybe_suppress_debug_info (tree t)
   /* We might have set this earlier in cp_finish_decl.  */
   TYPE_DECL_SUPPRESS_DEBUG (TYPE_MAIN_DECL (t)) = 0;
 
+  /* Always emit the information for each class every time. */
+  if (flag_emit_class_debug_always)
+    return;
+
   /* If we already know how we're handling this class, handle debug info
      the same way.  */
   if (CLASSTYPE_INTERFACE_KNOWN (t))
@@ -2352,7 +2359,7 @@ lookup_conversions_r (tree binfo,
     {
       parent_tpl_convs = tree_cons (binfo, my_tpl_convs, parent_tpl_convs);
       if (virtual_depth)
-       TREE_STATIC (parent_convs) = 1;
+       TREE_STATIC (parent_tpl_convs) = 1;
     }
 
   child_convs = other_convs;