mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-11-12 19:37:16 +01:00
RAPIDJSON_NOEXCEPT_ASSERT() should never throw.
clang warns about throwing from RAPIDJSON_NOEXCEPT_ASSERT() in a nothrow context. If RAPIDJSON_ASSERT() throws it can never be used for _NOEXCEPT_ASSERT(), so use C assert() instead. Finally (and originally), since RAPIDJSON_ASSERT() in "unittest.h" throws, make it define RAPIDJSON_ASSERT_THROWS for RAPIDJSON_NOEXCEPT_ASSERT() to now do the right thing.
This commit is contained in:
@@ -122,6 +122,9 @@ public:
|
||||
|
||||
#ifndef RAPIDJSON_ASSERT
|
||||
#define RAPIDJSON_ASSERT(x) (!(x) ? throw AssertException(RAPIDJSON_STRINGIFY(x)) : (void)0u)
|
||||
#ifndef RAPIDJSON_ASSERT_THROWS
|
||||
#define RAPIDJSON_ASSERT_THROWS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
class Random {
|
||||
|
||||
Reference in New Issue
Block a user