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

KARTHIKVENKATESH BHAT kv.bhat at samsung.com
Thu Oct 17 00:45:01 PDT 2013


Hi Richard,
Please find the modified patch. Using TypeSourceInfo to conclude in an array was of incomplete type.
Added a test case for the same.Please let me know if the patch is ok.
Thanks!

------- Original Message -------
Sender : Richard Smith<richard at metafoo.co.uk>
Date : Oct 15, 2013 13:36 (GMT+09:00)
Title : Re: [Patch] Unknown-bound array static data member of template shouldd be type dependent

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 --------------
A non-text attachment was scrubbed...
Name: dr408.patch
Type: application/octet-stream
Size: 1279 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131017/1e1dccf2/attachment.obj>


More information about the cfe-commits mailing list