• Stephan Bergmann's avatar
    New loplugin:faileddyncast · 75f0f9d5
    Stephan Bergmann yazdı
    Offline discussion about tdf#96067 "Crash on undo row inserts" brought up the
    idea to warn about cases where uses of dynamic_cast are statically knwon to
    always fail.  Clang's clang::AST::CXXDynamicCastExpr::isAlwaysNull already
    implements such a check, reporting true if the casted-from class is final, but
    has two issues:
    
    For one, it does not work for template code, when one of the involved types is a
    template parameter type (so e.g., DestType->castAs<PointerType>() can crash).
    
    For another, it misses the opportunity to report true if the casted-to type is
    final and only derives from the casted-from type non-publicly.  My hope was that
    this, after the "final" decorations in 548c4323
    "Mark some classes as final," might turn up the culprit of tdf#96067 (with a
    scenario similar to the failed dynamic_cast on private derivation in
    63b67ab5 "Use public derivation, and remove
    then-unnecessary downcasts")---but not so.
    
    Change-Id: I962ee19820758f9c601f4a292da7f37fa9dff5ce
    75f0f9d5
Adı
Son kayıt (commit)
Son güncelleme
..
store Loading commit data...
automem.cxx Loading commit data...
badstatics.cxx Loading commit data...
badvectorinit.cxx Loading commit data...
bodynotinblock.cxx Loading commit data...
bodynotinblock.hxx Loading commit data...
checkconfigmacros.cxx Loading commit data...
compat.hxx Loading commit data...
cstylecast.cxx Loading commit data...
defaultparams.cxx Loading commit data...
derefnullptr.cxx Loading commit data...
externandnotdefined.cxx Loading commit data...
faileddyncast.cxx Loading commit data...
getimplementationname.cxx Loading commit data...
implicitboolconversion.cxx Loading commit data...
inlinesimplememberfunctions.cxx Loading commit data...
inlinevisible.cxx Loading commit data...
literaltoboolconversion.cxx Loading commit data...
loopvartoosmall.cxx Loading commit data...
memoryvar.cxx Loading commit data...
mergeclasses.cxx Loading commit data...
mergeclasses.py Loading commit data...
mergeclasses.results Loading commit data...
nullptr.cxx Loading commit data...
oncevar.cxx Loading commit data...
override.cxx Loading commit data...
passstuffbyref.cxx Loading commit data...
plugin.cxx Loading commit data...
plugin.hxx Loading commit data...
pluginhandler.cxx Loading commit data...
pluginhandler.hxx Loading commit data...
privatebase.cxx Loading commit data...
ptrvector.cxx Loading commit data...
rangedforcopy.cxx Loading commit data...
redundantcast.cxx Loading commit data...
refcounting.cxx Loading commit data...
rendercontext.cxx Loading commit data...
returnbyref.cxx Loading commit data...
salbool.cxx Loading commit data...
sallogareas.cxx Loading commit data...
sallogareas.hxx Loading commit data...
simplifybool.cxx Loading commit data...
staticcall.cxx Loading commit data...
staticmethods.cxx Loading commit data...
stringconcat.cxx Loading commit data...
stringconstant.cxx Loading commit data...
typecheck.cxx Loading commit data...
typecheck.hxx Loading commit data...
unreffun.cxx Loading commit data...
unusedfields.cxx Loading commit data...
unusedfields.py Loading commit data...
unusedfieldsremove.cxx Loading commit data...
unusedmethods.cxx Loading commit data...
unusedmethods.py Loading commit data...
unusedmethodsremove.cxx Loading commit data...
unusedvariablecheck.cxx Loading commit data...
unusedvariablecheck.hxx Loading commit data...
vclwidgets.cxx Loading commit data...