From patchwork Thu Nov 26 15:42:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 549143 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 26C241402DD for ; Fri, 27 Nov 2015 02:43:17 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=sy8/xHdz; 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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=dFhjR3JKF/wHAEuUw GSW7tTG8/7l+RPjf4Sq+cVvigXz21idaF7yR5/8oYH3hQQMspilqzpwO369SuyRZ qpPpUK14BZUPYHWE/To2lwX28dvKqGlLHh4WgkGKSeeFKgAL3nUX7JqAfC07wy2W OiGPkfHFTzIEYDNXtKkgwsFIYQ= 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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=GaGnEjq2El/VoSmtEfI8Z7g uZ8A=; b=sy8/xHdz8vN8xjVJTMhEByGCFym4yslBoMKp1yLcBor5gahZJ12M0rE NdlVsWc7BwsetQCtA/LfnBHBFIeYwztekpVvSNounS0Ixjv5az07AWDTX56Lv5Ot fD8aVLWEa6UG0/cNuTn+o5ETEi3ashBzPZclsJxGr5rpcJI0yjtU= Received: (qmail 54520 invoked by alias); 26 Nov 2015 15:43:03 -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 54499 invoked by uid 89); 26 Nov 2015 15:43:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS 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; Thu, 26 Nov 2015 15:43:01 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 5E31F68E15; Thu, 26 Nov 2015 15:43:00 +0000 (UTC) Received: from localhost (ovpn-116-120.ams2.redhat.com [10.36.116.120]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAQFgxNC027499; Thu, 26 Nov 2015 10:42:59 -0500 Date: Thu, 26 Nov 2015 15:42:59 +0000 From: Jonathan Wakely To: Jonathan Wakely Cc: Alan Lawrence , Doug Evans , gcc-patches , libstdc++ Subject: Re: [PATCH] libstdc++: Fix libstdc++/67440: pretty-printing of a const set fails Message-ID: <20151126154259.GQ11200@redhat.com> References: <047d7b10cdcf8731080524aec2e9@google.com> <5655F014.9080508@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.24 (2015-08-30) On 25/11/15 19:55 +0000, Jonathan Wakely wrote: >On 25 November 2015 at 17:29, Alan Lawrence wrote: >> On 16/11/15 21:04, Doug Evans wrote: >>> >>> Hi. >>> >>> Apologies for the delay. >>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67440 >>> >>> Tested with current trunk. >>> >>> 2015-11-16 Doug Evans >>> >>> PR libstdc++/67440 >>> * python/libstdcxx/v6/printers.py (find_type): Handle "const" in >>> type name. >>> * testsuite/libstdc++-prettyprinters/debug.cc: Add test for >>> const set. >>> * testsuite/libstdc++-prettyprinters/simple.cc: Ditto. >>> * testsuite/libstdc++-prettyprinters/simple11.cc: Ditto. >> >> >> On gcc-5-branch, the debug.cc and simple.cc tests don't seem to compile, on >> either x86_64-none-linux-gnu or aarch64-none-linux-gnu. I get errors like: >> >> /work/alalaw01/src/gcc/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc: >> In function 'int main()': >> /work/alalaw01/src/gcc/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc:77:43: >> error: in C++98 'const_intset' must be initialized by constructor, not by >> '{...}' >> const std::set const_intset = {2, 3}; >> ^ > >Which should have failed to compile on trunk as well, but we're >missing a -std=gnu++98 in the simple.cc testcase, so on trunk it uses >the -std=gnu++14 default. I'll add -std=gnu++98 to the test. I've committed this to trunk, and will apply it to gcc-5-branch after I finish testing it on the branch. commit 0ee15827a1132aeb960ff613ecafd8351a2535e0 Author: Jonathan Wakely Date: Thu Nov 26 15:10:15 2015 +0000 Ensure pretty-printer test uses C++98 mode * testsuite/libstdc++-prettyprinters/simple.cc: Add -std=gnu++98 to dg-options and avoid use of uniform-init. diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc index 68c4d83..e1956bf 100644 --- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc +++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc @@ -1,7 +1,7 @@ // If you modify this, please update simple11.cc and debug.cc as well. // { dg-do run } -// { dg-options "-g -O0" } +// { dg-options "-g -O0 -std=gnu++98" } // Copyright (C) 2011-2015 Free Software Foundation, Inc. // @@ -74,7 +74,10 @@ main() // { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } } // PR 67440 - const std::set const_intset = {2, 3}; + std::set intset; + intset.insert(2); + intset.insert(3); + const std::set const_intset = intset; // { dg-final { note-test const_intset {std::set with 2 elements = {[0] = 2, [1] = 3}} } } std::set sp;