[cfe-users] When did Clang provide C++11 mutex?

Jeffrey Walton via cfe-users cfe-users at lists.llvm.org
Tue Jun 7 01:28:56 PDT 2016

>> I'm having trouble determining feature availability at compile time.
>> We don't use Autotools and friends; rather, we use the preprocessor.
>> I've been through the release notes from 2.8 through 3.5 (form: ), and
>> I can't find mention of mutex.

Whoops... here was the form:

>> I've also been to the latest docs, and I can't find a
>> __has_feature(cxx_mutex) or similar
>> (http://clang.llvm.org/docs/LanguageExtensions.html).
>> Finally, I visited http://clang.llvm.org/cxx_status.htmlbut there is
>> no topic or item for mutex. There is a statement "Clang 3.3 and later
>> implement all of the ISO C++ 2011 standard", so I guess that's the
>> version I should use in the absence of better information.
> std::mutex is not a feature of the compiler (clang). It is a feature
> of the C++ Standard Library (libcxx).
> You should look for the <mutex> header. If the following compiles,
> then mutex should be available:

Oh, that's a good point; thanks. That should work for both LLVM Clang
and Apple Clang (mostly same tool; different versioning schemes).


More information about the cfe-users mailing list