mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-23 00:51:00 +08:00
Fixed a couple of objctective-c bugs.
Oked by Mike Stump. From-SVN: r111642
This commit is contained in:
parent
21a8ffa158
commit
d349339d33
@ -1,3 +1,9 @@
|
||||
2006-03-02 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
* objc-act.c (init_module_descriptor): Remove file name from
|
||||
module descriptor.
|
||||
(gen_type_name_0): Fix ICE when issuing warning.
|
||||
|
||||
2006-02-20 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
|
||||
* Make-lang.in (OBJC): Remove
|
||||
(OBJECTIVE-C): Remove
|
||||
|
@ -2254,9 +2254,10 @@ init_module_descriptor (tree type)
|
||||
size_in_bytes (objc_module_template));
|
||||
initlist = tree_cons (NULL_TREE, expr, initlist);
|
||||
|
||||
/* name = { ..., "foo.m", ... } */
|
||||
/* Don't provide any file name for security reasons. */
|
||||
/* name = { ..., "", ... } */
|
||||
|
||||
expr = add_objc_string (get_identifier (input_filename), class_names);
|
||||
expr = add_objc_string (get_identifier (""), class_names);
|
||||
initlist = tree_cons (NULL_TREE, expr, initlist);
|
||||
|
||||
/* symtab = { ..., _OBJC_SYMBOLS, ... } */
|
||||
@ -8883,7 +8884,9 @@ gen_type_name_0 (tree type)
|
||||
if (TREE_CODE (type) == TYPE_DECL && DECL_NAME (type))
|
||||
type = DECL_NAME (type);
|
||||
|
||||
strcat (errbuf, IDENTIFIER_POINTER (type));
|
||||
strcat (errbuf, TREE_CODE (type) == IDENTIFIER_NODE
|
||||
? IDENTIFIER_POINTER (type)
|
||||
: "");
|
||||
|
||||
/* For 'id' and 'Class', adopted protocols are stored in the pointee. */
|
||||
if (objc_is_id (orig))
|
||||
|
@ -1,3 +1,9 @@
|
||||
2006-03-02 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
* objc.dg/objc-nofilename-1.m: New test.
|
||||
* objc.dg/bad-receiver-type.m: New test.
|
||||
* obj-c++.dg/bad-receiver-type.mm: New test.
|
||||
|
||||
2006-03-02 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||
|
||||
* gcc.dg/single-precision-constant.c: Tweak for non-C99 runtimes.
|
||||
|
15
gcc/testsuite/obj-c++.dg/bad-receiver-type.mm
Normal file
15
gcc/testsuite/obj-c++.dg/bad-receiver-type.mm
Normal file
@ -0,0 +1,15 @@
|
||||
// { dg-do compile }
|
||||
// { dg-options "" }
|
||||
|
||||
@interface A
|
||||
|
||||
- (void)test;
|
||||
|
||||
@end
|
||||
|
||||
extern int foo();
|
||||
|
||||
void baz()
|
||||
{
|
||||
[foo test]; /* { dg-warning "invalid receiver type" } */
|
||||
}
|
15
gcc/testsuite/objc.dg/bad-receiver-type.m
Normal file
15
gcc/testsuite/objc.dg/bad-receiver-type.m
Normal file
@ -0,0 +1,15 @@
|
||||
/* { dg-do compile } */
|
||||
|
||||
@interface A
|
||||
|
||||
- (void)test;
|
||||
|
||||
@end
|
||||
|
||||
extern int foo();
|
||||
|
||||
void baz()
|
||||
{
|
||||
[foo test]; /* { dg-warning "invalid receiver type" } */
|
||||
/* { dg-warning "cannot convert to a pointer type" "" { target *-*-* } 13} */
|
||||
}
|
21
gcc/testsuite/objc.dg/objc-nofilename-1.m
Normal file
21
gcc/testsuite/objc.dg/objc-nofilename-1.m
Normal file
@ -0,0 +1,21 @@
|
||||
/* Test to make sure that file name does not appear in the binary. */
|
||||
/* { dg-do compile } */
|
||||
#include <objc/objc.h>
|
||||
|
||||
@interface Foo { Class isa; } @end
|
||||
@implementation Foo @end
|
||||
|
||||
@interface Bar : Foo { Class Barisa; } @end
|
||||
|
||||
@implementation Bar : Foo @end;
|
||||
|
||||
@interface FINAL : Bar { Class FINALisa; } @end
|
||||
|
||||
@implementation FINAL : Bar @end;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* { dg-final { scan-assembler-not "objc-nofilename-1.m" } } */
|
Loading…
x
Reference in New Issue
Block a user