Commit eb5c3f05 by Jason Merrill Committed by Jason Merrill

pt.c (retrieve_specialization): Don't get confused by a using-declaration that…

pt.c (retrieve_specialization): Don't get confused by a using-declaration that brings in another instance of...

	* pt.c (retrieve_specialization): Don't get confused by a
	using-declaration that brings in another instance of this template
	from a base class.

	* ptree.c (cxx_print_type): Fix logic.

From-SVN: r149247
parent bf15d469
2009-07-04 Jason Merrill <jason@redhat.com> 2009-07-04 Jason Merrill <jason@redhat.com>
* pt.c (retrieve_specialization): Don't get confused by a
using-declaration that brings in another instance of this template
from a base class.
* ptree.c (cxx_print_type): Fix logic.
* cp-tree.h (LANG_DECL_FN_CHECK): Fix non-checking version. * cp-tree.h (LANG_DECL_FN_CHECK): Fix non-checking version.
PR c++/40619 PR c++/40619
......
...@@ -974,7 +974,10 @@ retrieve_specialization (tree tmpl, tree args, hashval_t hash) ...@@ -974,7 +974,10 @@ retrieve_specialization (tree tmpl, tree args, hashval_t hash)
for (fns = VEC_index (tree, methods, idx); fns; fns = OVL_NEXT (fns)) for (fns = VEC_index (tree, methods, idx); fns; fns = OVL_NEXT (fns))
{ {
tree fn = OVL_CURRENT (fns); tree fn = OVL_CURRENT (fns);
if (DECL_TEMPLATE_INFO (fn) && DECL_TI_TEMPLATE (fn) == tmpl) if (DECL_TEMPLATE_INFO (fn) && DECL_TI_TEMPLATE (fn) == tmpl
/* using-declarations can add base methods to the method vec,
and we don't want those here. */
&& DECL_CONTEXT (fn) == class_specialization)
return fn; return fn;
} }
return NULL_TREE; return NULL_TREE;
......
...@@ -91,6 +91,10 @@ cxx_print_type (FILE *file, tree node, int indent) ...@@ -91,6 +91,10 @@ cxx_print_type (FILE *file, tree node, int indent)
print_node (file, "throws", TYPE_RAISES_EXCEPTIONS (node), indent + 4); print_node (file, "throws", TYPE_RAISES_EXCEPTIONS (node), indent + 4);
return; return;
case RECORD_TYPE:
case UNION_TYPE:
break;
default: default:
return; return;
} }
......
2009-07-04 Jason Merrill <jason@redhat.com>
* g++.dg/template/using15.C: New.
2009-07-04 Jakub Jelinek <jakub@redhat.com> 2009-07-04 Jakub Jelinek <jakub@redhat.com>
* gfortran.dg/maxloc_1.f90: New test. * gfortran.dg/maxloc_1.f90: New test.
......
// Reduced from the testcase for c++/29433
template <class T>
struct A: T
{
void f(typename T::type);
using T::f;
void g() { f(1); }
};
template <class T>
struct B: T
{ typedef int type; };
struct C
{
typedef double type;
void f();
};
int main()
{
A<B<A<C> > > a;
a.g();
}
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