}
}
- /* Build template info for the new specialization. This can
- overwrite the existing TEMPLATE_INFO for T (that points to
- its instantiated TEMPLATE_DECL), with this one that points to
- the most general template, but that's what we want. */
-
- if (TYPE_ALIAS_P (t))
- {
- /* This should already have been constructed during
- instantiation of the alias decl. */
- tree ti = DECL_TEMPLATE_INFO (TYPE_NAME (t));
- gcc_checking_assert (template_args_equal (TI_ARGS (ti), arglist)
- && TI_TEMPLATE (ti) == found);
- }
- else
- SET_TYPE_TEMPLATE_INFO (t, build_template_info (found, arglist));
+ // Build template info for the new specialization.
+ SET_TYPE_TEMPLATE_INFO (t, build_template_info (found, arglist));
elt.spec = t;
slot = type_specializations->find_slot_with_hash (&elt, hash, INSERT);
--- /dev/null
+// { dg-do compile { target c++11 } }
+// PR C++/95263
+// ICE on alias template instantiation
+
+template <typename> class TPL {
+ template <int> using INT = int;
+};
+
+template <typename T> class Klass
+{
+public:
+ template <int I> using ALIAS = typename TPL<T>::INT<I>;
+
+ template <int> static void FUNC (); // OK
+
+ template <int I, typename> static ALIAS<I> FUNC (); // SFINAE ICE
+};
+
+void Fn ()
+{
+ Klass<int>::FUNC<0> ();
+}
+