[PATCH c++] Reduce -Weffc++ Rule 12 false positives

Gabriel Dos Reis gdr@integrable-solutions.net
Tue Feb 7 21:31:00 GMT 2006


Dirk Mueller <dmueller@suse.de> writes:

| Hi, 
| 
| -Weffc++ warns if any member is missing from the initialisation list, even if 
| its a POD type. Reduce the amount of warnings to those where it matters, 
| namely when a default constructor call indeed has to be emitted. 
| 
| bootstrapped, tested, regression test in progress. 
| 
| Ok for trunk if it passes?

I don't understand.  Actually, we should be warning for those cases,
especially I don't understand this:

[...]

| +struct A
| +{
| +   A();
| +};
| +
| +struct B
| +{
| +  B() {}
| +
| +  int bogus;         // { dg-bogus "should be initialized in the member" }
| +  nontriv right;     // { dg-warning "should be initialized in the member" }
| +};
| +
| +void breakme()
| +{
| +  foo bla;
| +}

-- Gaby



More information about the Gcc-patches mailing list