[cfe-dev] Semantic form of InitListExpr node not flagged as value dependent.

Richard Smith richard at metafoo.co.uk
Thu Sep 13 09:22:29 PDT 2012


Yes, this looks like a bug. Please file it. Is there a testcase whose
behavior is affected by this issue?

On Thu, Sep 13, 2012 at 8:23 AM, Enea Zaffanella <zaffanella at cs.unipr.it>wrote:

> Ping.
>
>
> On 05/25/2012 03:35 PM, Enea Zaffanella wrote:
>
>> We have found a problem when visiting the AST for the following code:
>> =========================
>> template <int>
>> struct A {
>>     static const int i;
>> };
>>
>> template <int N>
>> const int A<N>::i = { N };
>> =========================
>>
>> When visiting the initializer of the out-of-line static field
>> definition, we see:
>>
>> (gdb) p node
>> $18 = (clang::InitListExpr *) 0x2ffd680
>> (gdb) call node->dump()
>> (InitListExpr 0x2ffd680 'int'
>>     (DeclRefExpr 0x2ffd610 'int' NonTypeTemplateParm 0x2ffd2a0 'N' 'int'))
>> (gdb) p node->isValueDependent()
>> $19 = false
>> (gdb) p node->getSyntacticForm()
>> $20 = (clang::InitListExpr *) 0x2ffd638
>> (gdb) call node->getSyntacticForm()->**dump()
>> (InitListExpr 0x2ffd638 'int'
>>     (DeclRefExpr 0x2ffd610 'int' NonTypeTemplateParm 0x2ffd2a0 'N' 'int'))
>> (gdb) p node->getSyntacticForm()->**isValueDependent()
>> $21 = true
>>
>> That is, the syntactic form of the init list expr is (correctly) flagged
>> as value dependent, but the semantic form is not.
>>
>> Enea.
>> ______________________________**_________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/**mailman/listinfo/cfe-dev<http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev>
>>
>>
> ______________________________**_________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/**mailman/listinfo/cfe-dev<http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120913/f14ec9d3/attachment.html>


More information about the cfe-dev mailing list