OSDN Git Service

* class.c (check_field_decls): Don't special case anonymous
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Dec 2000 14:26:37 +0000 (14:26 +0000)
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Dec 2000 14:26:37 +0000 (14:26 +0000)
fields in error messages.
(note_name_declared_in_class): Use %D on diagnostic.

* tree.c (pod_type_p): Use strip_array_types.
(cp_valid_lang_attribute): Likewise.
* typeck.c (cp_type_quals): Strip arrays separately, to avoid
multiple evaluations.
(cp_has_mutable_p): Use strip_array_types.

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

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/tree.c
gcc/cp/typeck.c

index 923158a..00f9549 100644 (file)
@@ -1,5 +1,17 @@
 2000-12-07  Nathan Sidwell  <nathan@codesourcery.com>
 
+       * class.c (check_field_decls): Don't special case anonymous
+       fields in error messages.
+       (note_name_declared_in_class): Use %D on diagnostic.
+       
+       * tree.c (pod_type_p): Use strip_array_types.
+       (cp_valid_lang_attribute): Likewise.
+       * typeck.c (cp_type_quals): Strip arrays separately, to avoid
+       multiple evaluations.
+       (cp_has_mutable_p): Use strip_array_types.      
+
+2000-12-07  Nathan Sidwell  <nathan@codesourcery.com>
+
        * cp-tree.h (sufficient_parms_p): Declare new function.
        * call.c (sufficient_parms_p): New function, broken out of ...
        (add_function_candidate): ... here. Use it.
index ff3d264..60041c5 100644 (file)
@@ -3537,12 +3537,7 @@ check_field_decls (t, access_decls, empty_p,
          TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1;
 
          if (! TYPE_HAS_CONSTRUCTOR (t) && extra_warnings)
-           {
-             if (DECL_NAME (x))
-               cp_warning_at ("non-static reference `%#D' in class without a constructor", x);
-             else
-               cp_warning_at ("non-static reference in class without a constructor", x);
-           }
+            cp_warning_at ("non-static reference `%#D' in class without a constructor", x);
        }
 
       type = strip_array_types (type);
@@ -3574,12 +3569,7 @@ check_field_decls (t, access_decls, empty_p,
          TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1;
 
          if (! TYPE_HAS_CONSTRUCTOR (t) && extra_warnings)
-           {
-             if (DECL_NAME (x))
-               cp_warning_at ("non-static const member `%#D' in class without a constructor", x);
-             else
-               cp_warning_at ("non-static const member in class without a constructor", x);
-           }
+            cp_warning_at ("non-static const member `%#D' in class without a constructor", x);
        }
       /* A field that is pseudo-const makes the structure likewise.  */
       else if (IS_AGGR_TYPE (type))
@@ -6533,8 +6523,8 @@ note_name_declared_in_class (name, decl)
         in its context and when re-evaluated in the completed scope of
         S.  */
       cp_error ("declaration of `%#D'", decl);
-      cp_error_at ("changes meaning of `%s' from `%+#D'", 
-                  IDENTIFIER_POINTER (DECL_NAME (OVL_CURRENT (decl))),
+      cp_error_at ("changes meaning of `%D' from `%+#D'", 
+                  DECL_NAME (OVL_CURRENT (decl)),
                   (tree) n->value);
     }
 }
index 653930e..f59aef8 100644 (file)
@@ -2242,8 +2242,7 @@ int
 pod_type_p (t)
      tree t;
 {
-  while (TREE_CODE (t) == ARRAY_TYPE)
-    t = TREE_TYPE (t);
+  t = strip_array_types (t);
 
   if (INTEGRAL_TYPE_P (t))
     return 1;  /* integral, character or enumeral type */
@@ -2310,8 +2309,7 @@ cp_valid_lang_attribute (attr_name, attr_args, decl, type)
 
       pri = TREE_INT_CST_LOW (initp_expr);
        
-      while (TREE_CODE (type) == ARRAY_TYPE)
-       type = TREE_TYPE (type);
+      type = strip_array_types (type);
 
       if (decl == NULL_TREE
          || TREE_CODE (decl) != VAR_DECL
index b426e76..762f552 100644 (file)
@@ -6983,7 +6983,8 @@ int
 cp_type_quals (type)
      tree type;
 {
-  return TYPE_QUALS (strip_array_types (type));
+  type = strip_array_types (type);
+  return TYPE_QUALS (type);
 }
 
 /* Returns non-zero if the TYPE contains a mutable member */
@@ -6992,8 +6993,7 @@ int
 cp_has_mutable_p (type)
      tree type;
 {
-  while (TREE_CODE (type) == ARRAY_TYPE)
-    type = TREE_TYPE (type);
+  type = strip_array_types (type);
 
   return CLASS_TYPE_P (type) && CLASSTYPE_HAS_MUTABLE (type);
 }