This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
member templates and default parameter
- To: gcc at gcc dot gnu dot org
- Subject: member templates and default parameter
- From: Stefan Seefeld <seefeld at sympatico dot ca>
- Date: Wed, 21 Mar 2001 20:23:37 -0500
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