This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bug: template function ignored
- To: egcs-bugs at cygnus dot com
- Subject: Bug: template function ignored
- From: David Mazieres <dm at reeducation-labor dot lcs dot mit dot edu>
- Date: Thu, 11 Mar 1999 23:02:00 -0500 (EST)
This program demonstrates a bug in egcs 2.93.06.
% c++ -v
Reading specs from /u/dm/OSF1/lib/gcc-lib/alphaev56-dec-osf4.0c/egcs-2.93.06/specs
gcc version egcs-2.93.06 19990208 (gcc2 ss-980929 experimental)
% c++ -c sba.C
sba.C: In method `void prng::transform(struct sumbuf<5> *)':
sba.C:21: no matching function for call to `sumbufadd (sumbuf<16> *, sumbuf<16> *)'
sba.C:22: no matching function for call to `sumbufadd (sumbuf<16> *, sumbuf<5> *&, bool)'
For some reason, egcs is not seing the sumbufadd function.
Thanks,
David
===
#include <sys/types.h>
template<unsigned int N> struct sumbuf {};
template<size_t N, size_t M> inline bool
sumbufadd (sumbuf<N> *dst, const sumbuf<M> *src, bool carry = false)
{
return carry;
}
struct prng {
sumbuf<16> state;
sumbuf<16> input;
void transform (sumbuf<5> *);
};
void
prng::transform (sumbuf<5> *output)
{
sumbufadd (&input, &state);
sumbufadd (&state, output, true);
}