[PATCH] D13368: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

Matthias Gehre via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 5 16:00:38 PDT 2015


mgehre added inline comments.

================
Comment at: clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp:33
@@ +32,3 @@
+  const auto *SourceDecl = SourceType->getPointeeCXXRecordDecl();
+  if(!SourceDecl)
+    SourceDecl = SourceType->getAsCXXRecordDecl();
----------------
aaron.ballman wrote:
> In the event it's not a pointer or a reference, why are you getting the source as a value type?
Source type could be no pointer nor ref like in:
   Base B0;
   auto R0 = static_cast<Derived&>(B0);
 


http://reviews.llvm.org/D13368





More information about the cfe-commits mailing list