<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59840>59840</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
warning in DirectoryLookup.h about bit field DirCharacteristic not wide enough to fit enum CharacteristicKind
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
doxygen
</td>
</tr>
</table>
<pre>
When using clang 15.0.6 and including `clang/Lex/DirectoryLookup.h` with option `-Wbitfield-enum-conversion` enabled I get the following warning:
```
DirectoryLookup.h:77:17: warning:
bit-field 'DirCharacteristic' is not wide enough to store all enumerators of
'CharacteristicKind' [-Wbitfield-enum-conversion]
: u(Map), DirCharacteristic(DT), LookupType(LT_HeaderMap),
```
`DirCharacteristic` is a bitfield with 2 bits (4 values)
```c++
/// DirCharacteristic - The type of directory this is: this is an instance of
/// SrcMgr::CharacteristicKind.
unsigned DirCharacteristic : 2;
```
Whereas `SrcMgr::CharacterKind` is an enum with 5 values:
```c++
enum CharacteristicKind {
C_User,
C_System,
C_ExternCSystem,
C_User_ModuleMap,
C_System_ModuleMap
};
```
Probable solution: increase `DirCharacteristic` bitfield from 2 to 3.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VFuPszYQ_TXmZRRkzC088JBLo1bdlSp9qfYxMjCAW8eOfNls_n1lctlsk93IIsAwx3POHA-3VgwKsSb5kuTriHs3alN3-uM0oIoa3Z3qtxEVeCvUAK3kaoAkj2lcAFcdCNVK34UQKegUJWzzgh-EbdbCYOu0Ob1o_a8_xCMpKByFG0EfnNAqZMzeGuF6gbKbofL7WavVOxortAofo-KNxA7-gAEduBGh11LqY9juyI0SaiDpgtA1oddrQS9renwsIV2UJUkXSbjcYcD5e5h-jXCzqSYgrFwLsxq54a1DI6wTLWElCAtKOziKDgGV9sMIToN12iBwKSFwQcOdNhZ0f49NWPkV7k-hugBJ8uUPYuTrLyDpAjxh81d-IKwibAVPqpyvt5fgmfz2dEDC5i_b3e_IOzS35KfK3V4-Ihc08OdwLfbcUxaeLRA2z-CdS482oD9rTUvYMqwLIcI25_VIAmawHRHc6YCge-iu3QQ3CgvCBh0ut8AVCGUdVy3eSf4J_su0r4MJdkkXjx2IrwleTeehe1JM2I2RdPmDXm8jGuQ2OPvpflOzL_qpySVn8fKrZOmPYk0Jj8UDKW9qrnZ_WzS3rsJq9-tkHe4_38Bq99uHQ6NWTyIhefeqOy9x8sf_Ye5i5zrL9XeK_GV0E44vWC19OO9BP6HaIBDCd866mao3eg8sHKs0vpc46uq0q9KKR1gnRckqlmW0isa6r5I5L3PMc8SWUmxpygvMWF50VcHzIhI1oyylCc2TNElZFTdFnvRtVuas6osE5ySjuOdCxlK-72NthkhY67HOq3lGI8kblHaak4wpPMIUJIyFsWnqkDNr_GBJRqWwzn6iOOEk1pdhA0LBw1gC3mjvAnk4s39035N50wsH31gi8kbWo3OHyVLTCRiEG30Tt3pP2CbUdvmbHYz-B1tH2GZiZAnbTIz_CwAA___K9uYZ">