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

            Bug ID: 119515
           Summary: subsumption fails with concept-id that uses a function
                    parameter of an abbreviated function template
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppalka at gcc dot gnu.org
  Target Milestone: ---

$ cat testcase.C
template<class T> concept C = sizeof(T) != 1;

void f(auto x) requires C<decltype(x)> && true;
void f(auto x) requires C<decltype(x)>;

int main() {
  f(0);
}

$ g++ -std=c++20 testcase.C
testcase.C: In function ‘int main()’:
testcase.C:7:4: error: call of overloaded ‘f(int)’ is ambiguous
    7 |   f(0);
      |   ~^~~
testcase.C:3:6: note: candidate: ‘void f(auto:1) requires (C<decltype(f::x)>)
&& true [with auto:1 = int]’
    3 | void f(auto x) requires C<decltype(x)> && true;
      |      ^
testcase.C:4:6: note: candidate: ‘void f(auto:2) requires  C<decltype(f::x)>
[with auto:2 = int]’
    4 | void f(auto x) requires C<decltype(x)>;
      |      ^

Reply via email to