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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to