[libcxx-commits] [PATCH] D61119: Fix compilation error with -DLIBCXXABI_ENABLE_THREADS=OFF

Michael Platings via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 25 02:02:04 PDT 2019


michaelplatings created this revision.
michaelplatings added a reviewer: EricWF.
Herald added subscribers: libcxx-commits, christof.
Herald added a project: libc++.

The error is:

libcxxabi/src/cxa_guard_impl.h: In instantiation of ‘__cxxabiv1::{anonymous}::LibcppMutex __cxxabiv1::{anonymous}::GlobalStatic<__cxxabiv1::{anonymous}::LibcppMutex>::instance’:
libcxxabi/src/cxa_guard_impl.h:529:62:   required from here
libcxxabi/src/cxa_guard_impl.h:510:23: error: ‘__cxxabiv1::{anonymous}::LibcppMutex __cxxabiv1::{anonymous}::GlobalStatic<__cxxabiv1::{anonymous}::LibcppMutex>::instance’ has incomplete type
 _LIBCPP_SAFE_STATIC T GlobalStatic<T>::instance = {};

This was introduced in this commit: https://github.com/llvm/llvm-project/commit/70ebeabfb8330f805a26dbb2f8af77fb0ab0c5f0#diff-598857ff93b4283c6978bca09e013e02

  ^


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61119

Files:
  libcxxabi/src/cxa_guard_impl.h


Index: libcxxabi/src/cxa_guard_impl.h
===================================================================
--- libcxxabi/src/cxa_guard_impl.h
+++ libcxxabi/src/cxa_guard_impl.h
@@ -257,6 +257,9 @@
 private:
   std::__libcpp_condvar_t cond = _LIBCPP_CONDVAR_INITIALIZER;
 };
+#else
+struct LibcppMutex {};
+struct LibcppCondVar {};
 #endif // !defined(_LIBCXXABI_HAS_NO_THREADS)
 
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61119.196587.patch
Type: text/x-patch
Size: 381 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190425/82d1d98d/attachment.bin>


More information about the libcxx-commits mailing list