The following code doesn't compile only when I specify -stdlib=libc++
to clang++
:
namespace std {
class mutex;
}
void f(std::mutex &x);
#include <mutex>
void f(std::mutex &x) { }
- http://goo.gl/Uqpv6f (gcc.godbolt.org)
note: candidate found by name lookup is 'std::__1::mutex'
I understand what is ::__1
there,
but to my eyes, libc++
breaks the API defined by the C++ standard:
- http://ift.tt/1kLTd8K (well, this is not really a standard...)
It should be possible to forward-declare std::mutex
because it should reside directly under std
, shouldn't it?
Note that the compilation phase, rather than linking phase, is failing. So I don't think the answer to my question should be along the line of "because libc++ employs a different ABI from GNU libstdc++..."
Aucun commentaire:
Enregistrer un commentaire