This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: C++14 implementation status
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Ed Smith-Rowland <3dw4rd at verizon dot net>
- Cc: Jonathan Wakely <jwakely dot gcc at gmail dot com>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 10 Jun 2013 17:45:10 +0200 (CEST)
- Subject: Re: C++14 implementation status
- References: <CAH6eHdQb=PhvSVhE79Gv_0CxNq1PNDAtnHqRN+qAHn3-rhtWzA at mail dot gmail dot com> <51B5EFD6 dot 4060806 at verizon dot net>
- Reply-to: libstdc++ at gcc dot gnu dot org
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