<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/63057>63057</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [C++20] Clang chooses wrong overload resolution for empty arrays.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          jensmassberg
      </td>
    </tr>
</table>

<pre>
    It seems that Clang chooses the wrong overload resolution in the following example:

```
#include <stdio.h>
int f(int const(&)[]) { return 1; }
int f(int const(&)[2]) { return 2; }

int main () {
  if (f ({}) == 1) {
    printf("*** correct ***\n");
  } else {
    printf("*** wrong ***\n");
 }
}
```

GCC chooses the right function. See https://gcc.godbolt.org/z/ab3YMjGnh
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU8FunDAQ_ZrhMgqC8QLLgUN26UY99NRTj8YM4MjYK9skTb--AtJE2apVJGsMM-89M36MDEGPlrmB4gRFm8glTs43j2zDLEPo2I9J5_qX5mvEwDwHjJOMeDbSjqgm5wKvKcZn7-yI7om9cbJHz8GZJWpnUdsNMDhj3LO2I_JPOV8Ng7iHrIXsTyyz17W_ktBWmaVnBHEOsdcunUB82avaRhyAjuuunA0R6AhUAtV7H0A1QnVCz3HxFnMQJ4Sq_QSZ_mbTB_a7xiy1xY27wfcCoh7W5BbWbLXLiRZEi_kNFvHqtY3DpkJA9_tC5bxnFfEtA8XZbogaxBsbqhbZBP6M4u7Pf_XeW3x7uPFkiw_n8wfnvR6niMNi1Wp3it-ZcYrxGlaD6QJ0GZVKR9d3zsTU-RHo8gvoIjvx49vjg52SvhF9LWqZcJOXx6KkQ10ck6mpVVaUVSdVVXTloS_LSlRcZ0fZqX7o-iHRDWUksjLLc5HV-TGVeZWTzFR3ZCY6FHDIeJbapMY8zevZiQ5h4aYUWVElRnZswvbrE1l-xq24XkvRJr5ZOXfdMgY4ZEaHGN5Voo5mm5kz0AnoRBkU7c1U_HsiBueR52t8Qem9fAlpsnjT3NyZjtPSpcrNQJf13Nft7urdI6sIdNm-NgBdtm5-BwAA__8-dxly">