[Bug c++/26615] New: compute size of static table in compile time rejected.
pluto at agmk dot net
gcc-bugzilla@gcc.gnu.org
Thu Mar 9 09:13:00 GMT 2006
#include <cstdio>
template < typename T, std::size_t N >
char[N] sizer( T (&array)[N] ); <=== gcc error:
expected unqualified-id before ‘[’
token
int main()
{
int t[15];
printf("%Zd\n", sizeof(sizer(t)));
return 0;
}
--
Summary: compute size of static table in compile time rejected.
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pluto at agmk dot net
GCC build triplet: x86-64-linux
GCC host triplet: x86-64-linux
GCC target triplet: x86-64-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26615
More information about the Gcc-bugs
mailing list