Medium
A diagnostic behind a compile-time flag
expensiveDiagnostic() is declared here but never defined anywhere in the program. Compiled with -O2, what happens to the call and its surrounding branch?
main.cpp
void expensiveDiagnostic();
int compute(int x) {
constexpr bool DEBUG = false;
if (DEBUG) {
expensiveDiagnostic();
}
return x * x;
}7 of 44 in Compilers