-
-
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
Copy-construct using initializer-list converts objects to arrays #1359
Comments
Indeed, using braces when an |
This is expected behavior, I'm afraid. |
Crikey thanks for the amazingly fast reply! I guess the solution is not to use braces for initialising members! |
Looks like a Clang bug, since the output on Clang for both variants of the code is:
GCC behaves the same as MSVC in this case. I'll file a bug over there. Thanks again for the fast replies! |
Great! Please let us know about the progress of the filed bugs! |
Clang developers pointed me to this: https://clang.llvm.org/cxx_dr_status.html#2137 Sounds like it’s an unresolved ambiguity in the c++ spec itself. |
nlohmann/json#1359 This issue only occurred for me when using gcc 10, and did not happen while using gcc 9.
I seem to have hit a bug in either this library / MSVC. Here's a minimal repro case:
Output:
Interestingly, changing the initialiser from
mJson{input}
tomJson(input)
produces the correct output:I'm currently using 3.1.2 but confirmed it also reproduces on latest 3.4.0
The text was updated successfully, but these errors were encountered: