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

Parse from byte-vector results in compile error #2602

Closed
2 of 3 tasks
std-any-emplace opened this issue Jan 21, 2021 · 2 comments · Fixed by #2550
Closed
2 of 3 tasks

Parse from byte-vector results in compile error #2602

std-any-emplace opened this issue Jan 21, 2021 · 2 comments · Fixed by #2550
Assignees
Labels
kind: bug release item: 🐛 bug fix solution: duplicate the issue is a duplicate; refer to the linked issue instead solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@std-any-emplace
Copy link

This is a test-case from a larger code-base:

TEST_CASE("parse from byte-vector", "[compile-ok-3.7.3][compile-fail-3.9.1]")
{
	auto b = [](const char a_char){ return static_cast<std::byte>(a_char); };
	auto vec = std::vector{b('{'), b('}')};
	REQUIRE(nlohmann::json::parse(vec).dump() == "{}");
}

This was working with version 3.7.3. After upgrade to version 3.9.1 this fails to compile. I guess it will also fail with 3.8.0 b/c the problem may be related to the work on the InputAdapterType.

I am not sure, if it was ever intended to work before, but it did.

Which version of the library did you use?

  • latest release version 3.9.1
  • other release - please state the version: 3.7.3
  • the develop branch
@nlohmann
Copy link
Owner

This could have been fixed with #2550. Can you please try the develop branch?

@std-any-emplace
Copy link
Author

Yes it does compile on develop. Sorry for the duplicate.

@nlohmann nlohmann added release item: 🐛 bug fix solution: proposed fix a fix for the issue has been proposed and waits for confirmation labels Jan 21, 2021
@nlohmann nlohmann self-assigned this Jan 21, 2021
@nlohmann nlohmann added the solution: duplicate the issue is a duplicate; refer to the linked issue instead label Jan 21, 2021
@nlohmann nlohmann linked a pull request Jan 21, 2021 that will close this issue
1 task
@nlohmann nlohmann added this to the Release 3.9.2 milestone Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug release item: 🐛 bug fix solution: duplicate the issue is a duplicate; refer to the linked issue instead solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants