summaryrefslogtreecommitdiffstats
path: root/libcxx/src/ios.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [libc++] Avoid UB in the no-exceptions mode in a few placesLouis Dionne2019-02-121-15/+6
| | | | | | | | | | | | | | | | | | | | | | | Summary: A few places in the library seem to behave unexpectedly when the library is compiled or used with exceptions disabled. For example, not throwing an exception when a pointer is NULL can lead us to dereference the pointer later on, which is UB. This patch fixes such occurences. It's hard to tell whether there are other places where the no-exceptions mode misbehaves like this, because the replacement for throwing an exception does not always seem to be abort()ing, but at least this patch will improve the situation somewhat. See http://lists.llvm.org/pipermail/libcxx-dev/2019-January/000172.html Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D57761 llvm-svn: 353850
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on WindowsEric Fiselier2017-05-311-0/+1
| | | | | | | | | | | | | | | | Summary: This patch improves how libc++ handles min/max macros within the headers. Previously libc++ would undef them and emit a warning. This patch changes libc++ to use `#pragma push_macro` to save the macro before undefining it, and `#pragma pop_macro` to restore the macros and the end of the header. Reviewers: mclow.lists, bcraig, compnerd, EricWF Reviewed By: EricWF Subscribers: cfe-commits, krytarowski Differential Revision: https://reviews.llvm.org/D33080 llvm-svn: 304357
* [libc++] Fix extern template visibility for WindowsShoaib Meenai2016-09-191-9/+9
| | | | | | | | | | On Windows, marking an `extern template class` declaration as exported actually forces an instantiation, which is not the desired behavior. Instead, the actual explicit instantiations need to be exported. Differential Revision: https://reviews.llvm.org/D24679 llvm-svn: 281925
* [libcxx] Allow use of <atomic> in C++03. Try 3.Eric Fiselier2015-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: After putting this question up on cfe-dev I have decided that it would be best to allow the use of `<atomic>` in C++03. Although static initialization is a concern the syntax required to get it is C++11 only. Meaning that C++11 constant static initialization cannot silently break in C++03, it will always cause a syntax error. Furthermore `ATOMIC_VAR_INIT` and `ATOMIC_FLAG_INIT` remain defined in C++03 even though they cannot be used because C++03 usages will cause better error messages. The main change in this patch is to replace `__has_feature(cxx_atomic)`, which only returns true when C++ >= 11, to `__has_extension(c_atomic)` which returns true whenever clang supports the required atomic builtins. This patch adds the following macros: * `_LIBCPP_HAS_C_ATOMIC_IMP` - Defined on clang versions which provide the C `_Atomic` keyword. * `_LIBCPP_HAS_GCC_ATOMIC_IMP` - Defined on GCC > 4.7. We must use the fallback atomic implementation. * `_LIBCPP_HAS_NO_ATOMIC_HEADER` - Defined when it is not safe to include `<atomic>`. `_LIBCPP_HAS_C_ATOMIC_IMP` and `_LIBCPP_HAS_GCC_ATOMIC_IMP` are mutually exclusive, only one should be defined. If neither is defined then `<atomic>` is not implemented and including `<atomic>` will issue an error. Reviewers: chandlerc, jroelofs, mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11555 llvm-svn: 245463
* Move atomic_support.h and config_elast.h into src/includeEric Fiselier2015-08-181-1/+1
| | | | llvm-svn: 245354
* [libcxx] Set _LIBCPP_ELAST for mingw.Dan Albert2015-01-061-5/+9
| | | | | | | | | | | | Reviewers: K-ballo, mclow.lists, EricWF Reviewed By: EricWF Subscribers: jfb, jroelofs, majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D6558 llvm-svn: 225273
* PR #21321 talked about implementation-defined behavior of realloc. I ↵Marshall Clow2014-10-271-28/+22
| | | | | | poo-poohed it, and was wrong. Fix the call in <locale>. Review the others, refactored some duplicated code, and found overflow bugs (and __event_cap_ was never getting updated, either). llvm-svn: 220702
* Address some post-commit review comments on r217261Jonathan Roelofs2014-09-051-1/+1
| | | | llvm-svn: 217276
* Allow libc++ to be built on systems without POSIX threadsJonathan Roelofs2014-09-051-1/+1
| | | | | | | | | | If you're crazy enough to want this sort of thing, then add -D_LIBCPP_HAS_NO_THREADS to your CXXFLAGS and --param=additiona_features=libcpp-has-no-threads to your lit commnad line. http://reviews.llvm.org/D3969 llvm-svn: 217271
* Newlib names ELAST differently than linuxJonathan Roelofs2014-09-021-5/+4
| | | | llvm-svn: 216943
* Revert "Turn off extern templates for most uses."Justin Bogner2014-08-151-2/+0
| | | | | | | | | | | Turning off explicit template instantiation leads to a pretty significant build time and code size cost. We're better off dealing with ABI incompatibility issues that come up in a less heavy handed way. This reverts commit r189610. llvm-svn: 215740
* Linux: Correctly identify valid error codesDavid Majnemer2014-05-291-1/+3
| | | | | | | | | | | | | | [syserr.errcat.objects]p4 specifies that system_category().default_error_condition(ev) map to error_condition(posv, generic_category()) if ev could map to a POSIX errno. Linux reserves up to and including 4095 for errno values, use this as a bound. This fixes syserr.errcat.objects/system_category.pass.cpp on Linux. llvm-svn: 209795
* Fix typosAlp Toker2014-05-151-1/+1
| | | | llvm-svn: 208869
* Switch to using C++ style casts.Joerg Sonnenberger2014-01-041-16/+25
| | | | llvm-svn: 198505
* LWG Issue 2087: iostream_category() and noexceptMarshall Clow2013-10-121-1/+1
| | | | llvm-svn: 192545
* LWG issue 2143: ios_base::xalloc should be thread-safeMarshall Clow2013-10-121-1/+4
| | | | llvm-svn: 192539
* Turn off extern templates for most uses. It is causing more problems than ↵Howard Hinnant2013-08-291-0/+2
| | | | | | it is worth. The extern templates will still be built into the dylib, mainly for ABI stability purposes. And the client can still turn these back on with a #define if desire. This fixes http://llvm.org/bugs/show_bug.cgi?id=17027. However there's no associated test for the test suite because http://llvm.org/bugs/show_bug.cgi?id=17027 needs mismatched dylib and headers to fire. llvm-svn: 189610
* noexcept and constexpr applied to <ios>.Howard Hinnant2012-07-211-1/+1
| | | | llvm-svn: 160593
* _STD -> _VSTD to avoid macro clash on windowsHoward Hinnant2011-06-301-19/+19
| | | | llvm-svn: 134190
* Applied noexcept to everything in [diagnostics] (Chapter 19)Howard Hinnant2011-05-261-2/+2
| | | | llvm-svn: 132137
* Chris Jefferson noted many places where function calls needed to be ↵Howard Hinnant2011-02-141-3/+3
| | | | | | qualified (thanks Chris). llvm-svn: 125510
* license changeHoward Hinnant2010-11-161-2/+2
| | | | llvm-svn: 119395
* Fixing whitespace problemsHoward Hinnant2010-08-221-7/+7
| | | | llvm-svn: 111751
* now works with -fno-exceptions and -fno-rttiHoward Hinnant2010-08-111-0/+14
| | | | llvm-svn: 110828
* [string.conversions]Howard Hinnant2010-06-021-55/+0
| | | | llvm-svn: 105336
* patch by Jeffrey Yasskin for porting to Ubuntu Hardy. Everything was ↵Howard Hinnant2010-05-241-1/+5
| | | | | | accepted except there were some bug fixes needed in <locale> for the __nolocale_* series. For the apple branch I ended up using templates instead of the var_args solution because it seemed both safer and more efficient. llvm-svn: 104516
* Wiped out some non-ascii characters that snuck into the copyright.Howard Hinnant2010-05-111-1/+1
| | | | llvm-svn: 103516
* libcxx initial importHoward Hinnant2010-05-111-0/+492
llvm-svn: 103490
OpenPOWER on IntegriCloud