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

            Bug ID: 117422
           Summary: Error: template parameter was not declared in this
                    scope
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eczbek.void at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/rz5eGzqf6



```
template<typename>
void f();

struct S {
        template<typename T>
        friend void f() {
                T x;
        }
};

int main() {
        f<int>();
}
```



<source>: In function 'void f()':
<source>:7:17: error: 'T' was not declared in this scope [-Wtemplate-body]
    7 |                 T x;
      |                 ^
Compiler returned: 1

Reply via email to