-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Serializing std::variant causes stack overflow #1292
Comments
Well... oops. I'll make a fix asap |
@untrioctium Could you please check whether #1294 fixes this issue? |
@nlohmann Yes, on all previously tested compilers with that test code, I now get " |
Thanks for the quick check, @untrioctium ! And of course, @theodelrieu, thanks for the quick fix! |
@nlohmann |
This may be similar to #1261, but version 3.3.0, on my tested compilers, will stack overflow trying to serialize a variant instead of yelling at compile time that it doesn't know how to do it.
With this code:
MSVC 19.14.26430 will produce the cryptic and lengthy error C4717:
And crash with a stack overflow when run. GCC 7.3.0 and Clang 6.0.0 will not produce a compile error, but will segfault. An earlier version of json I was working with, 3.1.2, instead complains that it's not sure how to serialize a std::variant on all previously tested compilers.
I cannot even begin to claim to know what the resolution of this problem might even vaguely look like, but I hope this is helpful information. Hopefully I'm not just doing something horribly wrong.
The text was updated successfully, but these errors were encountered: