[SERVER-54368] Failure to compile when including <fmt/compile.h> in decimal_counter.h Created: 05/Feb/21  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Gregory Noma Assignee: Backlog - Security Team
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-45445 Upgrade of libfmt to 7.1.3 Closed
Assigned Teams:
Server Security
Participants:

 Description   

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.


Generated at Thu Feb 08 05:33:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.