This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

member templates and default parameter


 the following code doesn't compile, even though I believe there is
nothing wrong with it.

struct Default{};

class Bar
{
public:
  template <typename T, typename P = Default>
  void foo(T t) {}
};

int main(int, char **)
{
  Bar b;
  b.foo(24);
}

bash$ g++ -c templ.cc
templ.cc:7: default argument for template parameter in function template `void 
   Bar::foo(T)'
templ.cc: In function `int main(int, char**)':
templ.cc:13: no matching function for call to `Bar::foo(int)'
bash$ 


Is this a known bug ?

Stefan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]