You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libcxx/include
Tom Stellard 598ae4fa2e Merging r315994:
------------------------------------------------------------------------
r315994 | ericwf | 2017-10-17 06:03:17 -0700 (Tue, 17 Oct 2017) | 18 lines

[libc++] Fix PR34898 - vector iterator constructors and assign method perform push_back instead of emplace_back.

Summary:
The constructors `vector(Iter, Iter, Alloc = Alloc{})` and `assign(Iter, Iter)` don't correctly perform EmplaceConstruction from the result of dereferencing the iterator. This results in them performing an additional and unneeded copy.

This patch addresses the issue by correctly using `emplace_back` in C++11 and newer.

There are also some bugs in our `insert` implementation, but those will be handled separately.

@mclow.lists We should probably merge this into 5.1, agreed?

Reviewers: mclow.lists, dlj, EricWF

Reviewed By: mclow.lists, EricWF

Subscribers: cfe-commits, mclow.lists

Differential Revision: https://reviews.llvm.org/D38757
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/branches/release_50@318837 91177308-0d34-0410-b5e6-96231b3b80d8
8 years ago
..
experimental any: Add availability for experimental::bad_any_cast 9 years ago
ext Remove usages of _LIBCPP_MSVC which is never defined 9 years ago
support PR32476: __nop_locale_mgmt.h not needed with newlib 2.5+ 9 years ago
CMakeLists.txt [libcxx][CMake] Add install path variable to allow overriding the destination 8 years ago
__bit_reference [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
__bsd_locale_defaults.h Merging r309917: 8 years ago
__bsd_locale_fallbacks.h Merging r309917: 8 years ago
__config Check for _MSC_VER before defining _LIBCPP_MSVCRT 8 years ago
__config_site.in [libc++] Cleanup and document <__threading_support> 9 years ago
__debug [libc++] Introduce _LIBCPP_EXTERN_VIS to fix __libcpp_debug_function link errors 9 years ago
__functional_03 Add some const_casts in places where we were implicitly casting away constness. No functional change, but now they're explicit 9 years ago
__functional_base Fix bug 33389 - __is_transparent check requires too much 9 years ago
__functional_base_03 [libcxx] Rewrite C++03 __invoke. 10 years ago
__hash_table Fix some undefined behavior in __hash_table. Thanks to vsk for the report and the patch. Reviewed as https://reviews.llvm.org/D33588. 9 years ago
__libcpp_version Update version to 5.0 9 years ago
__locale Merging r309920: 8 years ago
__mutex_base Fix compile error with Bionic's PTHREAD_MUTEX_INITIALIZER 9 years ago
__nullptr [NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS 9 years ago
__split_buffer [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
__sso_allocator [libc++] Tolerate presence of __deallocate macro 9 years ago
__std_stream [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
__string [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
__threading_support [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
__tree [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
__tuple Cleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in tuple and utility 9 years ago
__undef_macros [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
algorithm Merging r313776: 8 years ago
any Implement part of LWG#2857 - any/optional. Still to do - variant. Reviewed as https://reviews.llvm.org/D31956 9 years ago
array [array.tuple]/1 says that instantiating tuple_element<N, array<T, M>> is ill-formed if N >= M. We didn't do that. Add a static_assert to cause a failure, and a test that checks that we failed 9 years ago
atomic Fix ATOMIC_<TYPE>_LOCK_FREE macros on Windows. 9 years ago
bitset [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
cassert Windows support by Ruben Van Boxem. 14 years ago
ccomplex Windows support by Ruben Van Boxem. 14 years ago
cctype Put back the undefs that Richard removed. Boost won't build w/o these; specifically the file 'bytes_methods.h' in Apple's python framework defines these. 10 years ago
cerrno Split <errno.h> out of <cerrno>. 10 years ago
cfenv Fix incorrect file header. This is <cfenv> not <cctype>. 10 years ago
cfloat Split <float.h> out of <cfloat>. 10 years ago
chrono [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
cinttypes Split <inttypes.h> out of <cinttypes>. 10 years ago
ciso646 Windows support by Ruben Van Boxem. 14 years ago
climits Windows support by Ruben Van Boxem. 14 years ago
clocale Make support for thread-unsafe C functions optional. 11 years ago
cmath cmath: Support clang's -fdelayed-template-parsing 8 years ago
codecvt [NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS 9 years ago
complex cmath: Support clang's -fdelayed-template-parsing 8 years ago
complex.h PR25118: move system_header pragma before uses of include_next to avoid extension warnings for people finding libc++ headers via -I paths. 10 years ago
condition_variable [libc++] Make _LIBCPP_TYPE_VIS export members 9 years ago
csetjmp Split <setjmp.h> out of <csetjmp>. 10 years ago
csignal Windows support by Ruben Van Boxem. 14 years ago
cstdarg Windows support by Ruben Van Boxem. 14 years ago
cstdbool Windows support by Ruben Van Boxem. 14 years ago
cstddef Implement P0298R3: 'std::byte'. Reviewed as https://reviews.llvm.org/D31022 9 years ago
cstdint Windows support by Ruben Van Boxem. 14 years ago
cstdio [libc++] Drop support for CRTs older than VS 2015 9 years ago
cstdlib [libc++] Respect Windows Store app CRT restrictions 9 years ago
cstring Fix overload sets of strchr, strpbrk, strrchr, memchr and strstr from 10 years ago
ctgmath Windows support by Ruben Van Boxem. 14 years ago
ctime Make support for thread-unsafe C functions optional. 11 years ago
ctype.h [libc++] Refactor Windows support headers. 9 years ago
cwchar [libc++] Remove unnecessary MSVCRT exclusions 9 years ago
cwctype Split <wctype.h> out of <cwctype>. 10 years ago
deque Merging r315994: 8 years ago
errno.h Cleanup foo.h headers and __config to work in C 10 years ago
exception [libc++] Implement exception_ptr on Windows 9 years ago
float.h Cleanup foo.h headers and __config to work in C 10 years ago
forward_list [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
fstream Add some const_casts in places where we were implicitly casting away constness. No functional change, but now they're explicit 9 years ago
functional Merging r312892: 8 years ago
future Add markup for libc++ dylib availability 9 years ago
initializer_list Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros for std::initializer_list 9 years ago
inttypes.h [include] Declare __STDC_*_MACROS for C++11 compat in old libc 9 years ago
iomanip Move 'quoted' for string_view from <string_view> to <iomanip> (where the other versions of 'quoted' live. No functional change. 9 years ago
ios Cleanup usages of _LIBCPP_HAS_NO_<c++11-feature> in <bitset>, <ios>, <locale>, and <iterator> 9 years ago
iosfwd [NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS 9 years ago
iostream Make the presence of stdin and stdout optional. 11 years ago
istream [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
iterator Implement LWG#2790: Remove istreambuf_iterator::operator->. It never did anything useful. 9 years ago
limits Fix more unreserved names 9 years ago
limits.h [libcxx] Fix gcc build. 9 years ago
list Merging r315994: 8 years ago
locale [locale] Avoid copy of __atoms when char_type is char 9 years ago
locale.h [libcxx] Implement locale.h to fix modules build 9 years ago
map Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::map and std::multimap 9 years ago
math.h cmath: Skip Libc for integral types in isinf, etc. 9 years ago
memory Rework some metaprogramming to use the detection idiom; no functional change 9 years ago
module.modulemap [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
mutex Merging r309296 and r309307: 8 years ago
new Revert "[libcxx] Annotate c++17 aligned new/delete operators with availability" 8 years ago
numeric Implement inclusive_scan/transform_inclusive_scan for C++17. 8 years ago
optional optional: Implement LWG 2900 and P0602 8 years ago
ostream Add markup for libc++ dylib availability 9 years ago
queue Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::queue and std::priority_queue. 9 years ago
random [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
ratio [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
regex Fix a bug in regex_Iterator where it would report zero-length matches forever. Reported as http://llvm.org/PR33681. Thanks to Karen Arutyunov for the report. 8 years ago
scoped_allocator [NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS 9 years ago
set Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::set and std::multiset 9 years ago
setjmp.h Cleanup foo.h headers and __config to work in C 10 years ago
shared_mutex [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
sstream Merging r309838: 8 years ago
stack Cleanup _LIBCPP_HAS_NO_<c++11-feature> macro uses in std::stack. 9 years ago
stdbool.h Add stdbool.h wrapper for libc++ 10 years ago
stddef.h Check for musl-libc's max_align_t in addition to other variants. 9 years ago
stdexcept Fix more unreserved names 9 years ago
stdint.h [include] Declare __STDC_*_MACROS for C++11 compat in old libc 9 years ago
stdio.h Fix Libc++ build with MinGW64 9 years ago
stdlib.h [libc++] Refactor Windows support headers. 9 years ago
streambuf [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
string Merging r312693: 8 years ago
string.h Instead of asking glibc to provide correct C++ signatures for <string.h> 10 years ago
string_view Fix more unreserved names 9 years ago
strstream Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output library 9 years ago
system_error Add ABI option to remove recently inlined __shared_count functions from the library. 9 years ago
tgmath.h Windows support by Ruben Van Boxem. 14 years ago
thread [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
tuple Add tests for class template deduction on std::tuple. 9 years ago
type_traits Merging r312892: 8 years ago
typeindex [NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS 9 years ago
typeinfo Add markup for libc++ dylib availability 9 years ago
unordered_map Cleanup _LIBCPP_HAS_NO_<c++11-feature> in std::unordered_map and std::unordered_multimap 9 years ago
unordered_set Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::unordered_set and std::unordered_multiset 9 years ago
utility Add an `__is_inplace_index` metafunction. 9 years ago
valarray [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows 9 years ago
variant Add a missing SFINAE condition to the `variant`'s converting constructor. 9 years ago
vector Merging r315994: 8 years ago
wchar.h Fix Libc++ build with MinGW64 9 years ago
wctype.h Split <wctype.h> out of <cwctype>. 10 years ago