[C++] Deprecating default arguments on function types

Nathan Sidwell nathan@codesourcery.com
Mon Jul 21 13:30:00 GMT 2003


Can we deprecate
	typedef int (*P) (int = 1);
	int f (P p) { return p ();}
?

3.4 only allows it (with pedwarn) when -fpermissive is in effect.
I'd like to deprecate it entirely. (deprecate in 3.4, remove in 3.5)

Rationale: Other than not being C++, I have a protopatch which improves
the speed of type comparisons. However, getting that into a sensible shape
within the current type handling machinery would be assisted (though not
impossible without change) by putting default argument expressions on
DECL_INITIAL of a function's PARM_DECLs.

nathan
-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
          The voices in my head said this was stupid too
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk




More information about the Gcc mailing list