[PATCH] D104285: [analyzer] Retrieve a value from list initialization of constant array declaration in a global scope.

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 6 01:53:35 PDT 2021


martong added a comment.

Good catch Artem, thanks for the report!

Maybe a single line change could solve this?

  const VarDecl *VD = VR->getDecl()->getCanonicalDecl();



================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1663
     // We can trust a const value or a value of a global initializer in main().
     const VarDecl *VD = VR->getDecl();
     if (VD->getType().isConstQualified() ||
----------------
const VarDecl *VD = VR->getDecl()->getCanonicalDecl();


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104285



More information about the cfe-commits mailing list