diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp
index 9b5c4f078506..b48f02d92dbb 100644
--- a/lib/tokenize.cpp
+++ b/lib/tokenize.cpp
@@ -9778,7 +9778,7 @@ void Tokenizer::simplifyOperatorName()
if (par->str() == "," && !op.empty())
break;
if (!(Token::Match(par, "<|>") && !op.empty())) {
- op += par->str();
+ op += par->str() == "." ? par->originalName() : par->str();
par = par->next();
done = false;
}
diff --git a/test/testclass.cpp b/test/testclass.cpp
index 356da84207fd..07915f6721e1 100644
--- a/test/testclass.cpp
+++ b/test/testclass.cpp
@@ -6287,8 +6287,7 @@ class TestClass : public TestFixture {
" P p;\n"
" void g() { p->f(); }\n"
"};\n");
- ASSERT_EQUALS("[test.cpp:11]: (style, inconclusive) Technically the member function 'S::g' can be const.\n",
- errout.str());
+ ASSERT_EQUALS("", errout.str());
checkConst("struct A {\n"
" void f(int) const;\n"
@@ -6302,7 +6301,7 @@ class TestClass : public TestFixture {
" P p;\n"
" void g() { p->f(1); }\n"
"};\n");
- ASSERT_EQUALS("[test.cpp:11]: (style, inconclusive) Technically the member function 'S::g' can be const.\n", errout.str());
+ ASSERT_EQUALS("", errout.str());
checkConst("struct A {\n"
" void f(void*) const;\n"
@@ -6319,7 +6318,7 @@ class TestClass : public TestFixture {
" P p;\n"
" std::vector g() { p->f(nullptr); return {}; }\n"
"};\n");
- ASSERT_EQUALS("[test.cpp:14]: (style, inconclusive) Technically the member function 'S::g' can be const.\n", errout.str());
+ ASSERT_EQUALS("", errout.str());
checkConst("struct A {\n"
" void f();\n"
@@ -8370,7 +8369,7 @@ class TestClass : public TestFixture {
"struct TPtr : public SPtr {\n"
" T* operator->() const { return (T*)p; }\n"
"};\n");
- ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:8]: (style) The function 'operator.' overrides a function in a base class but is not marked with a 'override' specifier.\n",
+ ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:8]: (style) The function 'operator->' overrides a function in a base class but is not marked with a 'override' specifier.\n",
errout.str());
}
diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp
index 0ff011e86374..8facb72b740c 100644
--- a/test/testtokenize.cpp
+++ b/test/testtokenize.cpp
@@ -4950,7 +4950,7 @@ class TestTokenizer : public TestFixture {
const char code[] = "void f() {"
"static_cast(xResult.operator->())->GetMatrix();"
"}";
- const char result[] = "void f ( ) { static_cast < ScToken * > ( xResult . operator. ( ) ) . GetMatrix ( ) ; }";
+ const char result[] = "void f ( ) { static_cast < ScToken * > ( xResult . operator-> ( ) ) . GetMatrix ( ) ; }";
ASSERT_EQUALS(result, tokenizeAndStringify(code));
}