diff options
author | Jason Merrill <jason@redhat.com> | 2009-07-04 22:09:15 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-07-04 22:09:15 -0400 |
commit | eb5c3f052a57f3b14c24848d6a195d96f0a6bbef (patch) | |
tree | f4ac00f6323e57653d33af03809113217cdd5479 /gcc/cp | |
parent | bf15d4697d6d4605699730e286f822ed27ff180d (diff) | |
download | gcc-eb5c3f052a57f3b14c24848d6a195d96f0a6bbef.zip gcc-eb5c3f052a57f3b14c24848d6a195d96f0a6bbef.tar.gz gcc-eb5c3f052a57f3b14c24848d6a195d96f0a6bbef.tar.bz2 |
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
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 5 | ||||
-rw-r--r-- | gcc/cp/ptree.c | 4 |
3 files changed, 14 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9953b20..e3fe9c2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 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. PR c++/40619 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 527fe04..4143bb1 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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)) { 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 NULL_TREE; diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c index ec7a471..69279cd 100644 --- a/gcc/cp/ptree.c +++ b/gcc/cp/ptree.c @@ -91,6 +91,10 @@ cxx_print_type (FILE *file, tree node, int indent) print_node (file, "throws", TYPE_RAISES_EXCEPTIONS (node), indent + 4); return; + case RECORD_TYPE: + case UNION_TYPE: + break; + default: return; } |