Skip to content

Commit 83d5131

Browse files
committed
[LifetimeAnalysis] Add [[gsl::Pointer]] to llvm::StringRef
Summary: This detected the bugs fixed in https://reviews.llvm.org/D66442 and https://reviews.llvm.org/D66440 The warning itself was implemented in https://reviews.llvm.org/D63954 https://reviews.llvm.org/D64256 https://reviews.llvm.org/D65120 https://reviews.llvm.org/D65127 https://reviews.llvm.org/D66152 Reviewers: zturner, mehdi_amini, gribozavr Subscribers: dexonsmith, Szelethus, xazax.hun, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66443
1 parent 0741dec commit 83d5131

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/ADT/StringRef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace llvm {
5454
/// situations where the character data resides in some other buffer, whose
5555
/// lifetime extends past that of the StringRef. For this reason, it is not in
5656
/// general safe to store a StringRef.
57-
class StringRef {
57+
class [[gsl::Pointer]] StringRef {
5858
public:
5959
static const size_t npos = ~size_t(0);
6060

0 commit comments

Comments
 (0)