g++ allows variable array creation

Gabriel Dos Reis gdr@integrable-solutions.net
Mon Jan 19 16:42:00 GMT 2004


Andrew Pinski <pinskia@physics.uc.edu> writes:

| On Jan 19, 2004, at 03:31, Omar Shaikh wrote:
| 
| > Dear All
| >
| > I found something in the GNU compiler that I am not
| > sure is a bug or the latest change to the C++
| > standard. However, the same did not work in Microsoft
| > C++ (v. 13.10.3077), the C++ compiler that comes with
| > Microsoft .NET product. I ran this code on both Win32
| > and Linux platforms with full warnings on (-Wall).
| > Surprisingly, there were no warnings either.
| 
| 
| That is because VLA is part of GNU C, C99, and GNU C++ and will most
| likely part of a future
| C++ standard (if not already part of a draft).  To get a warning from
| GCC use -pedantic.

VLA is part of no C++ standard draft I know of.  Variably modified
types come with their hosts of problems.  How they should interact
with the C++ type system, especially templates, is yet not determined.
And I have seen no proposal to enlighten that point.  
IMHO, it is unlikely that such beasts would be made part of C++ if they
can't play with templates .
And of course, we do have PRs about VLAs in C++ (either with classes
or templates) :-) 

-- Gaby



More information about the Gcc-bugs mailing list