[PATCH] D66443: [LifetimeAnalysis] Add [[gsl::Pointer]] to llvm::StringRef

Matthias Gehre via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 14:36:33 PDT 2019


mgehre created this revision.
mgehre added reviewers: zturner, mehdi_amini, gribozavr.
Herald added subscribers: Szelethus, dexonsmith.
Herald added a project: LLVM.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66443

Files:
  llvm/include/llvm/ADT/StringRef.h


Index: llvm/include/llvm/ADT/StringRef.h
===================================================================
--- llvm/include/llvm/ADT/StringRef.h
+++ llvm/include/llvm/ADT/StringRef.h
@@ -45,7 +45,7 @@
   /// situations where the character data resides in some other buffer, whose
   /// lifetime extends past that of the StringRef. For this reason, it is not in
   /// general safe to store a StringRef.
-  class StringRef {
+  class [[gsl::Pointer]] StringRef {
   public:
     static const size_t npos = ~size_t(0);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66443.215986.patch
Type: text/x-patch
Size: 522 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190819/5eb031e3/attachment.bin>


More information about the llvm-commits mailing list