pboettch / json-schema-validator

JSON schema validator for JSON for Modern C++
Other
464 stars 133 forks source link

Build fail on latest MSVC 17.6.2, cl.exe v19.36.32532 #273

Closed mark-99 closed 10 months ago

mark-99 commented 11 months ago

vcpkg\buildtrees\json-schema-validator\src\2.2.0-e87f98a2b7.clean\src\json-validator.cpp(606): error C7692: 'bool nlohmann::json_abi_v3_11_2::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::json_abi_v3_11_2::adl_serializer,std::vector<uint8_t,std::allocator<uint8_t>>>::operator ==(const nlohmann::json_abi_v3_11_2::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::json_abi_v3_11_2::adl_serializer,std::vector<uint8_t,std::allocator<uint8_t>>> &) noexcept const': rewritten candidate function was excluded from overload resolution because a corresponding operator!= declared in the same scope

VolkerChristian commented 10 months ago

The same error in json-validator.cpp line 606 happens on linux using g++-13 (current debian sid). Did not happen with g++-12 and clang-14 and bevore.

/home/voc/.../json-schema-validator/src/json-validator.cpp:606: error: no match for ‘operator==’ (operand types are ‘const std::__cxx11::basic_string’ and ‘nlohmann::json_abi_v3_11_2::basic_json<>’) /home/voc/projects/mqttbroker/mqttbroker/lib/json-schema-validator/src/json-validator.cpp: In constructor ‘{anonymous}::type_schema::type_schema(nlohmann::json_abi_v3_11_2::json&, nlohmann::json_schema::root_schema*, const std::vector&)’: /home/voc/projects/mqttbroker/mqttbroker/lib/json-schema-validator/src/json-validator.cpp:606:37: error: no match for ‘operator==’ (operand types are ‘const std::__cxx11::basic_string’ and ‘nlohmann::json_abi_v3_11_2::basic_json<>’) 606 if (t.first == schema_type) ~~~ ^~ ~~~
nlohmann::json_abi_v3_11_2::basic_json<>
const std::__cxx11::basic_string
mark-99 commented 8 months ago

Hi - this still doesn't work, probably because there hasn't been a release since Nov 2022 so vcpkg hasn't picked up any newer versions.

A custom port to latest SHA on main does seem to work.

pboettch commented 8 months ago

@mark-99 I just tested it with gcc-13, the main branch works (which has the fix integrated). Could you please confirm with msvc?

mark-99 commented 8 months ago

Yes msvc looks ok if I use latest main branch.