bcraig added inline comments.

================
Comment at: include/__mutex_base:51
 #ifndef _LIBCPP_CXX03_LANG
-    constexpr mutex() = default;
+#ifdef __GLIBC__
+    constexpr
----------------
smeenai wrote:
> EricWF wrote:
> > Limiting `constexpr` to GLIBC implementations only is incorrect; you want 
> > to exclude MUSL.
> > 
> > Also MUSL is wrong for not allowing `pthread_mutex_t mut = 
> > PTHREAD_MUTEX_INITIALIZER` to be a constant expression, and MUSL should fix 
> > that.
> I've used `__builtin_constant_p` to wok around a similarly non-conforming 
> `PTHREAD_MUTEX_INITIALIZER` (from pthread-win32, which defines it to be 
> `(void *)-1`): see the last part of 
> https://stackoverflow.com/a/10376574/382079. It's a terrible hack, but it 
> works.
musl's pthread_mutex_t has volatile members if I recall correctly.  It's hard 
to validate that statement without building musl, because the header that 
defines pthread_mutex_t is code generated.


https://reviews.llvm.org/D18174



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to