This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: C++14 implementation status


On Mon, 10 Jun 2013, Ed Smith-Rowland wrote:

The real pickle for dynarray is that, AFAICT, if you really want to support arrays on the stack you would need to intercept construction of dynarray in the front end and have the front end pass an appropriately sized VLA pointer to dynarray basically. (The VLA/alloca'd array must be built in the calling stack frame not the ctor frame).

Note that an alternative implementation might be possible using an extension that would allow default argument values to refer to previous arguments, like:

  void f(int n, void *p=alloca(n));

where alloca would happen in the caller's frame. Using the always_inline attribute could be another one.

It is probably better to introduce the magic anyway, just mentioning it.

--
Marc Glisse


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