On 9/21/23 07:28, waffl3x wrote:
This seems like a reasonable place for it since 'this' is supposed to
precede the decl-specifiers, and since we are parsing initial attributes
here rather than in the caller. You will want to give an error if
found_decl_spec is set. And elsewhere complain about 'this' on
parameters after the first (in cp_parser_parameter_declaration_list?),
or in a non-member/lambda (in grokdeclarator?).

Bringing this back up, I recalled another detail regarding this.

I'm pretty sure that found_decl_spec can be false when parsing the
second or latter decl-specifier. I tested it quickly and I believe I am
correct. I raise this as my diagnostics patch introduces another
variable to track whether we are on the first decl-specifier, given the
results of my quick test, I believe that was the correct choice.

Makes sense.

This kinda unclear machinery is what makes me really want to refactor
this code, but I've resisted as it would be inappropriate to try to do
so while implementing a feature. Once I am finished implementing
`deducing this` would you be open to me refactoring grokdeclarator and
it's various auxiliary functions?

Yes, but I'll warn you that grokdeclarator has resisted refactoring for a long time...

Jason

Reply via email to