if (tree spec = retrieve_specialization (gen_tmpl, argvec, hash))
return spec;
}
-
- /* We can see more levels of arguments than parameters if
- there was a specialization of a member template, like
- this:
-
- template <class T> struct S { template <class U> void f(); }
- template <> template <class U> void S<int>::f(U);
-
- Here, we'll be substituting into the specialization,
- because that's where we can find the code we actually
- want to generate, but we'll have enough arguments for
- the most general template.
-
- We also deal with the peculiar case:
-
- template <class T> struct S {
- template <class U> friend void f();
- };
- template <class U> void f() {}
- template S<int>;
- template void f<double>();
-
- Here, the ARGS for the instantiation of will be {int,
- double}. But, we only need as many ARGS as there are
- levels of template parameters in CODE_PATTERN. We are
- careful not to get fooled into reducing the ARGS in
- situations like:
-
- template <class T> struct S { template <class U> void f(U); }
- template <class T> template <> void S<T>::f(int) {}
-
- which we can spot because the pattern will be a
- specialization in this case. */
- int args_depth = TMPL_ARGS_DEPTH (args);
- int parms_depth =
- TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (DECL_TI_TEMPLATE (t)));
-
- if (args_depth > parms_depth && !DECL_TEMPLATE_SPECIALIZATION (t))
- args = get_innermost_template_args (args, parms_depth);
}
else
{
--- /dev/null
+// PR c++/100102
+// { dg-do compile { target c++11 } }
+
+template<int()> struct ratio;
+template<class T, class U> struct duration {
+ static constexpr int _S_gcd();
+ template<class> using __is_harmonic = ratio<_S_gcd>;
+ using type = __is_harmonic<int>;
+};
--- /dev/null
+// PR c++/100102
+// { dg-do compile { target c++11 } }
+
+template<int> struct ratio;
+template<class T> struct duration {
+ static constexpr int _S_gcd();
+ template<class> using __is_harmonic = ratio<(duration::_S_gcd)()>;
+ using type = __is_harmonic<int>;
+};