public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug objc++/49070] New: ObjC++ compiler fails to compile ObjC method invocations without keyword arguments
@ 2011-05-19 19:11 nicola at gcc dot gnu.org
  2011-05-19 19:14 ` [Bug objc++/49070] " nicola at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: nicola at gcc dot gnu.org @ 2011-05-19 19:11 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-05-27  9:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-19 19:11 [Bug objc++/49070] New: ObjC++ compiler fails to compile ObjC method invocations without keyword arguments nicola at gcc dot gnu.org
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

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).