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

Change expression.h registration macros to use REGISTER_EXPRESSION_CONDITIONALLY

    • Query Optimization
    • 170

      The expression.h registration macros could be refactored to use REGISTER_EXPRESSION_CONDITIONALLY rather than all calling MONGO_INITIALIZER_GENERAL and registerExpression .

      Currently if we try to refactor them this results in a compilation error on the Windows variants (see BF-25979)

      src\mongo\db\pipeline\expression.cpp(571,1): error C2143: syntax error: missing ';' before '&&'
       REGISTER_STABLE_EXPRESSION(and, ExpressionAnd::parse);
      

      This seems to be because the word 'and' in the Windows preprocessor is a macro for && : https://gcc.gnu.org/onlinedocs/cpp/C_002b_002b-Named-Operators.html#C_002b_002b-Named-Operators

      We should look into if it's possible to get around this

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            huayu.ouyang@mongodb.com Huayu Ouyang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: