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

using namespace toml::literals is ambiguous #69

Closed
std-any-emplace opened this issue Oct 22, 2020 · 2 comments
Closed

using namespace toml::literals is ambiguous #69

std-any-emplace opened this issue Oct 22, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@std-any-emplace
Copy link

This is from a unit-test from a larger codebase.

TEST_CASE("toml.udl - namespace toml::literals", "does not compile")
{
	using namespace toml::literals; // BUG reference to ?literals? is ambiguous
	auto table = "[table]\nkey=\"value\""_toml;
}

TEST_CASE("toml.udl - namespace toml::v2::ex::literals", "does compile")
{
	using namespace toml::v2::ex::literals;
	auto table = "[table]\nkey=\"value\""_toml;
}

This fails with (message slightly filtered):

error: reference to ?literals? is ambiguous
  112 |  using namespace toml::literals;
/usr/include/toml++/toml_parser.h:729:19: note: candidates are: ?namespace toml::v2::ex::literals { }?
  729 |  inline namespace literals
      |                   ^~~~~~~~
/usr/include/toml++/toml_common.h:218:19: note:                 ?namespace toml::v2::literals { }?
  218 |  inline namespace literals {}
      |                   ^~~~~~~~

As per example in toml_common:200 that should work.

@std-any-emplace std-any-emplace added the bug Something isn't working label Oct 22, 2020
@std-any-emplace
Copy link
Author

Forgot to mention: GCC 9.3.0 and tomlplusplus-2.2.0.

@marzer marzer closed this as completed in 44c7da2 Oct 22, 2020
@marzer
Copy link
Owner

marzer commented Oct 22, 2020

As per example in toml_common:200 that should work.

Yup. Should be fixed now in master, thanks @std-any-emplace!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants