[cfe-dev] C++ default arguments patch, rework Parse-Sema interaction for function parameters
Doug Gregor
doug.gregor at gmail.com
Mon Apr 7 06:16:18 PDT 2008
On Sun, Apr 6, 2008 at 7:18 PM, Neil Booth <neil at daikokuya.co.uk> wrote:
> > +// RUN: clang -fsyntax-only -verify %s
> > +void f(int i);
> > +void f(int i = 0); // expected-error {{previous definition is here}}
> > +void f(int i = 17); // expected-error {{redefinition of default argument}}
>
> Nit: those are really declarations not definitions. The problem may
> have been there already.
No, it's correct. We talking about redefinition of the default
argument, not of the function or of the parameter; the C++ standard
refers to these as definitions of default arguments, and says
explicitly that default arguments shall not be "redefined".
- Doug
More information about the cfe-dev
mailing list