https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123612

--- Comment #7 from Daniel Katz <katzdm at gmail dot com> ---
Yeah, default arguments on block scope declarations were discussed pretty
extensively during P2996 review in Sofia.

C++26 Reflection is definitely entity-based - a decision that I believe goes
back to SG7 discussions, where it was felt that not all implementations could
feasibly support a declaration-based model - so it's definitely the case that
'^^foo == bar ()' holds.

With that constraint in mind, we took the direction that 'has_default_argument'
returns whether _any_ reachable declaration of the parameter has a default
argument (even one at block scope). FWIW there was also fairly wide sentiment
that default arguments on block-scope function declarations are a sufficiently
obscure and troublesome corner of the language that we should even consider
deprecating and removing support for it in the future - if you feel strongly
one way or the other, I'd be interested to know in case it comes up again.

Reply via email to