Skip to content

Compile error when disabling C++11 support #109

Description

@CarterLi

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions