[clang] [clang] improve diagnostics for enums (PR #204682)

Yanzuo Liu via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 23 20:52:16 PDT 2026


zwuis wrote:

> Does this patch affect the output of `-Xclang -ast-print`?

```cpp
enum e { zero };
auto var = (e)0;
```

Output of `-Xclang -ast-print` with the code above:

<table>
<tr>
  <th>Without this PR</th>
  <th>With this PR</th>
</tr>
<tr>
  <td>
    <pre><code class="language-cpp">
enum e {
    zero
};
auto var = (e)0;
    </code></pre>
  </td>
  <td>
    <pre><code class="language-cpp">
enum e {
    zero
};
auto var = zero;
    </code></pre>
  </td>
</tr>
</table>

https://github.com/llvm/llvm-project/pull/204682


More information about the cfe-commits mailing list