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

    <tr>
        <th>Summary</th>
        <td>
            -Wc++20-compat diagnostic reports warnings about UTF-8 string literals that -std=c++20 doesn't
        </td>
    </tr>

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

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

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

<pre>
    clang 16 implements C++20 defect report D2513R3 (`char8_t` Compatibility and Portability Fix) so that `u8""` string literals (type `const char8_t` array) may be assigned to a `const char` or `const unsigned char` array variable.

https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html#c-language-changes
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2513r3.html

Given this test program:

```
int main() {
  const char s[] = u8"test";
  return 0;
}
```

clang -std=c++17 -Wc++20-compat warns:

```
test.cpp:2:20: warning: type of UTF-8 string literal will change from array of const char to array of const char8_t in C++20 [-Wc++20-compat]
  const char s[] = u8"test";
 ^
```

But clang -std=c++20 (with or without -Wc++20-compat) compiles the test program without warning. Given that, I would expect -Wc++20-compat would no longer report warnings about `u8""` string literals either.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVEuPozgQ_jXmUgoyJhBy4NDpLKu9rFajXe1xZEwFPDI2sovO5N-vDHR3ejqalUbi4Uc9XF99_mQIureINStOrDgncqbB-VpNSOiDS1rX3WplpO0hK0GPk8ERLQV4ZuLExElw6PCCisDj5DzBWRRZ_iUHJipWcjVIX30lVnJ4duMkSbfaaLqBtB385TzJbd7o70wcITigQRKwks8VEyI-JYdAXtsejCb00oQYnG4TRjPlbCC4yyO9l7cYa5Q3aBG2CjsgB_KjRzR3_n1ttpvp6-YSC16k17I1mDJ-Zvxp_Q5EU2D5ExMNE41HgzJgSI15GVPneyaarEx5yployDkTmGgWGJloOqfi9Mvq86cjDOlAo2EiV7toM8sed2qQtsfwKNv1ek3dhHYXqNuSfSOVMdEEFTFrrr3I3hNNckIfB4Ivu1Nskc_XnHcl_a5f0AINOgBhIJi8670cY9o7K1by7Vmm2hKMUtvYb3EEdjit6wDvOENY2QUsP8PS1xg_9jZ_s_ZIs7fA35bY4fww4fpdKRkBYPlZrVzMDrD7V73ycqcWwsFVeht-XkM8TaqmieVPIr6c5U-Ln7Z9HC5ccxf45-9mV_1ARrhqY2BtFly8GzfSuMs9AJF7n5errwTa3l0lVpw-V8CK8y9ByorffgLgaSZ4BGI8haiumoZ4NeLfzfQA19jsONIGA9CAHyjz5reBmMIrt6LjM_wBVzebDvD7FKXjUdeWfevAONujf1WXLV4A2cbw_yMTqGlAnyZdnXfH_CgTrLOyElVelNU-GequVQrLvCpLPB7alu-PBQpxqC6XvGgz3Ce6FlzkfJ9zXopM7NNMqFxVvMs63h1QCbbnOEpt3u59okOYsS7FvuSJkS2asEirEBavsGzGwxbnxNfRZ9fOfWB7bnSgd_VISJPB-gEunZa9dYG02iAJP2LyiKRhVdVPne4cBsvEgZLZm_qjyPSahrlNlRuZaOLBtt9u8u4bKmKiWcqJwrKU-18AAAD__0an7sk">