This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]