Fix warnings in clang for C++11

This commit is contained in:
Milo Yip
2016-01-23 14:37:15 +08:00
parent 534da223f7
commit a6eb15d274
12 changed files with 121 additions and 11 deletions

View File

@@ -99,12 +99,24 @@ inline FILE* TempFile(char *filename) {
#pragma warning(disable : 4127)
#endif
#ifdef __clang__
#pragma GCC diagnostic push
#if __has_warning("-Wdeprecated")
#pragma GCC diagnostic ignored "-Wdeprecated"
#endif
#endif
class AssertException : public std::logic_error {
public:
AssertException(const char* w) : std::logic_error(w) {}
AssertException(const AssertException& rhs) : std::logic_error(rhs) {}
virtual ~AssertException() throw();
};
#ifdef __clang__
#pragma GCC diagnostic pop
#endif
#define RAPIDJSON_ASSERT(x) if (!(x)) throw AssertException(RAPIDJSON_STRINGIFY(x))
class Random {