Skip to content

Commit

Permalink
Revert "Handle member access"
Browse files Browse the repository at this point in the history
This reverts commit 8ed71d7.
  • Loading branch information
chrchr-github committed Oct 6, 2023
1 parent 8ed71d7 commit ad668a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/astutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1506,11 +1506,11 @@ bool isSameExpression(bool cpp, bool macro, const Token *tok1, const Token *tok2
if (cpp) {
if (tok1->str() == "." && tok1->astOperand1() && tok1->astOperand1()->str() == "this")
tok1 = tok1->astOperand2();
while (Token::Match(tok1, "::|.") && tok1->astOperand2())
while (Token::simpleMatch(tok1, "::") && tok1->astOperand2())
tok1 = tok1->astOperand2();
if (tok2->str() == "." && tok2->astOperand1() && tok2->astOperand1()->str() == "this")
tok2 = tok2->astOperand2();
while (Token::Match(tok2, "::|.") && tok2->astOperand2())
while (Token::simpleMatch(tok2, "::") && tok2->astOperand2())
tok2 = tok2->astOperand2();
}
// Skip double not
Expand Down
7 changes: 2 additions & 5 deletions test/testother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6881,8 +6881,6 @@ class TestOther : public TestFixture {
"};\n"
"void g() {\n"
" if (0 > S::I) {}\n"
" S s;\n"
" if (0 > s.I) {}\n"
" if (0 > S::E0) {}\n"
" if (0 > S::F::F0) {}\n"
"}\n");
Expand All @@ -6891,9 +6889,8 @@ class TestOther : public TestFixture {
"[test.cpp:8]: (style) The comparison '0 > E0' is always false.\n"
"[test.cpp:9]: (style) The comparison '0 > S::E0' is always false.\n"
"[test.cpp:2] -> [test.cpp:13]: (style) The comparison '0 > S::I' is always false.\n"
"[test.cpp:2] -> [test.cpp:15]: (style) The comparison '0 > s.I' is always false.\n"
"[test.cpp:16]: (style) The comparison '0 > S::E0' is always false.\n"
"[test.cpp:17]: (style) The comparison '0 > S::F::F0' is always false.\n",
"[test.cpp:14]: (style) The comparison '0 > S::E0' is always false.\n"
"[test.cpp:15]: (style) The comparison '0 > S::F::F0' is always false.\n",
errout.str());
}

Expand Down

0 comments on commit ad668a5

Please sign in to comment.