Commit Graph

3910 Commits

Author SHA1 Message Date
Mehdi Amini 9cf881e62a Fix remote test execution in lit
Can be used as such:

  $ python /path/to/lit.py -sv /path/to/llvm/build/projects/libcxx/test/ \
    --param=use_system_cxx_lib=true \
    --param=executor='SSHExecutor("remote.domain", "username")'

llvm-svn: 299607
2017-04-06 01:14:57 +00:00
Mehdi Amini 605d1eb9f4 Use alternate string layout for ARMv7k
llvm-svn: 299606
2017-04-06 01:10:22 +00:00
Petr Hosek 963bcd2ec3 [CMake][libcxx] Use builtins rather than gcc_s when compiler-rt is requested
When compiler-rt is requested, we should attempt to link compiler-rt
builtins library rather than gcc_s.

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

llvm-svn: 299599
2017-04-05 22:53:05 +00:00
Eric Fiselier 61329522af Fix more -Wshadow warnings introduced by recent Clang change
llvm-svn: 299411
2017-04-04 02:54:27 +00:00
Eric Fiselier 3896bf7453 Work around recent -Wshadow changes in Clang
llvm-svn: 299407
2017-04-04 01:05:59 +00:00
Eric Fiselier 66f1ec46c6 Fix C++17 dylib build
llvm-svn: 299401
2017-04-03 23:23:44 +00:00
Eric Fiselier e4bda11453 suppress GCC warning about noexcept functions changing mangling
llvm-svn: 299385
2017-04-03 20:53:15 +00:00
Shoaib Meenai cf38eb99de [libc++] Explicitly mark specializations as dllexport
Method specializations don't get exported even if there's an exported
extern template instantiation on Windows. Explicitly mark the methods
for export. They're already exported on Linux and Darwin, so there's no
ABI change on those platforms.

llvm-svn: 299348
2017-04-03 04:04:24 +00:00
Duncan P. N. Exon Smith fa5f2c595b string: Remove always_inline from basic_string::__init
This is effectively a partial revert of r278356, which started inlining
basic_string::__init.  Even if we want to help the compiler along with
an inlinehint, we shouldn't hamstring it by forcing it to inline all the
time.

Libc++ uses always_inline widely as a limit-the-ABI-hack, but since
__init is already on the dylib boundary, it makes no sense here and just
harms the debugging experience at -O0.

rdar://problem/31013102

llvm-svn: 299290
2017-04-01 03:20:48 +00:00
Duncan P. N. Exon Smith 64ea46f82a Use strong enums independently of -fobjc-arc
r145698 introduced _LIBCPP_HAS_NO_STRONG_ENUMS by copy-pasting the
__has_feature check from objc_arc_weak/_LIBCPP_HAS_OBJC_ARC_WEAK, and
accidentally started defining _LIBCPP_HAS_NO_STRONG_ENUMS whenever
__has_feature(objc_arc_weak).  This is totally bogus, and means that
Libc++ thinks Objective-C++ compilations with -fobjc-arc don't have
strong enums.

Delete the accidental line.

I thought about adding a test, but it would be entirely duplicative of
the patch (if has-feature strong enums, check that has-no-strong-enums
is not defined).

llvm-svn: 299236
2017-03-31 17:39:56 +00:00
Reid Kleckner c5d4ad6bd6 Try to fix the libcxx build with mingw64
Summary:
mingw64 has lots of default libs that libc++ and its test programs
should link against.

With this patch, cmake now runs successfully with GCC on Windows.

Reviewers: mati865, EricWF

Subscribers: mgorny, cfe-commits

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

llvm-svn: 299144
2017-03-31 00:34:05 +00:00
Eric Fiselier dc808af38d Fix LWG 2934 - optional<const T> doesn't compare with T
llvm-svn: 299105
2017-03-30 20:06:52 +00:00
Eric Fiselier d3209f932f Implement LWG 2842 - optional(U&&) needs to SFINAE on decay_t<in_place_t>
llvm-svn: 299100
2017-03-30 19:43:50 +00:00
Mehdi Amini e8cc73ebe7 libc++ testing: fix invalid python syntax
llvm-svn: 299057
2017-03-30 05:21:33 +00:00
Mehdi Amini 566279fad7 libc++ testing: fix assertion around `use_system_cxx_lib`
Actually fix (hopefully) the assertions about `use_system_cxx_lib`,
the previous attempt failed because I misread the error.

