File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -2697,6 +2697,9 @@ namespace {
26972697 return false ;
26982698 }
26992699
2700+ if (tok1->tokAt (-1 )->tokType () == Token::eType || tok1->tokAt (-1 )->tokType () == Token::eName)
2701+ return false ;
2702+
27002703 if (Token::Match (tok1->tokAt (-1 ), " class|struct|union|enum|namespace" )) {
27012704 // fixme
27022705 return false ;
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ class TestSimplifyUsing : public TestFixture {
7474 TEST_CASE (simplifyUsing35);
7575 TEST_CASE (simplifyUsing36);
7676 TEST_CASE (simplifyUsing37);
77+ TEST_CASE (simplifyUsing38);
7778
7879 TEST_CASE (simplifyUsing8970);
7980 TEST_CASE (simplifyUsing8971);
@@ -914,6 +915,16 @@ class TestSimplifyUsing : public TestFixture {
914915 ASSERT_EQUALS (" " , errout_str ());
915916 }
916917
918+ void simplifyUsing38 () {
919+ const char code[] = " using std::begin;\n " // #14424
920+ " using std::end;\n "
921+ " Unknown begin;\n "
922+ " int end;\n " ;
923+ const char expected[] = " Unknown begin ; int end ;" ;
924+ ASSERT_EQUALS (expected, tok (code));
925+ ASSERT_EQUALS (" " , errout_str ());
926+ }
927+
917928 void simplifyUsing8970 () {
918929 const char code[] = " using V = std::vector<int>;\n "
919930 " struct A {\n "
You can’t perform that action at this time.
0 commit comments