Commit cc85b4c5 by Jason Merrill Committed by Jason Merrill

re PR c++/34950 (ICE in svn boost math toolkit)

        PR c++/34950
        * pt.c (resolve_overloaded_unification): Set processing_template_decl
        while we look for possible bindings.

From-SVN: r132455
parent daac0317
2008-02-19 Jason Merrill <jason@redhat.com>
PR c++/34950
* pt.c (resolve_overloaded_unification): Set processing_template_decl
while we look for possible bindings.
2008-02-19 Jakub Jelinek <jakub@redhat.com>
PR c++/35028
......
......@@ -12137,6 +12137,7 @@ resolve_overloaded_unification (tree tparms,
if (TREE_CODE (fn) != TEMPLATE_DECL)
continue;
++processing_template_decl;
subargs = get_bindings (fn, DECL_TEMPLATE_RESULT (fn),
expl_subargs, /*check_ret=*/false);
if (subargs)
......@@ -12145,6 +12146,7 @@ resolve_overloaded_unification (tree tparms,
good += try_one_overload (tparms, targs, tempargs, parm,
elem, strict, sub_strict, addr_p);
}
--processing_template_decl;
}
}
else if (TREE_CODE (arg) != OVERLOAD
......
// PR c++/34950
template <class T = int> struct policy {
typedef int unnecessary;
};
template <class Policy> struct A {
typedef int type;
typedef typename Policy::unnecessary unused;
};
template <class T> struct S {
typedef int type;
typedef typename A<T>::type unused;
};
template <class, class T> typename S<T>::type foo();
template <class> S<policy<> >::type foo();
template <typename T> int def(T);
const int i = def(foo<int>);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment