Repository navigation
Conversation
The prefix tree used by unflatten() (#5836) had a member named slots, which Qt defines as an empty macro, so including a Qt header before this library failed to compile. Rename it to table and add a test that includes the library with Qt's keyword macros (slots, signals, emit, foreach, forever) defined. Fixes #5865 Signed-off-by: Niels Lohmann <mail@nlohmann.me>
1 of 2 tasks
Clang (-Werror) rejected the macros that the test defines but the library must not use, and clang-tidy asked for parentheses around the arguments of the Q_FOREACH imitation, where the variable is a declaration. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5865.
#5836 added a
prefix_treemember namedslots. Qt definesslotsas an empty macro (unlessQT_NO_KEYWORDSis set), so including any Qt header beforejson.hppfailed to compile. This PR:table(include/nlohmann/detail/json_pointer.hpp, re-amalgamated),tests/src/unit-qt_keywords.cpp, which defines Qt's keyword macros as Qt does (slots,signals,emit,foreach,forever) before including the library and exercises parsing, dumping, flatten/unflatten, JSON pointers, the binary formats, and patch/diff. With the old header, this test fails to compile with the same errors as in the issue,<Windows.h>check.The bug only exists on
developsince #5836 and is not in any release.Breaking changes
None. The renamed member belongs to an internal
detailtype.🤖 Generated with Claude Code