https://bugs.llvm.org/show_bug.cgi?id=49964

            Bug ID: 49964
           Summary: [concepts] ambiguous overload accepted as valid
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

Clang accepts the following concept code that gcc considers ambiguous (reduced
testcase due to Patrick Palka).

```
  template <class T> concept C1 = true;
  template <class T> concept C2 = C1<T> && true;

  template <C1 T, C1 U> int f(T, U);
  template <C1 T, C2 U> int f(U, T);

  int x = f(0, 0); // expect error: ambiguous call
```

Live: https://godbolt.org/z/6K93d1Ye4

I originally submitted this as a gcc bug
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99963) but Patrick and Jason
Merrill determined that gcc's behavior is correct.

According to their reading of the standard (I don't have the background to make
this statement), this call to f should be ambiguous because the matching
between the template argument index and function argument index is different in
its two declarations.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to