basic_string(basic_string&& __str, const allocator_type& __a);
#endif // _LIBCPP_CXX03_LANG
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template <class = typename enable_if<__is_allocator<_Allocator>::value, nullptr_t>::type>
-#endif
_LIBCPP_INLINE_VISIBILITY
basic_string(const _CharT* __s) {
_LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr");
# endif
}
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template <class = typename enable_if<__is_allocator<_Allocator>::value, nullptr_t>::type>
-#endif
_LIBCPP_INLINE_VISIBILITY
basic_string(const _CharT* __s, const _Allocator& __a);
_LIBCPP_INLINE_VISIBILITY
basic_string(size_type __n, _CharT __c);
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template <class = typename enable_if<__is_allocator<_Allocator>::value, nullptr_t>::type>
-#endif
_LIBCPP_INLINE_VISIBILITY
basic_string(size_type __n, _CharT __c, const _Allocator& __a);
}
template <class _CharT, class _Traits, class _Allocator>
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template <class>
-#endif
basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, const _Allocator& __a)
: __r_(__second_tag(), __a)
{
}
template <class _CharT, class _Traits, class _Allocator>
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
template <class>
-#endif
basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c, const _Allocator& __a)
: __r_(__second_tag(), __a)
{
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// Regression test for PR42676.
+
+// RUN: %cxx %flags %s -o %t.exe %compile_flags -D_LIBCPP_HIDE_FROM_ABI_PER_TU
+// RUN: %t.exe
+
+#include <memory>
+#include <string>
+
+int main() {
+ std::string s1(10u, '-', std::allocator<char>()); (void)s1;
+ std::string s2("hello", std::allocator<char>()); (void)s2;
+ std::string s3("hello"); (void)s3;
+}