diff --git a/include/rapidjson/filereadstream.h b/include/rapidjson/filereadstream.h index b6d6524..6c8a86c 100644 --- a/include/rapidjson/filereadstream.h +++ b/include/rapidjson/filereadstream.h @@ -22,6 +22,7 @@ RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_OFF(padded) RAPIDJSON_DIAG_OFF(unreachable-code) +RAPIDJSON_DIAG_OFF(missing-noreturn) #endif RAPIDJSON_NAMESPACE_BEGIN @@ -51,8 +52,8 @@ public: size_t Tell() const { return count_ + static_cast(current_ - buffer_); } // Not implemented - void Put(Ch) RAPIDJSON_NORETURN_SUFFIX { RAPIDJSON_ASSERT(false); } - void Flush() RAPIDJSON_NORETURN_SUFFIX { RAPIDJSON_ASSERT(false); } + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } diff --git a/include/rapidjson/memorystream.h b/include/rapidjson/memorystream.h index dfaec37..beed1ef 100644 --- a/include/rapidjson/memorystream.h +++ b/include/rapidjson/memorystream.h @@ -20,6 +20,7 @@ #ifdef __clang__ RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_OFF(unreachable-code) +RAPIDJSON_DIAG_OFF(missing-noreturn) #endif RAPIDJSON_NAMESPACE_BEGIN @@ -46,8 +47,8 @@ struct MemoryStream { size_t Tell() const { return static_cast(src_ - begin_); } Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } - void Put(Ch) RAPIDJSON_NORETURN_SUFFIX { RAPIDJSON_ASSERT(false); } - void Flush() RAPIDJSON_NORETURN_SUFFIX { RAPIDJSON_ASSERT(false); } + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } // For encoding detection only. diff --git a/include/rapidjson/rapidjson.h b/include/rapidjson/rapidjson.h index e3560b7..d896a14 100644 --- a/include/rapidjson/rapidjson.h +++ b/include/rapidjson/rapidjson.h @@ -464,15 +464,6 @@ RAPIDJSON_NAMESPACE_END #endif // RAPIDJSON_DIAG_* -/////////////////////////////////////////////////////////////////////////////// -// RAPIDJSON_NORETURN_SUFFIX - -#if defined(__clang__) && !defined(NDEBUG) -#define RAPIDJSON_NORETURN_SUFFIX __attribute__ ((noreturn)) -#else -#define RAPIDJSON_NORETURN_SUFFIX -#endif - /////////////////////////////////////////////////////////////////////////////// // C++11 features diff --git a/test/unittest/readertest.cpp b/test/unittest/readertest.cpp index 6285181..f2a0be1 100644 --- a/test/unittest/readertest.cpp +++ b/test/unittest/readertest.cpp @@ -25,6 +25,7 @@ using namespace rapidjson; RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_OFF(effc++) RAPIDJSON_DIAG_OFF(float-equal) +RAPIDJSON_DIAG_OFF(missing-noreturn) #endif #ifdef __clang__ @@ -1040,8 +1041,8 @@ public: size_t Tell() const { return static_cast(is_.tellg()); } Ch* PutBegin() { assert(false); return 0; } - void Put(Ch) RAPIDJSON_NORETURN_SUFFIX { assert(false); } - void Flush() RAPIDJSON_NORETURN_SUFFIX { assert(false); } + void Put(Ch) { assert(false); } + void Flush() { assert(false); } size_t PutEnd(Ch*) { assert(false); return 0; } private: