[LLVMbugs] [Bug 3509] New: InitListExpr's getLocStart() incorrect

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Feb 7 12:40:27 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=3509

           Summary: InitListExpr's getLocStart() incorrect
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: AST
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: alexei.svitkine at gmail.com
                CC: llvmbugs at cs.uiuc.edu


It seems the start loc of an InitList points to the start token of the first
element in the list, rather than the {.

For example:

int a[10] = {0};

becomes:

(DeclStmt 0x1d06230
  0x1d061a0 "int a[10] =
    (InitListExpr 0x1d06250 'int [10]'
      (IntegerLiteral 0x1d061d0 'int' 0))"

getLocStart() on the InitListExpr ends up pointing at 0 rather than {.

This seems incorrect. (And I'm pretty sure its not an off-by-one error in my
code, since I get the correct result for other Exprs in a DeclStmt).


-- 
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