[libcxx-commits] [PATCH] D151223: [libc++] Fixes use-after move diagnostic.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 26 11:42:34 PDT 2023


Mordante created this revision.
Herald added a project: All.
Mordante updated this revision to Diff 525705.
Mordante added a comment.
Mordante updated this revision to Diff 526065.
Mordante edited the summary of this revision.
Mordante published this revision for review.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Rebased and a different approach.


Mordante added a comment.

Rebased to fix the CI.


The diagnostic is issued by clang-tidy 17.

This just suppressed the diagnostic. The code uses a non-standard extension
and the class itself is deprecated.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151223

Files:
  libcxx/include/strstream


Index: libcxx/include/strstream
===================================================================
--- libcxx/include/strstream
+++ libcxx/include/strstream
@@ -258,7 +258,7 @@
     _LIBCPP_INLINE_VISIBILITY
     istrstream(istrstream&& __rhs)
         : istream(_VSTD::move(__rhs)),
-          __sb_(_VSTD::move(__rhs.__sb_))
+          __sb_(_VSTD::move(__rhs.__sb_)) // NOLINT(bugprone-use-after-move)
     {
         istream::set_rdbuf(&__sb_);
     }
@@ -307,7 +307,7 @@
     _LIBCPP_INLINE_VISIBILITY
     ostrstream(ostrstream&& __rhs)
         : ostream(_VSTD::move(__rhs)),
-          __sb_(_VSTD::move(__rhs.__sb_))
+          __sb_(_VSTD::move(__rhs.__sb_)) // NOLINT(bugprone-use-after-move)
     {
         ostream::set_rdbuf(&__sb_);
     }
@@ -367,7 +367,7 @@
     _LIBCPP_INLINE_VISIBILITY
     strstream(strstream&& __rhs)
         : iostream(_VSTD::move(__rhs)),
-          __sb_(_VSTD::move(__rhs.__sb_))
+          __sb_(_VSTD::move(__rhs.__sb_)) // NOLINT(bugprone-use-after-move)
     {
         iostream::set_rdbuf(&__sb_);
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151223.526065.patch
Type: text/x-patch
Size: 1055 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230526/e3f22fc3/attachment.bin>


More information about the libcxx-commits mailing list