diff options
| author | austern <austern@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-02 20:02:10 +0000 |
|---|---|---|
| committer | austern <austern@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-02 20:02:10 +0000 |
| commit | c5174d40fa9d40ae1dff5ae5b058c8839788c7a3 (patch) | |
| tree | a00c49b13b983a9f5d955becd5f394c1a7f6d58b | |
| parent | 6507cda84cc463ede5a72898cccc0b5bf5fcbf01 (diff) | |
| download | ppe42-gcc-c5174d40fa9d40ae1dff5ae5b058c8839788c7a3.tar.gz ppe42-gcc-c5174d40fa9d40ae1dff5ae5b058c8839788c7a3.zip | |
* class.c (check_field_decls): Changed warning about const member
variables so that it doesn't get issued for a class aggregate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57749 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/cp/class.c | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fc2b1455f65..fdf0c28cca8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 3f074916a5a..267bd78e031 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -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. */ |

