summaryrefslogtreecommitdiffstats
path: root/libcxx/include/string
Commit message (Collapse)AuthorAgeFilesLines
...
* Disable unsigned integer sanitizer for basic_string::replace(). Patch from ↵Eric Fiselier2017-03-091-0/+4
| | | | | | | | | | | | | | | | | | tomcherry@google.com basic_string::replace() has the below line __sz += __n2 - __n1; which fails overflow checks if __n1 > __n2, as the negative result from the subtraction then overflows the original __sz when added to it. This behavior is valid as unsigned integer overflow is defined to wrap around the maximum value and that produces the correct final value for __sz. Therefore, we disable this check on this function. llvm-svn: 297355
* [libc++] Make _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS export membersShoaib Meenai2017-03-021-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building libc++ with hidden visibility, we want explicit template instantiations to export members. This is consistent with existing Windows behavior, and is necessary for clients to be able to link against a hidden visibility built libc++ without running into lots of missing symbols. An unfortunate side effect, however, is that any template methods of a class with an explicit instantiation will get default visibility when instantiated, unless the methods are explicitly marked inline or hidden visibility. This is not desirable for clients of libc++ headers who wish to control their visibility, and led to PR30642. Annotate all problematic methods with an explicit visibility specifier to avoid this. The problematic methods were found by running https://github.com/smeenai/bad-visibility-finder against the libc++ headers after making the _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS change. The methods were marked with the new _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS macro, which was created for this purpose. It should be noted that _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS was originally intended to expand to default visibility, and was changed to expanding to default type visibility to fix PR30642. The visibility macro documentation was not updated accordingly, however, so this change makes the macro consistent with its documentation again, while explicitly fixing the methods which resulted in that PR. Differential Revision: https://reviews.llvm.org/D29157 llvm-svn: 296731
* Mark a couple for basic_string member templates as inline. no ABI change ↵Eric Fiselier2017-02-171-3/+3
| | | | | | this time. llvm-svn: 295403
* Remove more basic_string member function templates from the dylib exportsEric Fiselier2017-02-171-8/+8
| | | | llvm-svn: 295398
* [libc++] Fix PR 31938 - std::basic_string constructors use non-deductible ↵Eric Fiselier2017-02-171-26/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parameter types. Summary: This patch fixes http://llvm.org/PR31938. The description below is copy/pasted from the bug: The standard says: template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>> class basic_string { using value_type = typename traits::char_type; // ... basic_string(const charT* s, const Allocator& a = Allocator()); }; libc++ actually chooses to declare the constructor as basic_string(const value_type* s, const Allocator& a = Allocator()); The implicit deduction guides from class template argument deduction make what was previously an implementation detail visible: std::basic_string s = "foo"; // error, can't deduce charT. The constructor in question is in the libc++ DSO, but fortunately it looks like fixing this will not result in an ABI break. @rsmith How does this look? I did more than just the constructors mentioned in the PR, but IDK how far to take it. Reviewers: mclow.lists, rsmith Reviewed By: rsmith Subscribers: cfe-commits, rsmith Differential Revision: https://reviews.llvm.org/D29863 llvm-svn: 295393
* Mark basic_string::assign templates as inline to improve ABI stability.Eric Fiselier2017-02-041-2/+2
| | | | | | | | | | | | Visible definitions for basic_string::assign are sometimes emitted in the dylib depending on the version of LLVM used to compile libc++. This can cause the check-cxx-abilist target to fail. This patch attempts marks the basic_string::assign templates as inline to prevent this. That way the export list is consistent across LLVM versions. llvm-svn: 294100
* Fix PR#31779: basic_string::operator= isn't exception safe.Marshall Clow2017-01-311-4/+20
| | | | llvm-svn: 293599
* Fix GCC C++03 build by hiding default template argument in C++03Eric Fiselier2017-01-231-0/+3
| | | | llvm-svn: 292830
* Fix std::string assignment ambiguity from braced initializer lists.Eric Fiselier2017-01-171-0/+1
| | | | | | | | | | When support for `basic_string_view` was added to string it also added new assignment operators from `basic_string_view`. These caused ambiguity when assigning from a braced initializer. This patch fixes that regression by making the basic_string_view assignment operator rank lower in overload resolution by making it a template. llvm-svn: 292276
* [NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VISEric Fiselier2017-01-041-4/+4
| | | | | | | | | | | | | The name _LIBCPP_TYPE_VIS_ONLY is no longer accurate because both _LIBCPP_TYPE_VIS and _LIBCPP_TYPE_VIS_ONLY expand to __attribute__((__type_visibility__)) with Clang. The only remaining difference is that _LIBCPP_TYPE_VIS_ONLY can be applied to templates whereas _LIBCPP_TYPE_VIS cannot (due to dllimport/dllexport not being allowed on templates). This patch renames _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS. llvm-svn: 291035
* Add tests for unordered container tests and std::stringEric Fiselier2016-12-281-4/+8
| | | | llvm-svn: 290655
* Fix unused parameters and variablesEric Fiselier2016-12-231-1/+1
| | | | llvm-svn: 290459
* Fixes for LWG 2598, 2686, 2739, 2742, 2747, and 2759, which were adopted ↵Marshall Clow2016-11-141-0/+20
| | | | | | last week in Issaquah llvm-svn: 286858
* Add 'inline' but not 'always_inline' to std::strings destructor.Eric Fiselier2016-10-311-1/+1
| | | | | | | | Adding both 'inline' and 'always_inline' to the destructor has been contentious. However most of the performance benefits can be gained by only adding 'inline', and there is no reason to hold up that change while discussing the other. llvm-svn: 285538
* Remove additional function template definitions from the dylibEric Fiselier2016-10-311-1/+1
| | | | llvm-svn: 285537
* Optimize filesystem::path by providing weaker exception guarantees.Eric Fiselier2016-10-311-24/+18
| | | | | | | | | | | | | | path uses string::append to construct, append, and concatenate paths. Unfortunatly string::append has a strong exception safety guaranteed and if it can't prove that the iterator operations don't throw then it will allocate a temporary string copy to append to. However this extra allocation and copy is very undesirable for path which doesn't have the same exception guarantees. To work around this this patch adds string::__append_forward_unsafe which exposes the std::string::append interface for forward iterators without enforcing that the iterator is noexcept. llvm-svn: 285532
* Revert "Added 'inline' attribute to basic_string's destructor"Mehdi Amini2016-10-291-1/+0
| | | | | | This reverts commit r285456, which broke LTO bootstrap on Darwin. llvm-svn: 285485
* Added 'inline' attribute to basic_string's destructorAditya Kumar2016-10-281-0/+1
| | | | | | | | | | | | | | | | | Author: laxmansole Reviewers: howard.hinnant mclow.lists Subscribers: EricWF, flyingforyou, evandro Differential Revision: https://reviews.llvm.org/D25624 Reapplying the patch as the bug https://llvm.org/bugs/show_bug.cgi?id=30341 is fixed. Currently basic_string's destructor is not getting inlined. So adding 'inline' attribute to ~basic_string(). Worked in collaboration with Aditya Kumar. llvm-svn: 285456
* Remove two ABI symbols added after the 3.9 releaseEric Fiselier2016-10-141-0/+1
| | | | llvm-svn: 284200
* Change a couple of 'template <typename's to 'template <class' which is what ↵Marshall Clow2016-10-031-3/+3
| | | | | | we use in the rest of the library. llvm-svn: 283162
* Implement proposed resolution for LWG#2758. Reviewed as D24446. Normally, I ↵Marshall Clow2016-09-241-31/+92
| | | | | | would wait for these to be voted upon at a committee meeting (November), but the current draft standard is broken, and this should fix it. (And if it doesn't, we want to know about it soonest) llvm-svn: 282342
* [libc++] Add _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY to support GCC ABI ↵Eric Fiselier2016-09-161-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compatibility Summary: GCC and Clang handle visibility attributes on the out-of-line definition of externally instantiated templates differently. For example in the reproducer below Clang will emit both 'foo' and 'bar' with default visibility while GCC only emits a non-hidden 'foo'. ``` // RUN: g++ -std=c++11 -shared -O3 test.cpp && sym_extract.py a.out // RUN: clang++ -std=c++11 -shared -O3 test.cpp && sym_extract.py a.out #define INLINE_VISIBILITY __attribute__((visibility("hidden"), always_inline)) template <class T> struct Foo { void foo(); void bar(); }; template <class T> void Foo<T>::foo() {} template <class T> inline INLINE_VISIBILITY void Foo<T>::bar() {} template struct Foo<int>; ``` This difference creates ABI incompatibilities between Clang and GCC built dylibs. Specifically GCC built dylibs lack definitions for various member functions of `basic_string`, `basic_istream`, `basic_ostream`, `basic_iostream`, and `basic_streambuf` (All of these types are externally instantiated). Surprisingly these missing symbols don't cause many problems because the functions are marked `always_inline` therefore the dylib definition is rarely needed. However when an out-of-line definition is required then GCC built dylibs will fail to link. For example [GCC built dylibs cannot build Clang](http://stackoverflow.com/questions/39454262/clang-build-errors). This patch works around this issue by adding `_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY` which is used to mark externally instantiated member functions as always inline. When building the library `_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY` sets the symbol's visibility to "default" instead of "hidden", otherwise it acts exactly the same as `_LIBCPP_INLINE_VISIBILITY`. After applying this patch GCC dylibs now contain: * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc` * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE` * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_` * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv` * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_` * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_` * `_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm` * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj` * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi` * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE` * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv` * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE` * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv` * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv` * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E` * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv` * `_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw` * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl` * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv` * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw` * `_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv` * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl` * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE` * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc` * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE` * `_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi` * `_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_` * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE` * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv` * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E` * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl` * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE` * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_` * `_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_` * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE` * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_` * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv` * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl` * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl` * `_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_` * `_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl` * `_ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv` * `_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE` * `_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv` * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE` * `_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj` * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE` * `_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw` * `_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl` * `_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E` * `_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl` * `_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw` This patch has no effect on Clang based builds. Reviewers: mclow.lists, eugenis, danalbert, jroelofs, EricWF Subscribers: beanz, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D24600 llvm-svn: 281681
* [libc++] Fix and document visibility attributes for Clang, GCC and Windows.Eric Fiselier2016-09-151-4/+4
| | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes a number of problems with the visibility macros across GCC (on Unix) and Windows (DLL import/export semantics). All of the visibility macros are now documented under `DesignDocs/VisibilityMacros.rst`. Now I'll no longer forget the subtleties of each! This patch adds two new visibility macros: * `_LIBCPP_ENUM_VIS` for controlling the typeinfo of enum types. Only Clang supports this. * `_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS` for redefining visibility on explicit instantiation declarations. Clang and Windows require this. After applying this patch GCC only emits one -Wattribute warning opposed to 30+. Reviewers: mclow.lists, EricWF Subscribers: beanz, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D24602 llvm-svn: 281673
* Revert r280944 - Added 'inline' attribute to basic_string's destructorEric Fiselier2016-09-141-1/+0
| | | | | | | | | | | | | | | | | | | | This patch causes a couple of issues: 1) It triggers http://llvm.org/PR30341. Although the bug is not truly a libc++ bug it breaks the LLVM build using libc++. Reverting this patch is only a temporary workaround until Clang is fixed. 2) It adds yet another ABI incompatibility when libc++.so is compiled with GCC. Specifically GCC doesn't ignore the _LIBCPP_INLINE_VISIBILITY on the out-of-line definition when compiling the dylib. This causes the externally instantiated ~basic_string symbol to have hidden visibility. This patch should be recommitted after addressing (1) and (2). (2) can be fixed by adding _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY which is defined as __attribute__((visibility("default"), always_inline)) as opposed to _LIBCPP_INLINE_VISIBILITY which makes the symbol hidden. llvm-svn: 281562
* Added 'inline' attribute to basic_string's destructorAditya Kumar2016-09-081-0/+1
| | | | | | | | | | | | | | | Author: laxmansole Reviewers: howard.hinnant mclow.lists Subscribers: EricWF, flyingforyou, evandro Differential Revision: https://reviews.llvm.org/D22834 Currently basic_string's destructor is not getting inlined. So adding 'inline' attribute to ~basic_string(). Worked in collaboration with Aditya Kumar. llvm-svn: 280944
* Fix PR#30303 - no matching function for call to '__ptr_in_range'Marshall Clow2016-09-071-1/+7
| | | | llvm-svn: 280779
* Fix Bug 30240 - std::string: append(first, last) error when aliasing. Add ↵Marshall Clow2016-09-051-13/+33
| | | | | | test cases for append/insert/assign/replace while we're at it, and fix a similar bug in insert. llvm-svn: 280643
* Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception ↵Marshall Clow2016-08-251-16/+4
| | | | | | type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855. llvm-svn: 279744
* Add 'inline' attribute to __init to inline the basic_string's constructorSebastian Pop2016-08-111-0/+5
| | | | | | | | | | | | basic_string's constructor calls init which was not getting inlined. This prevented optimization of const string as init would appear as a call in between a string's def and use. Patch by Laxman Sole and Aditya Kumar. Differential Revision: https://reviews.llvm.org/D22782 llvm-svn: 278356
* Implement std::string_view as described in http://wg21.link/P0254R1. ↵Marshall Clow2016-07-211-704/+288
| | | | | | Reviewed as https://reviews.llvm.org/D21459 llvm-svn: 276238
* Fix most GCC attribute ignored warningsEric Fiselier2016-04-211-10/+10
| | | | llvm-svn: 267074
* Recommit r263036 with additional inlining, so that it will continue to work ↵Marshall Clow2016-04-071-2/+22
| | | | | | with existing system dylibs. Implements LWG#2583 llvm-svn: 265706
* Revert r263036, it's ABI-breaking.Nico Weber2016-03-111-20/+2
| | | | llvm-svn: 263246
* Implement LWG#2579: Inconsistency wrt Allocators in basic_string assignment ↵Marshall Clow2016-03-091-10/+2
| | | | | | vs. basic_string::assign llvm-svn: 263042
* Implement LWG#2583: There is no way to supply an allocator for ↵Marshall Clow2016-03-091-2/+20
| | | | | | basic_string(str, pos) llvm-svn: 263036
* Implement P0272R1: Give 'std::string' a non-const '.data()' member functionMarshall Clow2016-03-081-0/+5
| | | | llvm-svn: 262931
* Implement P0253R1: Fixing a design mistake in the searchers interface.Marshall Clow2016-03-081-1/+1
| | | | llvm-svn: 262928
* Fix PR#25973 : 'basic_string::assign(InputIt, InputIt) doesn't provide the ↵Marshall Clow2016-01-131-55/+59
| | | | | | strong exception safety guarantee'. This turned out to be a pervasive problem in <string>, which required a fair amount of rework. Add in an optimization for when iterators provide noexcept increment/comparison/assignment/dereference (which covers many of the iterators in libc++). Reviewed as http://reviews.llvm.org/D15862 llvm-svn: 257682
* Cleanup: move visibility/linkage attributes to the first declaration.Evgeniy Stepanov2015-11-071-16/+32
| | | | | | | | | | | | This change moves visibility attributes from out-of-class method definitions to in-class declaration. This is needed for a switch to attribute((internal_linkage)) (see http://reviews.llvm.org/D13925) which can only appear on the first declaration. This change does not touch istream/ostream/streambuf. They are handled separately in http://reviews.llvm.org/D14409. llvm-svn: 252385
* ABI versioning macros for libc++.Evgeniy Stepanov2015-10-131-7/+7
| | | | | | | | C++ macros and CMake options that specify the default ABI version of the library, and can be overridden to pick up new ABI-changing features. llvm-svn: 250254
* Implement LWG#2063, and update the issues links to point to the github ↵Marshall Clow2015-10-051-0/+1
| | | | | | generated pages llvm-svn: 249325
* Fix most GCC warnings during build. Only -Wattribute left.Eric Fiselier2015-08-281-3/+4
| | | | llvm-svn: 246280
* [libcxx] Optimize away unneeded length calculation in ↵Eric Fiselier2015-08-281-2/+10
| | | | | | | | | | | | | | | | basic_string::compare(const char*) Summary: This patch optimizes basic_string::compare to use strcmp when the default char_traits has been given. See PR19900 for more information. https://llvm.org/bugs/show_bug.cgi?id=19900 Reviewers: mclow.lists Subscribers: bkramer, cfe-commits Differential Revision: http://reviews.llvm.org/D12355 llvm-svn: 246266
* implement more of N4258 - Cleaning up noexcept in the standard library. ↵Marshall Clow2015-08-181-7/+15
| | | | | | Specifically add new noexcept stuff to vector and string's move-assignment operations llvm-svn: 245330
* Change char_traits<char16_t>::eof() to return 0xFFFF instead of 0xDFFF. ↵Marshall Clow2015-08-041-1/+1
| | | | | | Fixes PR#24342 llvm-svn: 243937
* Enable and fix warnings during the build.Eric Fiselier2015-07-181-1/+6
| | | | | | | | | | | | | | | | | Although CMake adds warning flags, they are ignored in the libc++ headers because the headers '#pragma system header' themselves. This patch disables the system header pragma when building libc++ and fixes the warnings that arose. The warnings fixed were: 1. <memory> - anonymous structs are a GNU extension 2. <functional> - anonymous structs are a GNU extension. 3. <__hash_table> - Embedded preprocessor directives have undefined behavior. 4. <string> - Definition is missing noexcept from declaration. 5. <__std_stream> - Unused variable. llvm-svn: 242623
* Implement the first part of N4258: 'Cleaning up noexcept in the Library'. ↵Marshall Clow2015-07-131-25/+15
| | | | | | This patch deals with swapping containers, and implements a more strict noexcept specification (a conforming extension) than the standard mandates. llvm-svn: 242056
* While applying N4258, I forgot about LWG#2455, which modified the ↵Marshall Clow2015-06-041-9/+1
| | | | | | modifications. Correct those - h/t: Howard llvm-svn: 239004
* More of N4258 implementation. Mark all of our test_allocators as noexcept ↵Marshall Clow2015-06-031-2/+27
| | | | | | constructible. Make the constructors for basic_string noexcept all the time (under C++14). Update tests to reflect the new world order. More to come. llvm-svn: 238957
* Rooting out more undefined behavior in char_traits.Marshall Clow2015-02-131-8/+8
| | | | llvm-svn: 229119
OpenPOWER on IntegriCloud