File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6359,6 +6359,8 @@ void Tokenizer::dump(std::ostream &out) const
63596359 outs += " isAttributeMaybeUnused=\" true\" " ;
63606360 if (tok->isAttributeUnused ())
63616361 outs += " isAttributeUnused=\" true\" " ;
6362+ if (tok->isAttributeUsed ())
6363+ outs += " isAttributeUsed=\" true\" " ;
63626364 if (tok->isAttributeFallthrough ())
63636365 outs += " isAttributeFallthrough=\" true\" " ;
63646366 if (tok->isInitBracket ())
Original file line number Diff line number Diff line change @@ -537,6 +537,7 @@ class TestTokenizer : public TestFixture {
537537 TEST_CASE (simplifyPlatformTypes);
538538
539539 TEST_CASE (dumpFallthrough);
540+ TEST_CASE (dumpAttributeUsed);
540541
541542 TEST_CASE (simplifyRedundantParentheses);
542543
@@ -9389,6 +9390,16 @@ class TestTokenizer : public TestFixture {
93899390 ASSERT (dump.find (" isAttributeFallthrough=\" true\" " ) != std::string::npos);
93909391 }
93919392
9393+ void dumpAttributeUsed () {
9394+ const char code[] = " static int x __attribute__((used));\n " ;
9395+ SimpleTokenizer tokenizer (settingsDefault, *this , false );
9396+ ASSERT (tokenizer.tokenize (code));
9397+ std::ostringstream ostr;
9398+ tokenizer.dump (ostr);
9399+ const std::string dump = ostr.str ();
9400+ ASSERT (dump.find (" isAttributeUsed=\" true\" " ) != std::string::npos);
9401+ }
9402+
93929403 void simplifyRedundantParentheses () {
93939404 const char code[] = " int f(struct S s) {\n "
93949405 " return g(1, &(int){ s.i });\n "
You can’t perform that action at this time.
0 commit comments