https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66850
--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> --- Related test cases: template <typename T, template <typename U, U> class> struct Sort; template <template <typename U, U> class Comparator> struct Sort<int, Comparator> { template <int I> struct less_than { Comparator<int, I> a; }; }; ========== template <typename C, C> struct integral_constant {}; template <typename T, template <typename U, U> class> struct Sort; template <template <typename U, U> class Comparator> struct Sort<int, Comparator> { template <int I> struct less_than: integral_constant<bool, Comparator<int, I>::value> {}; };