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

            Bug ID: 116049
           Summary: friend function with explicit object parameter
           Product: gcc
           Version: 14.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

This program
```
struct A {
    friend void f(this A);
};
```
is invalid because an explicit object parameter cannot appear in a non-member
function, but GCC accepts the declaration.

Online demo: https://gcc.godbolt.org/z/Taj4Ea1Px

Reply via email to