[PATCH] D85752: [Analyzer] Store the pointed/referenced type for dynamic casts

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 11 11:12:00 PDT 2020


xazax.hun added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/DynamicType.cpp:73
+    Ty = STTPTy->getReplacementType();
+  if (Ty->isPointerType())
+    Ty = Ty->getPointeeType();
----------------
Is this doing what you intended? What about a reference to a pointer? Wouldn't you do too much unboxing? 

Also, I think a function returning a value would be more conventional. 

Other sugars like typedefs cannot interfere? I think this patch might benefit from additional test coverage. I also see no tests for template substitutions.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85752/new/

https://reviews.llvm.org/D85752



More information about the cfe-commits mailing list