From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29815 invoked by alias); 23 Jun 2011 16:10:55 -0000 Received: (qmail 29804 invoked by uid 22791); 23 Jun 2011 16:10:54 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtp207.alice.it (HELO smtp207.alice.it) (82.57.200.103) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Jun 2011 16:10:40 +0000 Received: from [192.168.1.4] (79.52.194.95) by smtp207.alice.it (8.5.124.08) id 4DFA189A00B21250; Thu, 23 Jun 2011 18:10:36 +0200 Message-ID: <4E0365AC.6000701@oracle.com> Date: Thu, 23 Jun 2011 16:13:00 -0000 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110414 SUSE/3.1.10 Thunderbird/3.1.10 MIME-Version: 1.0 To: Jason Merrill CC: "gcc-patches@gcc.gnu.org" Subject: Re: [C++ Patch] PR 44625 References: <4E031E9C.8090502@oracle.com> <4E0352EF.6000007@redhat.com> <4E035C0C.2070407@oracle.com> <4E035FF6.4050209@redhat.com> <4E03613B.2020302@oracle.com> <4E036350.7010700@redhat.com> <4E036459.2090903@redhat.com> In-Reply-To: <4E036459.2090903@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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: 2011-06/txt/msg01783.txt.bz2 On 06/23/2011 06:05 PM, Jason Merrill wrote: > Actually, 9.5 says > > A union of the form > union { member-specification } ; > is called an anonymous union; it defines an unnamed object of unnamed > type. The member-specification of an anonymous union shall only define > non-static data members. [ Note: Nested types and functions cannot > be declared within an anonymous union. — end note ] > > So we should be able to just reject nested anonymous aggregates and > not worry about how to make them work. Yes, but we are accepting already some of that as an extension. If I compile the testcase with -pedantic-errors I get: 44625.C:8:31: error: ISO C++ prohibits anonymous structs [-pedantic] 44625.C:9:9: error: anonymous struct not inside named type thus, it's not clear to me where we should stop, exactly. Paolo.