To POD or not to POD

Iain Buclaw ibuclaw at ubuntu.com
Wed Feb 13 06:10:26 PST 2013


On 13 February 2013 13:26, Johannes Pfau <nospam at example.com> wrote:

> Am Tue, 12 Feb 2013 18:16:31 +0000
> schrieb Iain Buclaw <ibuclaw at ubuntu.com>:
>
> > TREE_ADDRESSABLE should be sufficient.  I can't think any reason off
> > the top of my head why not.
> >
>
> maybe TREE_ADDRESSABLE is too strong: It generates errors in the
> backend if the frontend produces non-lvalues:
> ---
>     auto b = Date();
>     a(b);
> ---
>
> works, but
> ---
>     a(Date());
> ---
>
> fails in gimplify.c. Do we really have to rewrite such cases so that
> non-PODs get a temporary variable? And how would this be done? It seems
> we would have to use the frontend for this, as maybeMakeTemp  and
> makeTemp refuse to work for TREE_ADDRESSABLE types.
>

Don't set it on the variable, set it on the type.

TypeStruct::toCtype()
{
    TYPE_ADDRESSABLE(ctype) = !isPOD();
}



-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20130213/06930fd0/attachment.html>


More information about the D.gnu mailing list