compilerplugins/clang/redundantfcast.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 1e2977894f087255deb22dd4ea4dd1402493c574
Author:     Stephan Bergmann <stephan.bergm...@collabora.com>
AuthorDate: Tue Sep 2 14:48:59 2025 +0200
Commit:     Stephan Bergmann <stephan.bergm...@collabora.com>
CommitDate: Wed Sep 3 08:21:08 2025 +0200

    Adapt compilerplugins to recent LLVM 22 trunk change
    
    
...<https://github.com/llvm/llvm-project/commit/88438ba1f37fa4e0c2db203cd5556e52c9c34c08>
    "[clang] AST: fix getAs canonicalization of leaf types (#155028)", which 
started
    to cause
    
    > [CPT] compilerplugins/clang/test/redundantfcast.cxx
    > error: 'expected-error' diagnostics expected but not seen:
    >   File compilerplugins/clang/test/redundantfcast.cxx Line 77 (directive 
at compilerplugins/clang/test/redundantfcast.cxx:78): redundant functional cast 
from 'const tools::Polygon' to 'tools::Polygon' in construct expression 
[loplugin:redundantfcast]
    > error: 'expected-error' diagnostics seen but not expected:
    >   File compilerplugins/clang/test/redundantfcast.cxx Line 77: redundant 
functional cast from 'const tools::Polygon' to 'tools::Polygon' 
[loplugin:redundantfcast]
    >   File compilerplugins/clang/test/redundantfcast.cxx Line 221: redundant 
functional cast from 'const Primitive2DContainer' to 'Primitive2DContainer' 
[loplugin:redundantfcast]
    > error: 'expected-note' diagnostics expected but not seen:
    >   File compilerplugins/clang/test/redundantfcast.cxx Line 20: in call to 
method here [loplugin:redundantfcast]
    >   File compilerplugins/clang/test/redundantfcast.cxx Line 27: in call to 
method here [loplugin:redundantfcast]
    >   File compilerplugins/clang/test/redundantfcast.cxx Line 38: in call to 
method here [loplugin:redundantfcast]
    > 6 errors generated.
    > make[1]: *** [solenv/gbuild/LinkTarget.mk:338: 
workdir/CxxObject/compilerplugins/clang/test/redundantfcast.o] Error 1
    
    Change-Id: I2538d419b7921d5617b03de646c83973184ee1ff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190527
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@collabora.com>

diff --git a/compilerplugins/clang/redundantfcast.cxx 
b/compilerplugins/clang/redundantfcast.cxx
index 3a4dea0fd591..8a78fee4144f 100644
--- a/compilerplugins/clang/redundantfcast.cxx
+++ b/compilerplugins/clang/redundantfcast.cxx
@@ -93,7 +93,8 @@ public:
                 continue;
             if (!lvalueType->getPointeeType().isConstQualified())
                 continue;
-            auto paramClassOrStructType = 
lvalueType->getPointeeType()->getAs<RecordType>();
+            auto paramClassOrStructType
+                = 
lvalueType->getPointeeType().getCanonicalType()->getAs<RecordType>();
             if (!paramClassOrStructType)
                 continue;
             // check for temporary and functional cast in argument expression
@@ -155,7 +156,8 @@ public:
                     continue;
             }
             auto valueType = param->getType()->getAs<ReferenceType>();
-            auto paramClassOrStructType = 
valueType->getPointeeType()->getAs<RecordType>();
+            auto paramClassOrStructType
+                = 
valueType->getPointeeType().getCanonicalType()->getAs<RecordType>();
             if (!paramClassOrStructType)
                 continue;
             // check for temporary and functional cast in argument expression

Reply via email to