Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LFTM
Do we also need to consider this in the context of "AllowShortIfStatments"? (that would be in a different review in my view)
Comment Actions
Definitely. Since it didn't work at all, I reported it without a .clang-format. I was hoping it'd play well with AllowShortIfStatments out of the box.
I'm currently building HEAD with this patch to reformat my code.
Comment Actions
I'll handle AllowShortIfStatements and update this review. Should be pretty straightforward.
Comment Actions
My few cases format consistently with the condition case:
diff diff --git a/tests/integration/test.waarudo.io.dynamic.cpp b/tests/integration/test.waarudo.io.dynamic.cpp index be5a626..e1265b9 100644 --- a/tests/integration/test.waarudo.io.dynamic.cpp +++ b/tests/integration/test.waarudo.io.dynamic.cpp @@ -21,7 +21,7 @@ public: } constexpr ~input_source() { - if (std::is_constant_evaluated()) { + if consteval { expects(input_byte == previous_input_byte); } else { std::ofstream{"test.waarudo.io.dynamic.previous.input.byte.txt"} << "waarudo::byte{'" @@ -37,7 +37,7 @@ public: [[nodiscard]] constexpr waarudo::output_bytes output() override { return {&output_byte, 1z}; } constexpr ~output_destination() { - if (std::is_constant_evaluated()) { + if consteval { expects(output_byte == previous_output_byte); } else { std::cout << std::bit_cast<char>(output_byte); diff --git a/tests/waarudo.test.utilities.cpp b/tests/waarudo.test.utilities.cpp index ed82b2b..f4ec8e3 100644 --- a/tests/waarudo.test.utilities.cpp +++ b/tests/waarudo.test.utilities.cpp @@ -13,7 +13,7 @@ export template<auto F> concept constant_invocable = requires { typename std::in export using waarudo::expects; export constexpr void runtime(void (*const f)()) { - if (not std::is_constant_evaluated()) f(); + if not consteval { f(); } } template<std::integral I, std::invocable<I> F> void visit_values(F f) {
Thank you.