From patchwork Wed Oct 29 09:47:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Preud'homme X-Patchwork-Id: 404492 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 8159514003E for ; Wed, 29 Oct 2014 20:48:05 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=TOF Xkm/aGjm8F7VrVYtd2AbV9sUDQ0PnbBapff1VFq4YdZH4sHs580TsF4MD47itA3g BR5ru2Fc6c+Ya2PIK8fX/TxKtO0qZM4x3dMU84VqLGQSzFnKfhHF6MxNKtyvsPmG T4TW156xV1oe7AJGSnwtIav/LxVXe0TVPd0GnaAw= 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:from :to:references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=Lx31ONhn1 tSoncBqmokwJmv0Mow=; b=mP0zMuzTLBDzTMtjrs0fTlrpAIMZyvjsUxO79ub3m 3iuIHainUpUzM8KSaUQ8gu6/bZ8MlDHeKKBjDOaLfBQg3fBzhBkAL/FzwU/tcXSQ gimXZOO6hbIkV8KaOVV7CXPLZg0q8vgOZu82payShnvCareJ+iGr8ZXETSpzKQa/ Hw= Received: (qmail 15955 invoked by alias); 29 Oct 2014 09:47:59 -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 15942 invoked by uid 89); 29 Oct 2014 09:47:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 Oct 2014 09:47:56 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 29 Oct 2014 09:47:54 +0000 Received: from SHAWIN202 ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 29 Oct 2014 09:47:53 +0000 From: "Thomas Preud'homme" To: "'Nathan Sidwell'" , "Jason Merrill" , References: <000001cfdbb7$974ce1d0$c5e6a570$@arm.com> <002901cfe3a2$c4b6dfc0$4e249f40$@arm.com> <54368CC3.6020107@redhat.com> <54368DE3.40804@codesourcery.com> In-Reply-To: <54368DE3.40804@codesourcery.com> Subject: RE: [PATCH, C++] Fix PR63366: __complex not equivalent to __complex double in C++ Date: Wed, 29 Oct 2014 09:47:48 -0000 Message-ID: <000801cff35d$66786cb0$33694610$@arm.com> MIME-Version: 1.0 X-MC-Unique: 114102909475406401 X-IsSubscribed: yes > From: Nathan Sidwell [mailto:nathan@codesourcery.com] > Sent: Thursday, October 09, 2014 2:30 PM > On 10/09/14 09:25, Jason Merrill wrote: > > I would think we want to handle this up in the existing defaulted_int > block: > my thought was to at least put it next to the explicit_int = -1 above. It seems more sensible to keep it in this block as the existing defaulted_int block is for types for which it is not an error to omit the int type specifier. Here is an updated patch which moves the statement as requested by Nathan: ChangeLog unchanged. Ok for trunk? Best regards, Thomas diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index d26a432..f382e27 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9187,6 +9187,7 @@ grokdeclarator (const cp_declarator *declarator, int is_main; explicit_int = -1; + defaulted_int = 1; /* We handle `main' specially here, because 'main () { }' is so common. With no options, it is allowed. With -Wreturn-type, diff --git a/gcc/testsuite/g++.dg/torture/pr63366.C b/gcc/testsuite/g++.dg/torture/pr63366.C new file mode 100644 index 0000000..af59b98 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr63366.C @@ -0,0 +1,11 @@ +// { dg-do run } +// { dg-options "-fpermissive" } +// { dg-prune-output "ISO C\\+\\+ forbids declaration of 'type name' with no type" } + +#include + +int +main (void) +{ + return typeid (__complex) != typeid (__complex double); +}