This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25855] template specialisation not always found (partial ordering)
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jan 2006 14:29:00 -0000
- Subject: [Bug c++/25855] template specialisation not always found (partial ordering)
- References: <bug-25855-3563@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #10 from pinskia at gcc dot gnu dot org 2006-01-19 14:29 -------
Here is what is happening here:
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; }
The last qCompare is specializing qCompare(const T1 *t1, const T2 *t2) but we
are choosing the first one as shown by the example DR 214.
So I think this bug is in fact invalid and GCC is doing the correct thing
according to these DR's.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25855