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

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 29 14:28:38 PDT 2023


ldionne added inline comments.


================
Comment at: libcxx/include/strstream:261
         : istream(_VSTD::move(__rhs)),
-          __sb_(_VSTD::move(__rhs.__sb_))
+          __sb_(_VSTD::move(__rhs.__sb_)) // NOLINT(bugprone-use-after-move)
     {
----------------
What is the non-standard extension? I don't understand why this code is valid and this isn't a bug? Does `istream(_VSTD::move(__rhs))` above not move the `__sb_` member? If not, would it be possible to instead do something like

```
istream(std::move(static_cast<istream&>(__rhs)))
```

to make it clear that we're only moving `__rhs` as a base class object (if that's what's going on)?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151223/new/

https://reviews.llvm.org/D151223



More information about the libcxx-commits mailing list