Commit Graph

1455 Commits

Author SHA1 Message Date
Marshall Clow
0efd9dcfa0 Fix PR18404 - 'Bug in regex_token_iterator::operator++(int) implementation'. Enhance the tests for regex_token_iterator and regex_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198878 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-09 18:25:57 +00:00
Joerg Sonnenberger
4a07e0e159 Replace casts of __impl_ with the correct reinterpret_cast of the
address. Restores the assembly of before r198504.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198698 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-07 19:21:13 +00:00
Marshall Clow
908b5d7f92 Back out the <type_traits> changes from r198431; they were breaking when building with glibc. Need to find a better solution for PR18218.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198623 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-06 18:12:50 +00:00
Marshall Clow
af6cd294aa Removed extra trailing underscore in #ifdef (__GNUC___ --> __GNUC__ )
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198618 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-06 15:23:02 +00:00
Marshall Clow
0ea7f8cfb3 Rename several internal templates to get rid of ___ (triple underscores) or worse, four. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198608 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-06 14:00:09 +00:00
Joerg Sonnenberger
4c6acb5ecd Switch to using C++ style casts.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198505 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-04 17:43:00 +00:00
Yaron Keren
6c27250223 80 cols fixes.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198482 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-04 09:27:39 +00:00
Yaron Keren
c8d1bbab02 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.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198481 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-04 08:56:00 +00:00
Marshall Clow
a71f9562f0 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198457 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-03 22:55:49 +00:00
Marshall Clow
854a7a02b4 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()
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198431 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-03 18:21:14 +00:00
NAKAMURA Takumi
3f44c407b6 Update the copyright credits -- Happy new year 2014!
FIXME: Dragonegg may be updated at non-trivial changes.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198274 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-01 08:27:31 +00:00
Marshall Clow
239bc42b53 Make cv_status a class enum. Fixes PR18314. Thanks to Andersca for the report and the patch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@197921 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-23 22:14:27 +00:00
Yaron Keren
f1ebe26bdb Empty line between two unrelated #ifdefs.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@197810 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-20 13:19:45 +00:00
Logan Chien
8f48c23568 Fix GCC unknown pragma warning in libc++.
We should check defined(__clang__) before the usage of the
clang diagnostic pragmas.

The [-Wswitch] warning in src/future.cpp should be ignored.
As the result, the equivalent GCC pragma is added.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@197314 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-14 06:45:09 +00:00
Logan Chien
bfd68bf0c7 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.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@197313 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-14 06:44:09 +00:00
Marshall Clow
1c398696b0 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
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@197061 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-11 19:32:32 +00:00
Marshall Clow
73b46a7248 Refactored a bunch of duplicated code in <ostream>. Made a new routine called __put_character_sequence, and made nine places call it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@196951 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-10 19:25:49 +00:00
Marshall Clow
b671fc9b2d Refactor some of the operations in <string> so that they can be reused; no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@196788 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-09 16:00:28 +00:00
Howard Hinnant
615100223e Give all members of exception types default visibility. Lack of this is causing some illegal code relocations rare and hard to reproduce cases.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@196411 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 21:03:23 +00:00
Marshall Clow
1b92188a82 Found six (nmostly) identical files named 'test_allocator.h' in the libcxx test suite. Moved one to /support, made it a superset, and removed all but one of the others, and iupdated all the includes. Left the odd one (thread/futures/test_allocator.h) for later.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@196174 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-03 00:18:10 +00:00
Marshall Clow
ebedffde9a Found two identical files named 'allocators.h' in the libcxx test suite. Moved one to /support, removed the other, and iupdated all the includes. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@196127 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-02 18:08:31 +00:00
Marshall Clow
e27dbcf2dc Found two identical files named 'DefaultOnly.h' in the libcxx test suite. Moved one to /support, removed the other, and iupdated all the includes. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@196118 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-02 17:00:56 +00:00
Marshall Clow
6daf534441 Fix for PRPR17934; based on a fix suggested by Peter Sommerlad
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@196058 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-02 03:24:33 +00:00
Sylvestre Ledru
a7d46056b0 Remove executable permissions on a text file
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@196041 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-01 10:15:11 +00:00
Howard Hinnant
92b327712b Remove _LIBCPP_TRIVIAL_PAIR_COPY_CTOR=0 for __APPLE__, no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@195796 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 00:53:02 +00:00
Marshall Clow
061d0cc4db There were two identical files named 'min_allocator.h'. Move one of them to /support and delete the other. Then adjust all the tests that used them to include the moved one. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@195785 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26 20:58:02 +00:00
Joerg Sonnenberger
bfaafd539c Don't use T as template argument, it is part of the application
namespace.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@195693 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-25 22:44:20 +00:00
Yaron Keren
37d0212c57 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.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@195431 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-22 09:22:12 +00:00
Marshall Clow
016d4e847a Patch by Xing Xue to improve libc++ support for AIX
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@195144 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-19 19:16:03 +00:00
Marshall Clow
16c76a2107 Fix a test that I broke over the weekend
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@195143 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-19 19:14:27 +00:00
Marshall Clow
2ccffefaff 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@195136 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-19 18:05:03 +00:00
Yaron Keren
81241a9440 G M suggestion: conditionally include files on _WIN32.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@195045 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-18 21:30:19 +00:00
Yaron Keren
15c04bedad 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.




