Medium
constexpr and consteval called with a non-const local
What happens when this program is compiled?
main.cpp
consteval int squareConsteval(int x) {
return x * x;
}
constexpr int squareConstexpr(int x) {
return x * x;
}
int main() {
int runtimeVal = 5;
int a = squareConstexpr(runtimeVal); // (1)
int b = squareConsteval(runtimeVal); // (2)
return a + b;
}80 of 117 in C++