[Bug c++/35497] New: Compiling error with template part. spec. involving function call and >>

rodolfo at rodsoft dot org gcc-bugzilla@gcc.gnu.org
Fri Mar 7 14:49:00 GMT 2008


The following code gives a compiling error with gcc-4.3.0 with -std=c++0x:

template <class T> class A {};
template <class T> class B {};
template <class R, class X1> class A<B<R(X1)>> {};

main.cpp:3: error: a function call cannot appear in a constant-expression

While if we use > > (instead of >>) in the class specialization, it compiles
fine, as in:

template <class T> class A {};
template <class T> class B {};
template <class R, class X1> class A<B<R(X1)> > {};


-- 
           Summary: Compiling error with template part. spec. involving
                    function call and >>
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rodolfo at rodsoft dot org


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



More information about the Gcc-bugs mailing list