llvm-svn: 299056
2017-03-30 05:07:18 +00:00
Mehdi Amini 322757cae9 libc++ config testing: `use_system_cxx_lib` can be a bool
Fix the libc++ Green Dragon bot.

llvm-svn: 299055
2017-03-30 04:51:19 +00:00
Mehdi Amini 87e8e25548 Reexport operator new / delete from libc++abi
Both libc++ and libc++abi export a weak definition of operator
new/delete. On Darwin, this can often cause dirty __DATA in the
shared cache when having to switch from one to the other. Instead,
libc++ should reexport libc++abi's implementation of these symbols.

Patch by: Ted Kremenek <kremenek@apple.com>

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

llvm-svn: 299054
2017-03-30 04:47:19 +00:00
Mehdi Amini f029dcdb98 libc++ testing: allow to provide a path for `use_system_cxx_lib`
As we're trying to setup testing / bots for all shipping version of libc++
on macOS/iOS, we'll need to be able to pass a path to where to find the
dylib for each previous version of the OS.

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

llvm-svn: 299053
2017-03-30 04:45:33 +00:00
Mehdi Amini 994e17b815 Do not pass an explicit reexported symbol list when building libc++ dylib if also defining new/delete
llvm-svn: 299052
2017-03-30 04:40:56 +00:00
Shoaib Meenai c7cd73e8b8 [libc++] Add a key function for bad_function_call
Summary:
bad_function_call is currently an empty class, so any object files using
that class will end up with their own copy of its typeinfo, typeinfo
name and vtable, leading to unnecessary duplication that has to be
resolved by the dynamic linker. Instead, give bad_function_call a key
function and put a definition for that key function in libc++ itself, to
centralize the typeinfo and vtable.

This is consistent with the behavior for other exception classes. The
key functions are defined in libc++ rather than libc++abi since the
class is defined in the libc++ versioning namespace, so ABI
compatibility with libstdc++ is not a concern.

Guard this change behind an ABI macro, since it isn't backwards
compatible (i.e., clients built against the new libc++ headers wouldn't
be able to run against an older libc++ library).

Reviewers: mclow.lists, EricWF

Subscribers: mgorny, cfe-commits

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

llvm-svn: 298937
2017-03-28 19:33:31 +00:00
Marshall Clow 7a130c68f0 Mark *pass tests as UNUSUPPORTED instead of XFAIL on old compilers
llvm-svn: 298839
2017-03-27 10:44:33 +00:00
Marshall Clow d3ecc0db44 Mark *fail tests as UNUSUPPORTED instead of XFAIL on old compilers
llvm-svn: 298832
2017-03-27 06:31:58 +00:00
Shoaib Meenai f88923d9bf [libc++] Fix some comment typos
Remove a stray letter, add a missing letter. No functional change.

llvm-svn: 298766
2017-03-25 03:42:20 +00:00
Shoaib Meenai b73d43521f [libc++] Fix word transposition in comment
"to due" -> "due to". No functional change.

llvm-svn: 298764
2017-03-25 03:29:51 +00:00
Shoaib Meenai 84904fb7ea [libc++] Fix capitalization in comment
Fix a stray capital letter in the middle of a sentence. No functional
change.

llvm-svn: 298763
2017-03-25 03:22:35 +00:00
Shoaib Meenai 301854203c [libc++] Update package version
Make it consistent with the rest of LLVM.

llvm-svn: 298762
2017-03-25 03:12:37 +00:00
Marshall Clow a7e1007c27 XFAIL the std::byte tests on a bunch of old clang versions, because they don't like 'std::byte b1{1}'
llvm-svn: 298706
2017-03-24 16:17:20 +00:00
Marshall Clow c97d8aa866 Implement P0298R3: 'std::byte'. Reviewed as https://reviews.llvm.org/D31022
llvm-svn: 298689
2017-03-24 05:45:39 +00:00
Marshall Clow 9f3fd40aad Move the scoped_lock inside the '#ifndef NO_THREADS' block to fix the no-threading build
llvm-svn: 298686
2017-03-24 05:19:15 +00:00
Marshall Clow 6015dd11c8 Implement Pp0156r2: 'Variadic Lock Guard, version 5' Reviewed as https://reviews.llvm.org/D31163.
llvm-svn: 298681
2017-03-24 03:40:36 +00:00
Marshall Clow 315cd1fec9 Update the algorithm tests to not use the (deprecated) function binders. No functional change.
llvm-svn: 298618
2017-03-23 16:13:50 +00:00
Bruce Mitchener 50910bf842 [libcxx] Improve code generation for vector::clear().
Summary:
By manipulating a local variable in the loop, when the loop can
be optimized away (due to no non-trivial destructors), this lets
it be fully optimized away and we modify the __end_ separately.

