[PATCH] D71301: [clang][IFS] Prevent Clang-IFS from Leaking symbols from inside a block.
Saleem Abdulrasool via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 16 20:36:22 PST 2019
compnerd added inline comments.
================
Comment at: clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp:60
+ if (const auto *MD = dyn_cast_or_null<CXXMethodDecl>(Parent))
+ return true;
+ }
----------------
Use `isa` rather than `dyn_cast_or_null`. Furthermore, the `dyn_cast_or_null` is wrong - `Parent` is guaranteed to be !NULL given the condition on L56.
```
if (const auto *VD = dyn_cast<VarDecl>(ND))
if (const auto *P = VD->getParentFunctionOrMethod())
if (isa<BlockDecl>(P) || isa<CXXMethodDecl>(P))
return true;
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71301/new/
https://reviews.llvm.org/D71301
More information about the cfe-commits
mailing list