Skip to content

Commit 3c157f5

Browse files
Update testtokenize.cpp
1 parent 2d40fe5 commit 3c157f5

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

test/testtokenize.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,10 @@ class TestTokenizer : public TestFixture {
350350
TEST_CASE(simplifyOperatorName27);
351351
TEST_CASE(simplifyOperatorName28);
352352
TEST_CASE(simplifyOperatorName29); // spaceship operator
353+
TEST_CASE(simplifyOperatorName30);
353354
TEST_CASE(simplifyOperatorName31); // #6342
354355
TEST_CASE(simplifyOperatorName32); // #10256
355356
TEST_CASE(simplifyOperatorName33); // #10138
356-
TEST_CASE(simplifyOperatorName34);
357357

358358
TEST_CASE(simplifyOverloadedOperators1);
359359
TEST_CASE(simplifyOverloadedOperators2); // (*this)(123)
@@ -5605,6 +5605,20 @@ class TestTokenizer : public TestFixture {
56055605
ASSERT_EQUALS("auto operator<=> ( ) ;", tokenizeAndStringify("auto operator<=>();", settings));
56065606
}
56075607

5608+
void simplifyOperatorName30() { // #14151
5609+
const char code[] = "struct S { int operator()() const { return 42; } };\n"
5610+
"int f() {\n"
5611+
" S s;\n"
5612+
" return int{ s.operator()() };\n"
5613+
"}\n";
5614+
ASSERT_EQUALS("struct S { int operator() ( ) const { return 42 ; } } ;\n"
5615+
"int f ( ) {\n"
5616+
"S s ;\n"
5617+
"return int { s . operator() ( ) } ;\n"
5618+
"}", tokenizeAndStringify(code));
5619+
ASSERT_EQUALS("", errout_str());
5620+
}
5621+
56085622
void simplifyOperatorName31() { // #6342
56095623
const char code[] = "template <typename T>\n"
56105624
"struct B {\n"
@@ -5628,20 +5642,6 @@ class TestTokenizer : public TestFixture {
56285642
ASSERT_EQUALS("", errout_str());
56295643
}
56305644

5631-
void simplifyOperatorName34() { // #14151
5632-
const char code[] = "struct S { int operator()() const { return 42; } };\n"
5633-
"int f() {\n"
5634-
" S s;\n"
5635-
" return int{ s.operator()() };\n"
5636-
"}\n";
5637-
ASSERT_EQUALS("struct S { int operator() ( ) const { return 42 ; } } ;\n"
5638-
"int f ( ) {\n"
5639-
"S s ;\n"
5640-
"return int { s . operator() ( ) } ;\n"
5641-
"}", tokenizeAndStringify(code));
5642-
ASSERT_EQUALS("", errout_str());
5643-
}
5644-
56455645
void simplifyOverloadedOperators1() {
56465646
const char code[] = "struct S { void operator()(int); };\n"
56475647
"\n"

0 commit comments

Comments
 (0)