This results in a substantial improvement in the generated code.

Prior to this change, this would be generated (on x86_64):

    movq    (%rdi), %rdx
    movq    8(%rdi), %rcx
    cmpq    %rdx, %rcx
    je    LBB2_2
    leaq    -12(%rcx), %rax
    subq    %rdx, %rax
    movabsq    $-6148914691236517205, %rdx ## imm = 0xAAAAAAAAAAAAAAAB
    mulq    %rdx
    shrq    $3, %rdx
    notq    %rdx
    leaq    (%rdx,%rdx,2), %rax
    leaq    (%rcx,%rax,4), %rax
    movq    %rax, 8(%rdi)

And after:

    movq    (%rdi), %rax
    movq    %rax, 8(%rdi)

This brings this in line with what other implementations do.

Subscribers: cfe-commits

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

llvm-svn: 298601
2017-03-23 14:39:23 +00:00
Marshall Clow c53e96cb07 Use 'REQUIRES: c++98 || c++03 || c++11 || c++14' instead of the deprecated 'REQUIRES-ANY: c++98, c++03, c++11, c++14'
llvm-svn: 298600
2017-03-23 14:20:43 +00:00
Marshall Clow c53faf7bca One more file for the random_shuffle removal
llvm-svn: 298598
2017-03-23 13:44:06 +00:00
Marshall Clow 0f37a41029 Remove random_shuffle in C++17. Please use shuffle instead. If you have to, you cant get it back by defining _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE before including any libc++ headers.
llvm-svn: 298597
2017-03-23 13:43:37 +00:00
Marshall Clow 28f105d7a6 Silence a couple of 'unused variable' warnings in c++03 tests. No functional change
llvm-svn: 298582
2017-03-23 06:25:26 +00:00
Michael Park 41c4de43e6 Worked around GCC bug 56480. Explicit specialization in a different namespace.
Summary: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480

Reviewers: EricWF

Reviewed By: EricWF

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

llvm-svn: 298581
2017-03-23 06:21:24 +00:00
Marshall Clow d832316853 Can't test for noexcept on C++03; std::hash<nullptr_t> isn't available until C++17
llvm-svn: 298580
2017-03-23 06:20:18 +00:00
Marshall Clow 7c803385a7 Implement P0599: 'noexcept for hash functions'. Fix a couple of hash functions (optional<T> and unique_ptr<T>) which were mistakenly marked as 'noexcept'. Reviewed as https://reviews.llvm.org/D31234
llvm-svn: 298573
2017-03-23 02:40:28 +00:00
Eric Fiselier 351d2c36ef Address post-commit review comments regarding test_workarounds.h
llvm-svn: 298566
2017-03-23 00:48:59 +00:00
Eric Fiselier 9506f141bd [libc++] Work around C1XX bug which breaks poisoned hash tests.
Summary: This is my attempt to work around the C1XX bug described to me by @BillyONeal.

Reviewers: BillyONeal, STL_MSFT, CaseyCarter

Reviewed By: BillyONeal

Subscribers: cfe-commits, BillyONeal

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

llvm-svn: 298554
2017-03-22 22:41:41 +00:00
Marshall Clow 947f48fa0e Fix test failure I introduced
llvm-svn: 298438
2017-03-21 21:05:28 +00:00
Marshall Clow 0fa287b7ec Fix a couple of 'C++11'-isms from the last checkin, which broke the '03 bot.
llvm-svn: 298422
2017-03-21 19:12:21 +00:00
Marshall Clow c3d7b98d9d Add a bit more to one of the chrono tests
llvm-svn: 298418
2017-03-21 18:40:46 +00:00
Marshall Clow 9bd9ed4d23 Implement P0548: 'common_type and duration' This involves a subtle change in the return type of the unary +/- operators for std::chrono::duration, though I expect that no one will notice.
llvm-svn: 298416
2017-03-21 18:38:57 +00:00
Marshall Clow b49e06221c Add two more papers from Kona, and sort them
llvm-svn: 298284
2017-03-20 18:18:09 +00:00
Marshall Clow 4069c2bc48 Implement LWG#2761: 'basic_string should require that charT match traits::char_type'. Tests for string_view, too
llvm-svn: 297872
2017-03-15 18:41:11 +00:00
Mehdi Amini f8764e30d5 Add deployment knobs to tests (for Apple platforms)
The tests for libc++ specify -target on the command-line to the
compiler, but this is problematic for a few reasons.

