Commit Graph

1867 Commits

Author SHA1 Message Date
Eric Fiselier
c0b166e944 [libcxx] Add support for linking libc++ against a static ABI library.
Summary:
This patch add the CMake option `LIBCXX_ENABLE_STATIC_ABI_LIBRARY` which, when enabled, will link libc++ against the static version of the ABI library.


Reviewers: mclow.lists, jroelofs, danalbert

Reviewed By: danalbert

Subscribers: compnerd, cfe-commits

Differential Revision: http://reviews.llvm.org/D8017

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231076 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-03 15:59:51 +00:00
Saleem Abdulrasool
3ff0531e95 cmath: account for MSVCRT 12.0 changes
MSVCRT 12.0 introduces better compatibility for C99. This includes a number of
math routines that were previously undefined. Use the crtversion.h header to
detect the version of MSVCRT being targeted and avoid re-declaring the
variables.

Since copysign has been introduced in MSVCRT, importing the definition via using
makes it difficult to provide overloads (due to minor differences between
throw () and noexcept. Avoid defining the overloads on newer MSVCRT
targets.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230867 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28 20:18:39 +00:00
Jonathan Roelofs
7710603b64 Add self to CREDITS.txt
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230595 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 00:48:22 +00:00
Jonathan Roelofs
83d7735487 Add remote testing support to the lit config.
Executors can be specified at configure time by using the -DLIBCXX_EXECUTOR=""
option. Examples include:

  $ cmake <other_flags> -DLIBCXX_EXECUTOR="TimeoutExecutor(30,LocalExecutor())"
      This runs individual tests with a maximum duration

  $ cmake <other_flags> -DLIBCXX_EXECUTOR="SSHExecutor('hostname','username')"
      This runs tests on a remote target, using scp to shuttle binaries to the
      target, and ssh to invoke commands there.

  $ cmake <other_flags> -DLIBCXX_EXECUTOR="PrefixExecutor('/path/to/run/script',LocalExecutor())"
      This assumes the script knows how to copy run the executables passed to it,
      and allows for the ultimate control. This is useful for running things
      inside emulators like Valgrind & QEMU.

TODO: This doesn't claim to support ShTest tests yet, that will take a bit more
  thought & finagling (I'm still not sure how to orchestrate copy-in for those cases.

  I've also punted on what to do about tests that read data files. The testsuite
  has several tests that need to read *.dat files placed next to them, and
  currently those aren't copied over when using, say, an SSHExecutor. The
  affected tests are:

     libc++ :: std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp
     libc++ :: std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp
     libc++ :: std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp

Note: One thing to watch out for when using the SSHExecutor for cross-testing is
  that you'll also want to specify a TargetInfo object (so that the host's
  features aren't used for available-features checks and flags setup).

http://reviews.llvm.org/D7380


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230592 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 00:42:17 +00:00
JF Bastien
a14f7cb412 libc++: support newlib's ctype
Summary: Newlib supports ctype differently from other platforms, this patch teaches libc++ about yet another platform that does ctype differently.

Reviewers: jroelofs

Subscribers: cfe-commits, danalbert, EricWF, jvoung, jfb, mclow.lists

Differential Revision: http://reviews.llvm.org/D7888

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230557 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-25 22:16:46 +00:00
Marshall Clow
59ac38ccd1 Add trailing return types (and noexcept specifications) to the 'diamond operators'. Fixes PR#22600.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230484 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-25 12:20:52 +00:00
Marshall Clow
fec08372b8 Make the forward declaration for array swap have the same inline/visibility attributes as the definition. Thanks to Steven Wu for the catch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230330 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 12:46:39 +00:00
Eric Fiselier
40310ac76c Remove XFAIL on string view test for apples clang compiler. Thanks to Marshall for the fix
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230322 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 10:52:07 +00:00
JF Bastien
a0ac177bea Reword ELAST warning
Summary:
GCC emits a pretty amusing warning when there are apostrophes in a #warning:
```warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]```

Reword the warning to avoid this, and be more consistent with other warnings in libc++.

Reviewers: danalbert

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D7818

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230298 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 01:59:38 +00:00
Marshall Clow
14861507bc Change string_view::at to make it work with gcc and VC++. Thanks to K-ballo for the bug report, and Jonathan Wakeley for the code review in the bar.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230260 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 21:12:02 +00:00
Eric Fiselier
da1818a08c [libc++] Try and prevent evaluation of is_default_constructible on tuples default constructor if it is not needed.
Summary:
Currently parts of the SFINAE on tuples default constructor always gets evaluated even when the default constructor is never called or instantiated. This can cause a hard compile error when a tuple is created with types that do not have a default constructor. Below is a self contained example using a pair like class. This code will not compile but probably should.

```

#include <type_traits>

template <class T>
struct IllFormedDefaultImp {
    IllFormedDefaultImp(T x) : value(x) {}
    constexpr IllFormedDefaultImp() {}
    T value;
};

typedef IllFormedDefaultImp<int &> IllFormedDefault;

template <class T, class U>
struct pair
{
  template <bool Dummy = true,
    class = typename std::enable_if<
         std::is_default_constructible<T>::value
      && std::is_default_constructible<U>::value
      && Dummy>::type
    >
  constexpr pair() : first(), second() {}

  pair(T const & t, U const & u) : first(t), second(u) {}

  T first;
  U second;
};

int main()
{
  int x = 1;
  IllFormedDefault v(x);
  pair<IllFormedDefault, IllFormedDefault> p(v, v);
}
```

One way to fix this is to use `Dummy` in a more involved way in the constructor SFINAE. The following patch fixes these sorts of hard compile errors for tuple.


Reviewers: mclow.lists, rsmith, K-ballo, EricWF

Reviewed By: EricWF

Subscribers: ldionne, cfe-commits

Differential Revision: http://reviews.llvm.org/D7569

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230120 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 02:30:41 +00:00
Eric Fiselier
45969ecfcd [libcxx] Move to using libc++abi2.exp as the default symbol list for libc++
Summary:
libc++abi2.exp should be used whenever `cxxabi.h` defines `_LIBCPPABI_VERSION`. This macro was added to libc++abi in 2012 in r149632. For this reason we should use libc++abi2.exp as default unless otherwise specified.

Also when building against an in-tree libc++abi we definitely want to use libc++abi2.exp.

I would love to know what OSX was the last to use libc++abi.exp but I can only test on 10.9.


Reviewers: danalbert, mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: meadori, cfe-commits

Differential Revision: http://reviews.llvm.org/D7773

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230119 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 02:26:24 +00:00
Larisse Voufo
43c1f2368e Add self to CREDITS.TXT
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229969 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20 06:17:20 +00:00
Larisse Voufo
74f95a01cd More on adding sized deallocation functions in libc++: Continuing from r229281, this adds version guards and test cases.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229968 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20 06:13:05 +00:00
Eric Fiselier
d75a44ba24 Fix incorrect locale mapping in config.py on OSX
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229935 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 23:57:46 +00:00
Eric Fiselier
8a8aae4618 Move to using -fdiagnostics-color=always on both GCC and Clang
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229927 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 23:26:54 +00:00
Marshall Clow
6b5a5e52f0 Make basic_streambuf::xsputn write characters in chunks whenever possible, instead of one at a time. References PR#10193
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229866 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 16:17:46 +00:00
Eric Fiselier
784fa1eeba Mark more tuple tests as unsupported in C++98 && C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229810 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 02:44:09 +00:00
Eric Fiselier
f063052fe1 [libcxx] Mark most tuple tests UNSUPPORTED for c++03 and c++98.
Summary: No declaration for the type `tuple` is given in c++03 or c++98 modes. Mark all tests that use the actual `tuple` type as UNSUPPORTED.

Reviewers: jroelofs, mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5956

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229808 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 02:10:42 +00:00
Marshall Clow
59f573f670 Remove several unused forward declarations. Fixes PR22605.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229728 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 19:28:35 +00:00
Marshall Clow
a46f5ce5bb Move the default template arguments into the forward declarations for the container adapters: stack and queue. References PR#22605.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229708 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 17:51:56 +00:00
Eric Fiselier
cc3ea928ae [libcxx] Tired of colorless compile errors? Enable color diagnostics today!
Summary:
This patch adds a lit option to enable color diagnostics when either `--param=color_diagnostics` is passed to LIT or `LIBCXX_COLOR_DIAGNOSTICS` is present in the environment.

My only concern with this patch is that GCC and Clang take different flags and that only GCC 4.9 and greater support `-fdiagnostics-color=always`

Does anybody have objections to this going in?

Reviewers: jroelofs, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7729

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229707 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 17:39:45 +00:00
Marshall Clow
ceead9c855 Move the default template arguments into the forward declarations for the containers: deque, forwardlist and list. References PR#22605.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229705 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 17:24:08 +00:00
Eric Fiselier
3f370b0a55 Enable testing with _LIBCPP_DEBUG and fix bad assertions in string_view.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229698 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 17:00:31 +00:00
Eric Fiselier
89465dce7c [libc++] Fix PR20084 - std::is_function<void() const> failed.
Summary:
This patch introduces some black magic to detect const and volatile qualified function types such as `void () const`.

The patch works in the following way:

We first rule out any type that satisfies on of the following. These restrictions are important so that the test below works properly.
* `is_class<_Tp>::value`
* `is_union<_Tp>::value`
* `is_void<_Tp>::value`
* `is_reference<_Tp>::value`
* `__is_nullptr_t<_Tp>::value`


If none of the above is true we perform overload resolution on `__source<_Tp>(0)` to determine the return type.
*  If `_Tp&` is well-formed we select `_Tp& __source(int)`. `_Tp&` is only ill formed for cv void types and cv/ref qualified function types.
* Otherwise we select `__dummy_type __source(...)`. Since we know `_Tp` cannot be void then it must be a function type.


let `R` be the returned from `__source<_Tp>(0)`. 
We perform overload resolution on `__test<_Tp>(R)`.
* If `R` is `__dummy_type` we call `true_type __test(__dummy_type)`.
* if `R` is `_Tp&` and `_Tp&` decays to `_Tp*` we call `true_type __test(_Tp*)`.  Only references to function types decay to a pointer of the same type.
* In all other cases we call `false_type __test(...)`. 

`__source<_Tp>(0)` will try and form `_Tp&`  in the return type. if `_Tp&` is not well formed the return type of `__source<_Tp>(0)` will be dummy type. `_Tp&` is only ill-formed for cv/ref qualified function types (and void which is dealt with elsewhere).


This fixes PR20084 - http://llvm.org/bugs/show_bug.cgi?id=20084

Reviewers: rsmith, K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7573

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229696 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 16:31:46 +00:00
Eric Fiselier
13b96fdfbd [libcxx] Add <experimental/ratio>
Summary:
This patch is pretty simple. It just adds the _v traits from <ratio>. 

The draft can be found here.

Reviewers: jroelofs, K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7351

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229509 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17 16:52:03 +00:00
Larisse Voufo
19efe015fb Implement C++14's sized deallocation functions, since there are no longer implicitly defined by clang, as of r229241.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229281 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 05:18:55 +00:00
Saleem Abdulrasool
f1b30c41ad Handle function name conflicts in _LIBCPP_MSVCRT mode
Visual Studio's SAL extension uses a macro named __deallocate. This macro is
used pervasively, and gets included through various different ways. This
conflicts with the similarly named interfaces in libc++. Introduce a undef
header similar to __undef_min_max to handle this. This fixes a number of errors
due to the macro replacing the function name.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229162 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 22:15:32 +00:00
Saleem Abdulrasool
846a4a0a65 cctype: tweak inclusions for _LIBCPP_MSVCRT case
cctype uses ctype functions such as isblank. However, when building against
msvcrt, this is provided by the support header. Include the support header if
building for Windows to ensure that the definition is properly visible.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229161 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 22:15:28 +00:00
Marshall Clow
6bcbced54f Rooting out more undefined behavior in char_traits.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229119 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 16:04:42 +00:00
Jonathan Roelofs
c3068a136a Appease buildbots
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229114 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 15:34:01 +00:00
Jonathan Roelofs
4205190e07 Modularize TargetInfo discovery in the lit config
When the remote execution patch lands, this will allow us to drop in a
replacement TargetInfo object for locale support discovery, alleviating
the assumption that host==target.

http://reviews.llvm.org/D7601


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229111 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 15:25:21 +00:00
Dan Albert
1bd299a58e Fix error checking in get_temp_file_name().
Checking errno without first checking that the call failed means that
if some other call prior to mkstemp failed with EINVAL prior to this,
the assert would fire even if mkstemp succeeded. If something failed
with EEXIST, it would go in to an infinite loop.

Change-Id: I3f140a3e15fe08664a38a8c9a950c4ed547eb481

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229035 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 03:02:28 +00:00
Marshall Clow
f2e36ef093 Move the test for zero-length into the char_traits (from string_view). Add tests to char_traits specializations
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228981 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 23:34:52 +00:00
Marshall Clow
7f59a88431 Fixed a problem that UBSAN found, where we were calling memcmp(null, p, 0) - which is undefined behavior
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228952 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 19:58:06 +00:00
Marshall Clow
451ae6e21c Remove undefined behavior from test; specifically, compare(NULL, XXX, 0)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228928 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 15:25:54 +00:00
Marshall Clow
bdb73f1f8b Remove undefined behavior from test; specifically, compare(NULL, XXX, 0). Thanks to Eric for the catch
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228927 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 15:21:20 +00:00
Marshall Clow
35e462ddee Change some template parameter names from _C and _N to _Cont and _Sz. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228843 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 16:14:01 +00:00
Marshall Clow
e7d392585e Need to wrap a bit in an ifdef, since there are no initializer_lists in C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228840 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 15:48:21 +00:00
Marshall Clow
3024f86865 Fix PR 22541: When values are equal, minmax should return the rightmost one in the initializer_list
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228839 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 15:41:34 +00:00
Eric Fiselier
a11e2cf183 Update double_include.sh.cpp for new headers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228784 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 01:31:02 +00:00
Eric Fiselier
578c9e8f46 libc++ tests: wait_until.pass test sporadically fails (bug 21998)
Summary:
Hello Howard,

While running the libc++ tests on our ARM boards, we encounter sporadic failures of the two tests:
test/std/thread/futures/futures.shared_future/wait_until.pass.cpp
test/std/thread/futures/futures.unique_future/wait_until.pass.cpp

The worker thread might not finish yet when the main thread checks its result.
I filed the bug 21998 for this case: http://llvm.org/bugs/show_bug.cgi?id=21998

Would you be able to review this please?
Thank you.
Oleg

Reviewers: howard.hinnant, mclow.lists, danalbert, jroelofs, EricWF

Reviewed By: jroelofs, EricWF

Subscribers: EricWF, mclow.lists, aemerson, llvm-commits

Differential Revision: http://reviews.llvm.org/D6750

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228783 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 01:25:57 +00:00
Eric Fiselier
566739170a Make convert_to_integral.pass.cpp more platform generic.
Don't depend on the underlying types of enums and wchar_t.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228781 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 01:18:05 +00:00
Eric Fiselier
1a633ca404 Remove default definition for libcxx_obj_dir because it doesn't make sense
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228778 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 01:03:44 +00:00
Dan Albert
f42a8e6003 Make ABI header not found a warning, not an error.
Since we've added a new header to libc++abi (__cxxabi_config.h), we
now have a case where we might not always find all the ABI headers:
building libc++ against the system's libc++abi on Darwin.

Since this isn't actually a fatal error, degrade it to a warning.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228720 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 18:46:57 +00:00
Eric Fiselier
47b9a9a286 Add pragma system header to some experimental headers and add newlines to files.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228712 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 17:32:49 +00:00
Eric Fiselier
5495e2efb9 Fix more issues exposed by -pedantic-errors in c++03 mode
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228711 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 17:20:18 +00:00
Eric Fiselier
7f9cc52faf Remove use of zero length arrays in tests. Get tests passing with -pedantic-errors
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228706 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 16:51:29 +00:00
Eric Fiselier
c3231d213a [libcxx] Fix PR 22468 - std::function<void()> does not accept non-void-returning functions
Summary:
The bug can be found here: http://llvm.org/bugs/show_bug.cgi?id=22468

`__invoke_void_return_wrapper` is needed to properly handle calling a function that returns a value but where the std::function return type is void. Without this '-Wsystem-headers' will cause `function::operator()(...)` to not compile. 

Reviewers: eugenis, K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7444

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228705 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 16:48:45 +00:00
Eric Fiselier
31cb7fe75e [libcxx] Properly convert the count arguments to the *_n algorithms before use.
Summary:
The requirement on the `Size` type passed to *_n algorithms is that it is convertible to an integral type. This means we can't use a variable of type `Size` directly. Instead we need to convert it to an integral type first.  The problem is finding out what integral type to convert it to.  `__convert_to_integral` figures out what integral type to convert it to and performs the conversion, It also promotes the resulting integral type so that it is at least as big as an integer. `__convert_to_integral` also has a special case for converting enums. This should only work on non-scoped enumerations because it does not apply an explicit conversion from the enum to its underlying type.



Reviewers: chandlerc, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7449

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228704 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 16:46:42 +00:00