https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67970
Bug ID: 67970 Summary: [concepts] variable template bug Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ryan.burn at gmail dot com Target Milestone: --- The below code should compile, but I get this error: bug.cpp: In function ‘int main()’: bug.cpp:29:13: error: the value of ‘match_numeric_array’ is not usable in a constant expression func(0, v5); ^ bug.cpp:8:5: note: ‘match_numeric_array’ used in its own initializer match_numeric_array<NumericArray<Scalar>> = ^ bug.cpp:29:13: error: ‘<expression error>’ is not a constant expression func(0, v5); /////////////////////////////////////////////////////////////////// template <class> class NumericArray {}; template <class> constexpr bool match_numeric_array = false; template <class Scalar> constexpr bool match_numeric_array<NumericArray<Scalar>> = true; template <class T> concept bool cpt_NumericArrayContainer() { return match_numeric_array<T>; } template <class X> concept bool cpt_NumericArray() { return requires{requires cpt_NumericArrayContainer<X>()}; } template <class X> requires !cpt_NumericArray<X>() auto func(int, X) {} template <class X> requires cpt_NumericArray<X>() auto func(int, X) {} int main() { NumericArray<double> v5; func(0, v5); } ///////////////////////////////////////////////////////////////////