I have a code that depends on many external libraries that works fine in debug mode but it crashes in release mode.
When checking the root cause I found that there is a true condition that’s evaluated to false
My code looks like
#include <iostream>
enum fruits
{
a, b, c
}
...
int main()
{
auto condition (fruits::a == 99);
std::cout << condition;
if (fruits::a == 99) std::cout << " FATAL ERROR ";
...
}
The progam outputs :
0 FATAL ERROR
The program is using c++20 with O2 optimisation flag
The issue is not present if I execute the code in a separated program.