Commit Graph

1293 Commits

Author SHA1 Message Date
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
Marshall Clow
3b3108ec59 Better inline marking for __does_policy_contain. Thanks to Chongyu Zhu for the catch
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193963 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-03 22:06:53 +00:00
Marshall Clow
d8a8f57387 Mark __does_policy_contain as 'inline'. Thanks to Chongyu Zhu for the catch
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193962 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-03 20:07:47 +00:00
Marshall Clow
ad2a600c2a Fix LWG Issue 2078. Make std::async(policy,...) try multiple policies until one succeeds.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193960 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-03 15:43:35 +00:00
Marshall Clow
76a8670ce4 LWG issue 2341; Make the two variants of basic_ostream::seekp and basic_istream::seekg behave consistently; update tests to make sure
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193814 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 22:20:45 +00:00
Marshall Clow
09f8550e1c Fixes PR17148
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193772 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 17:23:08 +00:00
Marshall Clow
4259337da2 Update status of issues
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193228 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-23 05:59:18 +00:00
Marshall Clow
65ccddb341 Mark seed_seq default constructor and size() as noexcept. This is implied, but not required by LWG issue 2180
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193227 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-23 05:56:47 +00:00
Marshall Clow
0f7afe7b8e Patch by GM: Turn off 'deprecated' warnings when building with MSVC, and add '-Werror=return-type' to catch funtions that aren't returning what they should.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193088 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 15:56:35 +00:00
Marshall Clow
33ae2337e2 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193087 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 15:43:25 +00:00
Marshall Clow
a36451371c Patch from GM: locale.cpp; make implicit conversions to bool explicit, fix some 'unknown pragma' warnings when compiling under MSVC, and don't use the __sso_allocator under windows, b/c MSVC doesn't support aligned-by value parameters
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193086 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 15:07:28 +00:00
Marshall Clow
8a43fca8ed Patch by GM: Making implicit conversion to bool explicit in <ios> and <__locale>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193085 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 14:41:05 +00:00
Marshall Clow
0ac5cce17c Patch by GM: Adding MSVC support to __bit_reference
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193084 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 14:29:37 +00:00