Commit Graph

716 Commits

Author SHA1 Message Date
Howard Hinnant
e3e3291f3a Fixed PR10574: http://llvm.org/bugs/show_bug.cgi?id=10574
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@137522 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 21:56:02 +00:00
Howard Hinnant
8caf423916 Correct misspelling:_LIBCPP_APPLE_STABLE_ABI -> _LIBCPP_STABLE_APPLE_ABI
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136597 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-31 17:16:32 +00:00
Howard Hinnant
8775816ba3 Change how _LIBCPP_HAS_NO_ADVANCED_SFINAE gets set.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136596 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-31 17:10:44 +00:00
Howard Hinnant
199d0aec1b Fixed PR10507 (http://llvm.org/bugs/show_bug.cgi?id=10507)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136595 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-31 17:04:30 +00:00
Chandler Carruth
9d7530935d Revert r136547, r136545, and r136542 by removing slist.
This was checked in without review. It is not clear its reasonable to
include with libc++ at all, and needs discussion at a highlevel before
moving forward.

It's also completely lacking tests, and included several bugs in the
implementation.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136577 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-30 21:10:18 +00:00
Chandler Carruth
a73da5d2ca Revert r136546, which was submitted without review.
Original change:
Destruct elements of hash tables when removing individual entries from
the hash_table. I think this is the correct solution to PR10507, but I'm
not sure since this is a little bit cargo-culted. Howard, please review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136576 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-30 21:10:16 +00:00
Sean Hunt
8f0396e443 Add the missing default argument for the allocator and use a cleaner
implementation of previous().

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136547 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-30 00:47:53 +00:00
Sean Hunt
b59b929cc9 Destruct elements of hash tables when removing individual entries from
the hash_table. I think this is the correct solution to PR10507, but I'm
not sure since this is a little bit cargo-culted. Howard, please review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136546 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-30 00:18:12 +00:00
Sean Hunt
70bbcae9b5 Oops. That last commit was from an earlier revision of the file and was
more than just a bit broken. This one should compile and run without
infinite loops.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136545 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-30 00:06:52 +00:00
Sean Hunt
d50c1c7429 Include an "implementation" if SGI's slist. This was quickly hacked
together to get it working with code, and is neither optimal
(erase(Iterator, Iterator) calculates the previous iterator twice,
rather than calculating the previous iterator of the first one, then
advancing it until the second is found) nor complete (splice() was not
implemented). Most of the implementation is borrowed from forward_list
via using-declarations.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136542 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 23:42:36 +00:00
Sean Hunt
110b8bf57e Explicitly invoke the size_type specialization of max and min. This
avoids bugs where, when the allocator's size_type was smaller than int,
the multiplication or division would cause integral promotions and, with
two different integer types as arguments, deduction of the template
arguments would fail.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136540 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 23:31:58 +00:00
Sean Hunt
affd9e5d43 Add a new hash class in __gnu_ext for the extension containers. There
are two motivations for this.

First, this allows users who are specializing __gnu_ext::hash to
continue doing so without changing their code.

Second, SGI specifies hash overloads for char* and const char* that
perform a hash of the string, not of the pointer.

In order to support this, the hashing code for string is factored out.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136539 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 23:31:56 +00:00
Sean Hunt
e36a196049 Add two missing members from the extension hash containers. The first is
the type name 'data_type', which is specified by the SGI spec as being
the correct type name for the mapped type. The second is an overload of
insert found in standard containers, taking an iterator as a 'hint'
(which we ignore in the standard containers as well). libstdc++'s
implementation includes these overloads, and they are needed to make
insert_iterator work (which I suspect is the real motivation for
including them in the standard containers).

The motivation for including these overloads of insert and leaving the
mapped_type typedef is to make it easier for clients to migrate to the
standard containers.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136538 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 23:31:53 +00:00
Howard Hinnant
23369ee812 Configure to get along with 2.9 clang
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136526 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 21:35:53 +00:00
Howard Hinnant
db86663223 Optimizing valarray::operator=(some-valarray-expression)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136291 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-27 23:19:59 +00:00
Howard Hinnant
9c59d38112 Fix PR10509: http://llvm.org/bugs/show_bug.cgi?id=10509
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136247 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-27 19:25:28 +00:00
Howard Hinnant
d36369d910 Fix PR10510: http://llvm.org/bugs/show_bug.cgi?id=10510
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136232 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-27 18:34:06 +00:00
Howard Hinnant
4f598034d2 http://llvm.org/bugs/show_bug.cgi?id=10469
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135897 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-24 23:59:50 +00:00
Howard Hinnant
fa06d75e8d Optimization of string::operator< by M.E. O'Neill. Discussion in http://llvm.org/bugs/show_bug.cgi?id=10461
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135893 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-24 21:45:06 +00:00
Howard Hinnant
2644a7b3da http://llvm.org/bugs/show_bug.cgi?id=10461
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135873 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-24 15:07:21 +00:00
Howard Hinnant
099084d52f http://llvm.org/bugs/show_bug.cgi?id=10455
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135854 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-23 16:14:35 +00:00
Dave Zarzycki
b3296ae5bc Test commit
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135774 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-22 17:08:57 +00:00
Howard Hinnant
bf6666f7a0 Correct test.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135460 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-19 01:07:49 +00:00
Sean Hunt
541cb301a1 Adjust two tests to account for a nasty change in copying behavior
between C++03 and C++0x and its effect on exceptions, and another two to
not test move construction when rvalue references are not available.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135445 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 23:51:25 +00:00
Sean Hunt
13aaf422e4 Make all fstream tests use tmpnam if creating files, rather than
hard-coded names.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135444 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 23:51:21 +00:00
Sean Hunt
e6440c6fa2 Do a litmus test of using tmpnam to generate safe temporary file names
for the tests that open new data files.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135422 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 20:46:16 +00:00
Sean Hunt
737a351850 Given that __underlying_type is now available in clang, implement
std::underlying_type.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135410 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 18:37:21 +00:00
Sean Hunt
2d81f3d1f3 Give A an explicitly non-throwing destructor so that B's destructor is
itself non-throwing.  Since nested_exception's destructor is
non-throwing, if B's destructor is not, this causes an error in C++03
mode due to the overriding function having a more lax specification.
This did not occur in C++0x mode as A's destructor was implicitly
non-throwing.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135400 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 17:07:53 +00:00
Howard Hinnant
464aa5cad3 http://llvm.org/bugs/show_bug.cgi?id=10390
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135393 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 15:51:59 +00:00
Howard Hinnant
bcbbd4d14f Revert locale for apple back to original design, getting rid of now useless helper *_l functions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135272 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 14:46:11 +00:00
Howard Hinnant
9a2078137f _LIBCXX_STABLE_APPLE_ABI -> _LIBCPP_STABLE_APPLE_ABI
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135271 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 14:25:40 +00:00
Sean Hunt
a78264f872 Fix wchar tests by not assuming that tm is complete and by using the
proper va_list time on non-darwin platforms.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135247 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 05:44:47 +00:00
Sean Hunt
f3907e6cc0 Reapply 135035 with proper conditional inclusion, hopefully solving
issues with it.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135246 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 05:40:33 +00:00
Howard Hinnant
912012e949 http://llvm.org/bugs/show_bug.cgi?id=10353
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135125 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 01:34:46 +00:00
Howard Hinnant
22ba71b8ef http://llvm.org/bugs/show_bug.cgi?id=10346
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135045 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 16:00:50 +00:00
Howard Hinnant
8d75632ad0 Reverted to 134947. Once I got into it, I discovered there were too many problems to fix in 135035.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135044 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 15:48:16 +00:00
Sean Hunt
c97da3a590 Implement the __nolocale functions properly so that they will work on
all platforms. Unfortunately a lot of this remains conditionally
compiled so as not to break Apple's ABI.

The new _LIBCPP_LOCALE__L_EXTENSIONS macro can be defined on other
platforms that support _l suffixes for all functions in order to use
them.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@135035 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 06:40:50 +00:00
Sean Hunt
0389c53f44 Make sure that __time_put constructors properly on non-Apple platforms.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134947 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 00:55:04 +00:00
Howard Hinnant
66f2641ac9 Toralf Niebuhr: This is just a tiny patch fixing some small (probably copy & paste) errors.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134843 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 19:47:01 +00:00
Howard Hinnant
2bf1c08510 Make vector<bool>::reference and const_reference public
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134815 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 15:50:42 +00:00
Sean Hunt
6f0342cf2e Don't assume that wctype produces a nice mask on all platforms. On
glibc, for instance, it's a const char *.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134787 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 03:40:04 +00:00
Sean Hunt
e59f724f79 Conditionally wrap the changes from r134781.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134783 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 01:09:31 +00:00
Sean Hunt
62a6ac33a2 Implement generalized table lookups for upper, lower, and character
traits.

To the best of my knowledge, this will not break the ABI for Apple.
However, it does introduce three publicly visible (although with
reserved name) functions that will fail to link against the just-shipped
Apple version of libc++. Since they are not used in any inline
functions, no actual breakage should occur.

If Howard doesn't want to put undefined functions (even internal ones)
into a header, they could be surrounded by additional conditional
compilation.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134781 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 00:56:23 +00:00
Howard Hinnant
043fe1d931 provide ~future_error() definition
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134663 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 00:04:40 +00:00
Sean Hunt
cb05a0801a Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134650 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 22:45:07 +00:00
Howard Hinnant
ac6de546bd Fixing up some ABI issues
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134639 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 21:03:52 +00:00
Sean Hunt
12c3d374a5 <inttypes.h> does not necessarily include <stdint.h>. Accordingly, do
not test for this.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134531 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 20:52:28 +00:00
Howard Hinnant
9f66bffdbe Fix uninitialized loop counter. http://llvm.org/bugs/show_bug.cgi?id=10278
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134405 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 14:14:17 +00:00
Howard Hinnant
3c8894b078 Make the default Makefile less destructive: John McCall
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134375 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-04 14:12:27 +00:00
Howard Hinnant
f03c3b4612 http://llvm.org/bugs/show_bug.cgi?id=10248
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134327 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 20:33:23 +00:00