<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/66047>66047</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] lack comparison of declRefExpr in ASTStructuralEquivalence
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mzyKi
</td>
</tr>
</table>
<pre>
fixed in #66041
Before fix,the following testcase expected true. While I think only comparison of declName is not sufficient.Thanks for giving suggestions.
```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
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysU02PozgQ_TXmUprIKT5z4ACBSKudHY0mWW3fWo4pwNvGzmDTk95fvzJJd0utPk5UcsSDevV41BPOqcEQlSytWdpEYvGjncvpv5c_VXS23UvZqyt1oAwwjLOMJ1vGG8ar21lTb2eCXl0Z7v1I0Fut7S9lBvDkvBSOgK4Xkp468PNCG_hnVJrgD_CjMk9gjX4BaaeLmJWzBmwPHUn9TUwEyoGxHtzS90oqMn5zGoV5ctDbGQb1HKa4ZRjIeWWN29yFZfxW8nK5Iaf2eHo8MCyOfl6kX2ah25-LehaajKSjn_yJnGe4h4ak_kF9-822PxnugOX1jQLA-Y7FFYsr5-cw-PtMvboCixtgiGSWCQJLaIGqqgJbXdfA8obFNUMM551KLN6CX1sn8bQKcAyL19vh98qOdWB_tqqD3lqGhTIe1F2a6iEgwOIW-Cu20gYBcc3yBkg7esfrur7hoRAZ7n_j0DfyD0PfxHw69Ksww-P-4YHHwTLVBzeCGbgL9WZa-_C93Z8eD9XXY8uwCMv1_jX_El6OAX3rAoYHhofXttOPv9v7duTNhzW5XUZdGXe7eCciKrfZLkk5x5RHY5lt022f552kbXqWIjtvd1SIDEWSUFJgHqkSOcZ8t0WexTzJNlvKOp7EeS54IoqCs4TTJJTeaP08bew8RMq5hcoQpjzS4kzarfFDlFqY4e4RoqFfsD4akLSJ5jIwfDkvg2MJ18p5987plddrim8caQNayKdPohX2-3qZQ6Kr4-nTSETLrMvR-4sLK786OSg_LueNtBPDQxh6__tyme2_JD3DwyrVMTysL_Z_AAAA__8tp0dh">