18140 – [3.4/4.0 regression] C++ parser bug when using >> in templates (original) (raw)

Description Markus F.X.J. Oberhumer 2004-10-25 09:42:51 UTC

gcc incorrectly rejects the following template code - seems to be a bug in the new (gcc 3.4) C++ parser.

g++-4.0 -Wall -W x.cpp x.cpp:6: error: spurious '>>', use '>' to terminate a template argument list x.cpp:6: error: expected primary-expression before "S" x.cpp:6: error: expected %<;%> before "S"

template struct IntHolder { static const int value = N; };

template <int N, int S> struct ShrIntHolder { static const int value = IntHolder< N>>S >::value; };