summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-22 11:02:00 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-22 11:02:00 +0000
commit50d32ef1f1f2400cd88557d950600a5701b0e2b9 (patch)
treefb823f930efc33f1a9a8d837229a9125f51c63f5
parenta4871ae053f71339b0a93a4c134530c6b86274ea (diff)
downloadppe42-gcc-50d32ef1f1f2400cd88557d950600a5701b0e2b9.tar.gz
ppe42-gcc-50d32ef1f1f2400cd88557d950600a5701b0e2b9.zip
/testsuite
2008-02-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 * g++.dg/template/nontype17.C: Add. /cp 2008-02-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 Revert: 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-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 Revert: 2008-02-14 Paolo Carlini <pcarlini@suse.de> PR c++/28743 * g++.dg/template/nontype17.C: New. * g++.dg/template/nontype16.C: Add error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132543 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog10
-rw-r--r--gcc/cp/pt.c9
-rw-r--r--gcc/testsuite/ChangeLog15
-rw-r--r--gcc/testsuite/g++.dg/template/nontype16.C2
-rw-r--r--gcc/testsuite/g++.dg/template/nontype17.C6
5 files changed, 35 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b300db04bff..19c34ba5cfa 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,13 @@
+2008-02-22 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/35282
+ Revert:
+ 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-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR c/19999
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index e45f6da91e7..2a54986c551 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1563,9 +1563,12 @@ 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
- && !compparms (fn_arg_types, decl_arg_types))
- continue;
+ if (tsk == tsk_template)
+ {
+ if (compparms (fn_arg_types, decl_arg_types))
+ candidates = tree_cons (NULL_TREE, fn, candidates);
+ continue;
+ }
/* See whether this function might be a specialization of this
template. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 493effcce42..053949b98c2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,18 @@
+2008-02-22 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/35282
+ * g++.dg/template/nontype17.C: Add.
+
+2008-02-22 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/35282
+ Revert:
+ 2008-02-14 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/28743
+ * g++.dg/template/nontype17.C: New.
+ * g++.dg/template/nontype16.C: Add error.
+
2008-02-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR c/19999
diff --git a/gcc/testsuite/g++.dg/template/nontype16.C b/gcc/testsuite/g++.dg/template/nontype16.C
index 4b9f7602876..36d1e9564a0 100644
--- a/gcc/testsuite/g++.dg/template/nontype16.C
+++ b/gcc/testsuite/g++.dg/template/nontype16.C
@@ -5,5 +5,5 @@ template<int> struct A
template<typename> void foo();
};
-template<> template<struct T> void A<0>::foo() {} // { dg-error "not a valid type|match" }
+template<> template<struct T> void A<0>::foo() {} // { dg-error "not a valid type" }
diff --git a/gcc/testsuite/g++.dg/template/nontype17.C b/gcc/testsuite/g++.dg/template/nontype17.C
index c8f3404dea7..f3a4480c9e3 100644
--- a/gcc/testsuite/g++.dg/template/nontype17.C
+++ b/gcc/testsuite/g++.dg/template/nontype17.C
@@ -1,8 +1,8 @@
-// PR c++/28743
+// PR c++/35282
template<int> struct A
{
- template<typename> void foo();
+ template<int> void foo();
};
-template<int> template<typename> void A<0>::foo() {} // { dg-error "match" }
+template<> template<int> void A<0>::foo() {}
OpenPOWER on IntegriCloud