• Stephan Bergmann's avatar
    New loplugin:dyncastvisibility · 595371e5
    Stephan Bergmann yazdı
    ...to find uses of dynamic_cast where the static (base) type has hidden
    visibility while the dynamic (derived) one has default visibility, and which may
    thus fail at least on macOS like happened in
    d5ed3cd6 "Make WinMtfFontStyle's base class
    EMFIO_DLLPUBLIC, too".
    
    libcxxabi's __dynamic_cast takes static_type and dst_type arguments.  Now, if
    dst_type (the derived type, with default visibility) is taken from .so A (and
    thus references the version of the base type info hidden in .so A) but the
    __dynamic_cast call is made from .so B, it passes for static_type the base type
    information hidden in .so B, and __dynamic_cast will consider the cast to fail.
    I'm not sure whether hidden intermediary types (in the hierarchy between the
    dynamic_cast's base and derived types) acutally cause a problem too, but lets
    flag them with the plugin anyway.
    
    The fixes use SAL_DLLPUBLIC_RTTI.  For one, there appear to be no other reasons
    than type visibility to make those classes SAL_DLLPUBLIC.  For another, this
    nicely avoids any actual changes on Windows (where SAL_DLLPUBLIC expands to
    nothing, and many of the affected classes were explicityl introduced into class
    hierarchies as "MSVC hacks").
    
    Change-Id: Ia85a9635cebffb1009a9efc1484b8bd4025585d4
    Reviewed-on: https://gerrit.libreoffice.org/41802Tested-by: 's avatarJenkins <ci@libreoffice.org>
    Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
    595371e5
Adı
Son kayıt (commit)
Son güncelleme
..
helperdecl.hxx Loading commit data...
vbaaccesshelper.hxx Loading commit data...
vbaapplicationbase.hxx Loading commit data...
vbacollectionimpl.hxx Loading commit data...
vbadialogbase.hxx Loading commit data...
vbadialogsbase.hxx Loading commit data...
vbadllapi.h Loading commit data...
vbadocumentbase.hxx Loading commit data...
vbadocumentsbase.hxx Loading commit data...
vbaeventshelperbase.hxx Loading commit data...
vbafontbase.hxx Loading commit data...
vbaglobalbase.hxx Loading commit data...
vbahelper.hxx Loading commit data...
vbahelperinterface.hxx Loading commit data...
vbapagesetupbase.hxx Loading commit data...
vbapropvalue.hxx Loading commit data...
vbareturntypes.hxx Loading commit data...
vbashape.hxx Loading commit data...
vbashaperange.hxx Loading commit data...
vbashapes.hxx Loading commit data...
vbatextframe.hxx Loading commit data...
vbawindowbase.hxx Loading commit data...