[PATCH] D76761: [clang-tidy] Fix crash in readability-redundant-string-cstr

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 25 12:27:28 PDT 2020


njames93 added a comment.

In D76761#1941476 <https://reviews.llvm.org/D76761#1941476>, @gribozavr2 wrote:

> Right -- what I meant is a more detailed description of why, for example, `tryGetCallExprAncestorForCxxConstructExpr` can't find the `CallExpr` in this case -- is it not there, or does it not have the expected shape, or something else? What does the AST look like?
>
> I'm worried about adding defensive checks because they can make code more difficult to fix in future.


To be honest the whole fix that caused the crash in the first place was a mess, I have decided to fix this by checking if the parent is a temporary expr bound to an r value, as well as removing the hacky looking code from the previous patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76761





More information about the cfe-commits mailing list