MONGO_invariant confuses the MSVC compiler that execution may continue

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Minor - P4
    • None
    • Affects Version/s: 3.5.9
    • Component/s: Internal Code
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Compiling this code under MSVC produces the following warning:

      [1/2] CXX build\ninja\mongo\db\ops\write_ops_parsers_test.obj
      e:\workspace\mongo\src\mongo\db\ops\write_ops_parsers_test.cpp(341) : warning C4715: 'mongo::A0xc872fdd4::`anonymous namespace'::MyMockDBClient::call': not all control paths return a value
      

      The warning disappears if the invariant is changed to MONGO_UNREACHABLE, which probably means that the infinite loop in MONGO_invariant
      is confusing the compiler somehow.

              Assignee:
              Mira Chin Carey
              Reporter:
              Kaloian Manassiev
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: