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

Enea Zaffanella zaffanella at cs.unipr.it
Thu Sep 13 08:23:47 PDT 2012


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
>




More information about the cfe-dev mailing list