https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92642
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- No, not necessarily. extern const int n; // defined in another file auto i = 1 << n; void f(const int n) { auto i = 1 << n; } Not all const variables are compile-time constants.