[C++ Patch] Redefinition of default args is illegal

Craig Rodrigues rodrigc@attbi.com
Sun Feb 17 15:06:00 GMT 2002


On Sun, Feb 17, 2002 at 03:42:28PM -0500, Jakub Jelinek wrote:
> On Sun, Feb 17, 2002 at 03:11:24PM -0500, Craig Rodrigues wrote:
> > On Sun, Feb 17, 2002 at 11:50:34AM -0800, Richard Henderson wrote:
> > > On Sun, Feb 17, 2002 at 12:38:04PM -0500, Craig Rodrigues wrote:
> > > > 	PR c++/5685
> > > > 	* decl.c (duplicate_decls): Issue an error, not a warning,
> > > > 	if duplicate default argument declarations are present.
> > > 
> > > >From the coding here, it seems clear that it was intended that
> > > exact redeclaration is a gcc extension.  You'll get the error
> > > if you compile with -pedantic.
> > 
> > In this case, -pedantic will give you a warning, not an error.
> > I verified this with the testcase in PR c++/5685.
> 
> But -pedantic-errors will issue an error which is IMHO enough.

I don't see what the rationale is for keeping this as
a -pedantic-error.  I do not see it listed as a
GCC extension to the C++ language in the GCC manual.

I tried the PR c++/5685 testcase under Comeau C++
and the Digital Unix C++ compiler, and both
those compilers flagged the testcase as an error,
without requiring any fancy flags.

Since it is not documented as a GCC extension,
I think it would be useful if GCC flagged this
as an error, like other conformant C++ compilers do.
-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@attbi.com



More information about the Gcc-patches mailing list