This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
wrong C++ warning "fix" last year
- From: Michael Matz <matz at suse dot de>
- To: Matt Austern <austern at apple dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 4 Mar 2003 18:18:20 +0100 (CET)
- Subject: wrong C++ warning "fix" last year
Hi Matt,
your patch from
http://gcc.gnu.org/ml/gcc-patches/2002-10/msg00112.html
Breaks the following testcase:
--------- snip ----------
class A {
public:
char *const p;
};
class B {
public:
B() { }
A a;
};
--------- snap ----------
What you did, was removing a warning if the const-member-containing type
(M here) isn't an aggregate. The problem now is, that this also removes
any warning in the case above. But in the constructor B::B() there
_needs_ to be an initializer for B::a::p. Before your patch (and ergo in
3.2) GCC was emitting at least a warning in this case (it should be an
error anyway I believe), but now it doesn't even do that.
I'm not sure if this counts as regression (it certainly is regarding
standard conformance I believe), but it would be nice if this could be
fixed.
Ciao,
Michael.