[PATCH] D27310: Handle tests for noexcept that expect a false value

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 5 01:43:22 PST 2016


EricWF added inline comments.


================
Comment at: test/libcxx/strings/iterators.exceptions.pass.cpp:29
+#ifndef TEST_HAS_NO_EXCEPTIONS
+constexpr bool expected = false;
+#else
----------------
rogfer01 wrote:
> EricWF wrote:
> > We can't use constexpr because these tests run in C++03. However `const bool expected = ...` should give you a value you can use in constant expressions.
> Ah, I was confused by the usage of C++11 headers in this file but I will use a `static const bool` instead. Thanks.
No worries. It is super confusing, especially since we can use `static_assert` but not `constexpr`. Libc++ goes out of its way to provide as much C++11 in C++03 as possible, but there are weird limitations.


https://reviews.llvm.org/D27310





More information about the cfe-commits mailing list