-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang++ 6.0 (Xcode 9.3) Error in CEREAL_RAPIDJSON_ASSERT macro #439
Comments
Make sure to report this upstream to rapidjson. For us the likely solution will be to temporarily disable that warning for any files in rapidjson that cause it. |
I don't think this warning is caused by rapidjson. The origin of the exception is line 45 & 46 of cereal/include/cereal/archives/json.hpp #define CEREAL_RAPIDJSON_ASSERT(x) if(!(x)){ |
We faced this issue when we upgrade our compiler to clang 5.0. Is there any fix for this issue? |
The warning is present also with Clang++ 6.0 at it's not related to XCode or any other IDE (I'm running it on ArchLinux) |
Xcode has its own "rebranded" clang++/LLVM ... I didn't know that was also in the regular 1
|
This is still throwing warnings in XCode 9.3.1. puentev's workaround, or something like it, should go mainline until you get except vs. noexcept consistent between RapidJSON and cereal. The bad boy here is cereal/external/rapidson/document.h . There are a lot of obects being constructed with the CEREAL_RAPIDJSON_NOEXCEPT modifier, but in those call stacks you have CEREAL_RAPIDJSON_ASSERTs declared. You can't have both. For example, one bit of offending code is on line 755 of cereal/external/rapidson/document.h, where you've defined a function with the following prototype: GenericValue &operator=(GenericValue &rhs) CEREAL_RAPIDJSON_NOEXCEPT { Same thing on line 592: explicit GenericValue( Type type ) CEREAL_RAPIDJSON_NOEXCEPT : data_() { And that conflicts with at least the following code on line 597 of cereal/external/rapidjson/document.h: CEREAL_RAPIDJSON_ASSERT( type <= kNumberType ); |
I'm not using cereal, but this this same issue (using Xcode 9.3.1 with rapidjson). The problem does indeed seem to lie with rapidjson as @johnwbyrd cites. From what I can tell, cereal is just adding CEREAL_ But rapidjson has stuff like:
With RAPIDJSON_NOEXCEPT being controlled by
I'm going to update to the latest, but I quick scan of the code has the same issues. |
Fixed upstream in Tencent/rapidjson#1329. |
Hello, Do I just need to git clone a new release of rapidjson directly into Or is there a different set of steps I should try? (I found the customization script add_rapidjson_prefix.sh, but I didn't find any other scripts that run that script. So I'm unclear if there's some order I should follow.) Thank you, |
From current stable version i'm getting this warning (with -Wall):
../ext/cereal//include/cereal/external/rapidjson/document.h:597:9: error: 'GenericValue' has a non-throwing exception specification but can still throw [-Werror,-Wexceptions]
CEREAL_RAPIDJSON_ASSERT(type <= kNumberType);
With latest Xcode (9.3) this is no longer a warning but an error. As dirty workaround ...
replace in
cereal/include/cereal/archives/json.hpp
by
The text was updated successfully, but these errors were encountered: