Commit Graph

793 Commits

Author SHA1 Message Date
Yaron Keren acb42aefd7 80 cols fixes.
llvm-svn: 198482
2014-01-04 09:27:39 +00:00
Yaron Keren f8f56755e0 Implement the functions: clz, clzl, clzll, ctz, ctzl, and ctzll
for libcxx when compiled with Visual C++ on Win32 and Win64.

clang and gcc (MinGW) compilers provide these implementations themselves.

llvm-svn: 198481
2014-01-04 08:56:00 +00:00
Marshall Clow 0724bf6767 Rename ___make_pair_return to __make_pair_return_impl; ___make_tuple_return to __make_tuple_return_impl; and ____iterator_traits to __iterator_traits_impl. Part of a campaign to remove > 2 underscores from libc++. No functionality change.
llvm-svn: 198457
2014-01-03 22:55:49 +00:00
Marshall Clow d41295da72 Patch by Howard. First part of fix for PR18218; add type traits needed to do the right thing. Fix the problems in PR18218 for isnan and pow - they also need to be applied to the other functions in <cmath>. Also, a drive-by fix for the test - now actually calls test_abs()
llvm-svn: 198431
2014-01-03 18:21:14 +00:00
Marshall Clow ce81aed463 Make cv_status a class enum. Fixes PR18314. Thanks to Andersca for the report and the patch.
llvm-svn: 197921
2013-12-23 22:14:27 +00:00
Yaron Keren 21a697b8b1 Empty line between two unrelated #ifdefs.
llvm-svn: 197810
2013-12-20 13:19:45 +00:00
Logan Chien ca83921ddc GCC does not support strong enum in pre-C++0x mode.
GCC does not support strong enum if -std=c++0x is not used.
Without the strong enum, we will see following error:

  In file included from libcxx/include/ostream:131:0,
                   from libcxx/include/sstream:174,
                   from libcxx/include/complex:247,
                   from cpp03-headers.cpp:11:
  libcxx/include/ios:419:68: error: 'io_errc' is not a class or namespace
  libcxx/include/ios:420:66: error: 'io_errc' is not a class or namespace

To workaround this issue, this commit will define
_LIBCPP_HAS_NO_STRONG_ENUMS when we are compiling with
g++ without c++0x.

llvm-svn: 197313
2013-12-14 06:44:09 +00:00
Marshall Clow c66a611b27 Move std::begin(array) and std::end(array) out from under an #ifdef that was preventing people from building libc++ using gcc. This corrects a mistake that I introduced in r196058
llvm-svn: 197061
2013-12-11 19:32:32 +00:00
Marshall Clow 6bc32ebf35 Refactored a bunch of duplicated code in <ostream>. Made a new routine called __put_character_sequence, and made nine places call it.
llvm-svn: 196951
2013-12-10 19:25:49 +00:00
Marshall Clow 8283ba3704 Refactor some of the operations in <string> so that they can be reused; no functionality change
llvm-svn: 196788
2013-12-09 16:00:28 +00:00
Howard Hinnant 395485efc0 Give all members of exception types default visibility. Lack of this is causing some illegal code relocations rare and hard to reproduce cases.
llvm-svn: 196411
2013-12-04 21:03:23 +00:00
Marshall Clow 3772a46ab4 Fix for PRPR17934; based on a fix suggested by Peter Sommerlad
llvm-svn: 196058
2013-12-02 03:24:33 +00:00
Howard Hinnant 6ef2bb02f5 Remove _LIBCPP_TRIVIAL_PAIR_COPY_CTOR=0 for __APPLE__, no longer needed.
llvm-svn: 195796
2013-11-27 00:53:02 +00:00
Joerg Sonnenberger c55d97b1f9 Don't use T as template argument, it is part of the application
namespace.

llvm-svn: 195693
2013-11-25 22:44:20 +00:00
Yaron Keren e050d66e12 Compiling libcxx with gcc 4.6.4 (MingW) produces these errors:
type_traits:3280:31: error: expected primary-expression before 'decltype'
 type_traits:3280:29: error: expected ';' at end of member declaration

 memory:2415:49: error: function 'std::__1::default_delete<_Tp>::default_delete()'
 defaulted on its first declaration must not have an exception-specification

 memory:2435:49: error: function 'std::__1::default_delete<_Tp []>::default_delete()'
 defaulted on its first declaration must not have an exception-specification

The attached patch defines _LIBCPP_HAS_NO_ADVANCED_SFINAE and 
_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS for gcc version < 4.7, making
the library compile with gcc 4.6.4.

llvm-svn: 195431
2013-11-22 09:22:12 +00:00
Marshall Clow 028875aa7c Patch by Xing Xue to improve libc++ support for AIX
llvm-svn: 195144
2013-11-19 19:16:03 +00:00
Marshall Clow 7e1ea8d288 Patch by Bruce Mitchener. Change all references to EMSCRIPTEN to __EMSCRIPTEN__. If you're not using the PP symbol EMSCRIPTEN, then you should see no functionality change.
llvm-svn: 195136
2013-11-19 18:05:03 +00:00
Yaron Keren fbeb63c0d1 This patch implements snprintf_l function in a way similar to the other
functions in src/support/win32/locale_win32.cpp and locale_win32.h, 
calling upon vsnprintf for which there is a MingW correct alternative.

Note! __USE_MINGW_ANSI_STDIO is not modified in this patch. In order to 
use the __mingw version it must be defined before including the MingW 
headers.

llvm-svn: 195044
2013-11-18 21:12:14 +00:00
Yaron Keren c0299d7f53 Fix-it suggestion for fixing min or max defines on Windows.
llvm-svn: 194891
2013-11-15 23:41:01 +00:00
Yaron Keren 6e72b8ba8c Windows.h is not required.
llvm-svn: 194870
2013-11-15 22:54:15 +00:00
Marshall Clow dfdac03c8f Move <optional> into include/experimental, and into the std::experimental namespace, since it's not part of C++14, but of an upcoming TS
llvm-svn: 194867
2013-11-15 22:42:10 +00:00
Justin Bogner fd6cfe92d3 Add the CMakeLists.txt that was missed in r194825
llvm-svn: 194838
2013-11-15 18:34:43 +00:00
Howard Hinnant f9fd0d6d11 This is a followup to r194536, which changed the pair copy constructor to be
trivial in C++03, thus making it trivial in both C++03 and C++11.

This patch allows one to opt-in/out of this decision with a macro.  You can
choose to have the pair copy constructor always be trivial, or always be
non-trivial.  The flag controlling this is now _LIBCPP_TRIVIAL_PAIR_COPY_CTOR.

The client can define this flag to 1, and the pair copy constructor will be
trivial (when possible of course), or to 0, and the pair copy constructor will
be nontrivial.

Default settings for this flag are set in <__config> (as usual).  With this
commit the default is _LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 for all platforms
except __APPLE__, which defaults to _LIBCPP_TRIVIAL_PAIR_COPY_CTOR=0.

llvm-svn: 194742
2013-11-14 22:52:25 +00:00
Marshall Clow 513ecaba91 Fixed bug in quoted strings implementation. Added test to be sure. Thanks to Peter Sommerlad for the report (and suggested fix)
llvm-svn: 194725
2013-11-14 20:01:38 +00:00
Marshall Clow 21fee96f69 Move <dynarray> into include/experimental, and into the std::experimental namespace, since it's not part of C++14, but of an upcoming TS
llvm-svn: 194614
2013-11-13 22:44:48 +00:00
Howard Hinnant ccad8c32e0 This fixes a very subtle ABI problem concerning the copy constructor of
pair, and a couple of pair-like implementation detail types.  The
C++98/03 and 11 standards all specify that the copy constructor of
pair<int, int> is trivial. However as libc++ tracked the draft C++11
standard over the years, this copy constructor became non-trivial, and
then just recently was corrected back to trivial for C++11.

Unfortunately (for libc++1) the Itanium ABI specifies different calling
conventions for trivial and non-trivial copy constructors.  Therefore
currently the C++03 libc++ copy constructor for pair<int, int> is ABI
incompatible with the C++11 libc++ copy constructor for pair<int, int>.
This is Bad(tm).   This patch corrects the situation by making this copy
constructor trivial in C++03 mode as well.

Just in case it is needed for an incomplete C++11 compiler, libc++
retains the ability to support pair with rvalue references, but without
defaulted special members.  However the pair needs non-trivial special
members to implement this special case, (as it did when clang was in
this place a couple of years ago).

During this work a bug was also found and fixed in
is_trivially_constructible.

And there is a minor drive-by fix in <__config> regarding
__type_visibility__.

A test is updated to ensure that the copy constructor of pair<int, int>
is trivial in both C++03 and C++11.  This test will necessarily fail for
a compiler that implements rvalue references but not defaulted special
members.

llvm-svn: 194536
2013-11-13 00:39:22 +00:00
Howard Hinnant 88960d151e Tell libc++abi whether or not libc++ has declared bad_array_length.
llvm-svn: 194207
2013-11-07 17:15:51 +00:00
Marshall Clow 57b8f44c87 More duplicate code removal in <locale>. Hoist common parsing code into two templates: num_get::__do_get_signed and num_get::__do_get_unsigned, and make the do_get routines call them. No functionality change.
llvm-svn: 194185
2013-11-07 01:00:50 +00:00
Howard Hinnant 4478b25ade Fix several tuple bugs that were exposed by clang's implementation of CWG 1402. This fixes http://llvm.org/bugs/show_bug.cgi?id=17798.
llvm-svn: 194154
2013-11-06 17:45:43 +00:00
Marshall Clow e427322327 Fix an off-by-one error in basic_string::__grow_by, where it would incorrectly throw length_error (instead of bad_alloc) when attempting to resize the string to 'max_size()'. Add tests for resizing to max_size +/-1
llvm-svn: 194151
2013-11-06 14:24:38 +00:00
Marshall Clow 9d66b72aa9 Refactor floating point code for num_get::do_get into a template. No functionality change
llvm-svn: 194080
2013-11-05 14:28:52 +00:00
Marshall Clow 99c096472d Better inline marking for __does_policy_contain. Thanks to Chongyu Zhu for the catch
llvm-svn: 193963
2013-11-03 22:06:53 +00:00
Marshall Clow 222d1c7f13 Mark __does_policy_contain as 'inline'. Thanks to Chongyu Zhu for the catch
llvm-svn: 193962
2013-11-03 20:07:47 +00:00
Marshall Clow b1915875d0 Fix LWG Issue 2078. Make std::async(policy,...) try multiple policies until one succeeds.
llvm-svn: 193960
2013-11-03 15:43:35 +00:00
Marshall Clow e1bedf4e93 LWG issue 2341; Make the two variants of basic_ostream::seekp and basic_istream::seekg behave consistently; update tests to make sure
llvm-svn: 193814
2013-10-31 22:20:45 +00:00
Marshall Clow f5fa53882f Fixes PR17148
llvm-svn: 193772
2013-10-31 17:23:08 +00:00
Marshall Clow 07c28fe026 Mark seed_seq default constructor and size() as noexcept. This is implied, but not required by LWG issue 2180
llvm-svn: 193227
2013-10-23 05:56:47 +00:00
Marshall Clow e604469e5c Patch by GM: apparently '__value' (two underscores) is a special name in Visual Studio, so rename the private method in <regex> with that name. GM's patch used '___value' (three underscores), but I changed that to '__regex_traits_value' because I've been burned in the past by identifiers that appear identical but are not.
llvm-svn: 193087
2013-10-21 15:43:25 +00:00
Marshall Clow 5b40666c6c Patch by GM: Making implicit conversion to bool explicit in <ios> and <__locale>
llvm-svn: 193085
2013-10-21 14:41:05 +00:00
Marshall Clow d8cfc7dce9 Patch by GM: Adding MSVC support to __bit_reference
llvm-svn: 193084
2013-10-21 14:29:37 +00:00
Marshall Clow 9f21325ac7 Patch from GM to make more implicit bools explicit since we can't stop MSVC warning about this in headers and to warn is the MSVC default. No functionality change.
llvm-svn: 192548
2013-10-13 01:02:45 +00:00
Marshall Clow c3776b1ce0 LWG Issue 2087: iostream_category() and noexcept
llvm-svn: 192545
2013-10-12 22:49:56 +00:00
Marshall Clow d58daf9433 LWG Issue 2097: packaged_task constructors should be constrained
llvm-svn: 192544
2013-10-12 22:49:17 +00:00
Marshall Clow f28fd284f8 LWG issue 2143: ios_base::xalloc should be thread-safe
llvm-svn: 192539
2013-10-12 19:13:52 +00:00
Marshall Clow 8de32cb3dc Implement national body comment GB9: remove std::gets
llvm-svn: 192538
2013-10-12 19:09:47 +00:00
Marshall Clow 0354b92992 patch by Yaron: Uses rand_s() from stdlib.h (when building for Windows)
llvm-svn: 192325
2013-10-09 21:49:03 +00:00
Marshall Clow db78c7049e Fix LWG Issue 2141: common_type trait produces reference types
llvm-svn: 192142
2013-10-07 23:43:33 +00:00
Howard Hinnant 04c63bdb36 G M: Rename local variable from __except to avoid MSVC keyword clash.
llvm-svn: 192072
2013-10-06 21:00:29 +00:00
Howard Hinnant 32f9a776fb Use _LIBCPP_NEW_DELETE_VIS instead of LIBCPP_FUNC_VIS in src/new.cpp.
llvm-svn: 192071
2013-10-06 20:53:24 +00:00
Howard Hinnant f66a81ad56 Yaron Keren: Add missing comment.
llvm-svn: 192068
2013-10-06 19:48:40 +00:00