]> granicus.if.org Git - clang/commit
[LibTooling] Fix dangling references in RangeSelector.
authorYitzhak Mandelbaum <yitzhakm@google.com>
Thu, 23 May 2019 17:11:33 +0000 (17:11 +0000)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Thu, 23 May 2019 17:11:33 +0000 (17:11 +0000)
commit33b8ef199182819269df7b4045983d30f86cf1ea
tree45b693dc9247e6b61431e2aa1203be03fd50c2cc
parent51db2e5c4b635698f0ec7aa9fd578e9d4510382d
[LibTooling] Fix dangling references in RangeSelector.

Summary:
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.

Reviewers: ilya-biryukov, gribozavr

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D62328

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361514 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Tooling/Refactoring/RangeSelector.h
lib/Tooling/Refactoring/RangeSelector.cpp