diff options
author | Eric Fiselier <eric@efcs.ca> | 2018-02-11 22:00:19 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2018-02-11 22:00:19 +0000 |
commit | 2328c589f1b29804a246974f24cbaf7d7c1a55bd (patch) | |
tree | c5f074ff7e31a7aac9b125e0cd4ceedfe691cc2e /libcxx/include/new | |
parent | 6808a5924426fe4a8e6b60e8dcfc357d70e0ca1f (diff) | |
download | bcm5719-llvm-2328c589f1b29804a246974f24cbaf7d7c1a55bd.tar.gz bcm5719-llvm-2328c589f1b29804a246974f24cbaf7d7c1a55bd.zip |
Fix libcxx MSVC C++17 redefinition of 'align_val_t'
Patch from charlieio@outlook.com
Reviewed as https://reviews.llvm.org/D42354
When the following command is used:
> clang-cl -std:c++17 -Iinclude\c++\v1 hello.cc c++.lib
An error occurred:
In file included from hello.cc:1:
In file included from include\c++\v1\iostream:38:
In file included from include\c++\v1\ios:216:
In file included from include\c++\v1\__locale:15:
In file included from include\c++\v1\string:477:
In file included from include\c++\v1\string_view:176:
In file included from include\c++\v1\__string:56:
In file included from include\c++\v1\algorithm:643:
In file included from include\c++\v1\memory:656:
include\c++\v1\new(165,29): error: redefinition of 'align_val_t'
enum class _LIBCPP_ENUM_VIS align_val_t : size_t { };
^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\vcruntime_new.h(43,16): note:
previous definition is here
enum class align_val_t : size_t {};
^
1 error generated.
vcruntime_new.h has defined align_val_t, libcxx need hide align_val_t.
This patch fixes that error.
llvm-svn: 324853
Diffstat (limited to 'libcxx/include/new')
-rw-r--r-- | libcxx/include/new | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libcxx/include/new b/libcxx/include/new index 4e527501b1e..27c248c83c9 100644 --- a/libcxx/include/new +++ b/libcxx/include/new @@ -160,6 +160,7 @@ public: #endif // defined(_LIBCPP_BUILDING_NEW) || (_LIBCPP_STD_VER > 11) +#if !defined(_LIBCPP_ABI_MICROSOFT) || defined(_LIBCPP_NO_VCRUNTIME) #if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) || _LIBCPP_STD_VER > 14 #ifndef _LIBCPP_CXX03_LANG enum class _LIBCPP_ENUM_VIS align_val_t : size_t { }; @@ -167,6 +168,7 @@ enum class _LIBCPP_ENUM_VIS align_val_t : size_t { }; enum align_val_t { __zero = 0, __max = (size_t)-1 }; #endif #endif +#endif } // std |