Commit Graph

51 Commits

Author SHA1 Message Date
Nico Weber
28db4445e2 libcxx: Rename .hpp files in libcxx/test/support to .h
LLVM uses .h as its extension for header files.

Files renamed using:

    for f in libcxx/test/support/*.hpp; do git mv $f ${f%.hpp}.h; done

References to the files updated using:

    for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do
        a=$(basename $f);
        echo $a;
        rg -l $a libcxx | xargs sed -i '' "s/$a/${a%.hpp}.h/";
    done

HPP include guards updated manually using:

    for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do
      echo ${f%.hpp}.h ;
    done | xargs mvim

Differential Revision: https://reviews.llvm.org/D66104

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369481 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 00:14:12 +00:00
Marshall Clow
b6e011b18b Add include for 'test_macros.h' to all the tests that were missing them. Thanks to Zoe for the (big, but simple) patch. NFC intended.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@362252 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-31 18:35:30 +00:00
JF Bastien
e15dd4e32e Support tests in freestanding
Summary:
Freestanding is *weird*. The standard allows it to differ in a bunch of odd
manners from regular C++, and the committee would like to improve that
situation. I'd like to make libc++ behave better with what freestanding should
be, so that it can be a tool we use in improving the standard. To do that we
need to try stuff out, both with "freestanding the language mode" and
"freestanding the library subset".

Let's start with the super basic: run the libc++ tests in freestanding, using
clang as the compiler, and see what works. The easiest hack to do this:

In utils/libcxx/test/config.py add:

  self.cxx.compile_flags += ['-ffreestanding']

Run the tests and they all fail.

Why? Because in freestanding `main` isn't special. This "not special" property
has two effects: main doesn't get mangled, and main isn't allowed to omit its
`return` statement. The first means main gets mangled and the linker can't
create a valid executable for us to test. The second means we spew out warnings
(ew) and the compiler doesn't insert the `return` we omitted, and main just
falls of the end and does whatever undefined behavior (if you're luck, ud2
leading to non-zero return code).

Let's start my work with the basics. This patch changes all libc++ tests to
declare `main` as `int main(int, char**` so it mangles consistently (enabling us
to declare another `extern "C"` main for freestanding which calls the mangled
one), and adds `return 0;` to all places where it was missing. This touches 6124
files, and I apologize.

The former was done with The Magic Of Sed.

The later was done with a (not quite correct but decent) clang tool:

  https://gist.github.com/jfbastien/793819ff360baa845483dde81170feed

This works for most tests, though I did have to adjust a few places when e.g.
the test runs with `-x c`, macros are used for main (such as for the filesystem
tests), etc.

Once this is in we can create a freestanding bot which will prevent further
regressions. After that, we can start the real work of supporting C++
freestanding fairly well in libc++.

<rdar://problem/47754795>

Reviewers: ldionne, mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, arphaman, miyuki, libcxx-commits

Differential Revision: https://reviews.llvm.org/D57624

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353086 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-04 20:31:13 +00:00
Chandler Carruth
7c3769df62 Update more file headers across all of the LLVM projects in the monorepo
to reflect the new license. These used slightly different spellings that
defeated my regular expressions.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351648 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 10:56:40 +00:00
Louis Dionne
bca4d67c16 [pair] Mark constructors as conditionally noexcept
Summary:
std::tuple marks its constructors as noexcept when the corresponding
memberwise constructors are noexcept too -- this commit improves std::pair
so that it behaves the same.

This is a re-application of r348824, which broke the build in C++03 mode
because a test was marked as supported in C++03 when it shouldn't be.

Note:
I did not add support in the explicit and non-explicit `pair(_Tuple&& __p)`
constructors because those are non-standard extensions, and supporting them
properly is tedious (we have to copy the rvalue-referenceness of the deduced
_Tuple&& onto the result of tuple_element).

<rdar://problem/29537079>

Reviewers: mclow.lists, EricWF

Subscribers: christof, llvm-commits

Differential Revision: https://reviews.llvm.org/D48669

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348847 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 14:22:28 +00:00
Louis Dionne
21a8669ade Revert "[pair] Mark constructors as conditionally noexcept"
This broke the tests on Linux. Reverting until I find out why the tests
are broken (tomorrow).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348825 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 02:32:46 +00:00
Louis Dionne
adde8aeb1c [pair] Mark constructors as conditionally noexcept
Summary:
std::tuple marks its constructors as noexcept when the corresponding
memberwise constructors are noexcept too -- this commit improves std::pair
so that it behaves the same.

Note:
I did not add support in the explicit and non-explicit `pair(_Tuple&& __p)`
constructors because those are non-standard extensions, and supporting them
properly is tedious (we have to copy the rvalue-referenceness of the deduced
_Tuple&& onto the result of tuple_element).

<rdar://problem/29537079>

Reviewers: mclow.lists, EricWF

Subscribers: christof, llvm-commits

Differential Revision: https://reviews.llvm.org/D48669

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348824 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 02:17:23 +00:00
Stephan T. Lavavej
f18ee8f765 [libcxx] [test] Avoid MSVC truncation warnings.
MSVC emits "warning C4244: 'initializing': conversion from 'int'
to 'short', possible loss of data" when it sees pair<Whatever, short>
constructed from (whatever, 4), because int is being truncated to
short within pair's constructor. (The compiler doesn't take into
account the fact that 4 is a literal at the callsite; it generates
this warning when the constructor is instantiated, because it might
be called with a runtime-valued int that would actually truncate.)

Instead of static_cast<short>, we can simply change short to int
in these tests, without affecting the pair operations that they're
trying to test: move assignment, convert copy construction, and
convert move construction.

Fixes D45016.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329973 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-12 23:56:07 +00:00
Eric Fiselier
4e177b91d0 fix typo in align_const_pair_U_V.pass.cpp
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328760 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29 03:44:01 +00:00
Eric Fiselier
3e005cc583 Move libc++ pair/tuple assign test to libcxx/ test directory.
Libc++ implements the pair& operator=(pair<U, V>) assignment operator
using a single template that handles assignment from all tuple-like types.

This patch moves the test for that to the libcxx test directory since
it's non-standard. It also adds additional tests to the std/.../pair
directory to test the standard behavior this template implements.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328758 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29 03:30:00 +00:00
Roger Ferrer Ibanez
2f494f7331 Remove unneeded typename from test
Differential Revision: https://reviews.llvm.org/D38628



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315278 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10 07:42:19 +00:00
Eric Fiselier
2b7279cb08 Fix accidental assignment inside test asserts
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314947 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-04 23:21:18 +00:00
Eric Fiselier
8a29c9d39b Add C++17 explicit deduction guides to std::pair.
This patch adds the newly standardized deduction guides
for std::pair, allowing it to work class template deduction.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-04 00:04:26 +00:00
Marshall Clow
a12318f5ae Added failing tests for index out of range for tuple_element<pair<T1,T2>> and variant_alternative<>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@306580 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28 18:18:30 +00:00
Stephan T. Lavavej
b836deb5db [libcxx] [test] Strip trailing whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305848 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-20 21:00:02 +00:00
Marshall Clow
8fdd8117a9 Mark LWG#2796 as complete. No functionality change; we had tests that covered it already. Just added comments to the tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302798 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11 13:51:09 +00:00
Eric Fiselier
d311b3c55a Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the utilities library
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300635 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 00:56:32 +00:00
Stephan T. Lavavej
0eb6bb8d2d [libcxx] [test] Fix Clang -Wunused-local-typedef, part 3/3.
test/std/strings/string.classes/typedefs.pass.cpp
Actually test what basic_string's typedefs stand for.

test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
NotDerived and ND were completely unused.

test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
P2 was mistakenly not being used. Yes, that's
right: -Wunused-local-typedef CAUGHT A MISTAKE! AMAZING!

Fixes D29137.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294156 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 22:47:54 +00:00
Eric Fiselier
66ed0bc836 Remove all usages of REQUIRES-ANY in the test suite.
Pending LIT changes are about to remove the REQUIRES-ANY keyword
in place of supporting boolean && and || within "REQUIRES". This
patch prepares libc++ for that change so that when applied
the bots don't lose their mind.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292901 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 09:11:08 +00:00
Stephan T. Lavavej
16e2ba19df [libcxx] [test] Fix comment typos, strip trailing whitespace.
No functional change, no code review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292434 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 20:10:25 +00:00
Eric Fiselier
1d0d379c40 Fix XFAILS for is_trivially_destructible trait
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289802 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 11:00:07 +00:00
Eric Fiselier
b7fe139a72 Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289781 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 07:23:44 +00:00
Eric Fiselier
cdc59e576e Add tests for LWG 2796
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289780 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 07:15:39 +00:00
Stephan T. Lavavej
3e541a6172 [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 7/7.
test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
Add static_cast<char> because basic_istream::get() returns int_type (N4606 27.7.2.3 [istream.unformatted]/4).

test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
Add static_cast<char> because toupper() returns int (C11 7.4.2.2/1).

test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
This test is intentionally writing doubles to ostream_iterator<int>.
It's silencing -Wliteral-conversion for Clang, so I'm adding C4244 silencing for MSVC.

test/std/language.support/support.limits/limits/numeric.limits.members/infinity.pass.cpp
Given `extern float zero;`, the expression `1./zero` has type double, which emits a truncation warning
when being passed to test<float>() taking float. The fix is to say `1.f/zero` which has type float.

test/std/numerics/complex.number/cmplx.over/arg.pass.cpp
test/std/numerics/complex.number/cmplx.over/norm.pass.cpp
These tests were constructing std::complex<double>(x, 0), emitting truncation warnings when x is long long.
Saying static_cast<double>(x) avoids this.

test/std/numerics/rand/rand.eng/rand.eng.lcong/seed_result_type.pass.cpp
This was using `int s` to construct and seed a linear_congruential_engine<T, stuff>, where T is
unsigned short/unsigned int/unsigned long/unsigned long long. That emits a truncation warning in the
unsigned short case. Because the range [0, 20) is tiny and we aren't doing anything else with the index,
we can just iterate with `T s`.

test/std/re/re.traits/value.pass.cpp
regex_traits<wchar_t>::value()'s first parameter is wchar_t (N4606 28.7 [re.traits]/13). This loop is
using int to iterate through ['g', 0xFFFF), emitting a truncation warning from int to wchar_t
(which is 16-bit for some of us). Because the bound is exclusive, we can just iterate with wchar_t.

test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
This test is a little strange. It's trying to verify that basic_string's (InIt, InIt) range constructor
isn't confused by "N copies of C" when N and C have the same integral type. To do this, it was
testing (100, 65), but that eventually emits truncation warnings from int to char. There's a simple way
to avoid this - passing (static_cast<char>(100), static_cast<char>(65)) also exercises the disambiguation.
(And 100 is representable even when char has a signed range.)

test/std/strings/string.view/string.view.hash/string_view.pass.cpp
Add static_cast<char_type> because `'0' + i` has type int.

test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp
What's more horrible than nested bind()? pow() overloads! This operator()(T a, T b) was assuming that
std::pow(a, b) can be returned as T. (In this case, T is int.) However, N4606 26.9.1 [cmath.syn]/2
says that pow(int, int) returns double, so this was truncating double to int.
Adding static_cast<T> silences this.

test/std/utilities/function.objects/unord.hash/integral.pass.cpp
This was iterating `for (int i = 0; i <= 5; ++i)` and constructing `T t(i);` but that's truncating
when T is short. (And super truncating when T is bool.) Adding static_cast<T> silences this.

test/std/utilities/utility/exchange/exchange.pass.cpp
First, this was exchanging 67.2 into an int, but that's inherently truncating.
Changing this to static_cast<short>(67) avoids the truncation while preserving the
"what if T and U are different" test coverage.
Second, this was exchanging {} with the explicit type float into an int, and that's also
inherently truncating. Specifying short is just as good.

test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp
Add static_cast<short>. Note that this affects template argument deduction for make_pair(),
better fulfilling the test's intent. For example, this was saying
`typedef std::pair<int, short> P1; P1 p1 = std::make_pair(3, 4);` but that was asking
make_pair() to return pair<int, int>, which was then being converted to pair<int, short>.
(pair's converting constructors are tested elsewhere.)
Now, std::make_pair(3, static_cast<short>(4)) actually returns pair<int, short>.
(There's still a conversion from pair<nullptr_t, short> to pair<unique_ptr<int>, short>.)

Fixes D27544.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289111 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 21:38:57 +00:00
Stephan T. Lavavej
f008c5389e [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 3/7.
Add static_cast<short> when constructing pair<Whatever, short> from (Something, int).

Fixes D27540.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289107 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 21:38:14 +00:00
Stephan T. Lavavej
e619862dbf [libcxx] [test] Replace _LIBCPP_STD_VER with TEST_STD_VER.
This replaces every occurrence of _LIBCPP_STD_VER in the tests with
TEST_STD_VER. Additionally, for every affected
file, #include "test_macros.h" is being added explicitly if it wasn't
already there.

https://reviews.llvm.org/D26294

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 20:26:59 +00:00
Dimitry Andric
ecb5332d41 Disable trivial pair copy/move tests when unsupported
Summary:
On FreeBSD, for ABI compatibility reasons, the pair trivial copy
constructor is disabled, using the aptly-named
`_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR` define.

Disable the related tests when this define is on, so they don't fail
unexpectedly.

Reviewers: emaste, rsmith, theraven, EricWF

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D25449

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@284047 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 20:26:47 +00:00
Eric Fiselier
89e826a160 Remove all instances of _LIBCPP_HAS_NO_RVALUE_REFERENCES from test/std/utilities
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283032 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 10:46:01 +00:00
Eric Fiselier
235d71f053 Fix pair::operator=(TupleLike&&).
This assignment operator was previously broken since the SFINAE always resulted
in substitution failure. This caused assignments to turn into
copy construction + assignment.

This patch was originally committed as r279953 but was reverted due to warnings
in the test-suite. This new patch corrects those warnings.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279955 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 01:43:41 +00:00
Eric Fiselier
0ecda7171c Revert r279953 - Fix pair::operator=(TupleLike&&)
The test emits warnings causing the test-suite to fail. Since I want this
patch merged into 3.9 I'll recommit it with a clean test.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279954 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 01:39:54 +00:00
Eric Fiselier
15ac5e4dc2 Fix pair::operator=(TupleLike&&).
This assignment operator was previously broken since the SFINAE always resulted
in substitution failure. This caused assignments to turn into
copy construction + assignment.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279953 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 01:09:47 +00:00
Eric Fiselier
1ed1df3a31 Unbreak C++03 build.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278323 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 08:15:35 +00:00
Eric Fiselier
92741e2493 Refactor test archetypes implementation.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278319 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-11 07:04:14 +00:00
Eric Fiselier
b0cf9cb1bc Remove use of C++1z static assert in C++11 test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276608 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 04:56:32 +00:00
Eric Fiselier
e1445fd8ed Implement the std::pair parts of "Improving pair and tuple". Completes N4387.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276605 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 04:32:07 +00:00
Eric Fiselier
4be71c6619 Recommit r276548 - Make pair/tuples assignment operators SFINAE properly.
I think I've solved issues with is_assignable and references to incomplete
types. The updated patch adds tests for this case.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276603 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 02:36:42 +00:00
Eric Fiselier
c76d8f7ff4 Revert r276548 - Make pair/tuples assignment operators SFINAE properly.
This is a breaking change. The SFINAE required is instantiated the second
the class is instantiated, and this can cause hard SFINAE errors
when applied to references to incomplete types. Ex.

struct IncompleteType;
extern IncompleteType it;
std::tuple<IncompleteType&> t(it); // SFINAE will blow up.




git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276598 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 01:45:07 +00:00
Eric Fiselier
932604f8d1 Don't SFINAE pair's copy assignment operator in C++03 mode.
In C++03 mode evaluating the SFINAE can cause a hard error due to
access control violations. This is a problem because the SFINAE
is evaluated as soon as the class is instantiated, and not later.




git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276594 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 00:48:36 +00:00
Eric Fiselier
8b5233f11c Make pair/tuples assignment operators SFINAE properly.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276548 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-24 05:51:11 +00:00
Eric Fiselier
d24c465bea Replace __cplusplus comparisons and dialect __has_feature checks with TEST_STD_VER.
This is a huge cleanup that helps make the libc++ test suite more portable.
Patch from STL@microsoft.com. Thanks STL!


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 21:31:42 +00:00
Eric Fiselier
bf5a4189d3 Remove _LIBCPP_TRIVIAL_PAIR_COPY_CTOR option.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272613 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 01:36:15 +00:00
Asiri Rathnayake
a3eac518e6 [libcxx] Improve tests to use the UNSUPPORTED lit directive
Quite a few libcxx tests seem to follow the format:
 #if _LIBCPP_STD_VER > X
   // Do test.
 #else
   // Empty test.
 #endif
We should instead use the UNSUPPORTED lit directive to exclude the test on
earlier C++ standards. This gives us a more accurate number of test passes
for those standards and avoids unnecessary conflicts with other lit
directives on the same tests.

Reviewers: bcraig, ericwf, mclow.lists

Differential revision: http://reviews.llvm.org/D20730

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 08:57:35 +00:00
Eric Fiselier
8a7462d163 Removing some trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@268543 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 20:29:19 +00:00
Eric Fiselier
c8b24c6d54 Mark some test XFAIL for GCC 4.9 due to missing is_trivial* traits
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258287 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 04:59:57 +00:00
Marshall Clow
e5e9bff62a Add a bunch of missing includes in the test suite to make it more portable. Fixes bugs #26120 and #26121. Thanks to Jonathan Wakely for the reports and the patches.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@257474 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 14:51:04 +00:00
Eric Fiselier
9bef1ff571 [libcxx] Fix LWG Issue #2367 - Fixing std::tuple and std::pair's default constructors.
Summary: This patch implements the solution for LWG Issue #2367. See http://cplusplus.github.io/LWG/lwg-active.html#2367

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@256325 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-23 08:20:26 +00:00
Eric Fiselier
199bee0ea7 [libcxx] LWG2485: get() should be overloaded for const tuple&&. Patch from K-Ballo.
Review: http://reviews.llvm.org/D14839

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@255941 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-18 00:36:55 +00:00
Marshall Clow
bf94e48216 The test I cnecked in to check the fix for PR#24890 failed (as expected) w/o the fix, but for the wrong reason. Now it fails for the right reason.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@248307 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 18:09:13 +00:00
Marshall Clow
842e3f6f51 Check in the test for PR#24890 that I forgot in previous commit
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@248305 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 17:57:41 +00:00
Eric Fiselier
8e706d2c3e [libcxx] Move tuple_size and tuple_element overloads for pair and array out of !defined(_LIBCPP_HAS_NO_VARIADICS) block.
Summary:
There is no reason to guard `tuple_size`, `tuple_element` and `get<I>(...)` for pair and array inside of `<__tuple>` so that they are only available when we have variadic templates.
This requires there be redundant declarations and definitions. It also makes it easy to get things wrong.

For example the following code should compile (and does in c++11).
```
#define _LIBCPP_HAS_NO_VARIADICS
#include <array>

int main()
{
  static_assert((std::tuple_size<std::array<int, 10> volatile>::value == 10), "");
}
```

This patch lifts the non-variadic parts of `tuple_size`, `tuple_types`, and `get<I>(...)` to the top of `<__tuple>` where they don't require variadic templates. This patch also removes `<__tuple_03>` because there is no longer a need for it.


Reviewers: danalbert, K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232492 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 15:08:03 +00:00