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]

g++ template value parameter / partial specialization bug


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();
}



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