This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]