Commit Graph

1275 Commits

Author SHA1 Message Date
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
Richard Smith
aa87532fee Avoid using the name 'bzero' for an enumerator in global scope. <strings.h> might declare this as a function.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193066 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 04:59:37 +00:00
Howard Hinnant
71b52152a9 r192075 broke the buildbot at
http://lab.llvm.org:8013/builders/libcxx_clang-x86_64-darwin11-RA

lit.py: <string>:230: note: inferred use_system_lib as: False
lit.py: <string>:247: fatal: C++ ABI setting None unsupported for tests

cxx_abi is geting set to None, and the lit script errors out shortly after
that.  This patch changes the default of cxx_abi from None to 'libcxxabi'.
This is likely not the right way to fix this problem.  However it gets the
buildbot running again.  Improvements to this fix are welcome.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192609 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-14 18:02:02 +00:00
Marshall Clow
9de3d4cab3 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192548 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-13 01:02:45 +00:00
Marshall Clow
0f91166ef8 Updated status of issues and features
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192546 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-12 22:57:58 +00:00
Marshall Clow
61a8422ffa LWG Issue 2087: iostream_category() and noexcept
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192545 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-12 22:49:56 +00:00
Marshall Clow
5f2d5b95e6 LWG Issue 2097: packaged_task constructors should be constrained
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192544 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-12 22:49:17 +00:00
Marshall Clow
206ce1faaf LWG issue 2143: ios_base::xalloc should be thread-safe
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192539 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-12 19:13:52 +00:00
Marshall Clow
1206720869 Implement national body comment GB9: remove std::gets
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192538 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-12 19:09:47 +00:00
Marshall Clow
b8dd5caf5a patch by Yaron: Uses rand_s() from stdlib.h (when building for Windows)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192325 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-09 21:49:03 +00:00
Marshall Clow
dab89a1412 Fix LWG Issue 2141: common_type trait produces reference types
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192142 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-07 23:43:33 +00:00
Marshall Clow
16f13a0b84 Marked issue 2284 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192085 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-07 03:26:42 +00:00
Marshall Clow
3f433cdb8e Apparently, I don't know the difference between 'left' and 'right'. Swap parameters named 'lhs' and 'rhs' so that they correctly refer to the 'left hand side' and 'right hand side' of comparisons. No functionality change. Thanks to Arthur O'Dwyer for pointing this out to me.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192080 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-07 02:37:18 +00:00
Peter Collingbourne
4a0555a9d4 Silence the unused function warning in exception.cpp.
Rather than try to protect the function behind a precise,
ever-changing #if expression, just inline it into every caller.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192077 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-06 22:13:24 +00:00
Peter Collingbourne
ece95914ac Implement std::exception_ptr under libsupc++.
libsupc++ does not implement the dependent EH ABI and the
functionality it uses to implement std::exception_ptr (which it
declares as an alias of std::__exception_ptr::exception_ptr) is not
directly exported to clients. So we have little choice but to hijack
std::__exception_ptr::exception_ptr's (which fortunately has the
same layout as our std::exception_ptr) copy constructor, assignment
operator and destructor (which are part of its stable ABI), and its
rethrow_exception(std::__exception_ptr::exception_ptr) function.

Also, remove some out of date comments.

Differential Revision: http://llvm-reviews.chandlerc.com/D1826

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192076 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-06 22:13:21 +00:00
Peter Collingbourne
d0d308f54b Make it possible to link against libstdc++ as well as libsupc++ with CMake.
Linking against libstdc++, rather than libsupc++, is probably better
for people who need to link against clients of libstdc++.  Because
libsupc++ is provided only as a static library, its globals are not
shared between the static library and the copy linked into libstdc++.
This has been found to cause at least one test failure.

This also removes a number of symbols which were multiply defined
between libstdc++ and libc++, only when linking with libstdc++.

Differential Revision: http://llvm-reviews.chandlerc.com/D1825

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192075 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-06 22:13:19 +00:00
Peter Collingbourne
40455c65da Eliminate more symbols multiply defined between libsupc++ and libc++.
The remaining multiple definitions were flushed out by attempting to
link libsupc++ and libc++ into the same executable with --whole-archive,
e.g.

clang++ -I../llvm/projects/libcxx/include -nodefaultlibs -Wl,--whole-archive lib/libc++.a /usr/lib/gcc/x86_64-linux-gnu/4.6/libsupc++.a -Wl,--no-whole-archive -lgcc -lgcc_s -lc -lpthread -lrt

(The same technique was used to flush out multiple definitions in
libstdc++.)

Differential Revision: http://llvm-reviews.chandlerc.com/D1824

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192074 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-06 22:13:16 +00:00
Howard Hinnant
ae2b90b86d G M: 1. It changes the temp file handling to use the template and the current directory for windows, matching how it works on other platforms.
2. It re-enables the temp file handling for mingw that regressed.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192073 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-06 21:14:05 +00:00
Howard Hinnant
e064055942 G M: Rename local variable from __except to avoid MSVC keyword clash.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192072 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-06 21:00:29 +00:00