[PATCH] D117339: [clang][dataflow] Add transfer functions for bind temporary and static cast

Stanislav Gatev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 14 15:02:32 PST 2022


sgatev marked an inline comment as done.
sgatev added inline comments.


================
Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:90
   void VisitDeclStmt(const DeclStmt *S) {
-    // FIXME: Add support for group decls, e.g: `int a, b;`
-    if (S->isSingleDecl()) {
-      if (const auto *D = dyn_cast<VarDecl>(S->getSingleDecl())) {
-        visitVarDecl(*D);
+    const auto &D = *cast<VarDecl>(S->getSingleDecl());
+    auto &Loc = Env.createStorageLocation(D);
----------------
xazax.hun wrote:
> Wouldn't you dereference a null pointer for group decls? 
I couldn't figure what code to write that would create a group decl. Maybe because of https://github.com/llvm/llvm-project/blob/main/clang/lib/Analysis/CFG.cpp#L2842-L2856?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117339



More information about the cfe-commits mailing list