-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
json({}) gives null instead of empty object with GCC and -std=c++17 #2046
Copy link
Copy link
Closed
Labels
kind: bugsolution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmationstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updatedthe issue has not been updated in a while and will be closed automatically soon unless it is updatedstate: waiting for PR
Milestone
Metadata
Metadata
Assignees
Labels
kind: bugsolution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmationstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updatedthe issue has not been updated in a while and will be closed automatically soon unless it is updatedstate: waiting for PR
Readme says:
But seems when using GCC with
-std=c++17json({})actually gives null. Without-std=c++17or with-std=c++14or any other version it works. On clang it works with any version.Seems there is some problem with overload resolution because
basic_json(std::nullptr_t = nullptr)is called instead ofbasic_json(initializer_list_t init, bool type_deduction = true.... It works after I explicitly set second parameter totrue.g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
developbranch?version 3.7.0