[libcxx-commits] [PATCH] D94656: [libcxx testing] Fix UB in tests for std::lock_guard

Igor Kudrin via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 14 04:31:48 PST 2021


ikudrin added a comment.

The current code violates the C++ standard, which says (in different sections, depending on the version):

> //The expression **m.try_lock()** shall be well-formed and have the following semantics://
> Requires: //If **m** is of type **mutex**, **timed_mutex**, **shared_mutex**, or **shared_timed_mutex**, the calling thread does not own the mutex.//

The particular UB depends on the implementation and is clearly triggered on our private platform, which is why we have noticed it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94656



More information about the libcxx-commits mailing list