sc/inc/stlalgorithm.hxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 8c49dab215ed012fea195ea71cea079ddaa97ba3
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Sun May 5 17:10:37 2024 +0200
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Sun May 5 21:07:44 2024 +0200

    Avoid loplugin:casttovoid with recent Clang 19 trunk
    
    > In file included from sc/source/core/data/autonamecache.cxx:23:
    > In file included from sc/inc/dociter.hxx:23:
    > In file included from sc/inc/formulagroup.hxx:17:
    > sc/inc/stlalgorithm.hxx:52:9: error: unnecessary cast to void 
[loplugin:casttovoid]
    >    52 |         (void)p; // avoid bogus MSVC '12 "unreferenced formal 
parameter" warning
    >       |         ^~~~~~~
    > sc/inc/stlalgorithm.hxx:51:9: note: first consumption is here 
[loplugin:casttovoid]
    >    51 |         p->~value_type();
    >       |         ^
    
    Change-Id: I14bcc32fcaf3026a9c3c36e522b1e61da15f224f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167158
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/sc/inc/stlalgorithm.hxx b/sc/inc/stlalgorithm.hxx
index f2143b9a84c7..fe3244148618 100644
--- a/sc/inc/stlalgorithm.hxx
+++ b/sc/inc/stlalgorithm.hxx
@@ -49,7 +49,9 @@ public:
     static void destroy(T* p)
     {
         p->~value_type();
+#if defined _MSC_VER
         (void)p; // avoid bogus MSVC '12 "unreferenced formal parameter" 
warning
+#endif
     }
 
     static size_type max_size()

Reply via email to