[LLVMbugs] [Bug 2816] New: Assertion failure when parsing "id <Protocol> const" method argument

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Sep 21 23:14:03 PDT 2008


http://llvm.org/bugs/show_bug.cgi?id=2816

           Summary: Assertion failure when parsing "id <Protocol> const"
                    method argument
           Product: clang
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: major
          Priority: P2
         Component: parser
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nikita at zhuk.fi
                CC: llvmbugs at cs.uiuc.edu


Clang parser throws an assertion failure when parsing an ObjC method with
argument of type "id <SomeProtocol> const". GCC compiles the test case without
warnings (tested with GCC 4.0 on Mac OS X 10.5.5). Clang revision: 56386


Test case:

@protocol MyProtocol
- (void)doSomething;
@end

@interface MyClass
- (void)m1:(id <MyProtocol> const)arg1;
@end

@implementation MyClass
- (void)m1:(id <MyProtocol> const)arg1 { }
@end

Output:

MyClass.m:15:29: error: expected ')'
- (void)m1:(id <MyProtocol> const)arg1;
                            ^
MyClass.m:15:12: error: to match this '('
- (void)m1:(id <MyProtocol> const)arg1;
           ^
Assertion failed: (isTokenParen() && "wrong consume method"), function
ConsumeParen, file
/Volumes/DocsHD/Ohjelmointi/llvm/tools/clang/lib/Parse/../../include/clang/Parse/Parser.h,
line 145.
0   clang                               0x003250c1
_ZN4llvm3sys7Program17FindProgramByNameERKSs + 611
1   clang                               0x0032538b
_ZN4llvm3sys28PrintStackTraceOnErrorSignalEv + 593
2   libSystem.B.dylib                   0x966f509b _sigtramp + 43
3   ???                                 0xffffffff 0x0 + 4294967295
4   libSystem.B.dylib                   0x9676dec2 raise + 26
5   libSystem.B.dylib                   0x9677d47f abort + 73
6   libSystem.B.dylib                   0x9676f063 __assert_rtn + 101
7   clang                               0x001f9f3d
_ZN5clang6Parser12ConsumeParenEv + 91
8   clang                               0x001edb6d
_ZN5clang6Parser17ParseObjCTypeNameERNS_12ObjCDeclSpecE + 409
9   clang                               0x001f1294
_ZN5clang6Parser19ParseObjCMethodDeclENS_14SourceLocationENS_3tok9TokenKindEPvNS2_15ObjCKeywordKindE
+ 788
10  clang                               0x001f178a
_ZN5clang6Parser24ParseObjCMethodPrototypeEPvNS_3tok15ObjCKeywordKindE + 204
11  clang                               0x001f1e45
_ZN5clang6Parser26ParseObjCInterfaceDeclListEPvNS_3tok15ObjCKeywordKindE + 1211
12  clang                               0x001f2b8d
_ZN5clang6Parser31ParseObjCAtInterfaceDeclarationENS_14SourceLocationEPNS_13AttributeListE
+ 1655
13  clang                               0x001f2d00
_ZN5clang6Parser21ParseObjCAtDirectivesEv + 224
14  clang                               0x001f9450
_ZN5clang6Parser24ParseExternalDeclarationEv + 414
15  clang                               0x001f9549
_ZN5clang6Parser17ParseTopLevelDeclERPv + 85
16  clang                               0x0012b604
_ZN5clang8ParseASTERNS_12PreprocessorEPNS_11ASTConsumerEb + 404
17  clang                               0x0002fbcb
_Z22InitializeIncludePathsPKcRN5clang12HeaderSearchERNS1_11FileManagerERKNS1_11LangOptionsE
+ 2971
18  clang                               0x00030d4b main + 1643
19  clang                               0x0000208a start + 54


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list