Oked by Mike Stump.
From-SVN: r111642
+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
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, ... } */
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))
+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.
--- /dev/null
+// { dg-do compile }
+// { dg-options "" }
+
+@interface A
+
+- (void)test;
+
+@end
+
+extern int foo();
+
+void baz()
+{
+ [foo test]; /* { dg-warning "invalid receiver type" } */
+}
--- /dev/null
+/* { 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} */
+}
--- /dev/null
+/* 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" } } */