mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 15:56:50 +01:00
libc++3.7: fix to use with modern compilers
Modern compiler will issue a following error whenever '#include <string>' is done: /nix/store/yxpwamjdapjcp53mmsdh1j2c9bc26h4k-libc++-3.7.1/include/c++/v1/string:1938:44: error: 'basic_string<_CharT, _Traits, _Allocator>' is missing exception specification 'noexcept(is_nothrow_copy_constructible<allocator_type>::value)' basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a) ^ /nix/store/yxpwamjdapjcp53mmsdh1j2c9bc26h4k-libc++-3.7.1/include/c++/v1/string:1326:40: note: previous declaration is here _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a) ^ 1 error generated. This happens because modern clang is more strict about checking exception specification for forward declaration and definition. http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/string?r1=242056&r2=242623&diff_format=h
This commit is contained in:
parent
2cac374241
commit
e9d60c5636
2 changed files with 20 additions and 1 deletions
|
@ -14,7 +14,10 @@ stdenv.mkDerivation rec {
|
||||||
cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$NIX_BUILD_TOP/libcxxabi-${version}.src/include")
|
cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$NIX_BUILD_TOP/libcxxabi-${version}.src/include")
|
||||||
'';
|
'';
|
||||||
|
|
||||||
patches = [ ./darwin.patch ];
|
patches = [
|
||||||
|
./darwin.patch
|
||||||
|
./r242056.patch
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||||
|
|
||||||
|
|
16
pkgs/development/compilers/llvm/3.7/libc++/r242056.patch
Normal file
16
pkgs/development/compilers/llvm/3.7/libc++/r242056.patch
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
--- a/include/string 2015/07/13 20:04:56 242056
|
||||||
|
+++ b/include/string 2015/07/18 20:40:46 242623
|
||||||
|
@@ -1936,7 +1936,12 @@
|
||||||
|
template <class _CharT, class _Traits, class _Allocator>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a)
|
||||||
|
- : __r_(__a)
|
||||||
|
+#if _LIBCPP_STD_VER <= 14
|
||||||
|
+ _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
|
||||||
|
+#else
|
||||||
|
+ _NOEXCEPT
|
||||||
|
+#endif
|
||||||
|
+: __r_(__a)
|
||||||
|
{
|
||||||
|
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||||
|
__get_db()->__insert_c(this);
|
Loading…
Reference in a new issue