Firstly, the -target option isn't supported on Apple platforms. Parts
of the triple get dropped and ignored. Instead, software should be
compiled with a combination of the -arch and -m<name>-version-min
options.

Secondly, the generic "darwin" target references a kernel version
instead of a platform version. Each platform has its own independent
versions (with different versions of libc++.1.dylib), independent of the
version of the Darwin kernel.

This commit adds support to the LIT infrastructure for testing against
Apple platforms using -arch and -platform options.

If the host is not on OS X, or the compiler type is not clang or apple-clang, then this commit has NFC.
If the host is on OS X and --param=target_triple=... is specified, then a warning is emitted to use arch and platform instead. Besides the warning, there's NFC.
If the host is on OS X and *no* target-triple is specified, then use the new deployment target logic. This uses two new lit parameters, --param=arch=<arch> and --param=platform=<platform>. <platform> has the form <name>[<version>].
By default, arch is auto-detected from clang -dumpmachine, and platform is "macosx".
If the platform doesn't have a version:
For "macosx", the version is auto-detected from the host system using sw_vers. This may give a different version than the SDK, since new SDKs can be installed on older hosts.
Otherwise, the version is auto-detected from the SDK version using xcrun --show-sdk-path.
-arch <arch> -m<name>-version-min=<version> is added to the compiler flags.
The target triple is computed as <arch>-apple-<platform>. It is *not* passed to clang, but it is available for XFAIL and UNSUPPORTED (as is with_system_cxx_lib=<target>).
For convenience, apple-darwin and <arch>-apple-darwin are added to the set of available features.
There were a number of tests marked to XFAIL on x86_64-apple-darwin11
and x86_64-apple-darwin12. I updated these to
x86_64-apple-macosx10.7 and x86_64-apple-macosx10.8.

llvm-svn: 297798
2017-03-15 00:59:54 +00:00
Billy Robert O'Neal III c32a1bdd5f Fixed unintentional assignment-in-assert in new "extending memory management tools" algorithms.
llvm-svn: 297772
2017-03-14 19:36:30 +00:00
Marshall Clow 47cc7e684f Mark LWG issues 2868, 2872, and 2890 as complete. There's nothing we need to do for them.
llvm-svn: 297758
2017-03-14 17:35:56 +00:00
Marshall Clow e1a292eafd Also mark LWG#2785 as complete, because we already implemented that
llvm-svn: 297753
2017-03-14 17:24:29 +00:00
Marshall Clow 55cfe4c16b Implement LWG2784, and mark 2786, 2795, 2804, 2812, 2826, 2834, 2837 and 2838 as complete - since we do them already
llvm-svn: 297752
2017-03-14 17:08:47 +00:00
Bruno Cardoso Lopes 704c8a929b Fix cmake to find the compiler-rt libs on darwin
Followup for r297553, which left darwin in a broken state
http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan_build/3812

rdar://problem/31011980

llvm-svn: 297703
2017-03-14 04:12:29 +00:00
Eric Fiselier 2b38ed7b15 fix test coverage capture dirs
llvm-svn: 297555
2017-03-11 05:28:09 +00:00
Eric Fiselier 2aeac46e84 Change test coverage generation to use llvm-cov instead of gcov.
Clang doesn't produce gcov compatible coverage files. This
causes lcov to break because it uses gcov by default. This
patch switches lcov to use llvm-cov as the gcov-tool.

Unfortunatly llvm-cov doesn't provide a gcov like interface by
default so it won't work with lcov. However `llvm-cov gcov` does.
For this reason we generate 'llvm-cov-wrapper' script that always
passes the gcov flag.

llvm-svn: 297553
2017-03-11 03:24:18 +00:00
Eric Fiselier d2001dac3f Fix DoNotOptimize on MSVC
llvm-svn: 297532
2017-03-11 00:07:08 +00:00
Eric Fiselier 84a2dadcee Disable unsigned integer sanitizer for basic_string::replace(). Patch from tomcherry@google.com
basic_string::replace() has the below line

