[libcxx-commits] [PATCH] D119152: [libc++] Implement P0627R6 (Function to mark unreachable code)

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 14 08:24:11 PST 2022


ldionne accepted this revision.
ldionne added a comment.
This revision is now accepted and ready to land.

LGTM except for my comment about using a proper `.verify.cpp` test, which I'd like to see addressed.



================
Comment at: libcxx/test/std/utilities/utility/utility.unreachable/unreachable.compile.pass.cpp:16
+
+// would warn if std::unreachable wasn't marked [[noreturn]] or something similar
+[[noreturn]] void unreachable() { std::unreachable(); }
----------------
I would like this to be a `.verify.cpp` test instead, with `expected-no-diagnostics`. You can look at e.g. `libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.lazy.verify.cpp` for how we do that.

Otherwise, we're relying on the fact that warnings are turned into errors in the test suite, and I find that to be slightly brittle.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119152



More information about the libcxx-commits mailing list