[LLVMbugs] [Bug 13898] New: Results of bind on sub-matchers of forEachDescendant aren't updated

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Sep 21 09:18:11 PDT 2012


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

             Bug #: 13898
           Summary: Results of bind on sub-matchers of forEachDescendant
                    aren't updated
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: magnus.reftel at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9247
  --> http://llvm.org/bugs/attachment.cgi?id=9247
Small testcase that should dump two different declarations.

When using bind() on the descendant-matcher of a forEachDescendant, the values
received from r.Nodes.getNodeAs in the callback are always the values of the
first match. They should be updated to reflect each different match.

The attached testcase attempts to dump each DeclStmt of a function, but as can
be seen from the below example, it prints the first one every time.

$ cat input.c
int main(int argc, char* argv[])
{
        int i;
        int j;
        return 0;
}
$ ./testcase input.c
Processing: /path/to/here/input.c.
(DeclStmt 0x130bcc8
  0x130bc70 "int i")
(DeclStmt 0x130bcc8
  0x130bc70 "int i")
$

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