aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-01 13:24:37 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-01 13:24:37 +0000
commit9d043122e0fc90510de06d43da8eda827464c1da (patch)
treef1eb4415067a94e88da72ff1845a1ce41a8938be
parentd23de13b3208b94a25e1de463ea3155911512e61 (diff)
downloadsrc-vendor/libc++/libc++-trunk-r306956.tar.gz
src-vendor/libc++/libc++-trunk-r306956.zip
Vendor import of libc++ trunk r306956:vendor/libc++/libc++-trunk-r306956
-rw-r--r--include/__config6
-rw-r--r--include/new20
-rw-r--r--include/string8
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_deployment.fail.cpp36
-rw-r--r--test/std/utilities/utility/pairs/pair.astuple/tuple_element.fail.cpp22
-rw-r--r--test/std/utilities/variant/variant.helpers/variant_alternative.fail.cpp32
-rw-r--r--utils/libcxx/test/target_info.py11
-rw-r--r--www/upcoming_meeting.html4
8 files changed, 76 insertions, 63 deletions
diff --git a/include/__config b/include/__config
index aae053102f55..003e1ea60c60 100644
--- a/include/__config
+++ b/include/__config
@@ -1176,11 +1176,6 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \
__attribute__((availability(macosx,strict,introduced=10.9))) \
__attribute__((availability(ios,strict,introduced=7.0)))
-#define _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION \
- __attribute__((availability(macosx,strict,introduced=10.13))) \
- __attribute__((availability(ios,strict,introduced=11.0))) \
- __attribute__((availability(tvos,strict,introduced=11.0))) \
- __attribute__((availability(watchos,strict,introduced=4.0)))
#else
#define _LIBCPP_AVAILABILITY_SHARED_MUTEX
#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
@@ -1192,7 +1187,6 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
#define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
#define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
-#define _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION
#endif
// Define availability that depends on _LIBCPP_NO_EXCEPTIONS.
diff --git a/include/new b/include/new
index 3945faee0e38..34df2efee09e 100644
--- a/include/new
+++ b/include/new
@@ -193,20 +193,20 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operato
#endif
#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void operator delete(void* __p, std::align_val_t) _NOEXCEPT;
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
#endif
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void operator delete[](void* __p, std::align_val_t) _NOEXCEPT;
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_ALIGNED_ALLOCATION void operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
#endif
#endif
diff --git a/include/string b/include/string
index accf1ce27716..d1a3a1f8e6cc 100644
--- a/include/string
+++ b/include/string
@@ -4004,6 +4004,10 @@ basic_string<_CharT, _Traits, _Allocator>::__subscriptable(const const_iterator*
#endif // _LIBCPP_DEBUG_LEVEL >= 2
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE(string operator+<char, char_traits<char>, allocator<char> >(char const*, string const&))
+
#if _LIBCPP_STD_VER > 11
// Literal suffixes for basic_string [basic.string.literals]
inline namespace literals
@@ -4037,10 +4041,6 @@ inline namespace literals
}
#endif
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string<char>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string<wchar_t>)
-_LIBCPP_EXTERN_TEMPLATE(string operator+<char, char_traits<char>, allocator<char> >(char const*, string const&))
-
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_deployment.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_deployment.fail.cpp
deleted file mode 100644
index f9f487dc7ef8..000000000000
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_deployment.fail.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-// REQUIRES: availability=macosx10.12
-
-// test availability of new/delete operators introduced in c++17.
-
-#include <new>
-
-int main () {
- int *p0 = new ((std::align_val_t)16) int(1);
- (void)p0;
- int *p1 = new ((std::align_val_t)16) int[1];
- (void)p1;
- // expected-error@-4 {{call to unavailable function 'operator new': introduced in macOS 10.13}}
- // expected-note@new:* {{candidate function has been explicitly made unavailable}}
- // expected-note@new:* {{candidate function not viable: no known conversion from 'std::align_val_t' to 'const std::nothrow_t' for 2nd argument}}
- // expected-note@new:* {{candidate function not viable: no known conversion from 'std::align_val_t' to 'void *' for 2nd argument}}
- // expected-note@new:* {{candidate function not viable: requires single argument '__sz', but 2 arguments were provided}}
- // expected-note@new:* {{candidate function not viable: requires 3 arguments, but 2 were provided}}
-
- // expected-error@-9 {{call to unavailable function 'operator new[]': introduced in macOS 10.13}}
- // expected-note@new:* {{candidate function has been explicitly made unavailable}}
- // expected-note@new:* {{candidate function not viable: no known conversion from 'std::align_val_t' to 'const std::nothrow_t' for 2nd argument}}
- // expected-note@new:* {{candidate function not viable: no known conversion from 'std::align_val_t' to 'void *' for 2nd argument}}
- // expected-note@new:* {{candidate function not viable: requires single argument '__sz', but 2 arguments were provided}}
- // expected-note@new:* {{candidate function not viable: requires 3 arguments, but 2 were provided}}
- return 0;
-}
diff --git a/test/std/utilities/utility/pairs/pair.astuple/tuple_element.fail.cpp b/test/std/utilities/utility/pairs/pair.astuple/tuple_element.fail.cpp
new file mode 100644
index 000000000000..8e994126cc0d
--- /dev/null
+++ b/test/std/utilities/utility/pairs/pair.astuple/tuple_element.fail.cpp
@@ -0,0 +1,22 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <utility>
+
+// template <class T1, class T2> struct pair
+
+// tuple_element<I, pair<T1, T2> >::type
+
+#include <utility>
+
+int main()
+{
+ typedef std::pair<int, short> T;
+ typename std::tuple_element<2, T>::type foo; // expected-error@utility:* {{Index out of bounds in std::tuple_element<std::pair<T1, T2>>}}
+}
diff --git a/test/std/utilities/variant/variant.helpers/variant_alternative.fail.cpp b/test/std/utilities/variant/variant.helpers/variant_alternative.fail.cpp
new file mode 100644
index 000000000000..cbaa2a568d5b
--- /dev/null
+++ b/test/std/utilities/variant/variant.helpers/variant_alternative.fail.cpp
@@ -0,0 +1,32 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <size_t I, class T> struct variant_alternative; // undefined
+// template <size_t I, class T> struct variant_alternative<I, const T>;
+// template <size_t I, class T> struct variant_alternative<I, volatile T>;
+// template <size_t I, class T> struct variant_alternative<I, const volatile T>;
+// template <size_t I, class T>
+// using variant_alternative_t = typename variant_alternative<I, T>::type;
+//
+// template <size_t I, class... Types>
+// struct variant_alternative<I, variant<Types...>>;
+
+#include <memory>
+#include <type_traits>
+#include <variant>
+
+int main() {
+ using V = std::variant<int, void *, const void *, long double>;
+ typename std::variant_alternative<4, V>::type foo; // expected-error@variant:* {{Index out of bounds in std::variant_alternative<>}}
+}
diff --git a/utils/libcxx/test/target_info.py b/utils/libcxx/test/target_info.py
index 2104432f03c0..b3bbc0088542 100644
--- a/utils/libcxx/test/target_info.py
+++ b/utils/libcxx/test/target_info.py
@@ -8,11 +8,11 @@
#===----------------------------------------------------------------------===//
import importlib
-import lit.util # pylint: disable=import-error,no-name-in-module
import locale
import os
import platform
import re
+import subprocess
import sys
class DefaultTargetInfo(object):
@@ -73,12 +73,13 @@ class DarwinLocalTI(DefaultTargetInfo):
super(DarwinLocalTI, self).__init__(full_config)
def is_host_macosx(self):
- name = lit.util.capture(['sw_vers', '-productName']).strip()
+ name = subprocess.check_output(['sw_vers', '-productName']).strip()
return name == "Mac OS X"
def get_macosx_version(self):
assert self.is_host_macosx()
- version = lit.util.capture(['sw_vers', '-productVersion']).strip()
+ version = subprocess.check_output(
+ ['sw_vers', '-productVersion']).strip()
version = re.sub(r'([0-9]+\.[0-9]+)(\..*)?', r'\1', version)
return version
@@ -86,7 +87,7 @@ class DarwinLocalTI(DefaultTargetInfo):
assert self.is_host_macosx()
cmd = ['xcrun', '--sdk', name, '--show-sdk-path']
try:
- out = lit.util.capture(cmd).strip()
+ out = subprocess.check_output(cmd).strip()
except OSError:
pass
@@ -127,7 +128,7 @@ class DarwinLocalTI(DefaultTargetInfo):
else:
cmd = ['xcrun', '--show-sdk-path']
try:
- out = lit.util.capture(cmd).strip()
+ out = subprocess.check_output(cmd).strip()
res = 0
except OSError:
res = -1
diff --git a/www/upcoming_meeting.html b/www/upcoming_meeting.html
index 839eea825c5c..c7bd83fb39ca 100644
--- a/www/upcoming_meeting.html
+++ b/www/upcoming_meeting.html
@@ -90,10 +90,10 @@
<li>2954 - I don't think there's anything to do here.</li>
<li>2961 - We haven't implemented the PMR stuff yet.</li>
<li>2966 - Wording cleanup; no code or test changes needed.</li>
-<li>2974 - I have some code lying around that does this.</li>
+<li>2974 - I did this in r305196. Tests added in 306580</li>
</ul>
-<p>Last Updated: 25-Jun-2017</p>
+<p>Last Updated: 28-Jun-2017</p>
</div>
</body>
</html>