hanchenye-llvm-project/libcxx/include
Eric Fiselier 2328c589f1 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
2018-02-11 22:00:19 +00:00
..
experimental Remove more of the std::experimental bits that are now in std::. All the _v type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html 2018-02-06 23:13:48 +00:00
ext Remove usages of _LIBCPP_MSVC which is never defined 2017-05-10 21:40:58 +00:00
support Stop using __strtonum_fallback on Android. 2018-02-07 21:58:48 +00:00
CMakeLists.txt [libc++] Unbreak Apple buildbots 2017-12-08 21:50:32 +00:00
__bit_reference [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 2017-05-31 22:07:49 +00:00
__bsd_locale_defaults.h Add system header pragma to BSD locale fallback headers. 2017-08-03 02:50:43 +00:00
__bsd_locale_fallbacks.h Add system header pragma to BSD locale fallback headers. 2017-08-03 02:50:43 +00:00
__config Fix size and alignment of array<T, 0>. 2018-02-07 23:50:25 +00:00
__config_site.in [cmake] Add a config option LIBCXX_HAS_WIN32_THREAD_API for enforcing win32 threads 2018-01-05 20:48:29 +00:00
__debug
__functional_03 Add some const_casts in places where we were implicitly casting away constness. No functional change, but now they're explicit 2017-06-14 20:00:36 +00:00
__functional_base Un-inline a few more variables that are exported from the dylib. 2018-01-02 19:01:45 +00:00
__functional_base_03
__hash_table Revert "Make rehash(0) work with ubsan's unsigned-integer-overflow." 2018-01-08 22:57:12 +00:00
__libcpp_version Update version to 7.0.0svn: cmake, include files and docs 2018-01-03 15:40:29 +00:00
__locale Allow to set locale on Windows. 2017-11-23 10:38:18 +00:00
__mutex_base One more (should be) inline variable that is defined in the dylib 2018-01-02 19:23:30 +00:00
__nullptr
__split_buffer [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 2017-05-31 22:07:49 +00:00
__sso_allocator
__std_stream [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 2017-05-31 22:07:49 +00:00
__string Fix misleading indentation; replace a couple of NULLs with nullptr. Resolves https://reviews.llvm.org/D42945 ; thanks to Bruce Mitchener for the patch. 2018-02-06 18:58:05 +00:00
__threading_support libcxx: Move Windows threading support into a .cpp file. 2018-01-23 01:59:43 +00:00
__tree Spelling 2017-08-18 12:57:36 +00:00
__tuple
__undef_macros [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 2017-05-31 22:07:49 +00:00
algorithm Fix misleading indentation; replace a couple of NULLs with nullptr. Resolves https://reviews.llvm.org/D42945 ; thanks to Bruce Mitchener for the patch. 2018-02-06 18:58:05 +00:00
any
array Fix size and alignment of array<T, 0>. 2018-02-07 23:50:25 +00:00
atomic
bitset Fix problems with r'890 when building on machines where sizeof(size_t) != sizeof(unsigned long long) and C++03 2017-11-27 22:27:22 +00:00
cassert
ccomplex
cctype
cerrno
cfenv
cfloat
chrono Implement most of P0607: Inline Variables for the Standard Library. This involved marking a lot of variables as inline (but only for C++17 and later). 2018-01-02 17:17:01 +00:00
cinttypes
ciso646
climits
clocale
cmath cmath: Support clang's -fdelayed-template-parsing 2017-07-07 05:13:36 +00:00
codecvt
complex Implement LWG2870: Default value of parameter theta of polar should be dependent 2018-01-31 21:42:39 +00:00
complex.h
condition_variable
csetjmp
csignal
cstdarg
cstdbool
cstddef Implement LWG2950: std::byte operations are misspecified 2017-11-14 01:14:53 +00:00
cstdint
cstdio
cstdlib
cstring
ctgmath
ctime
ctype.h
cwchar
cwctype
deque First part of P0600 - '[[nodiscard] in the standard library'. Mark the 'empty()' methods of all the containers as nodiscard. If you're calling empty() w/o looking at the result, you probably meanto to call 'clear()'. c++2a only 2017-11-15 05:51:26 +00:00
errno.h
exception [libc++] Support Microsoft ABI without vcruntime headers 2017-10-09 19:25:17 +00:00
float.h
forward_list First part of P0600 - '[[nodiscard] in the standard library'. Mark the 'empty()' methods of all the containers as nodiscard. If you're calling empty() w/o looking at the result, you probably meanto to call 'clear()'. c++2a only 2017-11-15 05:51:26 +00:00
fstream libcxx: Provide overloads for basic_filebuf::open() et al that take wchar_t* filenames on Windows. 2018-01-23 02:07:27 +00:00
functional More constexpr algorithms from P0202. search/search_n 2018-01-16 15:48:27 +00:00
future Revert commit removing allocator support from packaged_task. Will investigate further 2017-11-27 20:47:54 +00:00
initializer_list
inttypes.h
iomanip
ios Add static_asserts to basic_ios and basic_stream_buf to ensure that that the traits match the character type. This is a requirement on the user - now we get consistent failures at compile time instead of incomprehensible error messages or runtime failures. This is also LWG#2994 - not yet adopted. 2018-02-01 03:55:27 +00:00
iosfwd
iostream
istream [libcxx] Make std::basic_istream::get 0-terminate input array in case of error. 2018-01-11 23:23:49 +00:00
iterator [libcxx] Define istream_iterator equality comparison operators out-of-line 2017-12-11 13:54:58 +00:00
limits Fix more unreserved names 2017-06-01 02:29:37 +00:00
limits.h
list Fix PR35564 - std::list splice/erase incorrectly throw in debug mode. 2018-01-25 00:02:48 +00:00
locale Make pbump (internally) handle sizes bigger than MAX_INT. Fixes PR#33725 - thanks to Jonathan Wakely for the report 2017-09-12 15:00:43 +00:00
locale.h
map Use multi-key tree search for {map, set}::{count, equal_range} 2018-02-10 02:53:47 +00:00
math.h libcxx: Move #include_next <math.h> out of header guard in wrapper header. 2018-01-26 01:19:23 +00:00
memory Make std::get_temporary_buffer respect overaligned types when possible 2018-02-01 22:24:45 +00:00
module.modulemap Remove more of the std::experimental bits that are now in std::. All the _v type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html 2018-02-06 23:13:48 +00:00
mutex Implement most of P0607: Inline Variables for the Standard Library. This involved marking a lot of variables as inline (but only for C++17 and later). 2018-01-02 17:17:01 +00:00
new Fix libcxx MSVC C++17 redefinition of 'align_val_t' 2018-02-11 22:00:19 +00:00
numeric Fix incorrect handling of move-only types in transform_reduce iter iter iter init, and add test. 2018-01-05 01:31:57 +00:00
optional Implement P0777: Treating unnecessay decay 2018-02-06 20:56:55 +00:00
ostream Fix failure on C++03 bots 2017-11-27 16:17:19 +00:00
queue Implement LWG2783: stack::emplace() and queue::emplace() should return decltype(auto) 2018-01-24 22:42:25 +00:00
random Change an internal table of constants for the poisson distribution from 2018-01-16 14:54:36 +00:00
ratio Implement most of P0607: Inline Variables for the Standard Library. This involved marking a lot of variables as inline (but only for C++17 and later). 2018-01-02 17:17:01 +00:00
regex [libcxx] Correctly handle invalid regex character class names 2018-01-24 12:45:18 +00:00
scoped_allocator More of P0600; marking allocation routines as [[nodiscard]] 2017-11-26 02:55:38 +00:00
set Use multi-key tree search for {map, set}::{count, equal_range} 2018-02-10 02:53:47 +00:00
setjmp.h
shared_mutex [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 2017-05-31 22:07:49 +00:00
sstream libcxx: Fix for basic_stringbuf::seekoff() after r320604. 2017-12-19 23:33:16 +00:00
stack Implement LWG2783: stack::emplace() and queue::emplace() should return decltype(auto) 2018-01-24 22:42:25 +00:00
stdbool.h
stddef.h
stdexcept Fix more unreserved names 2017-06-01 02:29:37 +00:00
stdint.h
stdio.h libcxx: Rename vasprintf function to __libcpp_vasprintf. 2018-01-23 18:53:33 +00:00
stdlib.h
streambuf Add static_asserts to basic_ios and basic_stream_buf to ensure that that the traits match the character type. This is a requirement on the user - now we get consistent failures at compile time instead of incomprehensible error messages or runtime failures. This is also LWG#2994 - not yet adopted. 2018-02-01 03:55:27 +00:00
string Implement deduction guide for basic_string as described in P0433 2018-02-08 06:34:03 +00:00
string.h
string_view Change a static_assert to check for is_trivial instead of is_pod, as is mandated by P0767. 2018-01-22 00:17:48 +00:00
strstream
system_error Implement most of P0607: Inline Variables for the Standard Library. This involved marking a lot of variables as inline (but only for C++17 and later). 2018-01-02 17:17:01 +00:00
tgmath.h
thread [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 2017-05-31 22:07:49 +00:00
tuple Implement P0777: Treating unnecessay decay 2018-02-06 20:56:55 +00:00
type_traits Implement P0777: Treating unnecessay decay 2018-02-06 20:56:55 +00:00
typeindex
typeinfo libcxx: Use vcruntime declarations for typeinfo on Windows. 2018-01-26 01:22:17 +00:00
unordered_map First part of P0600 - '[[nodiscard] in the standard library'. Mark the 'empty()' methods of all the containers as nodiscard. If you're calling empty() w/o looking at the result, you probably meanto to call 'clear()'. c++2a only 2017-11-15 05:51:26 +00:00
unordered_set First part of P0600 - '[[nodiscard] in the standard library'. Mark the 'empty()' methods of all the containers as nodiscard. If you're calling empty() w/o looking at the result, you probably meanto to call 'clear()'. c++2a only 2017-11-15 05:51:26 +00:00
utility Fix a typo in the synopsis comment. NFC. Thanks to K-ballo for the catch 2018-02-11 21:51:49 +00:00
valarray [libcxx] Avoid spurious construction of valarray elements 2018-02-08 11:33:48 +00:00
variant Implement P0777: Treating unnecessay decay 2018-02-06 20:56:55 +00:00
vector First part of P0600 - '[[nodiscard] in the standard library'. Mark the 'empty()' methods of all the containers as nodiscard. If you're calling empty() w/o looking at the result, you probably meanto to call 'clear()'. c++2a only 2017-11-15 05:51:26 +00:00
wchar.h [libc++] Account for Microsoft CRT const overloads 2017-09-15 18:49:34 +00:00
wctype.h