Restore disabled check for #3070 (except on MSVC)#3421
Merged
nlohmann merged 1 commit intonlohmann:developfrom Apr 6, 2022
Merged
Restore disabled check for #3070 (except on MSVC)#3421nlohmann merged 1 commit intonlohmann:developfrom
nlohmann merged 1 commit intonlohmann:developfrom
Conversation
Restore the previously disabled check for regression nlohmann#3070 on all compilers but MSVC. To summarize the issue: Given namespace fs = std::filesystem. On MSVC attempting to construct an fs::path from json results in an ambiguous overload resolution because fs::path can be constructed from both a std::string as well as another fs::path. To the best of my knowledge there is no way to fix an ambiguous overload situation involving a type we do not control and with json implicitly converting to both std::string and fs::path. Re-enabling the check where it compiles and keeping it disabled for MSVC is the best we can do. Closes nlohmann#3377 and nlohmann#3382.
Contributor
Author
|
Looking at #3229 we may want to disable it for ICPC as well. Should allow the PR to pass CI and be merged. Edit: I propose to merge this first. I've rebased https://github.com/nlohmann/json/tree/icpc and believe I can tackle ICPC and the doctest version bump (by excluding doctest from clang-tidy) in one swoop. |
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.
Restore the previously disabled check for regression #3070 on all compilers but MSVC.
To summarize the issue:
Given
namespace fs = std::filesystem.On MSVC attempting to construct an
fs::pathfromjsonresults in an ambiguous overload resolution becausefs::pathcan be constructed from both astd::stringas well as anotherfs::path. To the best of my knowledge there is no way to fix an ambiguous overload situation involving a type we do not control and withjsonimplicitly converting to bothstd::stringandfs::path.Re-enabling the check where it compiles and keeping it disabled for MSVC is the best we can do.
Closes #3377 and #3382.