c++/3779: Accepts illegal C++ code: redefinition of default argument
Petter Reinholdtsen
pere@opera.com
Tue Jul 24 00:32:00 GMT 2001
[ljrittle@gcc.gnu.org]
> Before reporting standard compliance issues related to
> gcc please try compiling with -pedantic.
Thank you for getting back to me.
As the code in question is illegal C++, I believe it at least
should give a warning no matter which flags are used. If this
problem is considered to only bother pedantic programmers then
adding -pedantic could turn it into an error.
While I was porting KDE to Irix C++ a few years ago, I discovered
hundreds of these bugs (typical cut-n-paste) in the code, and worked
a week on it before it where even close to compiling. I therefore
believe the programmers using gcc need to at least get a warning
when they write illegal C++ which fails to compile on many compilers.
In short: move the warning from -pedantic to all the time, and make
it possible to force an error for this kind of illegal code.
More information about the Gcc-bugs
mailing list