From nobody Thu Jan 29 15:39:49 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f23H93tKjz6QrSL for ; Thu, 29 Jan 2026 15:39:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f23H91SQMz3xRH for ; Thu, 29 Jan 2026 15:39:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769701189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MvC5C/gE0ORULUslb5zJogMVGJ2WPkAak6/USt5NRME=; b=L3k496ct9ozAjgmg+WBGsqdziTVMOOIWZGUnqZ6NkbdK1nQK97Sis58T0+wWUBMnnAN2OV Nyu/kWsv7iXkl9sH2lSOHKxxBaQEL1b+RvmnbKV6peKR2z4qGDzWUF+HMtkBozApyehlk8 PeXl5oaPkN2jkSs7LESk6y4xgYX9KLfAOygqW2R6f5F9mA6qDgL7qXNjWjp7hgHmk8Klf8 jlRpEtreSkn4ui5IP89xIwORTDye23CT5hD4lDdbUqq5nSIL3DROt8wqsb4SePzID+DkEV 7ibkoEXZ17P2Oty9jt0FehrNhIrPENGGxW01aZPZHrx84kJvc+rzvCHcm6OS1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769701189; a=rsa-sha256; cv=none; b=VIa4N9l3A6GBmtuIxVL/BJJm+LoASmjxhsHYlX2hRli4FGF+3PcZY68nnmUyYAcu5D3uz+ TozuKQtEYd3bVpIRMUWpYUoPaO/Bk228EnM1NnV7hKSf6yrlADBOl/NtRaPRLQqYHHzunH hf88siRxh6wACY9EdgmThPvhp5R51IOr9x1odb4Zy8Y2hYKV2s5uclSmRwCh6tQEDHUcbm s1+8iTH7v4PxawCii+k33h1nSusb/VLhG+JT5dwin6lpA2zqcNp3NPrfxhIeih1yMa2eGz EKxive1Lq52q91DQMf7mHwbN19kjdmPtQL971I/noG2uLMsKQYkZq1C/dR0AxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769701189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MvC5C/gE0ORULUslb5zJogMVGJ2WPkAak6/USt5NRME=; b=pOiiDWTpY9jWxEtrqvGqx7CgiFXgMsXkn49sYl9mAPfDYZICQ658voXaz8aWMrvMYlVT1e c+LW+SWYJZWpb2pIj8ss+jSeLPzdQFvg9VC1RpdFXRhb7DxE9nbH2u4JzXiuh94tkWaHtV ySNiQtzAXNDkV7Ivm6IcThimUjsMghqZTm91ya2hZid/y7qv26BrRJmfMtLLZXWeR3SGMW C5IrR6hZPGxcuH7HW7e/FyK7/8/h9XgOGcaK5i0zWWa1dhFfpo5PMgtx6NEArJA+sp3T9N sY0uhbckqzaZBH/r4uqK3IwzVsXYMfLE7aeE7vC3aH30OcVsiDQ0VJZmLPV+Ng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f23H90jStzkvv for ; Thu, 29 Jan 2026 15:39:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39832 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Jan 2026 15:39:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f4973f97daab - stable/14 - atf: Switch from std::auto_ptr<> to std::unique_ptr<> List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f4973f97daab7222eedfb0a5f1d30e5d122d3d1d Auto-Submitted: auto-generated Date: Thu, 29 Jan 2026 15:39:49 +0000 Message-Id: <697b7f45.39832.38fb900e@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f4973f97daab7222eedfb0a5f1d30e5d122d3d1d commit f4973f97daab7222eedfb0a5f1d30e5d122d3d1d Author: John Baldwin AuthorDate: 2025-04-16 14:10:35 +0000 Commit: John Baldwin CommitDate: 2026-01-29 15:15:39 +0000 atf: Switch from std::auto_ptr<> to std::unique_ptr<> This mirrors upstream commit f053ab687f6e27aa264f599ecbfc5ef27ad4e2d3. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D49789 (cherry picked from commit 5e6befdaca5194a8fb91b48d5f678942f22fa8f1) --- contrib/atf/atf-c++/check.cpp | 4 ++-- contrib/atf/atf-c++/check.hpp | 4 ++-- contrib/atf/atf-c++/check_test.cpp | 22 +++++++++++----------- contrib/atf/atf-c++/detail/process_test.cpp | 8 ++++---- contrib/atf/atf-sh/atf-check.cpp | 8 ++++---- lib/atf/Makefile.inc | 3 --- lib/atf/libatf-c++/Makefile | 3 --- libexec/atf/atf-check/Makefile | 4 ---- libexec/atf/atf-sh/Makefile | 3 --- share/mk/atf.test.mk | 2 -- 10 files changed, 23 insertions(+), 38 deletions(-) diff --git a/contrib/atf/atf-c++/check.cpp b/contrib/atf/atf-c++/check.cpp index e4d7db4d49a6..5d8580023a15 100644 --- a/contrib/atf/atf-c++/check.cpp +++ b/contrib/atf/atf-c++/check.cpp @@ -141,7 +141,7 @@ impl::build_cxx_o(const std::string& sfile, const std::string& ofile, return success; } -std::auto_ptr< impl::check_result > +std::unique_ptr< impl::check_result > impl::exec(const atf::process::argv_array& argva) { atf_check_result_t result; @@ -150,5 +150,5 @@ impl::exec(const atf::process::argv_array& argva) if (atf_is_error(err)) throw_atf_error(err); - return std::auto_ptr< impl::check_result >(new impl::check_result(&result)); + return std::unique_ptr< impl::check_result >(new impl::check_result(&result)); } diff --git a/contrib/atf/atf-c++/check.hpp b/contrib/atf/atf-c++/check.hpp index 0144dedb2841..4d7f079d1ac1 100644 --- a/contrib/atf/atf-c++/check.hpp +++ b/contrib/atf/atf-c++/check.hpp @@ -71,7 +71,7 @@ class check_result { check_result(const atf_check_result_t* result); friend check_result test_constructor(const char* const*); - friend std::auto_ptr< check_result > exec(const atf::process::argv_array&); + friend std::unique_ptr< check_result > exec(const atf::process::argv_array&); public: //! @@ -120,7 +120,7 @@ bool build_cpp(const std::string&, const std::string&, const atf::process::argv_array&); bool build_cxx_o(const std::string&, const std::string&, const atf::process::argv_array&); -std::auto_ptr< check_result > exec(const atf::process::argv_array&); +std::unique_ptr< check_result > exec(const atf::process::argv_array&); // Useful for testing only. check_result test_constructor(void); diff --git a/contrib/atf/atf-c++/check_test.cpp b/contrib/atf/atf-c++/check_test.cpp index 7baf3fa19692..ecb5a9380e8f 100644 --- a/contrib/atf/atf-c++/check_test.cpp +++ b/contrib/atf/atf-c++/check_test.cpp @@ -52,7 +52,7 @@ extern "C" { // ------------------------------------------------------------------------ static -std::auto_ptr< atf::check::check_result > +std::unique_ptr< atf::check::check_result > do_exec(const atf::tests::tc* tc, const char* helper_name) { std::vector< std::string > argv; @@ -65,7 +65,7 @@ do_exec(const atf::tests::tc* tc, const char* helper_name) } static -std::auto_ptr< atf::check::check_result > +std::unique_ptr< atf::check::check_result > do_exec(const atf::tests::tc* tc, const char* helper_name, const char *carg2) { std::vector< std::string > argv; @@ -248,11 +248,11 @@ ATF_TEST_CASE_HEAD(exec_cleanup) } ATF_TEST_CASE_BODY(exec_cleanup) { - std::auto_ptr< atf::fs::path > out; - std::auto_ptr< atf::fs::path > err; + std::unique_ptr< atf::fs::path > out; + std::unique_ptr< atf::fs::path > err; { - std::auto_ptr< atf::check::check_result > r = + std::unique_ptr< atf::check::check_result > r = do_exec(this, "exit-success"); out.reset(new atf::fs::path(r->stdout_path())); err.reset(new atf::fs::path(r->stderr_path())); @@ -272,7 +272,7 @@ ATF_TEST_CASE_HEAD(exec_exitstatus) ATF_TEST_CASE_BODY(exec_exitstatus) { { - std::auto_ptr< atf::check::check_result > r = + std::unique_ptr< atf::check::check_result > r = do_exec(this, "exit-success"); ATF_REQUIRE(r->exited()); ATF_REQUIRE(!r->signaled()); @@ -280,7 +280,7 @@ ATF_TEST_CASE_BODY(exec_exitstatus) } { - std::auto_ptr< atf::check::check_result > r = + std::unique_ptr< atf::check::check_result > r = do_exec(this, "exit-failure"); ATF_REQUIRE(r->exited()); ATF_REQUIRE(!r->signaled()); @@ -288,7 +288,7 @@ ATF_TEST_CASE_BODY(exec_exitstatus) } { - std::auto_ptr< atf::check::check_result > r = + std::unique_ptr< atf::check::check_result > r = do_exec(this, "exit-signal"); ATF_REQUIRE(!r->exited()); ATF_REQUIRE(r->signaled()); @@ -321,12 +321,12 @@ ATF_TEST_CASE_HEAD(exec_stdout_stderr) } ATF_TEST_CASE_BODY(exec_stdout_stderr) { - std::auto_ptr< atf::check::check_result > r1 = + std::unique_ptr< atf::check::check_result > r1 = do_exec(this, "stdout-stderr", "result1"); ATF_REQUIRE(r1->exited()); ATF_REQUIRE_EQ(r1->exitcode(), EXIT_SUCCESS); - std::auto_ptr< atf::check::check_result > r2 = + std::unique_ptr< atf::check::check_result > r2 = do_exec(this, "stdout-stderr", "result2"); ATF_REQUIRE(r2->exited()); ATF_REQUIRE_EQ(r2->exitcode(), EXIT_SUCCESS); @@ -372,7 +372,7 @@ ATF_TEST_CASE_BODY(exec_unknown) argv.push_back("/foo/bar/non-existent"); atf::process::argv_array argva(argv); - std::auto_ptr< atf::check::check_result > r = atf::check::exec(argva); + std::unique_ptr< atf::check::check_result > r = atf::check::exec(argva); ATF_REQUIRE(r->exited()); ATF_REQUIRE_EQ(r->exitcode(), 127); } diff --git a/contrib/atf/atf-c++/detail/process_test.cpp b/contrib/atf/atf-c++/detail/process_test.cpp index 0686d2a1911c..97f9a08e2504 100644 --- a/contrib/atf/atf-c++/detail/process_test.cpp +++ b/contrib/atf/atf-c++/detail/process_test.cpp @@ -196,8 +196,8 @@ ATF_TEST_CASE_BODY(argv_array_assign) const char* const carray1[] = { "arg1", NULL }; const char* const carray2[] = { "arg1", "arg2", NULL }; - std::auto_ptr< argv_array > argv1(new argv_array(carray1)); - std::auto_ptr< argv_array > argv2(new argv_array(carray2)); + std::unique_ptr< argv_array > argv1(new argv_array(carray1)); + std::unique_ptr< argv_array > argv2(new argv_array(carray2)); *argv2 = *argv1; ATF_REQUIRE_EQ(argv2->size(), argv1->size()); @@ -226,8 +226,8 @@ ATF_TEST_CASE_BODY(argv_array_copy) const char* const carray[] = { "arg0", NULL }; - std::auto_ptr< argv_array > argv1(new argv_array(carray)); - std::auto_ptr< argv_array > argv2(new argv_array(*argv1)); + std::unique_ptr< argv_array > argv1(new argv_array(carray)); + std::unique_ptr< argv_array > argv2(new argv_array(*argv1)); ATF_REQUIRE_EQ(argv2->size(), argv1->size()); ATF_REQUIRE(std::strcmp((*argv2)[0], (*argv1)[0]) == 0); diff --git a/contrib/atf/atf-sh/atf-check.cpp b/contrib/atf/atf-sh/atf-check.cpp index 4cb1e33a005a..911e004432f3 100644 --- a/contrib/atf/atf-sh/atf-check.cpp +++ b/contrib/atf/atf-sh/atf-check.cpp @@ -108,7 +108,7 @@ struct output_check { }; class temp_file : public std::ostream { - std::auto_ptr< atf::fs::path > m_path; + std::unique_ptr< atf::fs::path > m_path; int m_fd; public: @@ -414,7 +414,7 @@ flatten_argv(char* const* argv) } static -std::auto_ptr< atf::check::check_result > +std::unique_ptr< atf::check::check_result > execute(const char* const* argv) { // TODO: This should go to stderr... but fixing it now may be hard as test @@ -430,7 +430,7 @@ execute(const char* const* argv) } static -std::auto_ptr< atf::check::check_result > +std::unique_ptr< atf::check::check_result > execute_with_shell(char* const* argv) { const std::string cmd = flatten_argv(argv); @@ -916,7 +916,7 @@ atf_check::main(void) m_stderr_checks.push_back(output_check(oc_empty, false, "")); do { - std::auto_ptr< atf::check::check_result > r = + std::unique_ptr< atf::check::check_result > r = m_xflag ? execute_with_shell(m_argv) : execute(m_argv); if ((run_status_checks(m_status_checks, *r) == false) || diff --git a/lib/atf/Makefile.inc b/lib/atf/Makefile.inc index c776c2f8f84e..f8f329842eb4 100644 --- a/lib/atf/Makefile.inc +++ b/lib/atf/Makefile.inc @@ -27,6 +27,3 @@ CFLAGS+= -DHAVE_CONFIG_H WARNS?= 3 - -# Permit use of auto_ptr for compilers defaulting to C++17 or later -CXXSTD= c++11 diff --git a/lib/atf/libatf-c++/Makefile b/lib/atf/libatf-c++/Makefile index 221a16657c2a..985a79b7dc03 100644 --- a/lib/atf/libatf-c++/Makefile +++ b/lib/atf/libatf-c++/Makefile @@ -48,9 +48,6 @@ CFLAGS+= -I. CFLAGS+= -DHAVE_CONFIG_H -# Silence warnings about usage of deprecated std::auto_ptr -CXXWARNFLAGS+= -Wno-deprecated-declarations - SRCS= application.cpp \ build.cpp \ check.cpp \ diff --git a/libexec/atf/atf-check/Makefile b/libexec/atf/atf-check/Makefile index e1ccdce95ec8..87d7a7cfdada 100644 --- a/libexec/atf/atf-check/Makefile +++ b/libexec/atf/atf-check/Makefile @@ -38,10 +38,6 @@ MAN= atf-check.1 CFLAGS+= -I${ATF} CFLAGS+= -DATF_SHELL='"/bin/sh"' -# Silence warnings about usage of deprecated std::auto_ptr -CXXWARNFLAGS+= -Wno-deprecated-declarations -CXXSTD= c++11 - LIBADD= atf_cxx HAS_TESTS= diff --git a/libexec/atf/atf-sh/Makefile b/libexec/atf/atf-sh/Makefile index 7253fc2d2b12..2e821684d8a8 100644 --- a/libexec/atf/atf-sh/Makefile +++ b/libexec/atf/atf-sh/Makefile @@ -66,9 +66,6 @@ CFLAGS+= -DATF_PKGDATADIR='"${SHAREDIR}/atf"' CFLAGS+= -DATF_SHELL='"/bin/sh"' CFLAGS+= -I${ATF} -# Silence warnings about usage of deprecated std::auto_ptr -CXXWARNFLAGS+= -Wno-deprecated-declarations - LIBADD= atf_cxx FILESGROUPS= SUBR diff --git a/share/mk/atf.test.mk b/share/mk/atf.test.mk index 4b8ac8dedc27..345ed11c5048 100644 --- a/share/mk/atf.test.mk +++ b/share/mk/atf.test.mk @@ -55,8 +55,6 @@ LDADD.${_T}+= ${LIBATF_CXX} ${LIBATF_C} .endif TEST_INTERFACE.${_T}= atf .endfor -# Silence warnings about usage of deprecated std::auto_ptr -CXXWARNFLAGS+= -Wno-deprecated-declarations .endif .if !empty(ATF_TESTS_SH)