[clang] [Clang] Diagnose down casting static_cast (PR #117914)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 27 11:26:18 PST 2024


================
@@ -593,6 +593,10 @@ Improvements to Clang's diagnostics
 - Clang now supports using alias templates in deduction guides, aligning with the C++ standard,
   which treats alias templates as synonyms for their underlying types (#GH54909).
 
+- Added ``-Wstatic-downcast`` to diagnose potentially dangerous uses of ``static_cast`` that perform a base-to-derived cast
+  on pointers and references of polymorphic types.
+
+
----------------
erichkeane wrote:

Should this be just 1 newline?

https://github.com/llvm/llvm-project/pull/117914


More information about the cfe-commits mailing list