__sz += __n2 - __n1;

which fails overflow checks if __n1 > __n2, as the negative result
from the subtraction then overflows the original __sz when added to
it.

This behavior is valid as unsigned integer overflow is defined to wrap
around the maximum value and that produces the correct final value for
__sz.  Therefore, we disable this check on this function.

llvm-svn: 297355
2017-03-09 01:54:13 +00:00
Shoaib Meenai 5e5d8672a7 [libc++] Avoid double defining macro on Windows
Put proper guards around _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS.
No functional change on non-Windows. Avoids incorrect macro redefinition
on Windows.

llvm-svn: 297330
2017-03-09 00:18:00 +00:00
Eric Fiselier e05469392e Fix PR32183 - Wrap GCC exception implementation in missing namespace std
llvm-svn: 297306
2017-03-08 20:06:01 +00:00
Eric Fiselier a655a61394 Add list of filesystem NB comments to TODO.TXT so they can be tracked separately
llvm-svn: 297079
2017-03-06 21:23:36 +00:00
Eric Fiselier 2c36b40a4b Mark LWG 2806 as complete. Libc++ speculatively shiped this change in 4.0
llvm-svn: 297074
2017-03-06 21:09:02 +00:00
Eric Fiselier ef7c5a6b9a Mark LWG 2789 as complete. No changes required
llvm-svn: 297073
2017-03-06 21:07:18 +00:00
Eric Fiselier bc9cbcedc1 Implement LWG 2787 - [file_status.cons] is inconsistent
llvm-svn: 297071
2017-03-06 21:02:06 +00:00
Eric Fiselier fb07598bf7 Mark LWG 2781 as complete. No changes required
llvm-svn: 297069
2017-03-06 20:56:13 +00:00
Eric Fiselier 23e323f284 Mark two any_cast issues as complete
llvm-svn: 297066
2017-03-06 20:49:42 +00:00
Michael Park 6f18866407 Updated email address in `CREDITS.txt`.
llvm-svn: 297065
2017-03-06 20:46:55 +00:00
Marshall Clow 921cab303c Header update with info about the current status of C++17
llvm-svn: 297022
2017-03-06 16:09:02 +00:00
Marshall Clow a6e3972bfc Update list with changes from Kona meeting
llvm-svn: 297021
2017-03-06 16:06:02 +00:00
Eric Fiselier 065c1abc5e Fix nonsense comment
llvm-svn: 296965
2017-03-04 12:28:12 +00:00
Eric Fiselier 51383a60c0 teach LIT how to detect the glibc version
llvm-svn: 296942
2017-03-04 01:29:51 +00:00
Eric Fiselier 5ba962706f Remove the buildit and testit scripts; they haven't been supported in years
llvm-svn: 296922
2017-03-03 22:47:45 +00:00
Eric Fiselier bd6a2d8505 Fix hash requirements check in __hash_table.
r296565 attempted to add better diagnostics when an unordered container
is instantiated with a hash that doesn't meet the Hash requirements.

However I mistakenly checked the wrong set of requirements. Specifically
it checked if the hash met the requirements for specializations of
std::hash. However these requirements are stricter than the generic
Hash requirements.

This patch fixes the assertions to only check the Hash requirements.

llvm-svn: 296919
2017-03-03 22:35:58 +00:00
Mehdi Amini dff33c2760 Fix libc++ test to pass in C++03 mode
Was hitting: "error: scalar initializer cannot be empty"

