From patchwork Tue Aug 18 12:41:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 508296 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 1270414032E for ; Tue, 18 Aug 2015 22:42:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=s4InLaVX; dkim-atps=neutral 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:mime-version:content-type; q=dns; s= default; b=yWoIWxAlg0k/5dmG+4HNMOCdmAYslFnY2GsIrBZAciPqVgRIh+M4P piDem5rkBV3hsVcxJPzkam+UeZRxTeaz23HFto7j3LoPtpNeO/CgsZQ169iOMRne OFj0moimTGfKd+JHduZYFRjj+2XX6oyO6F2JC7o43BGOTUTHqPvFsg= 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:mime-version:content-type; s= default; bh=jAsKQ7BhaibZJJOIFPivMYrPffs=; b=s4InLaVXVakSkmWilhRN oCHv9MWQPkyyVks3hEk5ugEhnqBnul5GHWlKHzcjz7LUqiTw/cB4SacEbyHlP7Eb tTzP+DqOJtJ9WvFd9aAiip0BkKZFPT79KVXb+DBOQttLlxE5FQCql0sYbPbcRkt1 dTlOPBiWPk7Q4Hj7+uSSOFg= Received: (qmail 111951 invoked by alias); 18 Aug 2015 12:41:53 -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 111931 invoked by uid 89); 18 Aug 2015 12:41:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no 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; Tue, 18 Aug 2015 12:41:51 +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 (Postfix) with ESMTPS id 737D5A49F7; Tue, 18 Aug 2015 12:41:50 +0000 (UTC) Received: from localhost (ovpn-116-48.ams2.redhat.com [10.36.116.48]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7ICfnAH022326; Tue, 18 Aug 2015 08:41:50 -0400 Date: Tue, 18 Aug 2015 13:41:49 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [patch] Alter libstdc++ test to work after c++/67216 fix Message-ID: <20150818124149.GD27791@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.23 (2014-03-12) With Paolo's fix the use of the safe-bool idiom in this test no longer compiles in C++11 or C++14. The requirement in TR1 is that it works "in a boolean context" and p1 == false is not necessarily a boolean context. Do an explicit conversion to make it valid in all modes. Tested powerpc64le-linux, committing to trunk. commit 78c8f95718d21c97653a61ba93ca3c311ca21bc7 Author: Jonathan Wakely Date: Tue Aug 18 13:17:50 2015 +0100 PR c++/67216 * testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc: Fix use of safe-bool idiom that isn't valid in C++11. diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc index 0c93f36..e7cefaf 100644 --- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc @@ -31,9 +31,9 @@ test01() bool test __attribute__((unused)) = true; const std::tr1::shared_ptr p1; - VERIFY( p1 == false ); + VERIFY( bool(p1) == false ); const std::tr1::shared_ptr p2(p1); - VERIFY( p2 == false ); + VERIFY( bool(p2) == false ); return 0; }