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

Compilation error when both ostream.h and format.h are included #768

Closed
ukreator opened this issue Jun 8, 2018 · 2 comments
Closed

Compilation error when both ostream.h and format.h are included #768

ukreator opened this issue Jun 8, 2018 · 2 comments

Comments

@ukreator
Copy link

ukreator commented Jun 8, 2018

This simple program does not compile:

#include "fmt/format.h"
#include "fmt/ostream.h"

void func() {
    std::string ss;
    fmt::format(fmt("{}"), ss);
}

First lines of the error:

builds/fmt/include/fmt/format.h:2217:50: error: ambiguous partial specializations of 'formatter<std::__1::basic_string<char>, char, void>'
  formatter<T, typename ParseContext::char_type> f{};
@Remotion
Copy link
Contributor

Remotion commented Jun 9, 2018

I can confirm this, but if fmt macro is not used then it compiles.

#include "fmt/format.h"
#include "fmt/ostream.h"

void func() {
    std::string ss;
    fmt::format("{}", ss); // ok
    // fmt::format(fmt("{}"), ss); // ERROR!
}

The same error happens if <fmt/printf.h> is included.

@vitaut
Copy link
Contributor

vitaut commented Jun 10, 2018

Fixed in 9ff3b6a, thanks for reporting.

@vitaut vitaut closed this as completed Jun 10, 2018
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

No branches or pull requests

3 participants