class.c (check_field_decls): Changed warning about const member variables so that...
authorMatt Austern <austern@apple.com>
Wed, 2 Oct 2002 20:02:10 +0000 (20:02 +0000)
committerMatt Austern <austern@gcc.gnu.org>
Wed, 2 Oct 2002 20:02:10 +0000 (20:02 +0000)
        * class.c (check_field_decls): Changed warning about const member
        variables so that it doesn't get issued for a class aggregate.

From-SVN: r57749

gcc/ChangeLog
gcc/cp/class.c

index fc2b1455f6573d9a6ad46cd17acd6b9541f116aa..fdf0c28cca8752377b35253f3cb1bea1a5e4d124 100644 (file)
@@ -1,3 +1,7 @@
+2002-10-02  Matt Austern  <austern@apple.com
+       * class.c (check_field_decls): Changed warning about const member
+       variables so that it doesn't get issued for a class aggregate.
+       
 2002-10-02  Nathanael Nerode  <neroden@gcc.gnu.org>
 
        * doc/vms.texi: Blow away false include file section.
index 3f074916a5a3ae5d63666214a58466b335406bef..267bd78e031e412f32fd200cf2e088398b8a0025 100644 (file)
@@ -3338,7 +3338,8 @@ check_field_decls (t, access_decls, empty_p,
          *cant_have_default_ctor_p = 1;
          TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1;
 
-         if (! TYPE_HAS_CONSTRUCTOR (t) && extra_warnings)
+         if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t)
+             && extra_warnings)
             cp_warning_at ("non-static reference `%#D' in class without a constructor", x);
        }
 
@@ -3372,7 +3373,8 @@ check_field_decls (t, access_decls, empty_p,
          *cant_have_default_ctor_p = 1;
          TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1;
 
-         if (! TYPE_HAS_CONSTRUCTOR (t) && extra_warnings)
+         if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t)
+             && extra_warnings)
             cp_warning_at ("non-static const member `%#D' in class without a constructor", x);
        }
       /* A field that is pseudo-const makes the structure likewise.  */