[PATCH] D66464: Regex: +regex string lifetime comment

Jan Kratochvil via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 03:16:39 PDT 2019


jankratochvil created this revision.
jankratochvil added reviewers: labath, JDevlieghere, dblaikie, eliben.
jankratochvil added a project: LLVM.
Herald added a subscriber: llvm-commits.

Is the wording OK?  The lifetime was found by Jonas Devlieghere.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66464

Files:
  llvm/include/llvm/Support/Regex.h


Index: llvm/include/llvm/Support/Regex.h
===================================================================
--- llvm/include/llvm/Support/Regex.h
+++ llvm/include/llvm/Support/Regex.h
@@ -44,6 +44,9 @@
 
     Regex();
     /// Compiles the given regular expression \p Regex.
+    ///
+    /// \param Regex - referenced string lifetime is no longer needed after this
+    /// constructor does finish.  Only its compiled form is kept stored.
     Regex(StringRef Regex, unsigned Flags = NoFlags);
     Regex(const Regex &) = delete;
     Regex &operator=(Regex regex) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66464.216088.patch
Type: text/x-patch
Size: 569 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190820/31ef9da5/attachment.bin>


More information about the llvm-commits mailing list