<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71206>71206</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang should warn when building with `-fexperimental-bounds-safety` and `-x assembler-with-cpp`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:diagnostics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
delcypher
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
delcypher
</td>
</tr>
</table>
<pre>
In #70480 the `-fexperimental-bounds-safety` flag was added.
Currently Clang will emit a warning that `-fexperimental-bounds-safety` is ignored when building with `-x assembler`. However, it won't emit a warning when building with `-x assembler-with-cpp`.
This issue tracks adding a warning to detect when `-fexperimental-bounds-safety` is used with `-x assembler-with-cpp`.
We can either have a generic warning whenever this combination of flags are used. Or we could have a more targeted warning:
E.g.
```
#if __has_feature(bounds_safety) // Should warn here
mov x0, #42
#else
#error "oh no"
#endif
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUk81u2zgUhZ-G2lxYoElZthZaZJIxZlazmAJdGhR5JbKlSIOkrPjtC0pu4gRokwKGBVLQd865PyJGMzjEluz-IowptPJ61hgIY2T3VIgpaR_al-ui8-ra_uuAML6n1YFC0gikppsen88YzIguCbvp_ORU3ETRY7qSmkJvxQCziCCUQlUS-kTow_r_OIWALtkrPFrhBpiNtYCjSSBgFsEZN0DSIn1GxkQwg_MBFcwaHXSTscos0KQXwDOIGHHsLAZS0xL-8TNect5HMAlm7wjbp_fyH7M2-XIjz-cMvU_3RWdPMU4IKQj5falAptyF86AwoUyrzudiTjFn_BMnXxGkcIAmaQygxQVBwIAOg5FvkuZ6QMq-pR8740Qy3oHvlyZGEAEX9RL-CzAjSD9Z9ZM3-oCQRBgwZX8rlfCHeyN_l8MbY6Smt996ZNz0cDppEU89ijQFJOyw1uB0qwFrgLAjYUf4Xy_yWQk0BlwZo7_AM81NJYxX7AWMNuLrIQQfgDDmNTifJ_7ljVOmf2euUC1XDW9Ege22bhrK2aHhhW73tK76vqs6pLjnyKXcN9jUh61ksup3WJiWUca3W8q3e17teHngvagPSmLT7FSjDqSiOApjS2svY-nDUCwD0-63jNaFFR3aeFtQmVeE8AdlxOB8TEbG26qGNn-96aYhkopaE1N85SWTLLbrfsW7iv1isD8YP-HU76aumIJtdUrnmBu_tGkwSU9dKf1I2DG7uj025-C_oUyEHZfIkbDjkvpHAAAA__8SxHz1">