From patchwork Wed Jun 25 23:06:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 364203 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3C66814009E for ; Thu, 26 Jun 2014 09:06:24 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=default; b=mF4GUs+QwRLNKBB/CG5wuvsb5+9KHd H0bZa7RwqguLzOP4PiPsfV2RUblbk8OTbUcZ8loUrwKqw2U5FJW2u3WqTgfNoCMm 6/iw3o9q1VQ1t7eLbFUBoEO2o0b2/TDn2ImkI4dCzBnFX1dZPbSTUwFTmN0CysNP J4Z/mP7a0ZO6M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=YyyxVUAKmrCXE8pRjwq/npq/Lbs=; b=xsTu Mx8tyrfwZIMnpR5zGTd8B2Mem/8xnqV3wVrgP3AbAO5ndpOy2nHzwc+/lTjgTX9H dU0xSJGhZE7tOlUaD3l7nKeOU0eB54nTLzkjzsKM0LPPVx5nibpp2vRrbx6cWR2K 0HjaxEGZbV3jGP5UayjLlX4Bshyd+EICKS+zlNc= Received: (qmail 22991 invoked by alias); 25 Jun 2014 23:06:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 22969 invoked by uid 89); 25 Jun 2014 23:06:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 25 Jun 2014 23:06:05 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5PN647D002040 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Jun 2014 19:06:04 -0400 Received: from localhost (vpn1-6-161.ams2.redhat.com [10.36.6.161]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5PN63Bv023206; Wed, 25 Jun 2014 19:06:03 -0400 Date: Thu, 26 Jun 2014 00:06:02 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [patch] Simplify allocator use Message-ID: <20140625230602.GF2711@redhat.com> References: <20140625205624.GD2711@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140625205624.GD2711@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) This simplifies some of the test changes in my last patch, I was misusing the CustomPointerAlloc due to confusion with some uncommitted changes. Tested x86_64-linux, committed to trunk. commit d1a05535e99bfecb427829d3e03ef82e0977e60c Author: Jonathan Wakely Date: Wed Jun 25 23:39:20 2014 +0100 * testsuite/20_util/shared_ptr/creation/alloc.cc: Fix use of test allocator. * testsuite/20_util/shared_ptr/creation/no_rtti.cc: Likewise. * testsuite/30_threads/promise/cons/alloc.cc: Likewise. diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/creation/alloc.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/creation/alloc.cc index 402c612..0628807 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/creation/alloc.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/creation/alloc.cc @@ -101,16 +101,10 @@ test02() == tracker_allocator_counter::get_deallocation_count() ); } -template - struct Pointer : __gnu_test::PointerBase, T> - { - using __gnu_test::PointerBase, T>::PointerBase; - }; - void test03() { - __gnu_test::CustomPointerAlloc> alloc; + __gnu_test::CustomPointerAlloc alloc; auto p = std::allocate_shared(alloc, 1); VERIFY( *p == 1 ); } diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/creation/no_rtti.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/creation/no_rtti.cc index 127bafb..d1fab6c 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/creation/no_rtti.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/creation/no_rtti.cc @@ -29,13 +29,7 @@ struct X { }; // test allocate_shared with no RTTI -template - struct Pointer : __gnu_test::PointerBase, T> - { - using __gnu_test::PointerBase, T>::PointerBase; - }; - -__gnu_test::CustomPointerAlloc> alloc; +__gnu_test::CustomPointerAlloc alloc; auto p = std::allocate_shared(alloc); diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc index c45e646..ea9bb1a 100644 --- a/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc +++ b/libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc @@ -38,16 +38,9 @@ void test01() VERIFY( p1.get_future().get() == 5 ); } -template - struct Pointer : __gnu_test::PointerBase, T> - { - using __gnu_test::PointerBase, T>::PointerBase; - }; - -void -test02() +void test02() { - __gnu_test::CustomPointerAlloc> alloc; + __gnu_test::CustomPointerAlloc alloc; promise p1(allocator_arg, alloc); p1.set_value(5); VERIFY( p1.get_future().get() == 5 );