]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
class.c (check_field_decls): Don't special case anonymous fields in error messages.
authorNathan Sidwell <nathan@codesourcery.com>
Thu, 7 Dec 2000 14:26:37 +0000 (14:26 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Thu, 7 Dec 2000 14:26:37 +0000 (14:26 +0000)
* 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.

From-SVN: r38112

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

index 923158ab373730f97c8fb5181335763935f8e31c..00f954910504a0a7a04e9e7f42917675076c81e2 100644 (file)
@@ -1,3 +1,15 @@
+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.
index ff3d26456c00a5dbeeef572dc3b976049da6a880..60041c51a064a438a76b439ec6f57eb1e7582a23 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 653930e423fc72dcad35f513060dd9cdda086a41..f59aef895ad1cf45d3b3e23d691048216620200a 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 b426e76748c35a8820d0ae52cc953aa62d0ddf33..762f552caace61e9d1b874d9165b6d7949fa3ad2 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);
 }