Fix binding of nodes in case of forEach..() matchers.
authorDaniel Jasper <djasper@google.com>
Sun, 11 Nov 2012 22:14:55 +0000 (22:14 +0000)
committerDaniel Jasper <djasper@google.com>
Sun, 11 Nov 2012 22:14:55 +0000 (22:14 +0000)
commit33806cdefcffb091515bc329158d8c05714aa01a
treec6e61cc59a7223c299e05c11f30a32d6fe125c3b
parent07351f8e78b415907342591a5a067e9efcd837e4
Fix binding of nodes in case of forEach..() matchers.

When recursively visiting the generated matches, the aggregated bindings need
to be copied during the recursion. Otherwise, we they might not be properly
overwritten (which is shown by the test), or there might be bound nodes present
that were bound on a different matching branch.

Review: http://llvm-reviews.chandlerc.com/D112
llvm-svn: 167695
clang/include/clang/ASTMatchers/ASTMatchersInternal.h
clang/lib/ASTMatchers/ASTMatchersInternal.cpp
clang/unittests/ASTMatchers/ASTMatchersTest.cpp
clang/unittests/ASTMatchers/ASTMatchersTest.h