https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68884
--- Comment #5 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- markus@x4 /tmp % cat tst.ii namespace std { template <typename _Tp, _Tp __v> struct A { static constexpr _Tp value = __v; }; typedef A<bool, true> true_type; } template <int> struct VsA; template <class ValueType> struct ValueTemplate { template <template <ValueType> class, class> struct IsInstanceOf; template <template <ValueType> class TemplateA, ValueType... TypesA> struct IsInstanceOf<TemplateA, TemplateA<TypesA...>> : std::true_type {}; }; bool foo = ValueTemplate<int>::IsInstanceOf<VsA, VsA<0>>::value; markus@x4 /tmp % g++ -c tst.ii tst.ii:11:57: internal compiler error: in tsubst, at cp/pt.c:12869 bool foo = ValueTemplate<int>::IsInstanceOf<VsA, VsA<0>>::value; ^~ 0x64ff30 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:12869 0x6524b0 convert_template_argument ../../gcc/gcc/cp/pt.c:7194 0x65f379 coerce_template_parms ../../gcc/gcc/cp/pt.c:7684 0x66d267 unify ../../gcc/gcc/cp/pt.c:19378 0x66c88b unify ../../gcc/gcc/cp/pt.c:19709 0x66ebff get_partial_spec_bindings ../../gcc/gcc/cp/pt.c:20469 0x66687a most_specialized_partial_spec ../../gcc/gcc/cp/pt.c:20741 0x682153 instantiate_class_template_1 ../../gcc/gcc/cp/pt.c:9698 0x682153 instantiate_class_template(tree_node*) ../../gcc/gcc/cp/pt.c:10259 0x72b43b complete_type(tree_node*) ../../gcc/gcc/cp/typeck.c:131 0x6f8b90 cp_parser_nested_name_specifier_opt ../../gcc/gcc/cp/parser.c:6027 0x71bcc9 cp_parser_simple_type_specifier ../../gcc/gcc/cp/parser.c:16120 0x6f7456 cp_parser_postfix_expression ../../gcc/gcc/cp/parser.c:6533 0x700ff4 cp_parser_unary_expression ../../gcc/gcc/cp/parser.c:7901 0x701c7b cp_parser_cast_expression ../../gcc/gcc/cp/parser.c:8578 0x702097 cp_parser_binary_expression ../../gcc/gcc/cp/parser.c:8679 0x702a74 cp_parser_assignment_expression ../../gcc/gcc/cp/parser.c:8966 0x70300a cp_parser_constant_expression ../../gcc/gcc/cp/parser.c:9236 0x7038f5 cp_parser_initializer_clause ../../gcc/gcc/cp/parser.c:20679 0x7057f5 cp_parser_initializer ../../gcc/gcc/cp/parser.c:20622