[Patch] Unknown-bound array static data member of template shouldd be type dependent

Richard Smith richard at metafoo.co.uk
Mon Oct 14 21:34:32 PDT 2013


The addition of WasIncompleteArray pushes us up to 33 bits in VarDecl, and
will cause us to use more memory on 32-bit systems. Do you really need to
store this bit? This seems like something that could be reconstructed from
the TypeSourceInfo.

Instead of setting a flag on the variable, how about directly giving the
definition of the variable a dependent type?

On Mon, Oct 7, 2013 at 2:25 AM, KARTHIKVENKATESH BHAT
<kv.bhat at samsung.com>wrote:

> Hi All,
> Please find attached the patch to fix issue #408 discussed at
> http://open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html
> As per this "An explicit specialization of a static data member declared
> as an array of unknown bound can have a different bound from its
> definition, if any" .
>
> This fixes the problem in which clang fails to produce executable in these
> cases- e.g. http://searchcode.com/codesearch/raw/8024712
>
> The patch tests that if a static data member of a current instantiation is
> incomplete array type mark it as type dependent.  This is similar to the
> way it is currently fixed in gcc.
> I'm not sure were the TC for this patch will go hence not added a TC for
> now.
>
> Please let me know if the patch looks good.
>
> Thanks and Regards
> Karthik Bhat
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131014/2601611d/attachment.html>


More information about the cfe-commits mailing list