diff options
author | Paolo Carlini <pcarlini@suse.de> | 2008-02-14 12:34:42 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2008-02-14 12:34:42 +0000 |
commit | 4571259b7a5875586d1579334aa9b944b103216b (patch) | |
tree | 2f1072d8d319f8bddd80a01dbf037db9911b292a /gcc/cp | |
parent | b49326f1ca9f1e9ec206d431643cf1996008fdcf (diff) | |
download | gcc-4571259b7a5875586d1579334aa9b944b103216b.zip gcc-4571259b7a5875586d1579334aa9b944b103216b.tar.gz gcc-4571259b7a5875586d1579334aa9b944b103216b.tar.bz2 |
re PR c++/28743 (ICE with invalid specialization)
/cp
2008-02-14 Paolo Carlini <pcarlini@suse.de>
PR c++/28743
* pt.c (determine_specialization): In case of function templates,
when the type of DECL does not match FN there is no match.
/testsuite
2008-02-14 Paolo Carlini <pcarlini@suse.de>
PR c++/28743
* g++.dg/template/nontype17.C: New.
* g++.dg/template/nontype16.C: Add error.
From-SVN: r132316
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c237abd..275ca4b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-02-14 Paolo Carlini <pcarlini@suse.de> + + PR c++/28743 + * pt.c (determine_specialization): In case of function templates, + when the type of DECL does not match FN there is no match. + 2008-02-13 Jakub Jelinek <jakub@redhat.com> Manuel Lopez-Ibanez <manu@gcc.gnu.org> diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 577b621..2e2a636 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1561,12 +1561,9 @@ determine_specialization (tree template_id, no partial specializations of functions. Therefore, if the type of DECL does not match FN, there is no match. */ - if (tsk == tsk_template) - { - if (compparms (fn_arg_types, decl_arg_types)) - candidates = tree_cons (NULL_TREE, fn, candidates); - continue; - } + if (tsk == tsk_template + && !compparms (fn_arg_types, decl_arg_types)) + continue; /* See whether this function might be a specialization of this template. */ |