compilerplugins/clang/singlevalfields.cxx |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit a2cb1d16e71fd2b265c9ad4a497c5b8627ba9145
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Mon Jan 15 08:29:58 2024 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Mon Jan 15 09:51:27 2024 +0100

    Fix loplugin:singlevalfields handling of DesignatedInitExpr
    
    ...as seen when building CompilerTest_compilerplugins_clang against recent 
LLVM
    18 trunk libc++,
    
    > [CPT] compilerplugins/clang/test/singlevalfields.cxx
    > DesignatedInitExpr 0x1388bb790 'void' lvalue bitfield
    > `-MemberExpr 0x1388bb760 'const __alignment':'const enum 
std::__format_spec::__alignment' lvalue bitfield ->__alignment_ 0x1401d5868
    >   `-CXXThisExpr 0x1388bb750 'const __parser<_CharT> *' implicit this
    [...]
    > error: 'expected-error' diagnostics seen but not expected:
    >   File 
/Users/stephan/llvm/inst/bin/../include/c++/v1/__format/parser_std_format_spec.h
 Line 499: oh dear, what can the matter be? [loplugin:singlevalfields]
    [...]
    
    Change-Id: I1cce598780bafc9306c9fbc42a1c98ff1f5450a1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162075
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/compilerplugins/clang/singlevalfields.cxx 
b/compilerplugins/clang/singlevalfields.cxx
index 1e930878e6ff..4217114d3d89 100644
--- a/compilerplugins/clang/singlevalfields.cxx
+++ b/compilerplugins/clang/singlevalfields.cxx
@@ -412,6 +412,7 @@ void SingleValFields::walkPotentialAssign( const 
DeclaratorDecl* fieldOrVarDecl,
                 || isa<UnresolvedMemberExpr>(parent)
                 || isa<MaterializeTemporaryExpr>(parent)  //???
                 || isa<InitListExpr>(parent)
+                || isa<DesignatedInitExpr>(parent)
                 || isa<CXXUnresolvedConstructExpr>(parent)
                 || isa<LambdaExpr>(parent)
                 || isa<PackExpansionExpr>(parent)

Reply via email to