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

Compile error when disabling C++11 support #109

Closed
CarterLi opened this issue Feb 13, 2015 · 2 comments
Closed

Compile error when disabling C++11 support #109

CarterLi opened this issue Feb 13, 2015 · 2 comments

Comments

@CarterLi
Copy link
Contributor

Simple test case:

~/cppformat-master/build % cat test.cpp
#include "../format.h"

int main() {
    fmt::MemoryWriter m;
    m.write("Test");
}
~/cppformat-master/build % clang++ test.cpp ../format.cc -o test
test.cpp:5:7: error: no matching member function for call to 'write'
    m.write("Test");
    ~~^~~~~
./../format.h:1612:21: note: candidate function template not viable: requires 2 arguments, but 1 was provided
  FMT_VARIADIC_VOID(write, BasicStringRef<Char>)
                    ^
./../format.h:1348:13: note: expanded from macro 'FMT_VARIADIC_VOID'
  FMT_WRAP1(func, arg_type, 1) FMT_WRAP1(func, arg_type, 2) \
            ^
./../format.h:1340:15: note: expanded from macro 'FMT_WRAP1'
  inline void func(arg_type arg1, FMT_GEN(n, FMT_MAKE_ARG)) { \
              ^
./../format.h:1612:21: note: candidate function template not viable: requires 3 arguments, but 1 was provided
./../format.h:1348:42: note: expanded from macro 'FMT_VARIADIC_VOID'
  FMT_WRAP1(func, arg_type, 1) FMT_WRAP1(func, arg_type, 2) \
                                         ^
./../format.h:1340:15: note: expanded from macro 'FMT_WRAP1'
  inline void func(arg_type arg1, FMT_GEN(n, FMT_MAKE_ARG)) { \
              ^
./../format.h:1612:21: note: candidate function template not viable: requires 4 arguments, but 1 was provided
./../format.h:1349:13: note: expanded from macro 'FMT_VARIADIC_VOID'
  FMT_WRAP1(func, arg_type, 3) FMT_WRAP1(func, arg_type, 4) \
            ^
./../format.h:1340:15: note: expanded from macro 'FMT_WRAP1'
  inline void func(arg_type arg1, FMT_GEN(n, FMT_MAKE_ARG)) { \
              ^
./../format.h:1612:21: note: candidate function template not viable: requires 5 arguments, but 1 was provided
./../format.h:1349:42: note: expanded from macro 'FMT_VARIADIC_VOID'
  FMT_WRAP1(func, arg_type, 3) FMT_WRAP1(func, arg_type, 4) \
                                         ^
./../format.h:1340:15: note: expanded from macro 'FMT_WRAP1'
  inline void func(arg_type arg1, FMT_GEN(n, FMT_MAKE_ARG)) { \
              ^
./../format.h:1612:21: note: candidate function template not viable: requires 6 arguments, but 1 was provided
./../format.h:1350:13: note: expanded from macro 'FMT_VARIADIC_VOID'
  FMT_WRAP1(func, arg_type, 5) FMT_WRAP1(func, arg_type, 6) \
            ^
./../format.h:1340:15: note: expanded from macro 'FMT_WRAP1'
  inline void func(arg_type arg1, FMT_GEN(n, FMT_MAKE_ARG)) { \
              ^
./../format.h:1612:21: note: candidate function template not viable: requires 7 arguments, but 1 was provided
./../format.h:1350:42: note: expanded from macro 'FMT_VARIADIC_VOID'
  FMT_WRAP1(func, arg_type, 5) FMT_WRAP1(func, arg_type, 6) \
                                         ^
./../format.h:1340:15: note: expanded from macro 'FMT_WRAP1'
  inline void func(arg_type arg1, FMT_GEN(n, FMT_MAKE_ARG)) { \
              ^
./../format.h:1612:21: note: candidate function template not viable: requires 8 arguments, but 1 was provided
./../format.h:1351:13: note: expanded from macro 'FMT_VARIADIC_VOID'
  FMT_WRAP1(func, arg_type, 7) FMT_WRAP1(func, arg_type, 8) \
            ^
./../format.h:1340:15: note: expanded from macro 'FMT_WRAP1'
  inline void func(arg_type arg1, FMT_GEN(n, FMT_MAKE_ARG)) { \
              ^
./../format.h:1612:21: note: candidate function template not viable: requires 9 arguments, but 1 was provided
./../format.h:1351:42: note: expanded from macro 'FMT_VARIADIC_VOID'
  FMT_WRAP1(func, arg_type, 7) FMT_WRAP1(func, arg_type, 8) \
                                         ^
./../format.h:1340:15: note: expanded from macro 'FMT_WRAP1'
  inline void func(arg_type arg1, FMT_GEN(n, FMT_MAKE_ARG)) { \
              ^
./../format.h:1612:21: note: candidate function template not viable: requires 10 arguments, but 1 was provided
./../format.h:1352:13: note: expanded from macro 'FMT_VARIADIC_VOID'
  FMT_WRAP1(func, arg_type, 9) FMT_WRAP1(func, arg_type, 10)
            ^
./../format.h:1340:15: note: expanded from macro 'FMT_WRAP1'
  inline void func(arg_type arg1, FMT_GEN(n, FMT_MAKE_ARG)) { \
              ^
./../format.h:1612:21: note: candidate function template not viable: requires 11 arguments, but 1 was provided
./../format.h:1352:42: note: expanded from macro 'FMT_VARIADIC_VOID'
  FMT_WRAP1(func, arg_type, 9) FMT_WRAP1(func, arg_type, 10)
                                         ^
./../format.h:1340:15: note: expanded from macro 'FMT_WRAP1'
  inline void func(arg_type arg1, FMT_GEN(n, FMT_MAKE_ARG)) { \
              ^
./../format.h:1609:8: note: candidate function not viable: requires 2 arguments, but 1 was provided
  void write(BasicStringRef<Char> format, ArgList args) {
       ^
1 error generated.
~/cppformat-master/build % clang++ -v
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix

It compiles fine with -std=c++11

@vitaut
Copy link
Contributor

vitaut commented Feb 14, 2015

Thanks for the bug report, I'll look into it.

@vitaut
Copy link
Contributor

vitaut commented Feb 16, 2015

Fixed in bd13338. Thanks again.

@vitaut vitaut closed this as completed Feb 16, 2015
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

2 participants