[Bug c++/103884] New: ICE when calling static and non-static member function templates with the same parameter types and requires clause

fchelnokov at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Jan 1 06:45:01 GMT 2022


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

            Bug ID: 103884
           Summary: ICE when calling static and non-static member function
                    templates with the same parameter types and requires
                    clause
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

Building this program:
```
struct A {
    static int f(auto) { return 1; }
    int f(auto) requires true { return 2; }
};

int main() {
    [[maybe_unused]] int (A::*y)(int) = &A::f;
    [[maybe_unused]] int (*x)(int) = &A::f;
}
```
results in ICE in GCC. Other compilers also show some errors, but not ICE.
Demo: https://gcc.godbolt.org/z/9aYofP31x

It is not clear yet whether `A` definition is correct, but all compilers accept
it. Related discussion: https://stackoverflow.com/q/70542265/7325599


More information about the Gcc-bugs mailing list