https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116798
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>: https://gcc.gnu.org/g:4700ad1c78ccd7767f846802fca148b2ea9a1852 commit r15-3812-g4700ad1c78ccd7767f846802fca148b2ea9a1852 Author: Marek Polacek <pola...@redhat.com> Date: Mon Sep 23 12:19:40 2024 -0400 c++: diagnose this specifier in requires expr [PR116798] We don't detect an explicit object parameter in a requires expression. We can get there by way of requires-expression -> requirement-parameter-list -> parameter-declaration-clause -> ... -> parameter-declaration with this[opt]. But [dcl.fct]/5 doesn't allow an explicit object parameter in this context. So let's fix it like r14-9033 and not like r14-8832. PR c++/116798 gcc/cp/ChangeLog: * parser.cc (cp_parser_parameter_declaration): Detect an explicit object parameter in a requires expression. gcc/testsuite/ChangeLog: * g++.dg/cpp23/explicit-obj-diagnostics12.C: New test. Reviewed-by: Jason Merrill <ja...@redhat.com>