This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
C++: variable length arrays and operator new[]
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 20 Sep 2009 09:59:01 +0000
- Subject: C++: variable length arrays and operator new[]
G++ currently accepts the following code:
char *
alloc(unsigned a, unsigned b)
{
typedef char array[a];
return &**(new array[b]);
}
Is this intentional? The equivalent "new char[a][b]" is rejected (as
required by the C++ standard).