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

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 2 23:19:17 PST 2016


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

Have you tested this against GCC which has different noexcept semantics?

If so this LGTM minus possibly addressing the inline comments.



================
Comment at: test/libcxx/strings/iterators.exceptions.pass.cpp:55
 
 //  iterators in the libc++ test suite
+    static_assert(TEST_FOR_FALSE(!std::__libcpp_string_gets_noexcept_iterator<output_iterator       <char *> >::value), "");
----------------
I would prefer something like this if possible:

```
#ifndef TEST_HAS_NO_EXCEPTIONS
static const bool expect = false;
#else
static const bool expect = true;
#endif
static_assert(std::__libcpp_string_gets_noexcept_iterator<...>::value == expect);
```

(Also the double negation of `TEST_FOR_FALSE(!foo)` is weird)


https://reviews.llvm.org/D27310





More information about the cfe-commits mailing list