public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nicola at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug objc++/49070] New: ObjC++ compiler fails to compile ObjC method invocations without keyword arguments
Date: Thu, 19 May 2011 19:11:00 -0000	[thread overview]
Message-ID: <bug-49070-4@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49070

           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 <nicola.pero@meta-innovation.com>, May 2011.  */
#include <objc/objc.h>

@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 ‘objc_object* function(A*)’:
test.mm:10:22: error: found ‘:’ in nested-name-specifier, expected ‘::’
test.mm:10:20: error: ‘x’ is not a class or namespace
test.mm:10:24: warning: ‘A’ may not respond to ‘-method:’ [enabled by default]
test.mm:10:24: warning: (Messages without a matching method signature [enabled
by default]
test.mm:10:24: warning: will be assumed to return ‘id’ and accept [enabled by
default]
test.mm:10:24: warning: ‘...’ as arguments.) [enabled by default]
[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++ 
testcase because what is broken is actually part of the basic Objective-C 
language syntax.

Thanks


             reply	other threads:[~2011-05-19 18:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 19:11 nicola at gcc dot gnu.org [this message]
2011-05-19 19:14 ` [Bug objc++/49070] " nicola at gcc dot gnu.org
2021-02-26 21:42 ` [Bug objc++/49070] [8/9/10/11 regression] " iains at gcc dot gnu.org
2021-03-18 11:50 ` cvs-commit at gcc dot gnu.org
2021-03-24 22:07 ` cvs-commit at gcc dot gnu.org
2021-05-14 14:05 ` [Bug objc++/49070] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:05 ` rguenth at gcc dot gnu.org
2022-05-27  9:11 ` [Bug objc++/49070] [9 " rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-49070-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).