// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
#include <cstddef>
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
#include <new>
#include <type_traits>
// { dg-options "-include string -include stdexcept" }
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
#include <source_location>
member_defaulted_sl.member.file_name());
std::string_view member_defaulted_sl_fn_name(
member_defaulted_sl.member.function_name());
- VERIFY(member_defaulted_sl.member.line() == 46);
+ VERIFY(member_defaulted_sl.member.line() == 47);
// closing paren of constructor declaration
VERIFY(member_defaulted_sl.member.column() == 25);
VERIFY(member_defaulted_sl_fn_name.starts_with("s::s(int)"sv));
// <http://www.gnu.org/licenses/>.
// { dg-do preprocess { target c++20 } }
+// { dg-add-options no_pch }
#include <version>
// { dg-options "-frtti" }
// { dg-do compile { target c++23 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
+// { dg-add-options no_pch }
#include <typeinfo>
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++17 } }
+// { dg-add-options no_pch }
#include <cassert>
#include <exception>
// { dg-do compile { target c++23 } }
// { dg-require-effective-target stacktrace }
+// { dg-add-options no_pch }
#include <stacktrace>
#include <sstream>
// { dg-do compile { target c++23 } }
// { dg-require-effective-target stacktrace }
// { dg-require-normal-namespace "" }
+// { dg-add-options no_pch }
#include <stacktrace>
// { dg-do preprocess { target c++23 } }
// { dg-require-effective-target stacktrace }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
#include <utility>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <memory>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
#include <utility>
// { dg-do compile { target c++23 } }
// This test relies on std::string.
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <bitset>
// { dg-do preprocess { target c++23 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
// Copyright (C) 2011-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
#include <chrono>
// { dg-do run { target c++17 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <memory>
#include <testsuite_hooks.h>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <utility>
// { dg-do compile { target c++23 } }
// { dg-require-normal-namespace "" }
+// { dg-add-options no_pch }
#include <expected>
// { dg-do preprocess { target c++23 } }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
#include <functional>
-#include <testsuite_hooks.h>
#ifndef __cpp_lib_bind_front
-# error "Feature test macro for bind_front is missing"
+# error "Feature test macro for bind_front is missing in <functional>"
#elif __cpp_lib_bind_front < 201902L
-# error "Feature test macro for bind_front has wrong value"
+# error "Feature test macro for bind_front has wrong value in <functional>"
#endif
+#include <testsuite_hooks.h>
+
using std::bind_front;
using std::is_same_v;
using std::is_invocable_v;
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
#include <functional>
-#include <memory>
-#include <string>
-#include <testsuite_hooks.h>
// P1651R0 bind_front should not unwrap reference_wrapper
#ifndef __cpp_lib_bind_front
-# error "Feature test macro for bind_front is missing"
+# error "Feature test macro for bind_front is missing in <functional>"
#elif __cpp_lib_bind_front < 201907L
-# error "Feature test macro for bind_front has wrong value"
+# error "Feature test macro for bind_front has wrong value in <functional>"
#endif
+#include <memory>
+#include <string>
+#include <testsuite_hooks.h>
+
void functionAcceptingStringView(std::string_view) { }
void
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
#include <functional>
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
#include <functional>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <functional>
#ifndef __cpp_lib_constexpr_functional
-# error "Feature test macro for constexpr invoke is missing"
+# error "Feature test macro for constexpr invoke is missing in <functional>"
#elif __cpp_lib_constexpr_functional < 201907L
-# error "Feature test macro for constexpr invoke has wrong value"
+# error "Feature test macro for constexpr invoke has wrong value in <functional>"
#endif
constexpr int inc(int i) { return i + 1; }
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++17 } }
+// { dg-add-options no_pch }
#include <functional>
-#include <string_view>
-#include <cstring>
-#include <cctype>
-#include <algorithm>
-#include <testsuite_hooks.h>
#if __STDC_HOSTED__
# ifndef __cpp_lib_boyer_moore_searcher
-# error "Feature-test macro for searchers missing"
+# error "Feature-test macro for searchers missing in <functional>"
# elif __cpp_lib_boyer_moore_searcher < 201603
-# error "Feature-test macro for searchers has wrong value"
+# error "Feature-test macro for searchers has wrong value in <functional>"
# endif
#endif // HOSTED
+#include <string_view>
+#include <cstring>
+#include <cctype>
+#include <algorithm>
+#include <testsuite_hooks.h>
+
using std::default_searcher;
#if __STDC_HOSTED__
using std::boyer_moore_searcher;
// <http://www.gnu.org/licenses/>.
// { dg-do preprocess { target c++20 } }
+// { dg-add-options no_pch }
#include <utility>
// <http://www.gnu.org/licenses/>.
// { dg-do preprocess { target c++20 } }
+// { dg-add-options no_pch }
#include <version>
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
// Copyright (C) 2019-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <type_traits>
-#include <testsuite_tr1.h>
#ifndef __cpp_lib_bounded_array_traits
-# error "Feature test macro for is_bounded_array is missing"
+# error "Feature test macro for is_bounded_array is missing in <type_traits>"
#elif __cpp_lib_bounded_array_traits < 201902L
-# error "Feature test macro for is_bounded_array has wrong value"
+# error "Feature test macro for is_bounded_array has wrong value in <type_traits>"
#endif
+#include <testsuite_tr1.h>
+
void test01()
{
using std::is_bounded_array;
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
+
#include <type_traits>
#ifndef __cpp_lib_is_layout_compatible
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <version>
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
// Copyright (C) 2015-2023 Free Software Foundation, Inc.
//
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
// Copyright (C) 2015-2023 Free Software Foundation, Inc.
//
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
// Copyright (C) 2015-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <type_traits>
-#include <testsuite_tr1.h>
-#include <utility>
-#include <array>
-#include <tuple>
-#include <queue>
-#include <stack>
#if defined(test_std_is_nothrow_swappable)
# ifndef __cpp_lib_is_swappable
"test_std_is_nothrow_swappable_ext need to be defined"
#endif
+#include <utility>
+#include <array>
+#include <tuple>
+#include <queue>
+#include <stack>
+#include <testsuite_tr1.h>
+
namespace funny {
struct F {};
void swap(F&, F&) = delete;
#include <type_traits>
-#ifndef __cpp_lib_is_swappable
-# error "Feature-test macro for is_nothrow_swappable_with missing"
-#elif __cpp_lib_is_swappable != 201603
-# error "Feature-test macro for is_nothrow_swappable_with has wrong value"
-#endif
-
namespace std
{
typedef short test_type;
#include <type_traits>
-#ifndef __cpp_lib_is_swappable
-# error "Feature-test macro for is_nothrow_swappable_with missing"
-#elif __cpp_lib_is_swappable != 201603
-# error "Feature-test macro for is_nothrow_swappable_with has wrong value"
-#endif
-
void test01()
{
// Check for required typedefs
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
// Copyright (C) 2016-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <type_traits>
-#include <testsuite_tr1.h>
#ifndef __cpp_lib_is_swappable
# error "Feature-test macro for is_nothrow_swappable_with missing"
# error "Feature-test macro for is_nothrow_swappable_with has wrong value"
#endif
+#include <testsuite_tr1.h>
+
namespace funny {
struct T0 {};
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
+
#include <type_traits>
#ifndef __cpp_lib_is_pointer_interconvertible
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
#include <type_traits>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
#include <version>
#include <type_traits>
-#ifndef __cpp_lib_is_swappable
-# error "Feature-test macro for is_swappable missing"
-#elif __cpp_lib_is_swappable != 201603
-# error "Feature-test macro for is_swappable has wrong value"
-#endif
-
namespace std
{
typedef short test_type;
#include <type_traits>
-#ifndef __cpp_lib_is_swappable
-# error "Feature-test macro for is_swappable missing"
-#elif __cpp_lib_is_swappable != 201603
-# error "Feature-test macro for is_swappable has wrong value"
-#endif
-
void test01()
{
// Check for required typedefs
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
// Copyright (C) 2015-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <type_traits>
-#include <testsuite_tr1.h>
-#include <utility>
-#include <array>
-#include <tuple>
-#include <queue>
-#include <stack>
#if defined(test_std_is_swappable)
# ifndef __cpp_lib_is_swappable
"need to be defined"
#endif
+#include <utility>
+#include <array>
+#include <tuple>
+#include <queue>
+#include <stack>
+#include <testsuite_tr1.h>
+
namespace funny {
struct F {};
void swap(F&, F&) = delete;
#include <type_traits>
-#ifndef __cpp_lib_is_swappable
-# error "Feature-test macro for is_swappable_with missing"
-#elif __cpp_lib_is_swappable != 201603
-# error "Feature-test macro for is_swappable_with has wrong value"
-#endif
-
namespace std
{
typedef short test_type;
#include <type_traits>
-#ifndef __cpp_lib_is_swappable
-# error "Feature-test macro for is_swappable_with missing"
-#elif __cpp_lib_is_swappable != 201603
-# error "Feature-test macro for is_swappable_with has wrong value"
-#endif
-
void test01()
{
// Check for required typedefs
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
// Copyright (C) 2016-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <type_traits>
-#include <testsuite_tr1.h>
#ifndef __cpp_lib_is_swappable
# error "Feature-test macro for is_swappable_with missing"
# error "Feature-test macro for is_swappable_with has wrong value"
#endif
+#include <testsuite_tr1.h>
+
namespace funny {
struct T0 {};
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
// Copyright (C) 2019-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <type_traits>
-#include <testsuite_tr1.h>
#ifndef __cpp_lib_bounded_array_traits
# error "Feature test macro for is_unbounded_array is missing"
# error "Feature test macro for is_unbounded_array has wrong value"
#endif
+#include <testsuite_tr1.h>
+
void test01()
{
using std::is_unbounded_array;
// { dg-do compile { target c++23 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <functional>
// { dg-do compile { target c++23 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <optional>
// { dg-do run { target c++17 } }
+// { dg-add-options no_pch }
// Copyright (C) 2013-2023 Free Software Foundation, Inc.
//
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
#include <version>
// { dg-do compile { target c++11 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <memory>
#if __cplusplus >= 201402L
// The feature-test macro is only defined for C++14 and later.
# if __cpp_lib_transparent_operators < 201510
-# error "__cpp_lib_transparent_operators < 201510"
+# error "__cpp_lib_transparent_operators < 201510 in <memory>"
# endif
#endif
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
#include <type_traits>
-#include <testsuite_tr1.h>
#ifndef __cpp_lib_reference_from_temporary
-# error "Feature test macro for reference_from_temporary is missing in <version>"
+# error "Feature test macro for reference_from_temporary is missing in <type_traits>"
#elif __cpp_lib_reference_from_temporary < 202202L
-# error "Feature test macro for reference_from_temporary has wrong value in <version>"
+# error "Feature test macro for reference_from_temporary has wrong value in <type_traits>"
#endif
+#include <testsuite_tr1.h>
+
void test01()
{
using std::reference_constructs_from_temporary;
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
#include <version>
// { dg-require-effective-target gthreads }
// { dg-additional-options "-pthread" { target pthread } }
// { dg-add-options libatomic }
+// { dg-add-options no_pch }
#include <memory>
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
// C++20 20.11.3.7 shared_ptr Creation [util.smartptr.shared.create]
// { dg-options "-fno-lifetime-dse -O0" }
// { dg-do run { target c++20 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
// C++20 20.11.3.7 shared_ptr Creation [util.smartptr.shared.create]
// { dg-do preprocess { target c++20 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
// C++20 20.11.3.7 shared_ptr Creation [util.smartptr.shared.create]
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
#include <chrono>
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
#include <charconv>
// { dg-do run { target c++26 } }
+// { dg-add-options no_pch }
#include <charconv>
-#include <testsuite_hooks.h>
#if defined(__cpp_lib_to_chars) && __cpp_lib_to_chars < 202306L
# error "Feature-test macro for std::to_chars has wrong value in <charconv>"
#endif
+#include <testsuite_hooks.h>
+
void
test_result()
{
// { dg-do preprocess { target c++23 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
#include <utility>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++17 } }
+// { dg-add-options no_pch }
#include <tuple>
-#include <testsuite_hooks.h>
#if __cpp_lib_apply < 201603
# error "__cpp_lib_apply < 201603"
#endif
+#include <testsuite_hooks.h>
+
void
test01()
{
// { dg-do compile { target c++20 } }
// FIXME [!HOSTED]: avoidable std::allocator usage
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
//
// Copyright (C) 2019-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++17 } }
+// { dg-add-options no_pch }
#include <tuple>
-#include <testsuite_hooks.h>
#ifndef __cpp_lib_make_from_tuple
-# error "Feature-test macro for make_from_tuple missing."
+# error "Feature-test macro for make_from_tuple missing in <tuple>"
#elif __cpp_lib_make_from_tuple < 201606
-# error "Feature-test macro for make_from_tuple has the wrong value."
+# error "Feature-test macro for make_from_tuple has the wrong value in <tuple>"
#endif
+#include <testsuite_hooks.h>
+
template <class T, class U, class V>
struct ThreeParam
{
// { dg-do run { target c++23 } }
// FIXME [!HOSTED]: avoidable std::allocator usage
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <tuple>
-#include <memory>
-#include <testsuite_hooks.h>
#if __cpp_lib_ranges_zip != 202110L
# error "Feature-test macro __cpp_lib_ranges_zip has wrong value in <tuple>"
#endif
+#include <memory>
+#include <testsuite_hooks.h>
+
using std::tuple;
using std::pair;
using std::allocator;
// { dg-do compile { target c++14 } }
+// { dg-add-options no_pch }
// Copyright (C) 2014-2023 Free Software Foundation, Inc.
//
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
#include <memory>
// { dg-do run { target c++20 } }
// { dg-xfail-run-if "AIX operator new" { powerpc-ibm-aix* } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
// Copyright (C) 2020-2023 Free Software Foundation, Inc.
//
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
#include <utility>
// { dg-do preprocess { target c++23 } }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <type_traits>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <version>
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <variant>
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
#include <version>
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
#include <variant>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
#include <type_traits>
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <string>
#endif
#endif
-
#include <cstring>
#include <testsuite_hooks.h>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target cxx11_abi }
+// { dg-add-options no_pch }
#include <string>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target cxx11_abi }
+// { dg-add-options no_pch }
#include <string>
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
// Copyright (C) 2018-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <string>
-#include <testsuite_hooks.h>
#ifndef __cpp_lib_erase_if
# error "Feature-test macro for erase_if missing in <string>"
# error "Feature-test macro for erase_if has wrong value in <string>"
#endif
+#include <testsuite_hooks.h>
+
void
test01()
{
// { dg-do run { target c++11 } }
// { dg-require-namedlocale "de_DE.ISO8859-15" }
+// { dg-add-options no_pch }
// C++11 21.5 Numeric Conversions [string.conversions]
#include <string>
-#include <format>
-#include <limits>
-#include <locale>
-#include <cstdio>
-#include <testsuite_hooks.h>
-
-namespace test
-{
-// Canonical version of std::to_string(double) as specified in the standard.
#if __cplusplus > 202302L
# error "Feature-test macro for std::to_string has wrong value in <string>"
#endif
-static std::string to_string(float val) { return std::format("{}", val); }
-static std::string to_string(double val) { return std::format("{}", val); }
-static std::string to_string(long double val) { return std::format("{}", val); }
-
#else
#ifdef __cpp_lib_to_string
# error "__cpp_lib_to_string should not be defined for C++23"
#endif
+#endif
+
+#include <format>
+#include <limits>
+#include <locale>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+namespace test
+{
+// Canonical version of std::to_string(double) as specified in the standard.
+
+#if __cpp_lib_to_string
+static std::string to_string(float val) { return std::format("{}", val); }
+static std::string to_string(double val) { return std::format("{}", val); }
+static std::string to_string(long double val) { return std::format("{}", val); }
+#else
static std::string to_string(double val)
{
std::string str(100, '9');
// { dg-do compile }
+// { dg-add-options no_pch }
+
#include <version>
#if __cplusplus > 202302L
// { dg-do compile { target c++17 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
// Copyright (C) 2021-2023 Free Software Foundation, Inc.
//
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
// Copyright (C) 2021-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <string_view>
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
// Copyright (C) 2017-2023 Free Software Foundation, Inc.
//
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
// Copyright (C) 2017-2023 Free Software Foundation, Inc.
//
// { dg-do compile { target c++17 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// { dg-do compile { target c++20 } }
-//
+// { dg-add-options no_pch }
+
// Copyright (C) 2019-2023 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
// Copyright (C) 2019-2023 Free Software Foundation, Inc.
//
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
// Copyright (C) 2019-2023 Free Software Foundation, Inc.
//
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
// Copyright (C) 2011-2023 Free Software Foundation, Inc.
//
// { dg-do compile { target c++20 } }
-//
+// { dg-add-options no_pch }
+
// Copyright (C) 2019-2023 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// { dg-do compile { target c++17 } }
-//
+// { dg-add-options no_pch }
+
// Copyright (C) 2019-2023 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
int n2 = std::get<1>(std::move(a));
int n3 = std::get<1>(ca);
-// { dg-error "static assertion failed" "" { target *-*-* } 389 }
-// { dg-error "static assertion failed" "" { target *-*-* } 398 }
-// { dg-error "static assertion failed" "" { target *-*-* } 407 }
+// { dg-error "static assertion failed" "" { target *-*-* } 391 }
+// { dg-error "static assertion failed" "" { target *-*-* } 400 }
+// { dg-error "static assertion failed" "" { target *-*-* } 409 }
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
// Copyright (C) 2018-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <deque>
-#include <testsuite_hooks.h>
#ifndef __cpp_lib_erase_if
# error "Feature-test macro for erase_if missing in <deque>"
# error "Feature-test macro for erase_if has wrong value in <deque>"
#endif
+#include <testsuite_hooks.h>
+
void
test01()
{
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
// Copyright (C) 2018-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <forward_list>
-#include <testsuite_hooks.h>
#ifndef __cpp_lib_erase_if
# error "Feature-test macro for erase_if missing in <forward_list>"
# error "Feature-test macro for erase_if has wrong value in <forward_list>"
#endif
+#include <testsuite_hooks.h>
+
void
test01()
{
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
// Copyright (C) 2018-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <list>
-#include <testsuite_hooks.h>
#ifndef __cpp_lib_erase_if
# error "Feature-test macro for erase_if missing in <list>"
# error "Feature-test macro for erase_if has wrong value in <list>"
#endif
+#include <testsuite_hooks.h>
+
void
test01()
{
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
// Copyright (C) 2018-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <map>
-#include <string>
-#include <testsuite_hooks.h>
#ifndef __cpp_lib_erase_if
# error "Feature-test macro for erase_if missing in <map>"
# error "Feature-test macro for erase_if has wrong value in <map>"
#endif
+#include <string>
+#include <testsuite_hooks.h>
+
auto is_odd_pair = [](const std::pair<const int, std::string>& p)
{
return p.first % 2 != 0;
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <queue>
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
// Copyright (C) 2018-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <set>
-#include <testsuite_hooks.h>
#ifndef __cpp_lib_erase_if
# error "Feature-test macro for erase_if missing in <set>"
# error "Feature-test macro for erase_if has wrong value in <set>"
#endif
+#include <testsuite_hooks.h>
+
auto is_odd = [](const int i) { return i % 2 != 0; };
void
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <span>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <stack>
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
// Copyright (C) 2018-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <unordered_map>
-#include <string>
-#include <testsuite_hooks.h>
#ifndef __cpp_lib_erase_if
# error "Feature-test macro for erase_if missing in <unordered_map>"
# error "Feature-test macro for erase_if has wrong value in <unordered_map>"
#endif
+#include <string>
+#include <testsuite_hooks.h>
+
auto is_odd_pair = [](const std::pair<const int, std::string>& p)
{
return p.first % 2 != 0;
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
#include <unordered_map>
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
// Copyright (C) 2018-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <unordered_set>
-#include <testsuite_hooks.h>
#ifndef __cpp_lib_erase_if
# error "Feature-test macro for erase_if missing in <unordered_set>"
# error "Feature-test macro for erase_if has wrong value in <unordered_set>"
#endif
+#include <testsuite_hooks.h>
+
void
test01()
{
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
#include <unordered_set>
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
// { dg-xfail-if "not supported" { debug_mode } }
#include <vector>
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
// Copyright (C) 2018-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <vector>
-#include <testsuite_hooks.h>
#ifndef __cpp_lib_erase_if
# error "Feature-test macro for erase_if missing in <vector>"
# error "Feature-test macro for erase_if has wrong value in <vector>"
#endif
+#include <testsuite_hooks.h>
+
void
test01()
{
// { dg-do preprocess { target c++20 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <iterator>
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
// Copyright (C) 2016-2023 Free Software Foundation, Inc.
//
// <http://www.gnu.org/licenses/>.
#include <algorithm>
-#include <functional>
#ifndef __cpp_lib_clamp
-# error "Feature-test macro for clamp missing"
+# error "Feature-test macro for clamp missing in <algorithm>"
#elif __cpp_lib_clamp != 201603
-# error "Feature-test macro for clamp has wrong value"
+# error "Feature-test macro for clamp has wrong value in <algorithm>"
#endif
+#include <functional>
+
static_assert(std::clamp(2, 0, 1) == 1);
static_assert(std::clamp(2, 1, 0, std::greater<int>()) == 1);
#include <functional>
#include <testsuite_api.h>
-#ifndef __cpp_lib_clamp
-# error "Feature-test macro for clamp missing"
-#elif __cpp_lib_clamp != 201603
-# error "Feature-test macro for clamp has wrong value"
-#endif
-
namespace std
{
using __gnu_test::NonDefaultConstructible;
// { dg-do compile { target c++20 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <algorithm>
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <algorithm>
-#include <ranges>
-#include <testsuite_iterators.h>
#if __cpp_lib_ranges_fold != 202207L
# error "Feature-test macro __cpp_lib_ranges_fold has wrong value in <algorithm>"
#endif
+#include <ranges>
+#include <testsuite_iterators.h>
+
namespace ranges = std::ranges;
namespace views = std::views;
// { dg-do preprocess { target c++17 } }
// { dg-require-effective-target tbb_backend }
+// { dg-add-options no_pch }
#include <numeric>
// { dg-do preprocess { target c++17 } }
// { dg-require-effective-target tbb_backend }
+// { dg-add-options no_pch }
#include <execution>
// { dg-do preprocess { target c++17 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// { dg-do preprocess { target c++17 } }
// { dg-require-effective-target tbb_backend }
+// { dg-add-options no_pch }
#include <memory>
// { dg-do preprocess { target c++17 } }
// { dg-require-effective-target tbb_backend }
+// { dg-add-options no_pch }
#include <algorithm>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
#include <bit>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <bit>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <bit>
// <http://www.gnu.org/licenses/>.
// { dg-do preprocess { target c++20 } }
+// { dg-add-options no_pch }
#include <complex>
// { dg-do preprocess { target c++20 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <bit>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
#include <numeric>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
#include <numeric>
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
#include <cmath>
// { dg-do preprocess { target c++20 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
#include <numeric>
// { dg-do preprocess { target c++20 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <numbers>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <version>
// { dg-options "-fno-inline" }
// { dg-do run { target c++26 } }
+// { dg-add-options no_pch }
// { dg-additional-files "filebuf_members-1.txt" }
#include <fstream>
// { dg-do preprocess { target c++26 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// { dg-do run { xfail *-*-vxworks* } }
+// { dg-add-options no_pch }
#include <ios>
// { dg-do run { xfail *-*-vxworks* } }
+// { dg-add-options no_pch }
#include <version>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target cxx11_abi }
+// { dg-add-options no_pch }
#include <syncstream>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target cxx11_abi }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target cxx11_abi }
+// { dg-add-options no_pch }
#include <syncstream>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target cxx11_abi }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <spanstream>
// { dg-do compile { target c++23 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// { dg-do run { target c++20 } }
// { dg-require-thread-fence "" }
+// { dg-add-options no_pch }
#include <atomic>
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <atomic>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target gthreads }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <atomic>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target gthreads }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// { dg-do compile { target c++23 } }
+// { dg-add-options no_pch }
#include <stdatomic.h>
// { dg-do preprocess { target c++23 } }
+// { dg-add-options no_pch }
// <stdatomic.h> is not freestanding.
// { dg-require-effective-target hosted }
// { dg-do compile { target c++20 } }
// { dg-require-effective-target gthreads }
+// { dg-add-options no_pch }
#include <barrier>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target gthreads }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <condition_variable>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// { dg-do compile { target c++20 } }
// { dg-require-gthreads "" }
+// { dg-add-options no_pch }
#include <thread>
// { dg-do compile { target c++20 } }
// { dg-require-gthreads "" }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <latch>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// { dg-do compile { target c++17 } }
// { dg-require-gthreads "" }
+// { dg-add-options no_pch }
// Copyright (C) 2017-2023 Free Software Foundation, Inc.
//
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-
// NB: This file is for testing with NO OTHER INCLUDES.
#include <mutex>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <semaphore>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <stop_token>
// { dg-do compile { target c++20 } }
// { dg-require-effective-target hosted }
+// { dg-add-options no_pch }
#include <version>
// { dg-do preprocess { target c++11 } }
// { dg-options "-fchar8_t" }
+// { dg-add-options no_pch }
#include <atomic>
#include <filesystem>
// { dg-do preprocess { target c++14 } }
+// { dg-add-options no_pch }
#include <utility>
#include <tuple>
#include <chrono>
#include <string>
#include <complex>
+#include <algorithm>
#include <iomanip>
#include <shared_mutex>
#include <map>
#include <set>
+#include <iterator>
#ifndef __cpp_lib_integer_sequence
# error "__cpp_lib_integer_sequence"
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++14 } }
+// { dg-add-options no_pch }
#include <experimental/iterator>
-#include <sstream>
-#include <testsuite_hooks.h>
#ifndef __cpp_lib_experimental_ostream_joiner
# error Feature-test macro is not defined.
# error Feature-test macro has bad value.
#endif
+#include <sstream>
+#include <testsuite_hooks.h>
+
using std::experimental::ostream_joiner;
void
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++14 } }
+// { dg-add-options no_pch }
#include <experimental/numeric>
-#include <experimental/type_traits>
#ifndef __cpp_lib_experimental_gcd_lcm
# error "Feature-test macro for gcd missing"
# error "Feature-test macro for gcd has wrong value"
#endif
+#include <experimental/type_traits>
+
using std::experimental::fundamentals_v2::gcd;
using std::experimental::is_same_v;
// { dg-do run { target c++20 } }
+// { dg-add-options no_pch }
#include <experimental/scope>
-#include <testsuite_hooks.h>
#ifndef __cpp_lib_experimental_scope
# error Feature-test macro is not defined.
# error Feature-test macro has bad value.
#endif
+#include <testsuite_hooks.h>
+
using std::experimental::unique_resource;
void
// <http://www.gnu.org/licenses/>.
// { dg-do preprocess { target c++20 } }
+// { dg-add-options no_pch }
#include <concepts>
// <http://www.gnu.org/licenses/>.
// { dg-do preprocess { target c++20 } }
+// { dg-add-options no_pch }
#include <version>
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <ranges>
+
+#if __cpp_lib_ranges_as_const != 202207L
+# error "Feature-test macro __cpp_lib_ranges_as_const has wrong value in <ranges>"
+#endif
+
#include <algorithm>
#include <span>
#include <utility>
#include <testsuite_hooks.h>
#include <testsuite_iterators.h>
-#if __cpp_lib_ranges_as_const != 202207L
-# error "Feature-test macro __cpp_lib_ranges_as_const has wrong value in <ranges>"
-#endif
-
namespace ranges = std::ranges;
namespace views = std::views;
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <ranges>
-#include <algorithm>
-#include <memory>
-#include <testsuite_hooks.h>
-#include <testsuite_iterators.h>
#if __cpp_lib_ranges_as_rvalue != 202207L
# error "Feature-test macro __cpp_lib_ranges_as_rvalue has wrong value in <ranges>"
#endif
+#include <algorithm>
+#include <memory>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+
namespace ranges = std::ranges;
namespace views = std::views;
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <ranges>
-#include <algorithm>
-#include <vector>
-#include <testsuite_hooks.h>
-#include <testsuite_iterators.h>
#if __cpp_lib_ranges_chunk != 202202L
# error "Feature-test macro __cpp_lib_ranges_chunk has wrong value in <ranges>"
#endif
+#include <algorithm>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+
namespace ranges = std::ranges;
namespace views = std::views;
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <ranges>
-#include <algorithm>
-#include <vector>
-#include <testsuite_hooks.h>
-#include <testsuite_iterators.h>
#if __cpp_lib_ranges_chunk_by != 202202L
# error "Feature-test macro __cpp_lib_ranges_chunk_by has wrong value in <ranges>"
#endif
+#include <algorithm>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+
namespace ranges = std::ranges;
namespace views = std::views;
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <ranges>
-#include <algorithm>
-#include <memory>
-#include <testsuite_hooks.h>
-#include <testsuite_iterators.h>
#if __cpp_lib_ranges_enumerate != 202302L
# error "Feature-test macro __cpp_lib_ranges_enumerate has wrong value in <ranges>"
#endif
+#include <algorithm>
+#include <memory>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+
namespace ranges = std::ranges;
namespace views = std::views;
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <ranges>
-#include <algorithm>
-#include <string>
-#include <testsuite_hooks.h>
-#include <testsuite_iterators.h>
#if __cpp_lib_ranges_join_with != 202202L
# error "Feature-test macro __cpp_lib_ranges_join_with has wrong value in <ranges>"
#endif
+#include <algorithm>
+#include <string>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+
namespace ranges = std::ranges;
namespace views = std::views;
using namespace std::literals;
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <ranges>
-#include <algorithm>
-#include <utility>
-#include <testsuite_hooks.h>
-#include <testsuite_iterators.h>
#if __cpp_lib_ranges_slide != 202202L
# error "Feature-test macro __cpp_lib_ranges_slide has wrong value in <ranges>"
#endif
+#include <algorithm>
+#include <utility>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+
namespace ranges = std::ranges;
namespace views = std::views;
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <ranges>
-#include <algorithm>
-#include <testsuite_hooks.h>
-#include <testsuite_iterators.h>
#if __cpp_lib_ranges_stride != 202207L
# error "Feature-test macro __cpp_lib_ranges_stride has wrong value in <ranges>"
#endif
+#include <algorithm>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+
namespace ranges = std::ranges;
namespace views = std::views;
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <ranges>
-#include <algorithm>
-#include <sstream>
-#include <testsuite_hooks.h>
-#include <testsuite_iterators.h>
#if __cpp_lib_ranges_cartesian_product != 202207L
# error "Feature-test macro __cpp_lib_ranges_cartesian_product has wrong value in <ranges>"
#endif
+#include <algorithm>
+#include <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+
namespace ranges = std::ranges;
namespace views = std::views;
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <ranges>
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <ranges>
-#include <algorithm>
-#include <memory>
-#include <testsuite_hooks.h>
#if __cpp_lib_ranges_repeat != 202207L
# error "Feature-test macro __cpp_lib_ranges_repeat has wrong value in <ranges>"
#endif
+#include <algorithm>
+#include <memory>
+#include <testsuite_hooks.h>
+
namespace ranges = std::ranges;
namespace views = std::views;
// { dg-do preprocess { target c++23 } }
+// { dg-add-options no_pch }
#include <version>
// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
#include <ranges>
+
+#if __cpp_lib_ranges_zip != 202110L
+# error "Feature-test macro __cpp_lib_ranges_zip has wrong value in <ranges>"
+#endif
+
#include <algorithm>
#include <utility>
#include <vector>
#include <testsuite_hooks.h>
#include <testsuite_iterators.h>
-#if __cpp_lib_ranges_zip != 202110L
-# error "Feature-test macro __cpp_lib_ranges_zip has wrong value in <ranges>"
-#endif
-
namespace ranges = std::ranges;
namespace views = std::views;
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++20 } }
+// { dg-add-options no_pch }
#include <chrono>