This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23823] New: Is this right?
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Sep 2005 13:33:59 -0000
- Subject: [Bug c++/23823] New: Is this right?
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
struct foo {
template<bool b>
void f();
template<typename T, bool b>
void g();
};
template<>
void foo::f<true>() {}
template<>
void foo::f<false>() {}
template<typename T>
void foo::g<T, true>() {}
template<typename T>
void foo::g<T, false>() {}
gets you:
~/ootbc/members/src$ g++ foo.cc
foo.cc:13: error: partial specialization `g<T, true>' of function template
foo.cc:13: error: got 1 template parameters for `void foo::g()'
foo.cc:13: error: but 2 required
foo.cc:15: error: partial specialization `g<T, false>' of function template
foo.cc:15: error: redefinition of `void foo::g()'
foo.cc:13: error: `void foo::g()' previously declared here
foo.cc:15: error: got 1 template parameters for `void foo::g()'
foo.cc:15: error: but 2 required
The error message is hosed, because there are in fact two parameters. Not sure
whether the code is valid or not (but it should be :-)
--
Summary: Is this right?
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23823