From patchwork Wed Nov 16 01:01:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 695401 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 3tJQvy5cxSz9s9c for ; Wed, 16 Nov 2016 12:02:20 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="COMJkArX"; 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=msTOnhWnci/GeRwzo 689iwJMkSj9he1iTl9jn5d98lLK3/DxgCkXoKqI3jis6p664+l+BsxVFkWAqZve8 mTg5sOuI+RRuiI6ogiFNFM1NIaak9DplN6ynFowyfvZ7HdA6HgJnfgSuaRCJju6D JqkYAbt8xfbnqKfMIKi1qHlkjQ= 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=ufHYBOdJOqSCS4N6UZo/yFT Njuc=; b=COMJkArXBX9cV5Xo0lE4JXVrRuRryQOI0IqVjiWSZMLcYnoWAc5GTmx mAzFFVhjG5Z5tr6eqlCWx0dj7gUwUcFKemv8qFfS/8lyCq7m5XvShC7fvjF+JBnJ g411f6zmvVbpEDXbPnxwI9Zk0BhaJVMXz02vCHTIn5bd0hhdJDTQ= Received: (qmail 125764 invoked by alias); 16 Nov 2016 01:02:08 -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 125063 invoked by uid 89); 16 Nov 2016 01:02:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1652, publish 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 ESMTP; Wed, 16 Nov 2016 01:02:06 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CD4998FCE8; Wed, 16 Nov 2016 01:02:04 +0000 (UTC) Received: from redhat.com (ovpn-204-66.brq.redhat.com [10.40.204.66]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uAG11w59019168 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 15 Nov 2016 20:02:02 -0500 Date: Tue, 15 Nov 2016 17:01:57 -0800 From: Marek Polacek To: David Edelsohn Cc: GCC Patches , Jason Merrill Subject: Re: C++ PATCH for C++17 selection statements with initializer Message-ID: <20161116010157.GG3646@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) On Sat, Nov 05, 2016 at 10:03:37PM -0400, David Edelsohn wrote: > The patch adds testcase init-statement6.C, which includes the declaration > > extern void publish (int), raise (int); > > POSIX defines > > int raise (int); > > in which gets included by the C++ headers for the testcase on AIX. > > This is causes the error message: > > /nasfarm/edelsohn/src/src/gcc/testsuite/g++.dg/cpp1z/init-statement6.C:10:28: > error: ambiguating new declaration of 'void raise(int)' > ... > /tmp/GCC/gcc/include-fixed/sys/signal.h:103:12: note: old declaration > 'int raise(int)' > > Is there a reason for the conflicting / ambiguating declaration? Oops, no reason at all. I'm fixing this with: Tested on x86_64-linux, applying to trunk. 2016-11-15 Marek Polacek * g++.dg/cpp1z/init-statement6.C: Rename a function. Marek diff --git gcc/testsuite/g++.dg/cpp1z/init-statement6.C gcc/testsuite/g++.dg/cpp1z/init-statement6.C index 53b0d31..e8e24b5 100644 --- gcc/testsuite/g++.dg/cpp1z/init-statement6.C +++ gcc/testsuite/g++.dg/cpp1z/init-statement6.C @@ -7,14 +7,14 @@ std::map m; extern int xread (int *); -extern void publish (int), raise (int); +extern void publish (int), xraise (int); void foo () { if (auto it = m.find (10); it != m.end ()) { std::string s = it->second; } if (char buf[10]; std::fgets(buf, 10, stdin)) { m[0] += buf; } - if (int s; int count = xread (&s)) { publish(count); raise(s); } + if (int s; int count = xread (&s)) { publish(count); xraise(s); } const char *s; if (auto keywords = {"if", "for", "while"};