[PATCH] D54222: [clang-tidy] Add a check to detect returning static locals in public headers

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 7 15:09:33 PST 2018

aaron.ballman added inline comments.

Comment at: clang-tidy/llvm/ProblematicStaticsCheck.cpp:33
+  const auto *VD = Result.Nodes.getNodeAs<VarDecl>("var");
+  const auto *Return = Result.Nodes.getNodeAs<ReturnStmt>("return");
+  diag(Return->getBeginLoc(), "address of static local variable %0 may not "
JonasToth wrote:
> Please `assert` on `VD` and `Return`
> Please assert on VD and Return

  rCTE Clang Tools Extra


More information about the cfe-commits mailing list