<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/99464>99464</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
type trait builtins __remove_cv[ref] are used unconditionally
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
AndreyG
</td>
</tr>
</table>
<pre>
After the commit 55357160d0e151c32f86e1d6683b4bddbb706aa1 by @philnik777 the usages of builtin type traits `__remove_cv`/`__remove_cvref` are not guarded by `#if __has_builtin(__remove_cv[ref])`:
https://github.com/llvm/llvm-project/blob/da0c8b275564f814a53a5c19497669ae2d99538d/libcxx/include/__type_traits/remove_cv.h#L22
https://github.com/llvm/llvm-project/blob/da0c8b275564f814a53a5c19497669ae2d99538d/libcxx/include/__type_traits/remove_cvref.h#L42
Note that even the remaining comment is wrong now `#endif // __has_builtin(__remove_cv)`. https://github.com/llvm/llvm-project/blob/da0c8b275564f814a53a5c19497669ae2d99538d/libcxx/include/__type_traits/remove_cv.h#L31
Also note that all other type traits builtins are used only after the check, for instance `__add_pointer` here: https://github.com/llvm/llvm-project/blob/da0c8b275564f814a53a5c19497669ae2d99538d/libcxx/include/__type_traits/add_pointer.h#L23.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVMuOszYUfhqzsRrZBzB4wSJ_R3RT9RWQLwdwx7Ej22Qmb19B0mYqVZX-3awQYH3-bueonN0SEAfS_iDtW6W2ssY0nINNeP-t0tHeh_NcMNGyIjXxcnGFtm3ddlwwy5C33NQw9wK5FaKvdaOt1bpjQilO9Z2Shl1X54N777ruANmyWjDTOFO9OV9coOV-RVqSciVTItg0JbzEG07mRgQjMP77W8KZCEZVQhpiocumkkV73LWfrt1Mp2lVeXrCE-i_IrY_doD2jYDcz9dnwt4IO6-lXPP-BiOBcXFl3fTJxAuB0fvb349frin-iaYQGLWPmsBoFTO9hq5tRTP3vFFtrVrDZSM7IaRCsFK2dW93AKfN5yeB0QXjN4sExmnatU8P7QTGf2ieVgL17wDfklzC-cGvefL7IxakZVWF4g3DkXLCi3LBheUoDYZCXaYfKYaFhvjxjAqDdTN9qPrf0I6sTvSb-fAwoeYPE84-x72RTyeU9zSWdZ-cL_V-ystHfbeMlsbg71S9RmxF807gVzrHRF3IRQWDj6lQ1k7X6ELBtA_AiglJff4mpnwh9-xufarsUFtZS1XhwDvgILu-ldU6WIu9FcqiMb2UPbRMgGoMt4AdcDVXbgAGDet4zxnvankSCL1GOYO0lgMo0rC9YP60azvFtFQu5w0HKRvRVF5p9PnYaQABP-jxkwDsKy4Nhx96WzJpmHe55BdKccXj8ErsFdh_7ZBXilswMVhXXAzK-3u1JT_8dDAHy93Mh4rbAH8FAAD___830PM">