Skip to content

Instantly share code, notes, and snippets.

View EricWF's full-sized avatar

Eric EricWF

View GitHub Profile
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef _LIBCPP_CONFIG_SITE
Waf: Entering directory `/home/eric/bloom/bde/build'
Waf: Using 8 jobs (change with -j)
[278/279] Linking ../../../build/groups/bsl/bslstl/bslstl_sharedptr.t
[279/279] Processing ../../../build/groups/bsl/bslstl/bslstl_sharedptr.t
Waf: Leaving directory `/home/eric/bloom/bde/build'
Test Summary
tests that pass 0/1
tests that fail 1/1
[/home/eric/bloom/bde/build/groups/bsl/bslstl/bslstl_sharedptr.t (TEST)] <<<<<<<<<<
[13:10:17] TEST START
template <class ...T>
void foo() {}
int main() {
auto x = &foo;
}
@EricWF
EricWF / repro.cpp
Last active December 10, 2015 12:33
// g++ -std=c++11 test.cpp
template <class Tp>
struct MyType {
__attribute__((visibility("hidden"), always_inline)) ~MyType();
};
// Moving the definition above this line will allow the compilation to succeed. Why?
extern template __attribute__((visibility("default"))) MyType<int>::~MyType();
// DEFINITION
#include <type_traits>
struct __dummy_type {};
template <class _Tp> _Tp& __test(int);
template <class _Tp> __dummy_type __test(...);
template <class _Tp>
struct __is_referenceable : std::integral_constant<bool,
!std::is_same<decltype(__test<_Tp>(0)), __dummy_type>::value
> {};
namespace ns1 {
class A {};
class B {
typedef ::ns1::A AT;
public:
operator AT const&() const noexcept {
return m_a;
}
template <class First, class Second, class ...Args>
int maxSize();
template <class First>
int maxSize();
template <class First, class Second, class ...Args>
int maxSize()
{
#include <type_traits>
template <class ...Args, class = typename std::enable_if<sizeof...(Args) == 0>::type>
int maxSize() { return 0; }
template <class First, class ...Args>
int maxSize() {
return sizeof(First) > maxSize<Args...>() ? sizeof(First) : maxSize<Args...>();
}
diff --git a/include/__config b/include/__config
index a62b2be..e57e63e 100644
--- a/include/__config
+++ b/include/__config
@@ -859,6 +859,11 @@ extern "C" void __sanitizer_annotate_contiguous_container(
#endif
#endif
+#if (!defined(_LIBCPP_HAS_NO_THREAD_ANNOTATIONS) && (!defined(__clang__) \
+ || !__has_attribute(acquire_capability)))
diff --git a/test/libcxx/test/config.py b/test/libcxx/test/config.py
index 6c52880..f1d60a3 100644
--- a/test/libcxx/test/config.py
+++ b/test/libcxx/test/config.py
@@ -98,6 +98,7 @@ class Configuration(object):
self.configure_cxx_library_root()
self.configure_use_system_cxx_lib()
self.configure_use_clang_verify()
+ self.configure_use_thread_safety()
self.configure_execute_external()