Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC++constexpr consteval constinitSingle-choice MCQ

Why is the second call ill-formed while the first is fine?

consteval int sqr(int x) { return x * x; } constexpr int a = sqr(5); // ok int n = 5; int b = sqr(n); // error