Skip to content

compile error on Xcode 16.1 #4713

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

Open
2 tasks
ovaar opened this issue Apr 1, 2025 · 1 comment
Open
2 tasks

compile error on Xcode 16.1 #4713

ovaar opened this issue Apr 1, 2025 · 1 comment
Labels
kind: bug state: cannot reproduce we cannot reproduce the issue

Comments

@ovaar
Copy link

ovaar commented Apr 1, 2025

Description

platform: Macos (Sequoia, 15.3.2 (24D81)), Intel x86_64
arch: x86_64
compiler: Xcode Version 16.1 (16B40) apple-clang++
cppstd: 23

I faced the following compile error, when including the #include <nlohmann/json.hpp>

I boiled it down to the [std::enable_if](https://en.cppreference.com/w/cpp/types/enable_if) compiler conditional, but I couldn't figure out the real fix, see bool operator==(const IterImpl& other) const

Image Image

On top of that I fixed the following compile errors where, apparently, the compiler has become more strict or couldn't match, which I created a PR for #4712

Reproduction steps

* Include nlohmann/json.hpp header
* build

Minimal code example

#include <nlohmann/json.hpp>
const auto json_object = nlohmann::json::parse(std::string());

Error messages

Invalid operands to binary expression ('iterator' (aka 'iter_impl<nlohmann::basic_json<std::map, std::vector, std::string, bool, long long, unsigned long long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>>') and 'iterator' (aka 'iter_impl<nlohmann::basic_json<std::map, std::vector, std::string, bool, long long, unsigned long long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>>'))

Compiler and operating system

Macos (Sequoia, 15.3.2 (24D81)), Intel x86_64, Xcode Version 16.1 (16B40) apple-clang++

Library version

3.11.3

Validation

@nlohmann
Copy link
Owner

We use Xcode 16.1 among others (see https://json.nlohmann.me/community/quality_assurance/ for all compilers) in the CI without problems. I could also build the whole test suite in Xcode 16.3 with the C++ standard set to 23.

@nlohmann nlohmann added the state: cannot reproduce we cannot reproduce the issue label Apr 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug state: cannot reproduce we cannot reproduce the issue
Projects
None yet
Development

No branches or pull requests

2 participants