git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@195044 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-18 21:12:14 +00:00
Bill Wendling
35080eae90 Set the permissions for 'experimental' and its context to the correct values.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194993 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-18 07:01:16 +00:00
Yaron Keren
1823bea43a Fix-it suggestion for fixing min or max defines on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194891 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 23:41:01 +00:00
Yaron Keren
c26c385592 Windows.h is not required.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194870 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 22:54:15 +00:00
Marshall Clow
0cdbe60481 Move <optional> into include/experimental, and into the std::experimental namespace, since it's not part of C++14, but of an upcoming TS
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194867 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 22:42:10 +00:00
Justin Bogner
ec5714f27a Add the CMakeLists.txt that was missed in r194825
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194838 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 18:34:43 +00:00
Howard Hinnant
c4962b3f44 Justin Bogner: This makes the headers available in the build directory, making it
easier to use freshly-built clang with freshly-built libc++.

Basically, this makes it possible to run clang with libc++ without
having to install it, even if you don't have any version of libc++
installed in /usr/

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194825 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 17:18:57 +00:00
Howard Hinnant
65173fee34 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194742 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-14 22:52:25 +00:00
Marshall Clow
0c6a583e2a Fixed bug in quoted strings implementation. Added test to be sure. Thanks to Peter Sommerlad for the report (and suggested fix)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194725 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-14 20:01:38 +00:00
Marshall Clow
6b7c2aeb00 Move <dynarray> into include/experimental, and into the std::experimental namespace, since it's not part of C++14, but of an upcoming TS
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194614 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-13 22:44:48 +00:00
Marshall Clow
525a0fb982 Add directory for TSes, etc
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194591 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-13 18:25:56 +00:00
Howard Hinnant
3f81e9eeba 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194536 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-13 00:39:22 +00:00
Marshall Clow
a46a0ad9e5 Patch from Bruce Mitchener; fixes two typos in comments. No functionality change. PR17843
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194432 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-11 23:27:19 +00:00
Howard Hinnant
29250b7ec8 Tell libc++abi whether or not libc++ has declared bad_array_length.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194207 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-07 17:15:51 +00:00
Marshall Clow
fe2a561fca 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194185 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-07 01:00:50 +00:00
Howard Hinnant
3de5086dc7 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194154 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-06 17:45:43 +00:00
Marshall Clow
ecc8d7b334 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
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194151 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-06 14:24:38 +00:00
Marshall Clow
5ffe591d55 Refactor floating point code for num_get::do_get into a template. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194080 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-05 14:28:52 +00:00