[PATCH] D155064: [clang][SemaCXX] Diagnose tautological uses of consteval if and is_constant_evaluated

Takuya Shimizu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 19 00:22:15 PDT 2023


hazohelet added a comment.

Regarding the clang CI failure, libcxx's `__libcpp_is_constant_evaluated` always returns false under C++03 or earlier, where constexpr isn't available.
(Code: https://github.com/llvm/llvm-project/blob/036a1b2202cb71aacfa72ef15145a88dc50a02cf/libcxx/include/__type_traits/is_constant_evaluated.h#L26-L28)
`_LIBCPP_CONSTEXPR` expands to nothing under C++03 mode, and thus this returns false every time as clang now says.
(Live demo: https://godbolt.org/z/oszebM5o5)
I'm not sure how I should fix it, so I would like to ask for help from libcxx folks.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155064/new/

https://reviews.llvm.org/D155064



More information about the cfe-commits mailing list