The test case below declares 3 global functions with exactly the 
same signature, and another 3 member functions with the same signature.

The last of these is incorrectly rejected.

$ cat junk.cc
#include <vector>

using namespace std;

void foo11(const vector<char> & = vector<char>());
void foo12(const vector< char, allocator< char> >  & =
           vector< char > ()); 
void foo13(const vector< char, allocator< char> >  & = 
           vector< char, allocator< char> > ()); 

struct Foo {
    void foo21(const vector<char> & = vector<char>());
    void foo22(const vector< char, allocator< char> >  & = 
               vector< char > ()); 
    void foo23(const vector< char, allocator< char> >  & = 
               vector< char, allocator< char> > ()); 
};

$ /usr/local/gcc-4.3-20061104/bin/g++ -c junk.cc 
junk.cc:16: error: expected ',' or '...' before '>' token
junk.cc:16: error: template argument 1 is invalid
junk.cc:16: error: template argument 2 is invalid
junk.cc:16: error: default argument missing for parameter 2 of 'void
Foo::foo23(const std::vector<char, std::allocator<char> >&,
std::allocator<char>)'


-- 
           Summary: gcc rejects valid default template parameter
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ppluzhnikov at charter dot net
 GCC build triplet: i686-pc-linux-gnu/
  GCC host triplet: i686-pc-linux-gnu/
GCC target triplet: i686-pc-linux-gnu/


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

Reply via email to