https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102194
Bug ID: 102194 Summary: Incorrect explicit instantiation of constexpr variable accepted Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: fchelnokov at gmail dot com Target Milestone: --- This incorrect instantiation is accepted by GCC ``` template<int N> constexpr long long fib = fib<N-1> + fib<N-2>; template<> constexpr long long fib<1> = 1; template<> constexpr long long fib<2> = 1; template long long fib<70>; // error here, `const` is missing ``` The correct last line must be: ``` template const long long fib<70>; ```