On Fri, Aug 15, 2025 at 11:37:02AM -0400, Jason Merrill wrote:
> > +  int f7 (int = 42);               // { dg-message "previous specification 
> > in 'int f7\\\(int\\\)' here" }
> > +  int f7 (int = 42);               // { dg-error "default argument given 
> > for parameter 1 of 'int f7\\\(int\\\)'" }
> > +  int f8 (int = 42);
> > +  {
> > +    int f8 (int = 42);
> > +    {
> > +      int f8 (int = 43);
> 
> Hmm, it's unclear to me whether this is valid after P1766. Specifically, I'm
> not sure what "in a given scope" means -- inhabited scope, or target scope?
> I suppose we want to read it as inhabited and thus allow this; I think
> changing the defarg in a local definition is actually a deliberate feature,
> and local externs are ill-formed in a module anyway.

I think so too.  And all compilers I've tried (g++, clang++, EDG, MSVC)
accept it.

        Jakub

Reply via email to