aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2006-01-28 19:28:01 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2006-01-28 19:28:01 +0000
commit7ca383e6791272a9f99390b5981ae476a9b490f1 (patch)
treecf01e7e1711bb0a24daf243f5df6daba7b5aa587 /gcc/testsuite
parente94aab95ee93fd7c5f31ad1ec5aecdb9c3c97453 (diff)
downloadgcc-7ca383e6791272a9f99390b5981ae476a9b490f1.zip
gcc-7ca383e6791272a9f99390b5981ae476a9b490f1.tar.gz
gcc-7ca383e6791272a9f99390b5981ae476a9b490f1.tar.bz2
re PR c++/25855 (template specialisation not always found (partial ordering))
PR c++/25855 * class.c (resolve_address_of_overloaded_function): Adjust use of return value from most_specialized_instantiation. * pt.c (determine_specialization): Avoid multiple calls to get_bindings. (most_specialized_instantiation): When a tie occurs, set the current presumed champion to the next template. Return the TREE_LIST node containing the template, rather than the template itself. (most_specialized): Remove. * name-lookup.c (push_overloaded_decl): When duplicate_decls indicates a failed redeclaration, report that to callers. PR c++/25855 * g++.dg/template/spec29.C: New test. From-SVN: r110332
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/template/spec29.C13
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2f2f8c6..70b6dee 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-01-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25855
+ * g++.dg/template/spec29.C: New test.
+
2006-01-28 Kazu Hirata <kazu@codesourcery.com>
PR c/19606.
diff --git a/gcc/testsuite/g++.dg/template/spec29.C b/gcc/testsuite/g++.dg/template/spec29.C
new file mode 100644
index 0000000..4df00ee
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/spec29.C
@@ -0,0 +1,13 @@
+// PR c++/25855
+// { dg-do run }
+
+template <typename T> int qCompare(const T *t1, const T *t2) { return 1; }
+template <typename T> int qCompare(T *t1, T *t2) { return 2; }
+template <typename T1, typename T2> int qCompare(const T1 *t1, const T2 *t2) {
+ return 3; }
+template<> int qCompare(const char *t1, const char *t2) { return 4; }
+int main()
+{
+ if (qCompare("a", "b") != 4)
+ return 1;
+}