This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [C++] Deprecating default arguments on function types
- From: Jason Merrill <jason at redhat dot com>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: Nathan Sidwell <nathan at codesourcery dot com>, gcc at gcc dot gnu dot org, Mark Mitchell <mark at codesourcery dot com>
- Date: Mon, 21 Jul 2003 13:26:38 -0400
- Subject: Re: [C++] Deprecating default arguments on function types
- References: <3F1BE5C3.9020300@codesourcery.com><m3fzl0t3s7.fsf@uniton.integrable-solutions.net>
On 21 Jul 2003 15:20:24 +0200, Gabriel Dos Reis <gdr@integrable-solutions.net> wrote:
> Nathan Sidwell <nathan@codesourcery.com> writes:
>
> | Can we deprecate
> | typedef int (*P) (int = 1);
> | int f (P p) { return p ();}
> | ?
>
> Mark already deprecated something like
>
> int f(int, int = 0);
>
> int(*p)(int) = &f;
I don't think we ever supported code like that; it would require some sort
of thunk.
WRT Nathan's question, I still think that it makes sense to have default
args on, say, function pointers, but it certainly doesn't seem to have
caught the imagination of the C++ community, so it's probably not worth
retaining as an extension. I think one of our customers still uses this
extension, but I've never heard of anyone else doing so (and they're stuck
on a 1998-era compiler for other reasons).
Jason