From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13485 invoked by alias); 9 Jun 2010 03:21:57 -0000 Received: (qmail 13472 invoked by uid 22791); 9 Jun 2010 03:21:57 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Jun 2010 03:21:52 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o593LjZb008693 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Jun 2010 23:21:45 -0400 Received: from [IPv6:::1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o593LiNa023254; Tue, 8 Jun 2010 23:21:44 -0400 Message-ID: <4C0F08C7.1080007@redhat.com> Date: Wed, 09 Jun 2010 04:39:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100602 Lightning/1.0b1 Shredder/3.0.6pre MIME-Version: 1.0 To: Shujing Zhao CC: Joseph , Gcc-Patches , Paolo Carlini Subject: Re: [PATCH C/C++] Fix some diagnostics problems References: <4C0DC2B4.3080200@oracle.com> <4C0E94C8.4070807@redhat.com> <4C0F04A3.4080809@oracle.com> In-Reply-To: <4C0F04A3.4080809@oracle.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-06/txt/msg00854.txt.bz2 On 06/08/2010 11:04 PM, Shujing Zhao wrote: > Do you mean remove them as the following? > > @@ -727,10 +727,7 @@ > else if (TREE_CODE (init) == TREE_LIST > && TREE_TYPE (init) != unknown_type_node) > { > - if (TREE_CODE (decl) == RESULT_DECL) > - init = build_x_compound_expr_from_list (init, > - "return value initializer"); > - else if (TREE_CODE (init) == TREE_LIST > + if (TREE_CODE (init) == TREE_LIST > && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE) > { > error ("cannot initialize arrays using this syntax"); Yes. But better would be to replace it with gcc_assert (TREE_CODE (decl) != RESULT_DECL); Jason