Custom polyfill clang tidy check misses some cases

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Programmability
    • ALL
    • Programmability 2025-04-14
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The custom clang tidy check that flags polyfill identifiers misses some cases. One such is std::set_terminate. Applying the diff below (or, really, just calling std::set_terminate from anywhere) and running clang-tidy on mongod_main fails to flag the use of std::set_terminate. mathias@mongodb.com and I believe this is because the check is only looking for type declarations that match the polyfill name list, which will miss function calls, among other things.

      --- a/src/mongo/db/mongod_main.cpp
      +++ b/src/mongo/db/mongod_main.cpp
      @@ -2175,6 +2175,8 @@ int mongod_main(int argc, char* argv[]) {
           }
       #endif
      +    std::set_terminate([]() { });
      +
           ExitCode exitCode = initAndListen(service);
           exitCleanly(exitCode);
           return 0;

              Assignee:
              Alex Li
              Reporter:
              James Bronsted
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: