[all-commits] [llvm/llvm-project] 354216: [clang][AST] fix lack comparison of declRefExpr in...

Sunrise via All-commits all-commits at lists.llvm.org
Wed Sep 20 23:55:33 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3542168be0a0f3bb88b5298e4463c185a69f0357
      https://github.com/llvm/llvm-project/commit/3542168be0a0f3bb88b5298e4463c185a69f0357
  Author: Sunrise <2094247798 at qq.com>
  Date:   2023-09-21 (Thu, 21 Sep 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/ASTStructuralEquivalence.cpp
    M clang/unittests/AST/StructuralEquivalenceTest.cpp

  Log Message:
  -----------
  [clang][AST] fix lack comparison of declRefExpr in ASTStructuralEquivalence (#66041)

Fixed #66047
Before fix,the following testcase expected true.
```cpp
TEST_F(StructuralEquivalenceStmtTest, DeclRefENoEq) {
  std::string Prefix = "enum Test { AAA, BBB };";
  auto t = makeStmts(
      Prefix + "void foo(int i) {if (i > 0) {i = AAA;} else {i = BBB;}}",
      Prefix + "void foo(int i) {if (i > 0) {i = BBB;} else {i = AAA;}}",
      Lang_CXX03, ifStmt());
  EXPECT_FALSE(testStructuralMatch(t)); // EXPECT_TRUE
}
```




More information about the All-commits mailing list