[all-commits] [llvm/llvm-project] 586f13: [AST Matchers] Fix bug in 'optionally' matcher whe...

Yitzhak Mandelbaum via All-commits all-commits at lists.llvm.org
Fri Feb 28 10:47:01 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 586f13aeac3fd51916774f523e30f0aee2b62d46
      https://github.com/llvm/llvm-project/commit/586f13aeac3fd51916774f523e30f0aee2b62d46
  Author: Yitzhak Mandelbaum <yitzhakm at google.com>
  Date:   2020-02-28 (Fri, 28 Feb 2020)

  Changed paths:
    M clang/lib/ASTMatchers/ASTMatchersInternal.cpp
    M clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp

  Log Message:
  -----------
  [AST Matchers] Fix bug in 'optionally' matcher wherein all previous bindings are cleared when all inner matchers fail.

Summary: The implementation of 'optionally' doesn't preserve bindings when none of the submatchers succeed. This patch adds a regression test for that behavior and fixes it.

Reviewers: aaron.ballman, sbenza

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D75365




More information about the All-commits mailing list