PR obj-c++/23640
* decl2.c (cp_finish_file): If this is obj-c++ and we need a static
init, call generate_ctor_or_dtor_function.
2005-08-31 Andrew Pinski <pinskia@physics.uc.edu>
PR obj-c++/23640
* obj-c++.dg/gnu-runtime-3.mm: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103673
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-08-31 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR obj-c++/23640
+ * decl2.c (cp_finish_file): If this is obj-c++ and we need a static
+ init, call generate_ctor_or_dtor_function.
+
2005-08-31 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/13377
/*data=*/&locus);
else
{
-
- if (static_ctors)
+ /* If we have a ctor or this is obj-c++ and we need a static init,
+ call generate_ctor_or_dtor_function. */
+ if (static_ctors || (c_dialect_objc () && objc_static_init_needed_p ()))
generate_ctor_or_dtor_function (/*constructor_p=*/true,
DEFAULT_INIT_PRIORITY, &locus);
if (static_dtors)
+2005-08-31 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR obj-c++/23640
+ * obj-c++.dg/gnu-runtime-3.mm: New test.
+
2005-08-31 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/13377
--- /dev/null
+/* Test that compiling for the GNU runtime works (regardless of
+ the system runtime used). */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do run } */
+/* { dg-options "-fgnu-runtime" } */
+
+#include <objc/Object.h>
+
+@interface FooBar: Object
+- (void)boo;
+@end
+
+int called = 0;
+extern "C" void abort ();
+
+@implementation FooBar
+- (void)boo
+{
+ called ++;
+}
+@end
+
+int main ()
+{
+ id fooBarInst = [[FooBar alloc] init];
+ [fooBarInst boo];
+ if (called != 1)
+ abort ();
+ return 0;
+}
+