#include <utility>
template < typename T > struct X { };
struct A
{
        void f( X< std::pair< int, int > > v = X< std::pair< int, int > >() );
};


$ g++ tmp.cpp -Wall -c
tmp.cpp:5: error: expected &#8216;,&#8217; or &#8216;...&#8217; before
&#8216;>&#8217; token
tmp.cpp:5: error: wrong number of template arguments (1, should be 2)
/usr/include/c++/4.1.2/bits/stl_pair.h:68: error: provided for
&#8216;template<class _T1, class _T2> struct std::pair&#8217;
tmp.cpp:5: error: template argument 1 is invalid
tmp.cpp:5: error: default argument missing for parameter 2 of &#8216;void
A::f(X<std::pair<int, int> >, int)&#8217;


online comeau compiler accepts this testcase.


-- 
           Summary: parser error, reject valid code.
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net
GCC target triplet: *-linux


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

Reply via email to