Skip to content
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

Fix global UDLs #3646

Merged
merged 5 commits into from
Aug 1, 2022
Merged

Conversation

falbrechtskirchinger
Copy link
Contributor

@falbrechtskirchinger falbrechtskirchinger commented Aug 1, 2022

Really default JSON_GLOBAL_UDLS to 1 (oops) and modify tests to catch this error.

Fixes #3644.
Fixes #3645.

@falbrechtskirchinger
Copy link
Contributor Author

As expected, the tests are failing now without the fix.

@falbrechtskirchinger falbrechtskirchinger force-pushed the fix-udls_issue3645 branch 2 times, most recently from cb2b535 to eb2952b Compare August 1, 2022 17:42
@falbrechtskirchinger
Copy link
Contributor Author

falbrechtskirchinger commented Aug 1, 2022

I'm switching from

using namespace nlohmann::literals::json_literals;

to

using nlohmann::literals::json_literals::operator""_json;
using nlohmann::literals::json_literals::operator""_json_pointer;

(in json.hpp)

Still requires // NOLINT but no compiler warning suppressions.

Copy link
Owner

@nlohmann nlohmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@nlohmann
Copy link
Owner

nlohmann commented Aug 1, 2022

Let's wait until the CI succeeds. I would then create a new release with #3640 as release notes. Thanks for the quick response! I guess this is another item for #3641.

@falbrechtskirchinger
Copy link
Contributor Author

I have one more minor documentation tweak, but I'm waiting for CI to pass.

I'm adding this to the top of the lists of recommended ways to bring the UDL operators into scope:

using nlohmann::literals::operator "" _json[_pointer];

@nlohmann
Copy link
Owner

nlohmann commented Aug 1, 2022

using nlohmann::literals::operator "" _json[_pointer];

I find the [] notation confusing. I guess you mean.

using nlohmann::literals::operator "" _json;
using nlohmann::literals::operator "" _json_pointer;

@falbrechtskirchinger
Copy link
Contributor Author

Let's wait until the CI succeeds. I would then create a new release with #3640 as release notes. Thanks for the quick response! I guess this is another item for #3641.

Sorry for messing this one up in the first place. Really don't know how it happened. Maybe I forgot to cherry-pick the most important commit...

@nlohmann
Copy link
Owner

nlohmann commented Aug 1, 2022

I have one more minor documentation tweak, but I'm waiting for CI to pass.

Unfortunately, GCC 4.8 complains.

@falbrechtskirchinger
Copy link
Contributor Author

using nlohmann::literals::operator "" _json[_pointer];

I find the [] notation confusing. I guess you mean.

using nlohmann::literals::operator "" _json;
using nlohmann::literals::operator "" _json_pointer;

Each file gets the correct line. :-)

@nlohmann
Copy link
Owner

nlohmann commented Aug 1, 2022

Let's wait until the CI succeeds. I would then create a new release with #3640 as release notes. Thanks for the quick response! I guess this is another item for #3641.

Sorry for messing this one up in the first place. Really don't know how it happened. Maybe I forgot to cherry-pick the most important commit...

No problem at all! You contributed so much to this release!

@falbrechtskirchinger
Copy link
Contributor Author

I think I fixed it. Works on Compiler Explorer (GCC 4.8.1).

Copy link
Owner

@nlohmann nlohmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling fdc8e6e on falbrechtskirchinger:fix-udls_issue3645 into 817a4a2 on nlohmann:develop.

@nlohmann nlohmann merged commit cbaf103 into nlohmann:develop Aug 1, 2022
@falbrechtskirchinger falbrechtskirchinger deleted the fix-udls_issue3645 branch August 1, 2022 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: no matching literal operator for call to 'operator""_json' _json operator""()
3 participants