https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125330
Bug ID: 125330
Summary: [17 Regression] Explicit object parameter not
available in the scope of trailing requires expression
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: pilarlatiesa at gmail dot com
Target Milestone: ---
I've just noticed on Compiler Explorer that the following (valid) snipped is
rejected by trunk. It is accepted by 14, 15, and 16.
```
struct T
{
template<typename Self>
void foo(this Self const &x) requires requires { x.bar(); }
{ x.bar(); }
};
```
The reported error is:
<source>:5:52: error: 'x' was not declared in this scope
5 | void foo(this Self const &x) requires requires { x.bar(); }
|