Eric Fiselier
8279a1399e
Revert "Suppress -Wctad-maybe-unsupported on types w/o deduction guides."
...
Some modules builds are issuing buggy diagnostics. The cause of which is
TBD.
This reverts commit r@367770.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@367777 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-04 07:13:43 +00:00
Eric Fiselier
de267ad1f1
Suppress -Wctad-maybe-unsupported on types w/o deduction guides.
...
There are a handful of standard library types that are intended
to support CTAD but don't need any explicit deduction guides to
do so.
This patch adds a dummy deduction guide to those types to suppress
-Wctad-maybe-unsupported (which gets emitted in user code).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@367770 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-03 23:54:29 +00:00
Marshall Clow
e3f2980a56
Provide hashers for string_view only if they are using the default char_traits. Seen on SO: test/std/strings/string.view/string.view.hash/char_type.hash.fail.cpp
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@364545 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-27 14:18:32 +00:00
Marshall Clow
e590adb938
We had a _LIBCPP_ASSERT commented out because gcc 4.9 didn't like it. We (LLVM) now require GCC 5.1, so that's not a problem any more. Re-enable the assertion. Fixes PR#36863
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@362465 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-04 02:07:11 +00:00
Louis Dionne
c30e2d9f77
[NFC][libcxx] Remove trailing whitespace
...
It's incredibly annoying when trying to create diffs
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361981 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-29 16:01:36 +00:00
Marshall Clow
ddb1b0576a
Mark 'front()' and 'back()' as noexcept for array/deque/string/string_view. These are just rebranded 'operator[]', and should be noexcept like it is.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356435 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-19 03:30:07 +00:00
Chandler Carruth
4abbf7dac3
Update the file headers across all of the LLVM projects in the monorepo
...
to reflect the new license.
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@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +00:00
Marshall Clow
96484477d1
Second part of P0482 - char8_t. Reviewed as https://reviews.llvm.org/D55308
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@348828 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 04:35:44 +00:00
Louis Dionne
6bc632fa1a
[libcxx] Apply _LIBCPP_INLINE_VISIBILITY for std::hash for string_view
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347765 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 15:22:30 +00:00
Marshall Clow
e3973fd962
Implement the infrastructure for feature-test macros. Very few actual feature test macros, though. Reviewed as: https://reviews.llvm.org/D51955
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342073 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 19:41:40 +00:00
Marshall Clow
256f187bc6
Implement LWG3034: P0767R1 breaks previously-standard-layout types
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328064 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21 00:36:05 +00:00
Marshall Clow
46ea17ee62
Change a static_assert to check for is_trivial instead of is_pod, as is mandated by P0767.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323071 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-22 00:17:48 +00:00
Marshall Clow
de0811ac71
Fix the definitions of 'reference' and 'pointer' in string_view that no one uses :-). Thanks to K-ballo for the catch.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@321188 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-20 16:31:40 +00:00
Marshall Clow
46b4ad5400
Implement P0457R2: 'String Prefix and Suffix Checking' for c++2a
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@319687 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-04 20:11:38 +00:00
Marshall Clow
f1729d90b3
More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in string, string_view, and the free function std::empty(). Removed tabs from <string_view>, which is why the diff is so big.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318328 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 20:02:27 +00:00
Marshall Clow
76929f6825
Mark string_view's constructor from (ptr,len) as noexcept (an extension). Update the tests to check this (and other noexcept bits
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316456 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-24 16:30:06 +00:00
Marshall Clow
66db4e4fdd
Mark string_view literals as 'noexcept'. Fixes PR#25054. Thanks to Pavel K for the bug report.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316439 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-24 14:06:00 +00:00
Eric Fiselier
59e24fe13c
Fix more unreserved names
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304383 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 02:29:37 +00:00
Eric Fiselier
018a3d51a4
[Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows
...
Summary:
This patch improves how libc++ handles min/max macros within the headers. Previously libc++ would undef them and emit a warning.
This patch changes libc++ to use `#pragma push_macro` to save the macro before undefining it, and `#pragma pop_macro` to restore the macros and the end of the header.
Reviewers: mclow.lists, bcraig, compnerd, EricWF
Reviewed By: EricWF
Subscribers: cfe-commits, krytarowski
Differential Revision: https://reviews.llvm.org/D33080
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304357 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 22:07:49 +00:00
Eric Fiselier
050bf66723
Remove non-standard basic_string_view::clear() member.
...
This patch removes the clear() member from <string_view>. The
modifier was removed from the TS before it ever landed in the standard.
There is no reason libc++ should be providing this method.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302869 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 03:35:53 +00:00
Marshall Clow
2d4c3fa48a
Implement LWG#2761: 'basic_string should require that charT match traits::char_type'. Tests for string_view, too
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297872 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 18:41:11 +00:00
Marshall Clow
fbe68a68ab
Implement LWG#2778: basic_string_view is missing constexpr.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292823 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 19:53:28 +00:00
Marshall Clow
7d32d2f5a1
Implement P0403R1 - 'Literal suffixes for basic_string_view'. Requires clang 4.0 (specifically, r290744)
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291457 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 18:07:34 +00:00
Eric Fiselier
c3589a8305
[NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS
...
The name _LIBCPP_TYPE_VIS_ONLY is no longer accurate because both
_LIBCPP_TYPE_VIS and _LIBCPP_TYPE_VIS_ONLY expand to
__attribute__((__type_visibility__)) with Clang. The only remaining difference
is that _LIBCPP_TYPE_VIS_ONLY can be applied to templates whereas
_LIBCPP_TYPE_VIS cannot (due to dllimport/dllexport not being allowed on
templates).
This patch renames _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291035 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 23:56:00 +00:00
Eric Fiselier
72a5c771b8
Add module definitions for string_view
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288733 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 23:53:23 +00:00
Marshall Clow
db7fa111ab
Fixes for LWG 2598, 2686, 2739, 2742, 2747, and 2759, which were adopted last week in Issaquah
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286858 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14 18:22:19 +00:00
Marshall Clow
276a5209a3
Move 'quoted' for string_view from <string_view> to <iomanip> (where the other versions of 'quoted' live. No functional change.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@285300 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 15:10:07 +00:00
Marshall Clow
e7acb0e5be
Followon to r279744. Find the other exception types and make __throw_XXX routines (and call them). Remove the generic __libcpp_throw routine, since no one uses it anymore.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@279763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-25 17:47:09 +00:00
Marshall Clow
e6521d677b
Add a bunch of noexcepts to char_traits and string_view.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276955 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 04:52:02 +00:00
Marshall Clow
15362334f6
Fix some string_view tests that were failing when exceptions were disabled. Also comment out a _LIBCPP_ASSERT that gcc4.9 was complaining about. Will revisit that later.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276241 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 06:24:04 +00:00
Marshall Clow
1e00d6db31
Implement std::string_view as described in http://wg21.link/P0254R1 . Reviewed as https://reviews.llvm.org/D21459
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276238 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 05:31:24 +00:00