From: Nicola Pero Date: Tue, 28 Dec 2010 03:40:58 +0000 (+0000) Subject: In gcc/testsuite/: 2010-12-28 Nicola Pero X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=333031f2d302d9777cab0bf8422e2c5f9d3839b1;p=gcc.git In gcc/testsuite/: 2010-12-28 Nicola Pero In gcc/testsuite/: 2010-12-28 Nicola Pero PR objc/47073 * objc.dg/incomplete-type-1.m: New test. In gcc/objc/: 2010-12-28 Nicola Pero PR objc/47073 * objc-act.c (encode_method_prototype): Fixed both location and format string of error "type %qT does not have a known size". From-SVN: r168285 --- diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index cdfb5885472..16b774d5512 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,9 @@ +2010-12-28 Nicola Pero + + PR objc/47073 + * objc-act.c (encode_method_prototype): Fixed both location and + format string of error "type %qT does not have a known size". + 2010-12-26 Nicola Pero * config-lang.in (gtfiles): Added c-family/c-cppbuiltin.c. diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 2ac51bb6583..ba6c8108814 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -5965,8 +5965,9 @@ encode_method_prototype (tree method_decl) /* If a type size is not known, bail out. */ if (sz < 0) { - error ("type %q+D does not have a known size", - type); + error_at (DECL_SOURCE_LOCATION (method_decl), + "type %qT does not have a known size", + type); /* Pretend that the encoding succeeded; the compilation will fail nevertheless. */ goto finish_encoding; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cf8ff72b779..563fc03d048 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-12-28 Nicola Pero + + PR objc/47073 + * objc.dg/incomplete-type-1.m: New test. + 2010-12-27 Jakub Jelinek PR c++/46626 diff --git a/gcc/testsuite/objc.dg/incomplete-type-1.m b/gcc/testsuite/objc.dg/incomplete-type-1.m new file mode 100644 index 00000000000..f1e875f9aae --- /dev/null +++ b/gcc/testsuite/objc.dg/incomplete-type-1.m @@ -0,0 +1,22 @@ +/* Contributed by Nicola Pero , December 2010. */ +/* { dg-do compile } */ + +#include + +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 +