This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ template value parameter / partial specialization bug
- To: gcc-bugs at gcc dot gnu dot org
- Subject: g++ template value parameter / partial specialization bug
- From: Jens Maurer <jmaurer at menuett dot rhein-main dot de>
- Date: Wed, 23 Feb 2000 11:13:13 +0100
Hello,
I tried to compile the enclosed program with
gcc version 2.95.2 19991024 (release)
gcc version 2.96 20000221 (experimental)
on Linux kernel 2.2.13, glibc 2.1.2.
The error message was in both cases
value-partial-special.cc: In function `int main()':
value-partial-special.cc:14: no method `X<int,5,true>::doit'
Obviously, the compiler does not use the partial specialization
provided and thus fails to find the method doit().
Leaving out the "IntType x" template value parameter makes the
example compile.
Jens Maurer.
// leave out the "IntType x" template value parameter and it works.
template<class IntType, IntType x, bool v>
struct X;
template<class IntType, IntType x>
struct X<IntType, x, true>
{
static void doit() { }
};
int main()
{
X<int, 5, true>::doit();
}