[PATCH] D18823: Implementation of VlA of GNU C++ extension

Hal Finkel via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 11 08:53:55 PDT 2016


hfinkel added a comment.

In http://reviews.llvm.org/D18823#397122, @rengolin wrote:

> In http://reviews.llvm.org/D18823#397112, @hfinkel wrote:
>
> > However, as an implementation extension, this concern is not relevant. I'm in favor of this; I have uses who use this feature in GCC. It is certainly true that most HPC users are using these on PODs, but the fact that you cannot apply them to other types creates a problem with generic programming that people have run into.
>
>
> Sounds odd to argue in favour of generic programming and not in favour of using generic standard containers.
>
> I can easily accept the legacy argument, but creating new code with contentious features seems totally backwards to me.


It comes up in cases where you're writing templates that are normally used with PODs and the relevant types, but don't want them to completely fail when used with other types (class for extended precision floats, or those doing forward automated differentiation, etc.).

Using VLAs in C++, as a general statement, is one of the most common language extensions I see used. It is used in new code regularly, and is often critical for performance (i.e. to avoid calls to the memory allocator). Using them on on-PODs is certainly less common, but still comes up.


http://reviews.llvm.org/D18823





More information about the cfe-commits mailing list