[all-commits] [llvm/llvm-project] 04a02c: [ASTMatchers] forCallable should not erase binding...

Marco Borgeaud via All-commits all-commits at lists.llvm.org
Wed Jun 5 01:20:59 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 04a02c1b88cfb8445ce962ba5ce496401a3e27fe
      https://github.com/llvm/llvm-project/commit/04a02c1b88cfb8445ce962ba5ce496401a3e27fe
  Author: Marco Borgeaud <marco.borgeaud at sonarsource.com>
  Date:   2024-06-05 (Wed, 05 Jun 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/ASTMatchers/ASTMatchers.h
    M clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp

  Log Message:
  -----------
  [ASTMatchers] forCallable should not erase binding on success (#89657)

Do not erase Builder when the first check fails because it could succeed
on the second stack frame.

The problem was that `InnerMatcher.matches` erases the bindings when it
returns false. The appropriate solution is to pass a copy of the
bindings, similar to what `matchesFirstInRange` does.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list