<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/214399>214399</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] Add a new check in cppcoreguidelines for checking enum values' names
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kiner-shah
</td>
</tr>
</table>
<pre>
ISO C++ Core Guidelines section [Enum.5](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#enum5-dont-use-all_caps-for-enumerators) states that ALL_CAPS should be avoided for enum names. The reason for this mentioned there is to avoid clashes with macros.
Example given there:
```
// webcolors.h (third party header)
#define RED 0xFF0000
#define GREEN 0x00FF00
#define BLUE 0x0000FF
// productinfo.h
// The following define product subtypes based on color
enum class Product_info { RED, PURPLE, BLUE }; // syntax error
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsk92O5CYQhZ8G35RsYdx_vvBF_64ijZLRbvZ6hKHckMVgUbhn-u0j3B3NjhTJki0O9bnqwJFE9uoRO7Y-sPWpkHMyIXa_rMdYkpGm6IO-d3_8-AuOTByYOMAxRIRvs9XorEcCQpVs8MDWh7Ofx2rN1icmdialiVizZ-LCxMVSUNNUXW0yc1_ZwMTlOE0Z9Un6_7UG_TyuSx18KmfCUjr3puRE5RBimTWMMoVITLRASSYkSEYm2L-8vB33rz-ATJidhh5B3oLVqGEIEXIleDkiVfC3QYgoKfhFSsYSjOjzVKghGYwIliCFBwGUk2SQ4N0mA6NUMVDF-J7x_flDjpNDuNob-kdltoDv2YY_H76HhyXwjr0KLkSqDDCxS8ZGDZOM6Q4GpcbIRJtLRaNxsB7h-_kE_ONy4ZzzL8K37-fzn8A_OM_iF-nw8vMMi5TFR5fP_08x6Fkl64dQmc_l7MYQnAvv1l_hiXnuBZr7dJ-QoJeEGoKHZYQHd_E0m0Pw-tj_luHAtofcOxNHeP35_fXlnL-Wxtj2xJoDwH-W0N0n-QEY44P5m2uF7hrdNq0ssKu3u3Xb1qKuC9PVW46D3GnUdb1pt-2gBq6UaodaD5tBNoXtBBcbvuMbvlrxuq563LaNHHCjxGq1lTu24jhK6yrnbmMV4rWwRDN2ol41bVs42aOjJSFCKCf9tUxW35kQOTGxy1VlP1-JrbizlOiTk2xyS7Z-K1ufYK81SPD4Dsqg-gXWg5omFSJeP3OVr-Ii52NYrL1JN-dIbB8Xt5ij677G7JkvFUYmLrmL56ucYvgHVVqSSAvk8pzu1ol_AwAA__-l_Uro">