Files
libreoffice/compilerplugins/clang
Stephan Bergmann 75f0f9d553 New loplugin:faileddyncast
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 548c43238d
"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
63b67ab5ca "Use public derivation, and remove
then-unnecessary downcasts")---but not so.

Change-Id: I962ee19820758f9c601f4a292da7f37fa9dff5ce
2016-01-12 15:00:33 +01:00
..
2016-01-06 16:48:15 +01:00
2015-12-08 22:56:02 +01:00
2016-01-07 12:29:04 +00:00
2016-01-12 15:00:33 +01:00
2016-01-07 12:29:04 +00:00
2016-01-06 16:48:15 +01:00
2015-11-09 08:34:40 +00:00
2016-01-11 13:17:10 +01:00
2016-01-07 12:29:04 +00:00
2016-01-06 16:48:15 +01:00
2016-01-06 16:48:15 +01:00
2016-01-07 12:29:04 +00:00
2015-12-09 00:01:47 +01:00
2015-12-08 22:56:02 +01:00
2016-01-10 14:17:20 +00:00
2015-11-30 10:34:38 +02:00
2015-11-26 13:26:25 +02:00