llvm-svn: 296889
2017-03-03 17:24:29 +00:00
Eric Fiselier 4f73dbf403 Clean up more usages of _LIBCPP_HAS_NO_RVALUE_REFERENCES
llvm-svn: 296854
2017-03-03 03:43:25 +00:00
Eric Fiselier 412e9dbc60 Fix sign-compare warning in test; Oddly this only appears on OS X
llvm-svn: 296851
2017-03-03 02:02:07 +00:00
Eric Fiselier ae85a922d5 Work around test failure on 32 bit OS X
llvm-svn: 296840
2017-03-02 23:18:40 +00:00
Eric Fiselier 25f9f927c6 remove max_size() extension from polymorphic_allocator. It is unneeded
llvm-svn: 296831
2017-03-02 22:10:14 +00:00
Mehdi Amini 9a90c08a62 Fix libc++ test experimental/algorithms/alg.random.sample/sample.pass.cpp when ran in c++11 mode 32 bits
llvm-svn: 296830
2017-03-02 22:08:42 +00:00
Eric Fiselier c7051e706f Work around GCC linking errors within libc++abi due to missing new/delete definitions
llvm-svn: 296822
2017-03-02 21:55:03 +00:00
Eric Fiselier 7709213ece Fix test failures caused by new/delete calls getting optimized away
llvm-svn: 296813
2017-03-02 21:16:35 +00:00
Eric Fiselier 6ab12b3c14 Update ABI list for 4.0 release
llvm-svn: 296805
2017-03-02 19:59:53 +00:00
Eric Fiselier 3499263c36 [libc++] Add option to disable new/delete overloads when libc++abi provides them.
Summary:
Currently both libc++ and libc++abi provide definitions for operator new/delete. However I believe this is incorrect and that one or the other should offer them.

This patch adds the CMake option `-DLIBCXX_ENABLE_NEW_DELETE_DEFINITIONS` which defaults no `ON` unless `-DLIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS=ON` is specified.



Reviewers: mclow.lists, mehdi_amini, dexonsmith, danalbert, smeenai, mgorny, rmaprath

Reviewed By: mehdi_amini

Subscribers: cfe-commits

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

llvm-svn: 296802
2017-03-02 19:35:33 +00:00
Shoaib Meenai bda3c7df78 [libc++] Make _LIBCPP_TYPE_VIS export members
Summary:
Most classes annotated with _LIBCPP_TYPE_VIS need to have at least some
of their members exported, otherwise we have a lot of link errors when
linking against a libc++ built with hidden visibility. This also makes
_LIBCPP_TYPE_VIS be consistent across platforms, since on Windows it
already exports members.

With this change made, any template methods of a class marked
_LIBCPP_TYPE_VIS will also get default visibility when instantiatied,
which is not desirable for clients of libc++ headers who wish to control
their visibility; this is the same issue as PR30642. Annotate all
problematic methods with an explicit visibility specifier to avoid this.

The problematic methods were found by running bad-visibility-finder [1]
against the libc++ headers after making the _LIBCPP_TYPE_VIS change. The
small methods were marked for inlining; the larger ones hidden.

[1] https://github.com/smeenai/bad-visibility-finder

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

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

llvm-svn: 296732
2017-03-02 03:22:18 +00:00
Shoaib Meenai bad28c44eb [libc++] Make _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS export members
When building libc++ with hidden visibility, we want explicit template
instantiations to export members. This is consistent with existing
Windows behavior, and is necessary for clients to be able to link
against a hidden visibility built libc++ without running into lots of
missing symbols.

An unfortunate side effect, however, is that any template methods of a
class with an explicit instantiation will get default visibility when
instantiated, unless the methods are explicitly marked inline or hidden
visibility. This is not desirable for clients of libc++ headers who wish
to control their visibility, and led to PR30642.

Annotate all problematic methods with an explicit visibility specifier
to avoid this. The problematic methods were found by running
https://github.com/smeenai/bad-visibility-finder against the libc++
headers after making the _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS change. The
methods were marked with the new _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
macro, which was created for this purpose.

It should be noted that _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS was originally
intended to expand to default visibility, and was changed to expanding
to default type visibility to fix PR30642. The visibility macro
documentation was not updated accordingly, however, so this change makes
the macro consistent with its documentation again, while explicitly
fixing the methods which resulted in that PR.

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

llvm-svn: 296731
2017-03-02 03:02:50 +00:00
Shoaib Meenai a528e74735 [libc++] Mark some std::num_get method templates inline
D29157 will make explicit template instantiations expand to default
visibility, at which point these method templates will need to be
explicitly marked hidden visibility to avoid leaking into other DSOs.
Unfortunately, because of clang PR32114, they must be marked inline (in
conjunction with `-fvisibility-inlines-hidden`) to actually hide them,
since clang doesn't respect the hidden visibility annotation.

Since this involves an ABI change, mark these methods inline in a
separate change, so that the ABI changes can be reviewed separately and
verified to be safe.

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

