This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/25855] template specialisation not always found



------- Comment #2 from mueller at kde dot org  2006-01-19 11:13 -------
attaching testcase inline for better bugzilla queries: 

#ifdef BREAK
    template <typename T>               bool qCompare(const T *t1, const T
*t2);
    template <typename T>               bool qCompare(T *t1, T *t2);
#else
    template <typename T>               bool qCompare(T *t1, T *t2);
    template <typename T>               bool qCompare(const T *t1, const T
*t2);
#endif
    template <typename T1, typename T2> bool qCompare(const T1 *t1, const T2
*t2);
#ifdef WORKAROUND
    template<>                          bool qCompare<char>(const char *t1,
const char *t2)
#else
    template<>                          bool qCompare(const char *t1, const
char *t2)
#endif
    {
      return true;
    }

int main()
{
  return !qCompare("a", "b");
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25855


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]