compilerplugins/clang/unusedmethods.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 27509505be691b2f37d50d5c60ef1cea87357671
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Nov 29 15:06:48 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Nov 29 18:42:08 2024 +0100

    loplugin:unusedmethods tweak for less noise
    
    Change-Id: Idedd1680b03f6b62ff80ad7d0fd74c11d1675053
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177533
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/compilerplugins/clang/unusedmethods.cxx 
b/compilerplugins/clang/unusedmethods.cxx
index 5b10eae7e9df..db001f17620c 100644
--- a/compilerplugins/clang/unusedmethods.cxx
+++ b/compilerplugins/clang/unusedmethods.cxx
@@ -285,6 +285,8 @@ gotfunc:
         logCallToRootMethods(calleeFunctionDecl, usedReturnSet);
         return true;
     }
+    if (auto attributedStmt = dyn_cast<AttributedStmt>(parent))
+        parent = attributedStmt->getSubStmt();
     if (isa<Expr>(parent) || isa<ReturnStmt>(parent) || isa<DeclStmt>(parent)
         || isa<IfStmt>(parent) || isa<SwitchStmt>(parent) || 
isa<ForStmt>(parent)
         || isa<WhileStmt>(parent) || isa<DoStmt>(parent)
@@ -298,6 +300,10 @@ gotfunc:
     {
         return true;
     }
+    report(
+         DiagnosticsEngine::Warning,
+         "unknown parent?",
+          parent->getBeginLoc());
     parent->dump();
     return true;
 }

Reply via email to