From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 37F1B385DC09 for ; Mon, 4 Sep 2023 16:29:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 37F1B385DC09 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693844970; 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=jv+29KtvtrS3JH3irVYHgM4DJAIY1IZ0J/WYW+MtNz4=; b=Az1zetaNMi9of/X8QfnKUuE33byiEK0uHTUgVLRTrY7E1r11xxrvZ8awKzCIO9oVIRnPkg zXGUkd0Bcr/TPpVWv+VtB5h7w+l9DAb6bx/yNEui6w6rg+yW/GgAerWJVpDnXyeTTYrtD8 sz6T+TaD/PCix1x5JpPmaK632SIg70k= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-106-YfzaxGshMSy8L4BQBApkzA-1; Mon, 04 Sep 2023 12:29:28 -0400 X-MC-Unique: YfzaxGshMSy8L4BQBApkzA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8CD79800C78; Mon, 4 Sep 2023 16:29:27 +0000 (UTC) Received: from localhost (unknown [10.42.28.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 320F31121318; Mon, 4 Sep 2023 16:29:27 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Enable std::auto_ptr tests for C++11 and later Date: Mon, 4 Sep 2023 17:29:23 +0100 Message-ID: <20230904162926.515943-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Tested x86_64-linux. Pushed to trunk. -- >8 -- There is no reason to only test std::auto_ptr with -std=c++03, we just need to handle the deprecated warnings for C++11 and later. libstdc++-v3/ChangeLog: * testsuite/20_util/auto_ptr/1.cc: Remove dg-options -std=c++03 and add dg-warning for deprecation warnings. * testsuite/20_util/auto_ptr/2.cc: Likewise. * testsuite/20_util/auto_ptr/3.cc: Likewise. * testsuite/20_util/auto_ptr/3946.cc: Likewise. * testsuite/20_util/auto_ptr/4.cc: Likewise. * testsuite/20_util/auto_ptr/5.cc: Likewise. * testsuite/20_util/auto_ptr/6.cc: Likewise. * testsuite/20_util/auto_ptr/7.cc: Likewise. * testsuite/20_util/auto_ptr/assign_neg.cc: Likewise. * testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc: Likewise. --- libstdc++-v3/testsuite/20_util/auto_ptr/1.cc | 10 +++++----- libstdc++-v3/testsuite/20_util/auto_ptr/2.cc | 5 +++-- libstdc++-v3/testsuite/20_util/auto_ptr/3.cc | 5 +++-- libstdc++-v3/testsuite/20_util/auto_ptr/3946.cc | 5 +++-- libstdc++-v3/testsuite/20_util/auto_ptr/4.cc | 5 +++-- libstdc++-v3/testsuite/20_util/auto_ptr/5.cc | 5 +++-- libstdc++-v3/testsuite/20_util/auto_ptr/6.cc | 5 +++-- libstdc++-v3/testsuite/20_util/auto_ptr/7.cc | 5 +++-- libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc | 6 +++--- .../auto_ptr/requirements/explicit_instantiation/1.cc | 6 +++--- .../2_general_utilities/shared_ptr/assign/auto_ptr.cc | 3 ++- .../shared_ptr/assign/auto_ptr_neg.cc | 3 ++- .../shared_ptr/assign/auto_ptr_rvalue_neg.cc | 3 ++- .../2_general_utilities/shared_ptr/cons/43820_neg.cc | 3 ++- .../2_general_utilities/shared_ptr/cons/auto_ptr.cc | 3 ++- .../shared_ptr/cons/auto_ptr_neg.cc | 3 ++- 16 files changed, 44 insertions(+), 31 deletions(-) diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/1.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/1.cc index b498711da76..64c0cf97e2f 100644 --- a/libstdc++-v3/testsuite/20_util/auto_ptr/1.cc +++ b/libstdc++-v3/testsuite/20_util/auto_ptr/1.cc @@ -15,9 +15,9 @@ // with this library; see the file COPYING3. If not see // . -// 20.4.5 Template class auto_ptr [lib.auto.ptr] +// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr] -// { dg-options "-std=c++98" } +// { dg-add-options using-deprecated } #include #include @@ -63,21 +63,21 @@ test01() { reset_count_struct __attribute__((unused)) reset; - std::auto_ptr A_default; + std::auto_ptr A_default; // { dg-warning "deprecated" "" { target c++11 } } VERIFY( A_default.get() == 0 ); VERIFY( A::ctor_count == 0 ); VERIFY( A::dtor_count == 0 ); VERIFY( B::ctor_count == 0 ); VERIFY( B::dtor_count == 0 ); - std::auto_ptr A_from_A(new A); + std::auto_ptr A_from_A(new A); // { dg-warning "deprecated" "" { target c++11 } } VERIFY( A_from_A.get() != 0 ); VERIFY( A::ctor_count == 1 ); VERIFY( A::dtor_count == 0 ); VERIFY( B::ctor_count == 0 ); VERIFY( B::dtor_count == 0 ); - std::auto_ptr A_from_B(new B); + std::auto_ptr A_from_B(new B); // { dg-warning "deprecated" "" { target c++11 } } VERIFY( A_from_B.get() != 0 ); VERIFY( A::ctor_count == 2 ); VERIFY( A::dtor_count == 0 ); diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/2.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/2.cc index 0d5aabe61a4..9cbab139068 100644 --- a/libstdc++-v3/testsuite/20_util/auto_ptr/2.cc +++ b/libstdc++-v3/testsuite/20_util/auto_ptr/2.cc @@ -15,9 +15,10 @@ // with this library; see the file COPYING3. If not see // . -// 20.4.5 Template class auto_ptr [lib.auto.ptr] +// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr] -// { dg-options "-std=c++98" } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } #include #include diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/3.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/3.cc index afac4013b59..ce020406cb8 100644 --- a/libstdc++-v3/testsuite/20_util/auto_ptr/3.cc +++ b/libstdc++-v3/testsuite/20_util/auto_ptr/3.cc @@ -15,9 +15,10 @@ // with this library; see the file COPYING3. If not see // . -// 20.4.5 Template class auto_ptr [lib.auto.ptr] +// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr] -// { dg-options "-std=c++98" } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } #include #include diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/3946.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/3946.cc index d6d755ac911..42ccf99c181 100644 --- a/libstdc++-v3/testsuite/20_util/auto_ptr/3946.cc +++ b/libstdc++-v3/testsuite/20_util/auto_ptr/3946.cc @@ -15,9 +15,10 @@ // with this library; see the file COPYING3. If not see // . -// 20.4.5 Template class auto_ptr [lib.auto.ptr] +// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr] -// { dg-options "-std=c++98" } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } #include #include diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/4.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/4.cc index fb896e11f02..7cf59965d7a 100644 --- a/libstdc++-v3/testsuite/20_util/auto_ptr/4.cc +++ b/libstdc++-v3/testsuite/20_util/auto_ptr/4.cc @@ -15,9 +15,10 @@ // with this library; see the file COPYING3. If not see // . -// 20.4.5 Template class auto_ptr [lib.auto.ptr] +// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr] -// { dg-options "-std=c++98" } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } #include #include diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/5.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/5.cc index 8a766e6ec23..1e60f13a20d 100644 --- a/libstdc++-v3/testsuite/20_util/auto_ptr/5.cc +++ b/libstdc++-v3/testsuite/20_util/auto_ptr/5.cc @@ -15,9 +15,10 @@ // with this library; see the file COPYING3. If not see // . -// 20.4.5 Template class auto_ptr [lib.auto.ptr] +// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr] -// { dg-options "-std=c++98" } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } #include #include diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/6.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/6.cc index cd1f0547f5b..d888301c766 100644 --- a/libstdc++-v3/testsuite/20_util/auto_ptr/6.cc +++ b/libstdc++-v3/testsuite/20_util/auto_ptr/6.cc @@ -15,9 +15,10 @@ // with this library; see the file COPYING3. If not see // . -// 20.4.5 Template class auto_ptr [lib.auto.ptr] +// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr] -// { dg-options "-std=c++98" } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } #include #include diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/7.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/7.cc index 86338c7e259..fd3f78a46cd 100644 --- a/libstdc++-v3/testsuite/20_util/auto_ptr/7.cc +++ b/libstdc++-v3/testsuite/20_util/auto_ptr/7.cc @@ -15,9 +15,10 @@ // with this library; see the file COPYING3. If not see // . -// 20.4.5 Template class auto_ptr [lib.auto.ptr] +// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr] -// { dg-options "-std=c++98" } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } #include #include diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc index 5ff2ddb9113..fa890fa4fcd 100644 --- a/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc +++ b/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc @@ -1,4 +1,6 @@ // { dg-do compile } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } // Copyright (C) 2002-2023 Free Software Foundation, Inc. // @@ -17,9 +19,7 @@ // with this library; see the file COPYING3. If not see // . -// 20.4.5 Template class auto_ptr negative tests [lib.auto.ptr] - -// { dg-options "-std=c++98" } +// C++03 20.4.5 Template class auto_ptr negative tests [lib.auto.ptr] #include #include diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc index be7fb482250..b26b784fd4f 100644 --- a/libstdc++-v3/testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc +++ b/libstdc++-v3/testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc @@ -1,4 +1,6 @@ // { dg-do compile } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } // Copyright (C) 2007-2023 Free Software Foundation, Inc. // @@ -18,9 +20,7 @@ // . -// This file tests explicit instantiation of library containers. - -// { dg-options "-std=c++98" } +// This file tests explicit instantiation of library templates. #include diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc index c3ac4af7b7f..ad39e18eeee 100644 --- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc @@ -17,7 +17,8 @@ // TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] -// { dg-options "-std=c++98" } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } #include #include diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc index 56cc149fd68..2f8697a3fa2 100644 --- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc @@ -19,7 +19,8 @@ // TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] -// { dg-options "-std=c++98" } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } #include #include diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc index b77208a620e..2efc9dee823 100644 --- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc @@ -19,7 +19,8 @@ // TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] -// { dg-options "-std=c++98" } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } #include #include diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc index f6ba60aa824..3229a52c636 100644 --- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc @@ -17,7 +17,8 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-std=c++98 -fno-show-column" } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } // 2.2.3 Class template shared_ptr [tr.util.smartptr.shared] diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc index 371b2a8c96e..d885597798a 100644 --- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc @@ -15,7 +15,8 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-std=c++98" } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } // TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc index 88c896cc17f..8b2fff2e387 100644 --- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc @@ -17,7 +17,8 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-std=c++98" } +// { dg-add-options using-deprecated } +// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 } // TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] -- 2.41.0