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

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


Oh, and please do include a test. Feel free to start a
test/CXX/drs/dr4xx.cpp for this.


On Mon, Oct 14, 2013 at 9:34 PM, Richard Smith <richard at metafoo.co.uk>wrote:

> 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/ed0ba3f6/attachment.html>


More information about the cfe-commits mailing list