https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126677
Waffl3x <waffl3x at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
CC| |waffl3x at gcc dot gnu.org
Last reconfirmed| |2026-08-26
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=98939
Status|UNCONFIRMED |NEW
Summary|GCC accepts invalid program |[16/17 Regression] GCC
|involving overloaded member |accepts invalid program
|function templates |involving overloaded member
| |function templates
--- Comment #2 from Waffl3x <waffl3x at gcc dot gnu.org> ---
Confirmed. The changes for P1787R6 went too far. We should still be
rejecting corresponding object parameters.
See r16-7472-gae37ade22ecf4e.
https://eel.is/c++draft/basic.scope.scope#3.2
https://eel.is/c++draft/over.match.funcs.general#4.1
Note that the following...
```
struct S
{
void f0() &&;
void f0();
void f1() &;
void f1() const;
};
```
...are valid, and are correctly allowed in -std=c++20, while...
```
struct S
{
void f() &;
void f();
};
```
...should be rejected, even in -std=c++20.
https://godbolt.org/z/oKnv17rrx