[llvm-bugs] [Bug 50337] New: Concept subsumption broken with constrained + unconstrained parameter with terse syntax

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 13 23:02:14 PDT 2021


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

            Bug ID: 50337
           Summary: Concept subsumption broken with constrained +
                    unconstrained parameter with terse syntax
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: davidfromonline at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

The following valid translation unit:

```
template<typename T>
concept foo = true;

template<typename T>
concept foo2 = foo<T> and true;

void f(foo auto, auto) {
}
void f(foo2 auto, auto) {
}

void f() {
        f(1, 1);
}
```

is rejected with

```
<source>:13:2: fatal error: call to 'f' is ambiguous
        f(1, 1);
        ^
<source>:7:6: note: candidate function [with auto:1 = int, auto:2 = int]
void f(foo auto, auto) {
     ^
<source>:9:6: note: candidate function [with auto:1 = int, auto:2 = int]
void f(foo2 auto, auto) {
     ^
1 error generated.
Compiler returned: 1
```

This was broken in a recent commit (past couple of days). It's fine with
46c17429bc86dc5ccddb5512b77bd1ede39c9ccd but fails with
72797dedb720fae22682fc884cbf741c5a2066c2.

See it live: https://godbolt.org/z/EaGMs8dhT

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210514/0c4ee2a3/attachment.html>


More information about the llvm-bugs mailing list