[PATCH] D62328: [LibTooling] Fix dangling references in RangeSelector.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 23 09:11:30 PDT 2019


ymandel created this revision.
ymandel added reviewers: ilya-biryukov, gribozavr.
Herald added a project: clang.

RangeSelector had a number of cases of capturing a StringRef in a lambda, which
lead to dangling references. This change converts all uses in the API of
`StringRef` to `std::string` to avoid this problem. `std::string` in the API is
a reasonable choice, because the combinators are always storing the string
beyond the life of the combinator construction.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62328

Files:
  clang/include/clang/Tooling/Refactoring/RangeSelector.h
  clang/lib/Tooling/Refactoring/RangeSelector.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62328.200994.patch
Type: text/x-patch
Size: 5474 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190523/bc415778/attachment-0001.bin>


More information about the cfe-commits mailing list