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

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


hfinkel added a subscriber: hfinkel.
hfinkel added a comment.

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

> En passant comment: I really wish we wouldn't.
>
> The C++ standard had some very careful considerations on VLAs and decided *not* to support. It wasn't for lack of interest, it was a well informed decision.


The decision might have been well informed, but it was really a lack of consensus. There was (and still is) a large fraction of the committee in favor of VLAs (or ARBs as they called them). There is also a large fraction of the committee opposed to them, or willing to accept them, but only if we could also add a library type with a better interface. There is a concern, which is not completely unreasonable, that if we make a point of adding this feature to the C++ standard, without adding a library container type, it will make people more likely to use "raw" arrays and pointers instead of using higher-level containers and iterators. It turns out, however, that it is not clear how such a library container could be implemented in practice.

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.


http://reviews.llvm.org/D18823





More information about the cfe-commits mailing list