This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21661] New: Inconsistent function/constructor template requirements
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 May 2005 09:40:51 -0000
- Subject: [Bug c++/21661] New: Inconsistent function/constructor template requirements
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In:
template<typename T, typename U>
void foo(U u) {}
template<typename T, typename U>
struct bar {
bar(U u) {}
};
int main() {
foo<int>(true);
bar<int>(true);
}
you get:
foo.cc: In function `int main()':
foo.cc:11: error: wrong number of template arguments (1, should be 2)
foo.cc:5: error: provided for `template<class T, class U> struct bar'
Shouldn't both the call and the constructor require two args, or both require
only one? I thought constructors resolved like functions.
Ivan
--
Summary: Inconsistent function/constructor template requirements
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=21661