From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8062 invoked by alias); 15 Oct 2009 20:29:04 -0000 Received: (qmail 8052 invoked by uid 22791); 15 Oct 2009 20:29:03 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL,WEIRD_PORT X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Oct 2009 20:28:59 +0000 Received: from mx10.gnu.org ([199.232.76.166]:34392) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MyWwS-0001wB-G9 for gcc@gnu.org; Thu, 15 Oct 2009 16:28:56 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MyTSt-0004eu-7I for gcc@gnu.org; Thu, 15 Oct 2009 12:46:16 -0400 Received: from smtp-out.google.com ([216.239.33.17]:9940) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MyTSs-0004Nl-Os for gcc@gnu.org; Thu, 15 Oct 2009 12:46:11 -0400 Received: from zps78.corp.google.com (zps78.corp.google.com [172.25.146.78]) by smtp-out.google.com with ESMTP id n9FGiZNu021429 for ; Thu, 15 Oct 2009 17:44:36 +0100 Received: from fg-out-1718.google.com (fgad23.prod.google.com [10.86.55.23]) by zps78.corp.google.com with ESMTP id n9FGiWRC031502 for ; Thu, 15 Oct 2009 09:44:32 -0700 Received: by fg-out-1718.google.com with SMTP id d23so500073fga.10 for ; Thu, 15 Oct 2009 09:44:32 -0700 (PDT) Received: by 10.86.8.36 with SMTP id 36mr443499fgh.7.1255625071914; Thu, 15 Oct 2009 09:44:31 -0700 (PDT) Received: from coign.google.com (dhcp-172-22-124-228.mtv.corp.google.com [172.22.124.228]) by mx.google.com with ESMTPS id 4sm17852fge.22.2009.10.15.09.44.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Oct 2009 09:44:30 -0700 (PDT) To: John Holdsworth Cc: gcc@gnu.org Subject: Re: Bus error gcc compiler for any for ( x in array ) inside Objective-C++ template References: <4A7E26EB-B9BA-499F-9827-146BF7CC496F@johnholdsworth.com> From: Ian Lance Taylor Date: Thu, 15 Oct 2009 22:42:00 -0000 In-Reply-To: (John Holdsworth's message of "Thu\, 15 Oct 2009 09\:45\:46 +0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg00349.txt.bz2 John Holdsworth writes: > I've encountered a bus error using Apple's gcc in Xcode 3.1, 3.2 > compiling the following code or any containing for( x in y ) is used > inside a template in Objective-C++. > > template > class OODictionary { > void boom() { > NSArray *keys =3D nil; > for ( NSString *key in keys ) { > } > } > }; > > I've not been able to build with a more recent gcc so I can't tell > if it is still present but figure I'd better let you guys know. I tried your test case with current mainline, and got a bunch of errors. /home/iant/foo.mm: In member function =E2=80=98void OODictionary::bo= om()=E2=80=99: /home/iant/foo.mm:4:3: error: =E2=80=98NSArray=E2=80=99 was not declared in= this scope /home/iant/foo.mm:4:12: error: =E2=80=98keys=E2=80=99 was not declared in t= his scope /home/iant/foo.mm:4:19: error: =E2=80=98nil=E2=80=99 was not declared in th= is scope /home/iant/foo.mm:5:9: error: =E2=80=98NSString=E2=80=99 was not declared i= n this scope /home/iant/foo.mm:5:19: error: =E2=80=98key=E2=80=99 was not declared in th= is scope /home/iant/foo.mm:5:23: error: expected =E2=80=98;=E2=80=99 before =E2=80= =98in=E2=80=99 /home/iant/foo.mm:7:2: error: expected primary-expression before =E2=80=98}= =E2=80=99 token /home/iant/foo.mm:7:2: error: expected =E2=80=98;=E2=80=99 before =E2=80=98= }=E2=80=99 token /home/iant/foo.mm:7:2: error: expected primary-expression before =E2=80=98}= =E2=80=99 token /home/iant/foo.mm:7:2: error: expected =E2=80=98)=E2=80=99 before =E2=80=98= }=E2=80=99 token /home/iant/foo.mm:7:2: error: expected primary-expression before =E2=80=98}= =E2=80=99 token /home/iant/foo.mm:7:2: error: expected =E2=80=98;=E2=80=99 before =E2=80=98= }=E2=80=99 token Since I don't know Objective C++ at all, I don't know whether this is expected. In any case, I encourage you to file a bug report with a self-contained test case. Please follow the directions at http://gcc.gnu.org/bugs.html . Thanks. Ian