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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to