Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-54368

Failure to compile when including <fmt/compile.h> in decimal_counter.h

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Security

      If I simply add #include <fmt/compile.h> in decimal_counter.h, attempting to compile fails with the following error:

      In file included from src/mongo/base/initializer.cpp:43:
      In file included from src/mongo/logv2/log.h:51:
      In file included from src/mongo/logv2/log_debug.h:36:
      In file included from src/mongo/logv2/log_detail.h:34:
      In file included from src/mongo/logv2/attribute_storage.h:33:
      In file included from src/mongo/bson/bsonobjbuilder.h:46:
      In file included from src/mongo/util/decimal_counter.h:35:
      src/third_party/fmt/dist/include/fmt/compile.h:517:6: error: no member named 'format' in 'str'
        cf.format(std::back_inserter(buffer), args...);
        ~~ ^
      src/mongo/base/initializer.cpp:154:17: note: in instantiation of function template specialization 'fmt::v6::format<str, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > , char, 0>' requested here
                      format(FMT_STRING("node has no init function: \"{}\""), nodeName),
                      ^

      It doesn't seem to make sense that simply adding an #include like this should cause this error.

            Assignee:
            backlog-server-security [DO NOT USE] Backlog - Security Team
            Reporter:
            gregory.noma@mongodb.com Gregory Noma
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: