From cc3014d80e1072c376687f6fcfa421953a58fdd1 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Wed, 7 Oct 2020 16:24:14 +0100 Subject: [PATCH] testsuite, objective-c++ : Add a dummy retain/release to testuite object. On newer systems, the throw/catch process sends retain and release messages to thrown objects. While these are not needed in the testsuite cases, they cause the tests to fail because the selector is not handled. Add dummy methods to the testsuite object. gcc/testsuite/ChangeLog: * objc-obj-c++-shared/TestsuiteObject.h: Add dummy retain and release method declarations. * objc-obj-c++-shared/TestsuiteObject.m: Add dummy retain and release implementations. --- gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.h | 5 +++++ gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.m | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.h b/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.h index 0f139bc84b4..a1a964da8f5 100644 --- a/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.h +++ b/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.h @@ -45,6 +45,11 @@ __attribute__((objc_root_class)) + (Class) superclass; + (const char *)name; - (const char *)name; + +/* For try-catch impl that retains and releases thrown objects. */ +- (id) retain; +- (void) release; + @end #endif /* _TESTSUITE_OBJECT_H_ */ diff --git a/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.m b/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.m index 703827f8e61..96717e362d5 100644 --- a/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.m +++ b/gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.m @@ -66,4 +66,15 @@ along with GCC; see the file COPYING3. If not see { return object_getClassName (self); } + +- (id) retain +{ + return self; +} + +- (void) release +{ + return; +} + @end -- 2.30.2