[SERVER-68494] Change expression.h registration macros to use REGISTER_EXPRESSION_CONDITIONALLY Created: 02/Aug/22  Updated: 05/Dec/22

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

Type: Task Priority: Minor - P4
Reporter: Huayu Ouyang Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Query Optimization
Participants:
Linked BF Score: 170

 Description   

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


Generated at Thu Feb 08 06:10:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.