[PATCH] D83877: [Analyzer] Changed in SmartPtrModeling to handle Swap

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 15 09:36:27 PDT 2020


NoQ added inline comments.


================
Comment at: clang/test/Analysis/Inputs/system-header-simulator-cxx.h:964-965
+
+  template <typename T>
+  void swap(unique_ptr<T> &x, unique_ptr<T> &y) noexcept {
+    x.swap(y);
----------------
You seem to be relying on the fact that global `std::swap` is implemented in terms of the member `std::swap`. That's an implementation detail of the standard library; i'm not sure that this is always the case. Ideally we should model the global `std::swap` separately.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83877





More information about the cfe-commits mailing list