https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96330
Bug ID: 96330 Summary: Constexpr variables cannot be used in the template context. Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: steve_green at qq dot com Target Milestone: --- demo code: struct foo_t { template<class T> static constexpr bool bar = true; }; inline constexpr foo_t foo{}; template<class T> struct baz { static_assert(foo.bar<T>); // bug in clang (before instantiation) and gcc (during instantiation) static_assert(foo_t::bar<T>); // OK }; int main() { static_assert(foo.bar<void>, ""); // OK static_assert(foo_t::bar<void>, ""); // OK static_cast<void>(baz<void>{}); }