This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30836] New: template T[] doesn't catch T[5]
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Feb 2007 17:48:56 -0000
- Subject: [Bug c++/30836] New: template T[] doesn't catch T[5]
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The code:
#include <iostream>
template<typename T> struct foo {
static const int i = 0; };
template<>
template<typename U> struct foo<U[]> {
static const int i = 1; };
int main() {
int v[5];
std::cerr << foo<int[5]>::i << ":" << foo<int[]>::i << "\n";
return 0;
}
prints:
0:1
which shows that int[5] is not caught by a T[] specialization. This may be the
standard, but I'm not sure and submit it anyway in case it's a bug.
--
Summary: template T[] doesn't catch T[5]
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30836