llvm-svn: 296729
2017-03-02 02:51:27 +00:00
Eric Fiselier e2878b2f97 Remove more usages of REQUIRES-ANY in the test-suite
llvm-svn: 296727
2017-03-02 02:04:49 +00:00
Mehdi Amini 2f75ad4e51 Recommit r296712: "Fix Apple-specific XFAIL directive in libc++ test"
The test is passing with c++11 and c++14 but not c++1z on this
particular version of the compiler. Try to use lit boolean condition
to satisfy this constaint.

llvm-svn: 296725
2017-03-02 02:01:11 +00:00
Mehdi Amini cd0b56c5cf Revert "Fix Apple-specific XFAIL directive in libc++ test"
This reverts commit r296712. It broke our bot.

It turns out that the test is passing with c++11 and c++14 but
not c++1z on this particular version of the compiler. Since one
job is defaulting to c++1z and the other is testing all config I'm
not sure how to fix this...

llvm-svn: 296724
2017-03-02 01:57:40 +00:00
Eric Fiselier 803a491a64 Fix python 3 syntax error in sym_diff
llvm-svn: 296716
2017-03-02 00:03:01 +00:00
Mehdi Amini 48c4a82105 Fix Apple-specific XFAIL directive in libc++ test
This tests is failing in XCode 7.0. But Xcode 7.3 that shipped
an updated clang has this test passing. This is fixing green dragon
which runs this configuration.

llvm-svn: 296712
2017-03-01 23:45:03 +00:00
Mehdi Amini dc5474f800 Fix Apple-specific XFAIL directive in libc++ test
These tests are failing in XCode 8.0, 8.1, and 8.2, but not in Xcode
8.3. Annoyingly the version numbering for clang does not follow Xcode
and is bumped to 8.1 only in Xcode 8.3. So Xfailing apple-clang-8.0
should catch all cases here.

llvm-svn: 296704
2017-03-01 23:14:34 +00:00
Eric Fiselier d94189dc50 Generate the test configuration even when LIBCXX_INCLUDE_TESTS=OFF.
This patch changes the CMake configuration so that it always
generates the test/lit.site.cfg file, even when testing is disabled.

This allows users to test libc++ without requiring them to have
a full LLVM checkout on their machine.

llvm-svn: 296685
2017-03-01 21:53:30 +00:00
Petr Hosek 11d1770e14 [libcxx] Support threads on Fuchsia
Differential Revision: https://reviews.llvm.org/D30278

llvm-svn: 296573
2017-03-01 03:09:18 +00:00
Eric Fiselier f4bf2438c0 Mark test as unsupported in C++11
llvm-svn: 296571
2017-03-01 02:52:04 +00:00
Eric Fiselier 81529ba9ab Fix test failures due to bad test hasher
llvm-svn: 296568
2017-03-01 02:34:27 +00:00
Eric Fiselier acb21581d7 Improve diagnostics when an invalid hash is used in an unordered container.
This patch adds a static assertion that the specified hash meets
the requirements of an enabled hash, and it ensures that the static
assertion is evaluated before __compressed_pair is instantiated.
That way the static assertion diagnostic is emitted first.

llvm-svn: 296565
2017-03-01 02:02:28 +00:00
Eric Fiselier 1ad881c3e4 Fix PR32097 - is_abstract doesn't work on class templates.
This patch fixes llvm.org/PR32097 by using the __is_abstract
builtin type-trait instead of the previous library-only implementation.

All supported compilers provide this trait. I've tested as far
back as Clang 3.2, GCC 4.6 and MSVC trunk.

llvm-svn: 296561
2017-03-01 01:27:14 +00:00
Michael Park 466f0653a3 Updated the XFAIL comment in variant tests.
Summary:
`ConstexprTestTypes::NoCtors` is an aggregate type (and consequently a literal type) in C++17,
but not in C++14 since it has a base class. This patch updates the comment to accurately describe the reason for the XFAIL.

Reviewers: EricWF

Reviewed By: EricWF

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

llvm-svn: 296558
2017-03-01 01:07:56 +00:00
Steven Wu 1f27eaf5aa Remove XFAIL in implicit_deduction_guides tests
The clang assertion causing these tests failing with sanitizer is fixed
in r295794. All the bots running libcxx tests should be upgraded and
running the compiler with the fix.

llvm-svn: 296385
2017-02-27 21:10:41 +00:00
Asiri Rathnayake 68050fd694 Fix LIBCXX_HAS_EXTERNAL_THREAD_API builds. NFC.
Add the missing check in the __config header.

llvm-svn: 296351
2017-02-27 16:10:57 +00:00