[LLVMbugs] [Bug 13842] New: Semantic form of InitListExpr node not flagged as value dependent.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 13 14:18:19 PDT 2012


             Bug #: 13842
           Summary: Semantic form of InitListExpr node not flagged as
                    value dependent.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: zaffanella at cs.unipr.it
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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.

This can cause misbehavior of (third party) AST consumers querying the
dependency flags.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list