From 9a564c3dcbf742e083685698c672415f3e3585fb Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Thu, 26 Dec 2024 18:38:26 +0800 Subject: [PATCH] atf: 0.21-unstable-2021-09-01 -> 0.22 --- pkgs/by-name/at/atf/package.nix | 28 +- pkgs/by-name/at/atf/pr-85.patch | 1529 +++++++++++++++++++++++++++++++ 2 files changed, 1539 insertions(+), 18 deletions(-) create mode 100644 pkgs/by-name/at/atf/pr-85.patch diff --git a/pkgs/by-name/at/atf/package.nix b/pkgs/by-name/at/atf/package.nix index 5edb2d6366b8f9..94210aba9939e0 100644 --- a/pkgs/by-name/at/atf/package.nix +++ b/pkgs/by-name/at/atf/package.nix @@ -10,33 +10,23 @@ stdenv.mkDerivation (finalAttrs: { pname = "atf"; - version = "0.21-unstable-2021-09-01"; # Match the commit used in FreeBSD’s port. + version = "0.22-unstable-2024-12-26"; src = fetchFromGitHub { owner = "freebsd"; repo = "atf"; - rev = "55c21b2c5fb189bbdfccb2b297bfa89236502542"; - hash = "sha256-u0YBPcoIBvqBVaytaO9feBaRnQygtzEPGJV0ItI1Vco="; + rev = "f77b0c9a4bad26f19b11faea7a2641c01f6746c0"; + hash = "sha256-DJS9R5KyTUbCSNBi3u5XGxDraVMzRR6qm04ooc02Gfc="; }; patches = [ - # Fixes use after free that causes failures in Kyua’s test suite. - # https://github.com/freebsd/atf/pull/57 - # https://github.com/freebsd/kyua/issues/223 - (fetchpatch { - name = "fix-use-after-free.patch"; - url = "https://github.com/freebsd/atf/commit/fb22f3837bcfdce5ce8b3c0e18af131bb6902a02.patch"; - hash = "sha256-p4L3sxSYfMSzwKrUDlEZpoJydbaK3Hcbvn90KlPHkic="; - }) + # https://github.com/freebsd/atf/issues/88 + # https://github.com/freebsd/atf/pull/85 + ./pr-85.patch ]; postPatch = lib.optionalString finalAttrs.doInstallCheck '' - # https://github.com/freebsd/atf/issues/61 - substituteInPlace atf-c/check_test.c \ - --replace-fail 'ATF_TP_ADD_TC(tp, build_cpp)' "" - substituteInPlace atf-c++/check_test.cpp \ - --replace-fail 'ATF_ADD_TEST_CASE(tcs, build_cpp);' "" # Can’t find `c_helpers` in the work folder. substituteInPlace test-programs/Kyuafile \ --replace-fail 'atf_test_program{name="srcdir_test"}' "" @@ -60,12 +50,14 @@ stdenv.mkDerivation (finalAttrs: { makeFlags = [ # ATF isn’t compatible with C++17, which is the default on current clang and GCC. - "CXXFLAGS=-std=c++11" + "CXXFLAGS=-std=c++14" ]; doInstallCheck = true; - nativeInstallCheckInputs = [ kyua ]; + nativeInstallCheckInputs = [ + kyua + ]; installCheckPhase = '' runHook preInstallCheck diff --git a/pkgs/by-name/at/atf/pr-85.patch b/pkgs/by-name/at/atf/pr-85.patch new file mode 100644 index 00000000000000..d438ce16b04804 --- /dev/null +++ b/pkgs/by-name/at/atf/pr-85.patch @@ -0,0 +1,1529 @@ +From 1f0ee71c000074ca48c2d9edc94f152747835e20 Mon Sep 17 00:00:00 2001 +From: Enji Cooper +Date: Thu, 5 Dec 2024 23:07:18 -0800 +Subject: [PATCH 1/9] Garbage collect stray reference to auto_array + +This entry should have been removed in the referenced commit. + +Fixes: 6639d083e7d5b4b478397cc416cd42a756d17b0c +--- + atf-c++/detail/Makefile.am.inc | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/atf-c++/detail/Makefile.am.inc b/atf-c++/detail/Makefile.am.inc +index b3181346..29b41c3f 100644 +--- a/atf-c++/detail/Makefile.am.inc ++++ b/atf-c++/detail/Makefile.am.inc +@@ -25,7 +25,6 @@ + + libatf_c___la_SOURCES += atf-c++/detail/application.cpp \ + atf-c++/detail/application.hpp \ +- atf-c++/detail/auto_array.hpp \ + atf-c++/detail/env.cpp \ + atf-c++/detail/env.hpp \ + atf-c++/detail/exceptions.cpp \ + +From bb58a4dfbc98e95c365be8033f9778571f35ef9d Mon Sep 17 00:00:00 2001 +From: Enji Cooper +Date: Thu, 5 Dec 2024 23:25:26 -0800 +Subject: [PATCH 2/9] Require C++-14 at bare minimum + +This change imports ac_cxx_compile_stdcxx.m4 from gnu,org and makes use +of the `AX_CXX_COMPILE_STDCXX` macro in configure.ac to ensure that the +compiler specified supports C++-14 (at bare minimum). This is being done +to quell some issues reported by scan-build about the code using C++ +range-based for-loops (a feature added in C++-11). +--- + configure.ac | 3 +- + m4/ac_cxx_compile_stdcxx.m4 | 1070 +++++++++++++++++++++++++++++++++++ + 2 files changed, 1072 insertions(+), 1 deletion(-) + create mode 100644 m4/ac_cxx_compile_stdcxx.m4 + +diff --git a/configure.ac b/configure.ac +index c37aca44..6d802144 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -58,8 +58,9 @@ AM_PROG_CC_C_O + dnl The C compiler check automatically aborts if the compiler does not work. + dnl Nothing to do here. + +-AC_LANG(C++) + AC_PROG_CXX ++AC_LANG_COMPILER(C++) ++AX_CXX_COMPILE_STDCXX(14, noext, mandatory) + AC_CACHE_CHECK([whether the C++ compiler works], + [atf_cv_prog_cxx_works], + [AC_LANG_PUSH([C++]) +diff --git a/m4/ac_cxx_compile_stdcxx.m4 b/m4/ac_cxx_compile_stdcxx.m4 +new file mode 100644 +index 00000000..fe6ae17e +--- /dev/null ++++ b/m4/ac_cxx_compile_stdcxx.m4 +@@ -0,0 +1,1070 @@ ++# =========================================================================== ++# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html ++# =========================================================================== ++# ++# SYNOPSIS ++# ++# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) ++# ++# DESCRIPTION ++# ++# Check for baseline language coverage in the compiler for the specified ++# version of the C++ standard. If necessary, add switches to CXX and ++# CXXCPP to enable support. VERSION may be '11', '14', '17', '20', or ++# '23' for the respective C++ standard version. ++# ++# The second argument, if specified, indicates whether you insist on an ++# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. ++# -std=c++11). If neither is specified, you get whatever works, with ++# preference for no added switch, and then for an extended mode. ++# ++# The third argument, if specified 'mandatory' or if left unspecified, ++# indicates that baseline support for the specified C++ standard is ++# required and that the macro should error out if no mode with that ++# support is found. If specified 'optional', then configuration proceeds ++# regardless, after defining HAVE_CXX${VERSION} if and only if a ++# supporting mode is found. ++# ++# LICENSE ++# ++# Copyright (c) 2008 Benjamin Kosnik ++# Copyright (c) 2012 Zack Weinberg ++# Copyright (c) 2013 Roy Stogner ++# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov ++# Copyright (c) 2015 Paul Norman ++# Copyright (c) 2015 Moritz Klammler ++# Copyright (c) 2016, 2018 Krzesimir Nowak ++# Copyright (c) 2019 Enji Cooper ++# Copyright (c) 2020 Jason Merrill ++# Copyright (c) 2021, 2024 Jörn Heusipp ++# Copyright (c) 2015, 2022, 2023, 2024 Olly Betts ++# ++# Copying and distribution of this file, with or without modification, are ++# permitted in any medium without royalty provided the copyright notice ++# and this notice are preserved. This file is offered as-is, without any ++# warranty. ++ ++#serial 25 ++ ++dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro ++dnl (serial version number 13). ++ ++AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl ++ m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], ++ [$1], [14], [ax_cxx_compile_alternatives="14 1y"], ++ [$1], [17], [ax_cxx_compile_alternatives="17 1z"], ++ [$1], [20], [ax_cxx_compile_alternatives="20"], ++ [$1], [23], [ax_cxx_compile_alternatives="23"], ++ [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl ++ m4_if([$2], [], [], ++ [$2], [ext], [], ++ [$2], [noext], [], ++ [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl ++ m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], ++ [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], ++ [$3], [optional], [ax_cxx_compile_cxx$1_required=false], ++ [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) ++ AC_LANG_PUSH([C++])dnl ++ ac_success=no ++ ++ m4_if([$2], [], [dnl ++ AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, ++ ax_cv_cxx_compile_cxx$1, ++ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], ++ [ax_cv_cxx_compile_cxx$1=yes], ++ [ax_cv_cxx_compile_cxx$1=no])]) ++ if test x$ax_cv_cxx_compile_cxx$1 = xyes; then ++ ac_success=yes ++ fi]) ++ ++ m4_if([$2], [noext], [], [dnl ++ if test x$ac_success = xno; then ++ for alternative in ${ax_cxx_compile_alternatives}; do ++ switch="-std=gnu++${alternative}" ++ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) ++ AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, ++ $cachevar, ++ [ac_save_CXX="$CXX" ++ CXX="$CXX $switch" ++ AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], ++ [eval $cachevar=yes], ++ [eval $cachevar=no]) ++ CXX="$ac_save_CXX"]) ++ if eval test x\$$cachevar = xyes; then ++ CXX="$CXX $switch" ++ if test -n "$CXXCPP" ; then ++ CXXCPP="$CXXCPP $switch" ++ fi ++ ac_success=yes ++ break ++ fi ++ done ++ fi]) ++ ++ m4_if([$2], [ext], [], [dnl ++ if test x$ac_success = xno; then ++ dnl HP's aCC needs +std=c++11 according to: ++ dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf ++ dnl Cray's crayCC needs "-h std=c++11" ++ dnl MSVC needs -std:c++NN for C++17 and later (default is C++14) ++ for alternative in ${ax_cxx_compile_alternatives}; do ++ for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do ++ if test x"$switch" = xMSVC; then ++ dnl AS_TR_SH maps both `:` and `=` to `_` so -std:c++17 would collide ++ dnl with -std=c++17. We suffix the cache variable name with _MSVC to ++ dnl avoid this. ++ switch=-std:c++${alternative} ++ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_${switch}_MSVC]) ++ else ++ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) ++ fi ++ AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, ++ $cachevar, ++ [ac_save_CXX="$CXX" ++ CXX="$CXX $switch" ++ AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], ++ [eval $cachevar=yes], ++ [eval $cachevar=no]) ++ CXX="$ac_save_CXX"]) ++ if eval test x\$$cachevar = xyes; then ++ CXX="$CXX $switch" ++ if test -n "$CXXCPP" ; then ++ CXXCPP="$CXXCPP $switch" ++ fi ++ ac_success=yes ++ break ++ fi ++ done ++ if test x$ac_success = xyes; then ++ break ++ fi ++ done ++ fi]) ++ AC_LANG_POP([C++]) ++ if test x$ax_cxx_compile_cxx$1_required = xtrue; then ++ if test x$ac_success = xno; then ++ AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) ++ fi ++ fi ++ if test x$ac_success = xno; then ++ HAVE_CXX$1=0 ++ AC_MSG_NOTICE([No compiler with C++$1 support was found]) ++ else ++ HAVE_CXX$1=1 ++ AC_DEFINE(HAVE_CXX$1,1, ++ [define if the compiler supports basic C++$1 syntax]) ++ fi ++ AC_SUBST(HAVE_CXX$1) ++]) ++ ++ ++dnl Test body for checking C++11 support ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], ++ [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11] ++) ++ ++dnl Test body for checking C++14 support ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], ++ [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14] ++) ++ ++dnl Test body for checking C++17 support ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], ++ [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_17] ++) ++ ++dnl Test body for checking C++20 support ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20], ++ [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_20] ++) ++ ++dnl Test body for checking C++23 support ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_23], ++ [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_23] ++) ++ ++ ++dnl Tests for new features in C++11 ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ ++ ++// If the compiler admits that it is not ready for C++11, why torture it? ++// Hopefully, this will speed up the test. ++ ++#ifndef __cplusplus ++ ++#error "This is not a C++ compiler" ++ ++// MSVC always sets __cplusplus to 199711L in older versions; newer versions ++// only set it correctly if /Zc:__cplusplus is specified as well as a ++// /std:c++NN switch: ++// ++// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ ++// ++// The value __cplusplus ought to have is available in _MSVC_LANG since ++// Visual Studio 2015 Update 3: ++// ++// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros ++// ++// This was also the first MSVC version to support C++14 so we can't use the ++// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having ++// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. ++#elif __cplusplus < 201103L && !defined _MSC_VER ++ ++#error "This is not a C++11 compiler" ++ ++#else ++ ++namespace cxx11 ++{ ++ ++ namespace test_static_assert ++ { ++ ++ template ++ struct check ++ { ++ static_assert(sizeof(int) <= sizeof(T), "not big enough"); ++ }; ++ ++ } ++ ++ namespace test_final_override ++ { ++ ++ struct Base ++ { ++ virtual ~Base() {} ++ virtual void f() {} ++ }; ++ ++ struct Derived : public Base ++ { ++ virtual ~Derived() override {} ++ virtual void f() override {} ++ }; ++ ++ } ++ ++ namespace test_double_right_angle_brackets ++ { ++ ++ template < typename T > ++ struct check {}; ++ ++ typedef check single_type; ++ typedef check> double_type; ++ typedef check>> triple_type; ++ typedef check>>> quadruple_type; ++ ++ } ++ ++ namespace test_decltype ++ { ++ ++ int ++ f() ++ { ++ int a = 1; ++ decltype(a) b = 2; ++ return a + b; ++ } ++ ++ } ++ ++ namespace test_type_deduction ++ { ++ ++ template < typename T1, typename T2 > ++ struct is_same ++ { ++ static const bool value = false; ++ }; ++ ++ template < typename T > ++ struct is_same ++ { ++ static const bool value = true; ++ }; ++ ++ template < typename T1, typename T2 > ++ auto ++ add(T1 a1, T2 a2) -> decltype(a1 + a2) ++ { ++ return a1 + a2; ++ } ++ ++ int ++ test(const int c, volatile int v) ++ { ++ static_assert(is_same::value == true, ""); ++ static_assert(is_same::value == false, ""); ++ static_assert(is_same::value == false, ""); ++ auto ac = c; ++ auto av = v; ++ auto sumi = ac + av + 'x'; ++ auto sumf = ac + av + 1.0; ++ static_assert(is_same::value == true, ""); ++ static_assert(is_same::value == true, ""); ++ static_assert(is_same::value == true, ""); ++ static_assert(is_same::value == false, ""); ++ static_assert(is_same::value == true, ""); ++ return (sumf > 0.0) ? sumi : add(c, v); ++ } ++ ++ } ++ ++ namespace test_noexcept ++ { ++ ++ int f() { return 0; } ++ int g() noexcept { return 0; } ++ ++ static_assert(noexcept(f()) == false, ""); ++ static_assert(noexcept(g()) == true, ""); ++ ++ } ++ ++ namespace test_constexpr ++ { ++ ++ template < typename CharT > ++ unsigned long constexpr ++ strlen_c_r(const CharT *const s, const unsigned long acc) noexcept ++ { ++ return *s ? strlen_c_r(s + 1, acc + 1) : acc; ++ } ++ ++ template < typename CharT > ++ unsigned long constexpr ++ strlen_c(const CharT *const s) noexcept ++ { ++ return strlen_c_r(s, 0UL); ++ } ++ ++ static_assert(strlen_c("") == 0UL, ""); ++ static_assert(strlen_c("1") == 1UL, ""); ++ static_assert(strlen_c("example") == 7UL, ""); ++ static_assert(strlen_c("another\0example") == 7UL, ""); ++ ++ } ++ ++ namespace test_rvalue_references ++ { ++ ++ template < int N > ++ struct answer ++ { ++ static constexpr int value = N; ++ }; ++ ++ answer<1> f(int&) { return answer<1>(); } ++ answer<2> f(const int&) { return answer<2>(); } ++ answer<3> f(int&&) { return answer<3>(); } ++ ++ void ++ test() ++ { ++ int i = 0; ++ const int c = 0; ++ static_assert(decltype(f(i))::value == 1, ""); ++ static_assert(decltype(f(c))::value == 2, ""); ++ static_assert(decltype(f(0))::value == 3, ""); ++ } ++ ++ } ++ ++ namespace test_uniform_initialization ++ { ++ ++ struct test ++ { ++ static const int zero {}; ++ static const int one {1}; ++ }; ++ ++ static_assert(test::zero == 0, ""); ++ static_assert(test::one == 1, ""); ++ ++ } ++ ++ namespace test_lambdas ++ { ++ ++ void ++ test1() ++ { ++ auto lambda1 = [](){}; ++ auto lambda2 = lambda1; ++ lambda1(); ++ lambda2(); ++ } ++ ++ int ++ test2() ++ { ++ auto a = [](int i, int j){ return i + j; }(1, 2); ++ auto b = []() -> int { return '0'; }(); ++ auto c = [=](){ return a + b; }(); ++ auto d = [&](){ return c; }(); ++ auto e = [a, &b](int x) mutable { ++ const auto identity = [](int y){ return y; }; ++ for (auto i = 0; i < a; ++i) ++ a += b--; ++ return x + identity(a + b); ++ }(0); ++ return a + b + c + d + e; ++ } ++ ++ int ++ test3() ++ { ++ const auto nullary = [](){ return 0; }; ++ const auto unary = [](int x){ return x; }; ++ using nullary_t = decltype(nullary); ++ using unary_t = decltype(unary); ++ const auto higher1st = [](nullary_t f){ return f(); }; ++ const auto higher2nd = [unary](nullary_t f1){ ++ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; ++ }; ++ return higher1st(nullary) + higher2nd(nullary)(unary); ++ } ++ ++ } ++ ++ namespace test_variadic_templates ++ { ++ ++ template ++ struct sum; ++ ++ template ++ struct sum ++ { ++ static constexpr auto value = N0 + sum::value; ++ }; ++ ++ template <> ++ struct sum<> ++ { ++ static constexpr auto value = 0; ++ }; ++ ++ static_assert(sum<>::value == 0, ""); ++ static_assert(sum<1>::value == 1, ""); ++ static_assert(sum<23>::value == 23, ""); ++ static_assert(sum<1, 2>::value == 3, ""); ++ static_assert(sum<5, 5, 11>::value == 21, ""); ++ static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); ++ ++ } ++ ++ // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae ++ // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function ++ // because of this. ++ namespace test_template_alias_sfinae ++ { ++ ++ struct foo {}; ++ ++ template ++ using member = typename T::member_type; ++ ++ template ++ void func(...) {} ++ ++ template ++ void func(member*) {} ++ ++ void test(); ++ ++ void test() { func(0); } ++ ++ } ++ ++} // namespace cxx11 ++ ++#endif // __cplusplus >= 201103L ++ ++]]) ++ ++ ++dnl Tests for new features in C++14 ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ ++ ++// If the compiler admits that it is not ready for C++14, why torture it? ++// Hopefully, this will speed up the test. ++ ++#ifndef __cplusplus ++ ++#error "This is not a C++ compiler" ++ ++#elif __cplusplus < 201402L && !defined _MSC_VER ++ ++#error "This is not a C++14 compiler" ++ ++#else ++ ++namespace cxx14 ++{ ++ ++ namespace test_polymorphic_lambdas ++ { ++ ++ int ++ test() ++ { ++ const auto lambda = [](auto&&... args){ ++ const auto istiny = [](auto x){ ++ return (sizeof(x) == 1UL) ? 1 : 0; ++ }; ++ const int aretiny[] = { istiny(args)... }; ++ return aretiny[0]; ++ }; ++ return lambda(1, 1L, 1.0f, '1'); ++ } ++ ++ } ++ ++ namespace test_binary_literals ++ { ++ ++ constexpr auto ivii = 0b0000000000101010; ++ static_assert(ivii == 42, "wrong value"); ++ ++ } ++ ++ namespace test_generalized_constexpr ++ { ++ ++ template < typename CharT > ++ constexpr unsigned long ++ strlen_c(const CharT *const s) noexcept ++ { ++ auto length = 0UL; ++ for (auto p = s; *p; ++p) ++ ++length; ++ return length; ++ } ++ ++ static_assert(strlen_c("") == 0UL, ""); ++ static_assert(strlen_c("x") == 1UL, ""); ++ static_assert(strlen_c("test") == 4UL, ""); ++ static_assert(strlen_c("another\0test") == 7UL, ""); ++ ++ } ++ ++ namespace test_lambda_init_capture ++ { ++ ++ int ++ test() ++ { ++ auto x = 0; ++ const auto lambda1 = [a = x](int b){ return a + b; }; ++ const auto lambda2 = [a = lambda1(x)](){ return a; }; ++ return lambda2(); ++ } ++ ++ } ++ ++ namespace test_digit_separators ++ { ++ ++ constexpr auto ten_million = 100'000'000; ++ static_assert(ten_million == 100000000, ""); ++ ++ } ++ ++ namespace test_return_type_deduction ++ { ++ ++ auto f(int& x) { return x; } ++ decltype(auto) g(int& x) { return x; } ++ ++ template < typename T1, typename T2 > ++ struct is_same ++ { ++ static constexpr auto value = false; ++ }; ++ ++ template < typename T > ++ struct is_same ++ { ++ static constexpr auto value = true; ++ }; ++ ++ int ++ test() ++ { ++ auto x = 0; ++ static_assert(is_same::value, ""); ++ static_assert(is_same::value, ""); ++ return x; ++ } ++ ++ } ++ ++} // namespace cxx14 ++ ++#endif // __cplusplus >= 201402L ++ ++]]) ++ ++ ++dnl Tests for new features in C++17 ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ ++ ++// If the compiler admits that it is not ready for C++17, why torture it? ++// Hopefully, this will speed up the test. ++ ++#ifndef __cplusplus ++ ++#error "This is not a C++ compiler" ++ ++#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L ++ ++#error "This is not a C++17 compiler" ++ ++#else ++ ++#include ++#include ++#include ++ ++namespace cxx17 ++{ ++ ++ namespace test_constexpr_lambdas ++ { ++ ++ constexpr int foo = [](){return 42;}(); ++ ++ } ++ ++ namespace test::nested_namespace::definitions ++ { ++ ++ } ++ ++ namespace test_fold_expression ++ { ++ ++ template ++ int multiply(Args... args) ++ { ++ return (args * ... * 1); ++ } ++ ++ template ++ bool all(Args... args) ++ { ++ return (args && ...); ++ } ++ ++ } ++ ++ namespace test_extended_static_assert ++ { ++ ++ static_assert (true); ++ ++ } ++ ++ namespace test_auto_brace_init_list ++ { ++ ++ auto foo = {5}; ++ auto bar {5}; ++ ++ static_assert(std::is_same, decltype(foo)>::value); ++ static_assert(std::is_same::value); ++ } ++ ++ namespace test_typename_in_template_template_parameter ++ { ++ ++ template typename X> struct D; ++ ++ } ++ ++ namespace test_fallthrough_nodiscard_maybe_unused_attributes ++ { ++ ++ int f1() ++ { ++ return 42; ++ } ++ ++ [[nodiscard]] int f2() ++ { ++ [[maybe_unused]] auto unused = f1(); ++ ++ switch (f1()) ++ { ++ case 17: ++ f1(); ++ [[fallthrough]]; ++ case 42: ++ f1(); ++ } ++ return f1(); ++ } ++ ++ } ++ ++ namespace test_extended_aggregate_initialization ++ { ++ ++ struct base1 ++ { ++ int b1, b2 = 42; ++ }; ++ ++ struct base2 ++ { ++ base2() { ++ b3 = 42; ++ } ++ int b3; ++ }; ++ ++ struct derived : base1, base2 ++ { ++ int d; ++ }; ++ ++ derived d1 {{1, 2}, {}, 4}; // full initialization ++ derived d2 {{}, {}, 4}; // value-initialized bases ++ ++ } ++ ++ namespace test_general_range_based_for_loop ++ { ++ ++ struct iter ++ { ++ int i; ++ ++ int& operator* () ++ { ++ return i; ++ } ++ ++ const int& operator* () const ++ { ++ return i; ++ } ++ ++ iter& operator++() ++ { ++ ++i; ++ return *this; ++ } ++ }; ++ ++ struct sentinel ++ { ++ int i; ++ }; ++ ++ bool operator== (const iter& i, const sentinel& s) ++ { ++ return i.i == s.i; ++ } ++ ++ bool operator!= (const iter& i, const sentinel& s) ++ { ++ return !(i == s); ++ } ++ ++ struct range ++ { ++ iter begin() const ++ { ++ return {0}; ++ } ++ ++ sentinel end() const ++ { ++ return {5}; ++ } ++ }; ++ ++ void f() ++ { ++ range r {}; ++ ++ for (auto i : r) ++ { ++ [[maybe_unused]] auto v = i; ++ } ++ } ++ ++ } ++ ++ namespace test_lambda_capture_asterisk_this_by_value ++ { ++ ++ struct t ++ { ++ int i; ++ int foo() ++ { ++ return [*this]() ++ { ++ return i; ++ }(); ++ } ++ }; ++ ++ } ++ ++ namespace test_enum_class_construction ++ { ++ ++ enum class byte : unsigned char ++ {}; ++ ++ byte foo {42}; ++ ++ } ++ ++ namespace test_constexpr_if ++ { ++ ++ template ++ int f () ++ { ++ if constexpr(cond) ++ { ++ return 13; ++ } ++ else ++ { ++ return 42; ++ } ++ } ++ ++ } ++ ++ namespace test_selection_statement_with_initializer ++ { ++ ++ int f() ++ { ++ return 13; ++ } ++ ++ int f2() ++ { ++ if (auto i = f(); i > 0) ++ { ++ return 3; ++ } ++ ++ switch (auto i = f(); i + 4) ++ { ++ case 17: ++ return 2; ++ ++ default: ++ return 1; ++ } ++ } ++ ++ } ++ ++ namespace test_template_argument_deduction_for_class_templates ++ { ++ ++ template ++ struct pair ++ { ++ pair (T1 p1, T2 p2) ++ : m1 {p1}, ++ m2 {p2} ++ {} ++ ++ T1 m1; ++ T2 m2; ++ }; ++ ++ void f() ++ { ++ [[maybe_unused]] auto p = pair{13, 42u}; ++ } ++ ++ } ++ ++ namespace test_non_type_auto_template_parameters ++ { ++ ++ template ++ struct B ++ {}; ++ ++ B<5> b1; ++ B<'a'> b2; ++ ++ } ++ ++ namespace test_structured_bindings ++ { ++ ++ int arr[2] = { 1, 2 }; ++ std::pair pr = { 1, 2 }; ++ ++ auto f1() -> int(&)[2] ++ { ++ return arr; ++ } ++ ++ auto f2() -> std::pair& ++ { ++ return pr; ++ } ++ ++ struct S ++ { ++ int x1 : 2; ++ volatile double y1; ++ }; ++ ++ S f3() ++ { ++ return {}; ++ } ++ ++ auto [ x1, y1 ] = f1(); ++ auto& [ xr1, yr1 ] = f1(); ++ auto [ x2, y2 ] = f2(); ++ auto& [ xr2, yr2 ] = f2(); ++ const auto [ x3, y3 ] = f3(); ++ ++ } ++ ++ namespace test_exception_spec_type_system ++ { ++ ++ struct Good {}; ++ struct Bad {}; ++ ++ void g1() noexcept; ++ void g2(); ++ ++ template ++ Bad ++ f(T*, T*); ++ ++ template ++ Good ++ f(T1*, T2*); ++ ++ static_assert (std::is_same_v); ++ ++ } ++ ++ namespace test_inline_variables ++ { ++ ++ template void f(T) ++ {} ++ ++ template inline T g(T) ++ { ++ return T{}; ++ } ++ ++ template<> inline void f<>(int) ++ {} ++ ++ template<> int g<>(int) ++ { ++ return 5; ++ } ++ ++ } ++ ++} // namespace cxx17 ++ ++#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L ++ ++]]) ++ ++ ++dnl Tests for new features in C++20 ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[ ++ ++#ifndef __cplusplus ++ ++#error "This is not a C++ compiler" ++ ++#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L ++ ++#error "This is not a C++20 compiler" ++ ++#else ++ ++#include ++ ++namespace cxx20 ++{ ++ ++// As C++20 supports feature test macros in the standard, there is no ++// immediate need to actually test for feature availability on the ++// Autoconf side. ++ ++} // namespace cxx20 ++ ++#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L ++ ++]]) ++ ++ ++dnl Tests for new features in C++23 ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_23], [[ ++ ++#ifndef __cplusplus ++ ++#error "This is not a C++ compiler" ++ ++#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L ++ ++#error "This is not a C++23 compiler" ++ ++#else ++ ++#include ++ ++namespace cxx23 ++{ ++ ++// As C++23 supports feature test macros in the standard, there is no ++// immediate need to actually test for feature availability on the ++// Autoconf side. ++ ++} // namespace cxx23 ++ ++#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L ++ ++]]) + +From e00b7f9250e0b7dae44e6b9191be0aa31d8cb668 Mon Sep 17 00:00:00 2001 +From: Enji Cooper +Date: Sat, 7 Dec 2024 18:18:02 -0800 +Subject: [PATCH 3/9] Stop shipping atf-*-api(3) manpages + +These manpages have been deprecated for at least a release. Remove them +and all of the logic associated with them. + +Signed-off-by: Enji Cooper +--- + Makefile.am | 8 -------- + configure.ac | 3 --- + 2 files changed, 11 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 913910c2..d202fd1d 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -114,12 +114,4 @@ clean-all: + + .PHONY: $(PHONY_TARGETS) + +-# TODO(jmmv): Remove after atf 0.22. +-install-data-hook: +- cd $(DESTDIR)$(man3dir) && \ +- for binding in c c++ sh; do \ +- rm -f "atf-$${binding}-api.3"; \ +- $(LN_S) "atf-$${binding}.3" "atf-$${binding}-api.3"; \ +- done +- + # vim: syntax=make:noexpandtab:shiftwidth=8:softtabstop=8 +diff --git a/configure.ac b/configure.ac +index 6d802144..a2d68cee 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -74,9 +74,6 @@ fi + + KYUA_DEVELOPER_MODE([C,C++]) + +-dnl TODO(jmmv): Remove once the atf-*-api.3 symlinks are removed. +-AC_PROG_LN_S +- + ATF_MODULE_APPLICATION + ATF_MODULE_DEFS + ATF_MODULE_ENV + +From aa0fe99ef3de0f31dbaefb5268015258478d0ba4 Mon Sep 17 00:00:00 2001 +From: Enji Cooper +Date: Sat, 7 Dec 2024 18:20:47 -0800 +Subject: [PATCH 4/9] Expose WCOREDUMP(..) in a deterministic manner + +WCOREDUMP is considered an extension to the POSIX spec on multiple +platforms, and thus is not automatically exposed on all platforms. Add the +relevant preprocessor defines to config.h via autoconf, then leverage them +in atf-c(3). + +This helps ensure that the platforms which support WCOREDUMP properly +expose the macro. + +Signed-off-by: Enji Cooper +--- + atf-c/detail/process.c | 2 ++ + configure.ac | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/atf-c/detail/process.c b/atf-c/detail/process.c +index 567d28ec..84bb4882 100644 +--- a/atf-c/detail/process.c ++++ b/atf-c/detail/process.c +@@ -23,6 +23,8 @@ + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + ++#include "config.h" ++ + #include "atf-c/detail/process.h" + + #include +diff --git a/configure.ac b/configure.ac +index a2d68cee..3a88354b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -58,6 +58,8 @@ AM_PROG_CC_C_O + dnl The C compiler check automatically aborts if the compiler does not work. + dnl Nothing to do here. + ++AC_USE_SYSTEM_EXTENSIONS ++ + AC_PROG_CXX + AC_LANG_COMPILER(C++) + AX_CXX_COMPILE_STDCXX(14, noext, mandatory) + +From deee8f2628847e3fff6fd2af04f163fadee4c61c Mon Sep 17 00:00:00 2001 +From: Enji Cooper +Date: Tue, 10 Dec 2024 14:26:58 -0800 +Subject: [PATCH 5/9] Add compiler feature detection for + `__attribute__((nonnull))` + +This feature is being detected so several functions can be appropriately +marked as taking non-NULL/-nullptr parameters, and the compiler and static +analyzers can (in turn) make intelligent decisions when optimizing and +analyzing code, respectively. + +Signed-off-by: Enji Cooper +--- + atf-c/defs.h.in | 1 + + m4/module-defs.m4 | 21 +++++++++++++++++++++ + 2 files changed, 22 insertions(+) + +diff --git a/atf-c/defs.h.in b/atf-c/defs.h.in +index 6059e7fd..5346e56a 100644 +--- a/atf-c/defs.h.in ++++ b/atf-c/defs.h.in +@@ -27,6 +27,7 @@ + #define ATF_C_DEFS_H + + #define ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(a, b) @ATTRIBUTE_FORMAT_PRINTF@ ++#define ATF_DEFS_ATTRIBUTE_NONNULL @ATTRIBUTE_NONNULL@ + #define ATF_DEFS_ATTRIBUTE_NORETURN @ATTRIBUTE_NORETURN@ + #define ATF_DEFS_ATTRIBUTE_UNUSED @ATTRIBUTE_UNUSED@ + +diff --git a/m4/module-defs.m4 b/m4/module-defs.m4 +index b1c9cc84..feb3df27 100644 +--- a/m4/module-defs.m4 ++++ b/m4/module-defs.m4 +@@ -54,6 +54,26 @@ test_printf(const char *format, ...) + AC_SUBST([ATTRIBUTE_FORMAT_PRINTF], [${value}]) + ]) + ++AC_DEFUN([ATF_ATTRIBUTE_NONNULL], [ ++ AC_CACHE_CHECK( ++ [whether __attribute__((nonnull)) is supported], ++ [kyua_cv_attribute_nonnull], [ ++ AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM([ ++void func(char *foo __attribute__((nonnull))); ++])], ++ [kyua_cv_attribute_nonnull=yes], ++ [kyua_cv_attribute_nonnull=no]) ++ ]) ++ if test x"${kyua_cv_attribute_nonnull}" = xyes; then ++ value="__attribute__((nonnull))" ++ else ++ value="" ++ fi ++ AC_SUBST([ATTRIBUTE_NONNULL], [${value}]) ++]) ++ ++ + AC_DEFUN([ATF_ATTRIBUTE_NORETURN], [ + dnl XXX This check is overly simple and should be fixed. For example, + dnl Sun's cc does support the noreturn attribute but CC (the C++ +@@ -103,6 +123,7 @@ function(int a __attribute__((__unused__))) + + AC_DEFUN([ATF_MODULE_DEFS], [ + ATF_ATTRIBUTE_FORMAT_PRINTF ++ ATF_ATTRIBUTE_NONNULL + ATF_ATTRIBUTE_NORETURN + ATF_ATTRIBUTE_UNUSED + ]) + +From 1ca4688b87e8bcb3bfc5c05ef61b385d59019383 Mon Sep 17 00:00:00 2001 +From: Enji Cooper +Date: Wed, 25 Dec 2024 11:31:12 -0800 +Subject: [PATCH 6/9] Restore AC_PROG_CPP + +This was accidentally deleted post-0.21 release. It's still needed by +tests and build infrastructure. + +Signed-off-by: Enji Cooper +--- + configure.ac | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/configure.ac b/configure.ac +index 3a88354b..e42ee5e1 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -62,6 +62,7 @@ AC_USE_SYSTEM_EXTENSIONS + + AC_PROG_CXX + AC_LANG_COMPILER(C++) ++AC_PROG_CPP + AX_CXX_COMPILE_STDCXX(14, noext, mandatory) + AC_CACHE_CHECK([whether the C++ compiler works], + [atf_cv_prog_cxx_works], + +From bff968f5a164a81819046c55881e6083a7607dcf Mon Sep 17 00:00:00 2001 +From: Enji Cooper +Date: Sat, 7 Dec 2024 18:12:02 -0800 +Subject: [PATCH 7/9] atf-c/detail/env.c: remove unnecessary complexity + +The libcalls used have been in the POSIX standard since 2008.1. Require +them to be present instead of conditionally hoping they're present. + +This fixes an issue where the autoconf code was messing up with a +combination of clang tools, which resulted in the autoconf code failing +to properly determine whether or not the functions were available. + +Signed-off-by: Enji Cooper +--- + atf-c/detail/env.c | 41 +++-------------------------------------- + configure.ac | 1 - + m4/module-env.m4 | 28 ---------------------------- + 3 files changed, 3 insertions(+), 67 deletions(-) + delete mode 100644 m4/module-env.m4 + +diff --git a/atf-c/detail/env.c b/atf-c/detail/env.c +index 8ee3d697..36de217c 100644 +--- a/atf-c/detail/env.c ++++ b/atf-c/detail/env.c +@@ -25,10 +25,6 @@ + + #include "atf-c/detail/env.h" + +-#if defined(HAVE_CONFIG_H) +-#include "config.h" +-#endif +- + #include + #include + +@@ -65,25 +61,11 @@ atf_env_set(const char *name, const char *val) + { + atf_error_t err; + +-#if defined(HAVE_SETENV) + if (setenv(name, val, 1) == -1) +- err = atf_libc_error(errno, "Cannot set environment variable " +- "'%s' to '%s'", name, val); ++ err = atf_libc_error(errno, ++ "Cannot set environment variable '%s' to '%s'", name, val); + else + err = atf_no_error(); +-#elif defined(HAVE_PUTENV) +- char *buf; +- +- err = atf_text_format(&buf, "%s=%s", name, val); +- if (!atf_is_error(err)) { +- if (putenv(buf) == -1) +- err = atf_libc_error(errno, "Cannot set environment variable " +- "'%s' to '%s'", name, val); +- free(buf); +- } +-#else +-# error "Don't know how to set an environment variable." +-#endif + + return err; + } +@@ -91,24 +73,7 @@ atf_env_set(const char *name, const char *val) + atf_error_t + atf_env_unset(const char *name) + { +- atf_error_t err; + +-#if defined(HAVE_UNSETENV) + unsetenv(name); +- err = atf_no_error(); +-#elif defined(HAVE_PUTENV) +- char *buf; +- +- err = atf_text_format(&buf, "%s=", name); +- if (!atf_is_error(err)) { +- if (putenv(buf) == -1) +- err = atf_libc_error(errno, "Cannot unset environment variable" +- " '%s'", name); +- free(buf); +- } +-#else +-# error "Don't know how to unset an environment variable." +-#endif +- +- return err; ++ return (atf_no_error()); + } +diff --git a/configure.ac b/configure.ac +index e42ee5e1..00ee124c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -79,7 +79,6 @@ KYUA_DEVELOPER_MODE([C,C++]) + + ATF_MODULE_APPLICATION + ATF_MODULE_DEFS +-ATF_MODULE_ENV + ATF_MODULE_FS + + ATF_RUNTIME_TOOL([ATF_BUILD_CC], +diff --git a/m4/module-env.m4 b/m4/module-env.m4 +deleted file mode 100644 +index 963aab38..00000000 +--- a/m4/module-env.m4 ++++ /dev/null +@@ -1,28 +0,0 @@ +-dnl Copyright (c) 2007 The NetBSD Foundation, Inc. +-dnl All rights reserved. +-dnl +-dnl Redistribution and use in source and binary forms, with or without +-dnl modification, are permitted provided that the following conditions +-dnl are met: +-dnl 1. Redistributions of source code must retain the above copyright +-dnl notice, this list of conditions and the following disclaimer. +-dnl 2. Redistributions in binary form must reproduce the above copyright +-dnl notice, this list of conditions and the following disclaimer in the +-dnl documentation and/or other materials provided with the distribution. +-dnl +-dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND +-dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +-dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +-dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY +-dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +-dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +-dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +-dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +-dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +-dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +-dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- +-AC_DEFUN([ATF_MODULE_ENV], [ +- AC_CHECK_FUNCS([putenv setenv unsetenv]) +-]) + +From 402b9362d01448074c4d2d91a8c770e591577167 Mon Sep 17 00:00:00 2001 +From: Enji Cooper +Date: Wed, 25 Dec 2024 17:19:28 -0800 +Subject: [PATCH 8/9] Remove ATF_BUILD_CXX require.progs check + +This particular check unfortunately doesn't work when ATF_BUILD_CXX +contains multiple CXXFLAGS, or contains a path with spaces in it. Remove +this check to unbreak the dependent tests +post-793d4640031dc06ce8a239ffa9ab61322104c4ca. + +Signed-off-by: Enji Cooper +--- + atf-c++/detail/test_helpers.hpp | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/atf-c++/detail/test_helpers.hpp b/atf-c++/detail/test_helpers.hpp +index c1171801..1c4c316f 100644 +--- a/atf-c++/detail/test_helpers.hpp ++++ b/atf-c++/detail/test_helpers.hpp +@@ -45,8 +45,6 @@ + { \ + set_md_var("descr", "Tests that the " hdrname " file can be " \ + "included on its own, without any prerequisites"); \ +- const std::string cxx = atf::env::get("ATF_BUILD_CXX", ATF_BUILD_CXX); \ +- set_md_var("require.progs", cxx); \ + } \ + ATF_TEST_CASE_BODY(name) \ + { \ +@@ -58,8 +56,6 @@ + ATF_TEST_CASE_HEAD(name) \ + { \ + set_md_var("descr", descr); \ +- const std::string cxx = atf::env::get("ATF_BUILD_CXX", ATF_BUILD_CXX); \ +- set_md_var("require.progs", cxx); \ + } \ + ATF_TEST_CASE_BODY(name) \ + { \ + +From f054eebc616577d973fa6f3b4ec440bb29671c20 Mon Sep 17 00:00:00 2001 +From: Enji Cooper +Date: Wed, 25 Dec 2024 20:17:15 -0800 +Subject: [PATCH 9/9] Remove redundant C++ toolchain check + +The C++ toolchain is sanity checked when C++14 conformance is checked; +there's no reason why we need to check whether or not the C++ toolchain +works again. + +Signed-off-by: Enji Cooper +--- + configure.ac | 10 ---------- + 1 file changed, 10 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 00ee124c..e36f9817 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -64,16 +64,6 @@ AC_PROG_CXX + AC_LANG_COMPILER(C++) + AC_PROG_CPP + AX_CXX_COMPILE_STDCXX(14, noext, mandatory) +-AC_CACHE_CHECK([whether the C++ compiler works], +- [atf_cv_prog_cxx_works], +- [AC_LANG_PUSH([C++]) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], +- [atf_cv_prog_cxx_works=yes], +- [atf_cv_prog_cxx_works=no]) +- AC_LANG_POP]) +-if test "${atf_cv_prog_cxx_works}" = no; then +- AC_MSG_ERROR([C++ compiler cannot create executables]) +-fi + + KYUA_DEVELOPER_MODE([C,C++]) +