This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20295] New: template fails to match empty array
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Mar 2005 23:44:05 -0000
- Subject: [Bug c++/20295] New: template fails to match empty array
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In:
template<typename T, int n>
void thru(T (&arr)[n]) {}
int a0[] = {};
int a1[] = {0};
int main() {
thru(a1);
thru(a0);
}
you get:
~/ootbc/members/src$ g++ foo.cc
foo.cc: In function `int main()':
foo.cc:9: error: no matching function for call to `thru(int[0u])'
I think zero is still an int, at least the last time I heard :-)
Ivan
--
Summary: template fails to match empty array
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=20295