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 <int N> struct IntHolder {
    static const int value = N;
};

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

-- 
           Summary: C++ parser bug when using shr (>>) in templates
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: markus at oberhumer dot com
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to