Commit Graph

3883 Commits

Author SHA1 Message Date
Marshall Clow e391d9653f Additional test file for r300123
llvm-svn: 300124
2017-04-12 22:51:56 +00:00
Marshall Clow 5c80f4f6a2 Implement part of LWG#2857 - any/optional. Still to do - variant. Reviewed as https://reviews.llvm.org/D31956
llvm-svn: 300123
2017-04-12 22:51:27 +00:00
Eric Fiselier 34e38caa2f Fix incorrectly qualified return type from unique_ptr::get_deleter().
For reference deleter types the const qualifier on the return type
of get_deleter() should be ignored, and a non-const deleter should
be returned.

This patch fixes a bug where "const deleter_type&" is incorrectly
formed.

llvm-svn: 300121
2017-04-12 22:43:49 +00:00
Shoaib Meenai 538b3f4198 [libc++] Use more appropriate conditional for ABI macro definition
The inline function definition ABI macro is gated on COFF dllexport
semantics, so it's more appropriate to mark it with the object file
format macro rather than the generic _WIN32 macro. We now have no uses
of _WIN32 apart from those used to define the other Windows macros :)

Clarify the ABI macro comment and make the object file format check
exhaustive while I'm here.

llvm-svn: 300097
2017-04-12 19:56:37 +00:00
Stephan T. Lavavej a4961fe8ef [libcxx] [test] Avoid Clang's -Wunused-const-variable in is_constructible.pass.cpp.
This happens when using Clang with MSVC's STL, so there are no actual uses of this variable.

Fixes D31966.

llvm-svn: 300079
2017-04-12 17:16:38 +00:00
Marshall Clow 308624127f Add some FAIL constexpr tests for optional's copy/move ctors.
llvm-svn: 300009
2017-04-12 00:07:29 +00:00
Marshall Clow 36bc71782d Implement LWG#2873: 'Add noexcept to several shared_ptr related functions' This issue missed a couple, so I added those as well (see LWG#2942)
llvm-svn: 299963
2017-04-11 17:08:53 +00:00
Ben Craig 3f5b5fff8a [libc++] Fix unknown pragma warning on MSVC
llvm-svn: 299942
2017-04-11 14:06:39 +00:00
Marshall Clow 220706cd6d Mark P0599 as complete. It was implemented in r298573
llvm-svn: 299941
2017-04-11 14:04:03 +00:00
Marshall Clow dcad8bf00e Fix a C++03 failure
llvm-svn: 299909
2017-04-11 01:54:48 +00:00
Marshall Clow 76ad7d6e24 Remove some trigraphs that GCC was complaining about
llvm-svn: 299907
2017-04-11 00:18:28 +00:00
Marshall Clow c2be5ab581 Fix PR#32605: common_type<T> is not SFINAE-friendly
llvm-svn: 299901
2017-04-10 23:47:47 +00:00
Marshall Clow bd5f782868 Fix PR#32606: std::decay mishandles abominable function types
llvm-svn: 299894
2017-04-10 22:51:07 +00:00
Akira Hatanaka 6055ae88e9 Revert "Allow a standard library to implement conditional noexcept for optional and unique_ptr hash functions."
This reverts commit r299734.

llvm-svn: 299744
2017-04-07 05:55:28 +00:00
Shoaib Meenai 17af695f2b [libc++] Drop support for CRTs older than VS 2015
LLVM dropped support for Visual Studio versions older than 2015 quite
some time ago, so I consider it safe to drop libc++'s support for older
CRTs. The CRT in Visual Studio 2015 provides a lot of previously missing
functions, so targeting it requires less special casing.

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

llvm-svn: 299743
2017-04-07 02:20:52 +00:00
Billy Robert O'Neal III 8ac1fa16b2 Add noexcept(false) to more strongly indicate that not being noexcept is important for hash tests.
llvm-svn: 299735
2017-04-06 23:50:33 +00:00
Billy Robert O'Neal III eaeeaaf375 Allow a standard library to implement conditional noexcept for optional and unique_ptr hash functions.
These tests were unconditionally asserting that optional and unique_ptr declare throwing hashes, but MSVC++ implements conditional noexcept forwarding that of the underlying hash function. As a result we were failing these tests but there's nothing forbidding strengthening noexcept in that way.

Changed the ASSERT_NOT_NOEXCEPT asserts to use types which themselves have non-noexcept hash functions.

llvm-svn: 299734
2017-04-06 23:50:21 +00:00
Petr Hosek 7dc0e3d357 [CMake][libcxx] Use check_c_compiler_flag to check for nodefaultlibs
We're using -nodefaultlibs to avoid the dependency on C++ library
when using check_cxx_compiler_flag, and as such we cannot use
check_cxx_compiler_flag to check the availability of -nodefaultlibs
itself.

llvm-svn: 299711
2017-04-06 21:06:33 +00:00
Marshall Clow 14764c2200 Some of Eric's buildbots don't like this test. Disable it while I figure out why.
llvm-svn: 299686
2017-04-06 18:54:37 +00:00
Marshall Clow 71724f642e Recommit awk tests with warnings removed. Initial commit r299652, reverted r299656.
llvm-svn: 299680
2017-04-06 18:34:36 +00:00
Mehdi Amini ea7d7cd78a Revert "Restore Missing awk regex tests. Thanks to dexonsmith for noticing, and proposing this as https://reviews.llvm.org/D16541"
This reverts commit r299652, 32bits MacOS is broken.

llvm-svn: 299656
2017-04-06 15:56:55 +00:00
Marshall Clow 02c162d71a Restore Missing awk regex tests. Thanks to dexonsmith for noticing, and proposing this as https://reviews.llvm.org/D16541
llvm-svn: 299652
2017-04-06 14:32:42 +00:00
Shoaib Meenai 5dc5a8e5be [libc++] Respect Windows Store app CRT restrictions
Some CRT APIs are unavailable for Windows Store apps [1]. Detect when
we're targeting the Windows Store and don't try to refer to non-existent
CRT functions in that case. (This would otherwise lead to a compile
error when using the libc++ headers and compiling for Windows Store.)

[1] https://docs.microsoft.com/en-us/cpp/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps

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

llvm-svn: 299625
2017-04-06 04:47:49 +00:00
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