From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6431 invoked by alias); 19 May 2011 18:54:53 -0000 Received: (qmail 6421 invoked by uid 22791); 19 May 2011 18:54:53 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 May 2011 18:54:38 +0000 From: "nicola at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug objc++/49070] New: ObjC++ compiler fails to compile ObjC method invocations without keyword arguments X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: objc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nicola at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Thu, 19 May 2011 19:11:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg01644.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D49070 Summary: ObjC++ compiler fails to compile ObjC method invocations without keyword arguments Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: objc++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: nicola@gcc.gnu.org The following testcase /* Contributed by Nicola Pero , May 2011. = */ #include @interface A - (id) method:(id)arg0 :(id)arg1; @end id function (A *x) { return [x method:x :x]; } fails to compile as Objective-C++ with GCC 4.7.0: [nicola@lampone ~]$ gcc test.mm -c test.mm: In function =E2=80=98objc_object* function(A*)=E2=80=99: test.mm:10:22: error: found =E2=80=98:=E2=80=99 in nested-name-specifier, e= xpected =E2=80=98::=E2=80=99 test.mm:10:20: error: =E2=80=98x=E2=80=99 is not a class or namespace test.mm:10:24: warning: =E2=80=98A=E2=80=99 may not respond to =E2=80=98-me= thod:=E2=80=99 [enabled by default] test.mm:10:24: warning: (Messages without a matching method signature [enab= led by default] test.mm:10:24: warning: will be assumed to return =E2=80=98id=E2=80=99 and = accept [enabled by default] test.mm:10:24: warning: =E2=80=98...=E2=80=99 as arguments.) [enabled by de= fault] [nicola@lampone ~]$ It compiles as Objective-C (ie, if you rename the file as test.m). It also compiles with much older compilers, such as GCC 4.1.2. This testcase was distilled from a bug reported by Banlu Kemiyatorn. I'd consider this slightly higher priority than the usual Objective-C++=20 testcase because what is broken is actually part of the basic Objective-C=20 language syntax. Thanks