Issue 52951
Summary Static and non-static member function templates with the same parameter types are accepted
Labels new issue
Assignees
Reporter Fedr
    This code
```
struct A {
    static int f(auto) { return 1; }
    int f(auto) requires true { return 2; }
};
```
is invalid per https://timsong-cpp.github.io/cppwp/n4861/class.static.mfct#2:
> There shall not be a static and a non-static member function with the same name and the same parameter types ([over.load]).

But Clang accepts it without a warning (as some other compilers do), which later produces confusing errors. Related discussion: https://stackoverflow.com/q/70542265/7325599
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to