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

    <tr>
        <th>Summary</th>
        <td>
            Multicharacter constants are not handled correctly in C or C++ before C++23
        </td>
    </tr>

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

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

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

<pre>
    The following programs demonstrate the issues with how Clang handles multicharacter constants.

Program 1:
```c
int main(void){
    L'ab';
}
```
Program 2:
```c
int main(void){
 u'ab';
}
```
In program 1, multiple characters are used inside of a wchar_t character constant (prefixed with L). This is valid in C and valid in C++ before C++23. In program 2, multiple characters are used inside of a UTF-16 character constant (prefixed with u). This is valid in C before C23. This also applies to UTF-32 character constants (prefixed with U) as well. It seems that in Clang version 14 all language modes operate using the C++23 rules so that only character constants with no prefix can contain multiple characters. GCC correctly handles these cases, except that it doesn't reject program 2 in C23 which I have made a bug report for: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121739.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVE1vpDgQ_TXmUgqCooFw4NDpiN1Is9IeMudRYQrwytjINt2T_fUr00mmtZNod9QtIX_Uq1dVz4-8V5NhbkX5IMrHhLYwW9f-Tjr-thcaSeki6e3w0j7PDKPV2l6UmWB1dnK0eBh4scYHR4EhzAzK-409XFSYYbYXOGkyE8xkBs0elk0HJWdyJAM7kDGUTPCpyI4iO_55RYVcFHEpquz6lyI7KhNgIWUE3p-tGgQ2on4Q2REA4IvAmnqBtSjilqgfb6NvgPFXgLf_Qn0yb32AXODpWt2qGd4r9ECOYfM8gDJeDQx2BIJLvPAtwM-dAIH3q-NRfefh2sQvApsUnmflQXk4k1YRC05AZrhZCnwQ-AA9j9bx2xKLFG5I4i-R_Prc3eXV_-K4fcbxjU4ksh-T9hZoXbViD8HuSQr8IIn_OctXgQ2QhwtrncJTAM-8eAgzhT3brrQzO6-sgfwApDXEvY0mhsUO7MGuvCt181HEUa_vnQK3RYV6ewW0Rr98SGunYixcuYEkEw8DKfNRa1P47XQCaZ1jGfTL-0MIM3sGSZ59HAp_l7yG11ICDJa9EVgHcPwXy_BjgnuhWMBlVnKGJ5jpzLDQwEDQbxM4Xq0LMFoniiPMIaw-Sh47gd0kZTqZLbVuEtj12_S30poEdn62l2_9NqVyUqLo1CCKxxzzumjSZGiLoSkaSrjN67KqmrIoMJnboexp7BHHoa8O91lZyvv7Ppd9hoc8XkxUixmWWZPlGZZlgekoD_WBKqQ8rzmrSnHIeCGlU63PSySV7N7R5mWFVZNo6ln73ZkQDV-uziIQo1G5Ngbd9dvkxSHTygf_AyaooLn94xOr2cVubHgdxXAznF2y1n36mJLN6fZfPVVh3vpU2kVgFxm8fu5WZ-PkBHZXRxTYvRZ2bvGfAAAA__8q8MjM">