Skip to content
Discussion options

You must be logged in to vote

I could reproduce this with the actual protocol.h from the Code::Blocks tree. It is not a json.hpp issue, and it is also not really a clang bug — it only shows up in C++20 mode with libc++:

  • clang 21 + libc++, -std=c++17: compiles
  • clang 21 + libc++, -std=c++20/-std=c++23: fails with exactly your diagnostic (same note trail: protocol.h:735 → FROM_KEY → JSON_SERIALIZE → forward declaration at protocol.h:687)
  • GCC 16 + libstdc++: compiles in all modes

Same result with json 3.11.3 and 3.12.0, so the library version does not matter here.

The reason: Diagnostic (line 689) has option<std::vector<CodeAction>> while CodeAction is only forward-declared (line 687, defined at line 790). The serialize…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@MortenMacFly
Comment options

@nlohmann
Comment options

@MortenMacFly
Comment options

Comment options

You must be logged in to vote
1 reply
@MortenMacFly
Comment options

Answer selected by MortenMacFly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants