File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1346,7 +1346,7 @@ void CheckClass::privateFunctions()
13461346 privateFuncs.pop_front ();
13471347 continue ;
13481348 }
1349- if (pf->tokenDef && pf->tokenDef ->isAttributeMaybeUnused ()) {
1349+ if (pf->tokenDef && ( pf->tokenDef ->isAttributeMaybeUnused () || pf-> tokenDef -> isAttributeUnused () )) {
13501350 privateFuncs.pop_front ();
13511351 continue ;
13521352 }
Original file line number Diff line number Diff line change @@ -896,6 +896,12 @@ class TestUnusedPrivateFunction : public TestFixture {
896896 " __attribute__((unused)) int f() { return 42; }\n "
897897 " };" );
898898 ASSERT_EQUALS (" " , errout_str ());
899+
900+ check (" class C {\n "
901+ " __attribute__((unused)) int f();\n "
902+ " };\n "
903+ " int C::f() { return 42; }\n " );
904+ ASSERT_EQUALS (" " , errout_str ());
899905 }
900906
901907 void trailingReturn () {
You can’t perform that action at this time.
0 commit comments