File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2720,6 +2720,9 @@ namespace {
27202720 return false ;
27212721 }
27222722
2723+ if (!tok->tokAt (-1 ))
2724+ return false ;
2725+
27232726 // skip other using with this name
27242727 if (tok1->strAt (-1 ) == " using" ) {
27252728 // fixme: this is wrong
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ class TestSimplifyUsing : public TestFixture {
7777 TEST_CASE (simplifyUsing37);
7878 TEST_CASE (simplifyUsing38);
7979 TEST_CASE (simplifyUsing39);
80+ TEST_CASE (simplifyUsing40);
8081
8182 TEST_CASE (simplifyUsing8970);
8283 TEST_CASE (simplifyUsing8971);
@@ -939,6 +940,13 @@ class TestSimplifyUsing : public TestFixture {
939940 ASSERT_EQUALS (" " , errout_str ());
940941 }
941942
943+ void simplifyUsing40 () {
944+ const char code[] = " uint8_t f();\n " // #14876
945+ " using ::std::uint8_t;" ;
946+ const char expected[] = " uint8_t f ( ) ;" ;
947+ ASSERT_EQUALS (expected, tok (code));
948+ }
949+
942950 void simplifyUsing8970 () {
943951 const char code[] = " using V = std::vector<int>;\n "
944952 " struct A {\n "
You can’t perform that action at this time.
0 commit comments