steakhal wrote: Could you also add this test case? ```c++ namespace std { struct __mutex_base { void lock(); }; struct mutex : __mutex_base { void unlock(); bool try_lock(); }; template <class... MutexTypes> struct scoped_lock { explicit scoped_lock(MutexTypes&... m); ~scoped_lock(); }; template <class MutexType> class scoped_lock<MutexType> { public: explicit scoped_lock(MutexType& m) : m(m) { m.lock(); } ~scoped_lock() { m.unlock(); } private: MutexType& m; }; } // namespace std
extern "C" unsigned int sleep(unsigned int seconds); int magic_number; std::mutex m; void fixed() { int current; for (int items_processed = 0; items_processed < 100; ++items_processed) { { std::scoped_lock guard(m); current = magic_number; } sleep(current); // expected no warning } } ``` Or is it already implied by other tests? https://github.com/llvm/llvm-project/pull/106240 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits