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

--- Comment #3 from waffl3x <waffl3x at protonmail dot com> ---
I have some elements working so far, I opted to implement parsing for `this` in
cp_parser_parameter_declaration instead of in cp_parser_decl_specifier_seq
because I didn't want to add another member to cp_decl_specifier_seq, but I
ended up doing it anyway in the end. The `this` clause isn't a specifier so I
thought including it in the same function for parsing decl-specifier-seq would
be odd, but I ended up needing to put code to skip the first `this` token into
cp_parser_decl_specifier_seq so I don't know if that was the right decision in
the end. Ultimately I would like to refactor attribute parsing into another
function instead of having it be a part of cp_parser_decl_specifier_seq, but
I'm not going to do that while implementing "deducing this."

I'm uncertain of where to put the error checking, right now it is in
grokdeclarator. Setting the "explicit object function flag" is also in
grokdeclarator at the moment as I wanted to avoid adding more parameters to
functions. I'm pretty unhappy with how the code is organized, so if anyone has
any opinions on where certain things should be done, please share them.

Right now, parsing the `this` clause works, and errors are reported when it is
used other than in the first parameter, with an altered diagnostic when it is
used multiple times. There is also a diagnostic when `this` is used in a
function type declaration.

Input would be appreciated, thanks.

(In reply to Marek Polacek from comment #2)
> Related: https://cplusplus.github.io/CWG/issues/2653.html

I don't currently implement this, but I was going to, however I am unsure on
whether it's been merged into the standard, I guess "Status: C++23" means that
it was, yeah?

Reply via email to