-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
Labels:None
-
Fully Compatible
-
ALL
-
Service Arch 2021-03-08, Service Arch 2021-03-22
The iassert and tassert macros immediately expand all their arguments to a C++ function call expression. The called functions (there are several overloads possible) take nontrivial objects like std::string msg and SourceLocationHolder loc.
Another consequence is that the condition is not evaluated in an if condition's bool context, which causes objects with explicit operator bool conversions to be rejected from iassert and uassert where they would not be rejected from the other asserts.
(see SERVER-54836).
An assertion has to be nearly free if the condition passes.
- causes
-
SERVER-54836 tassert() should use operator bool()
- Closed