File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10890,6 +10890,8 @@ void Tokenizer::simplifyOperatorName()
1089010890 op += par->strAt (1 );
1089110891 par = par->tokAt (2 );
1089210892 done = true ;
10893+ } else if (par->str () != " (" ) {
10894+ syntaxError (par);
1089310895 }
1089410896 }
1089510897
Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ class TestGarbage : public TestFixture {
237237 TEST_CASE (garbageCode203); // #8972
238238 TEST_CASE (garbageCode204);
239239 TEST_CASE (garbageCode205);
240+ TEST_CASE (garbageCode206);
240241
241242 TEST_CASE (garbageCodeFuzzerClientMode1); // test cases created with the fuzzer client, mode 1
242243
@@ -1625,6 +1626,15 @@ class TestGarbage : public TestFixture {
16251626 " }" ); // don't crash
16261627 }
16271628
1629+ void garbageCode206 () {
1630+ {
1631+ ASSERT_EQUALS (" [test.cpp:1] syntax error" , getSyntaxError (" void foo() { for (auto operator new : int); }" ));
1632+ }
1633+ {
1634+ ASSERT_EQUALS (" [test.cpp:1] syntax error" , getSyntaxError (" void foo() { for (a operator== :) }" ));
1635+ }
1636+ }
1637+
16281638 void syntaxErrorFirstToken () {
16291639 ASSERT_THROW (checkCode (" &operator(){[]};" ), InternalError); // #7818
16301640 ASSERT_THROW (checkCode (" *(*const<> (size_t); foo) { } *(*const (size_t)() ; foo) { }" ), InternalError); // #6858
You can’t perform that action at this time.
0 commit comments