testsuite, objective-c++ : Add a dummy retain/release to testuite object.
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 7 Oct 2020 15:24:14 +0000 (16:24 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Sun, 11 Oct 2020 15:55:27 +0000 (16:55 +0100)
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
gcc/testsuite/objc-obj-c++-shared/TestsuiteObject.m

index 0f139bc84b4861bd3e4748992df9e776244e5cb9..a1a964da8f553e18708c4da618309e2d826e0f67 100644 (file)
@@ -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_ */
index 703827f8e6132067a7d83dd6fc0411462d4988aa..96717e362d5b0e8dc5314f32911c799a38ff3bc2 100644 (file)
@@ -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