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

           Summary: ICE when producing error for method argument which
                    "does not have know size"
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: objc
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: nic...@gcc.gnu.org


The following testcase crashes the compiler.  It is a regression; it works with
my stock "gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)" compiler --

[nic...@nicola objc.dg]$ gcc incomplete-type-1.m -c
cc1obj: error: type ‘({anonymous})’ does not have a known size
cc1obj: error: type ‘({anonymous})’ does not have a known size

(the error message is not great though)

Instead, with GCC 4.6 I get --

[nic...@nicola objc.dg]$ gcc incomplete-type-1.m -c -Wall
‘
tree check: expected tree that contains ‘decl minimal’ structure, have
‘enumeral_type’ in c_tree_printer, at c-objc-common.c:110
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Thanks

/* Contributed by Nicola Pero <nicola.p...@meta-innovation.com>, December 2010.
 */
/* { dg-do compile } */

#include <objc/objc.h>

enum type1;
struct type2;

@interface MyObject
- (void) method1: (enum type1)argument;
- (void) method2: (struct type2)argument;
@end

@implementation MyObject
- (void) method1: (enum type1)argument /* { dg-error "does not have a known
size" } */
{
  return;
}
- (void) method2: (struct type2)argument /* { dg-error "does not have a known
size" } */
{
  return;
}
@end

Reply via email to