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

    <tr>
        <th>Summary</th>
        <td>
            Disallow the `-fchar8_t` and `-fno-char8_t` options for C modes
        </td>
    </tr>

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

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

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

<pre>
    Clang 15 trunk currently allows the `-fchar8_t` and `-fno-char8_t` options to be specified when compiling in C modes and the former has the effect of causing `char8_t` to be both a keyword and a type specifier. This behavior is not desirable; in C23, `char8_t` is a typedef of `unsigned char` declared in `uchar.h`. See [N2653](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2653.htm) for details.

```
$ cat t.c
char8_t c8;

$ clang --version
clang version 15.0.0 (https://github.com/tahonermann/llvm-project.git 5531abaf7158652bf7411937781780e9f6358ecf)
...

$ clang -c t.c
t.c:1:1: error: unknown type name 'char8_t'
char8_t c8;
^
1 error generated.

$ clang -c -fchar8_t t.c
<no error, but we want one!>
```

This issue will track changing Clang to reject the `-fchar8_t` and `-fno-char8_t` options in C modes or to ignore them with an appropriate diagnostic.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydVMtynTAM_RruRnM9YJ53wSJN2mU37b5jbHFxY2zGNmHy95Xhtkkf6SIzPGQhS0fWOQxOPff3RtgrFDVEv9pHkKv3aKN5BmGM2wLECSFr8vMoJ-G7b5FsEFYdPuvOr9xuidpZ2uJgQAgLSj1qVLBNaEG6edFGUy1t4R5mpzDsiVKB0fkZPUziqIfjiDKCG0GKNaQ9lP5VoaPA4OIEAh7xeXNe7bkExOflpbRn8HXSgYIn8aSdB7Kti0CltReDwaz8sMPhZcbv_yhCsUc6hWOCQr7VBn211FEKSzEKpRGeHJQkfU9-NpHF4AvSudUfPvOmLrP6IePdFOMSsvIu45_o2raNuQXtOUTFnL-S63uUBb2C5DwFXIvqiKOncjLQy6ZsbIpzxi_p0AhAFNoEluUPWX53ezb57TqWvKJjjBCZPBy3HkF21P5vG1PkTofz-Ql9oGHeduzOm4u4wnKWw18dXXWc1oHRoGkRxeQs-llYSytjnubz4t13GiujOKjrshCDGNui7pqaD2NbFcWlbNuuaLscL2NT1h3Kkfo8IDDG3oAqXzpLRnlX3G5A751PBhHbus0e5LBipsnw9ueoefv2sdQfD6M4csEVqScRUb0N5pdQXmBl5b11NzREs2GNsCFswhLFLWacwH789-j2505hHcJKe7QxJFQhHxMF7TVJ4xAwScJjOt73CPaVIqlJSkUsdx5TqplqJplZEAsNcPGa2gelBUWEqCU7qb5Ul_IiTlFHg_2DDvuf4z04EqNvQE6rN_1_-JUY9QexaLmfUhIK8astT1MvsOjG9iLVyPEiVDU0Lc9LNVRFeSkbrE9GDGhCT0rNOLe4HQdNNmn2pHuec57XRV40eVl1jFeNqtq8Fa1sOe-GrMpxJgGyhCOp-OT7HdKwXgN9NDrE8PJRhP3_gXs5yi_WODnfv9LKaS_f7_B_ABgowHY">