[PATCH] D26139: Tests for strings conversions under libcpp-no-exceptions

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 4 18:36:01 PDT 2016


EricWF added inline comments.


================
Comment at: test/std/strings/string.conversions/stold.pass.cpp:39
     assert(idx == 2);
+#ifndef TEST_HAS_NO_EXCEPTIONS
     try
----------------
Hmm. All of these `#ifdef`s get ugly fast. I think it might be better to add `TEST_TRY` and `TEST_CATCH(...)` macros defined like:

```
#ifndef TEST_HAS_NO_EXCEPTIONS
#define TEST_TRY try
#define TEST_CATCH(...) catch(__VA_ARGS__)
#else
#define TEST_TRY
#define TEST_CATCH(...) if (false)
#endif
```

What do you think? Feel free to add those macros to `test_macros.h` if you like the idea.



https://reviews.llvm.org/D26139





More information about the cfe-commits mailing list