aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/method-2.mm
diff options
context:
space:
mode:
authorno-author <no-author@gcc.gnu.org>2005-07-22 07:31:32 +0000
committerno-author <no-author@gcc.gnu.org>2005-07-22 07:31:32 +0000
commitea85b3c5c3e92a70dabb440b249f7c97cdb3045f (patch)
tree2d00554ce3107c7986bcf8019547e9fa8d7708b7 /gcc/testsuite/obj-c++.dg/method-2.mm
parent06dbf9039672be06678a949dc384273e5a4ea8c1 (diff)
This commit was manufactured by cvs2svn to create branch 'cfo-branch'.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/cfo-branch@102274 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/method-2.mm')
-rw-r--r--gcc/testsuite/obj-c++.dg/method-2.mm56
1 files changed, 56 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/method-2.mm b/gcc/testsuite/obj-c++.dg/method-2.mm
new file mode 100644
index 00000000000..a76055e4716
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/method-2.mm
@@ -0,0 +1,56 @@
+/* Test if prior method lookup at method @implementation time is not
+ overly aggressive, leading to methods being found in other classes. */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-do compile } */
+
+#include <objc/Object.h>
+
+@class NSString;
+
+@protocol NSMenuItem
++ (void)setUsesUserKeyEquivalents:(BOOL)flag;
++ (BOOL)usesUserKeyEquivalents;
+@end
+
+@interface NSMenuItem : Object <NSMenuItem> {
+ @private
+ id _menu;
+}
+@end
+
+@interface NSResponder : Object <NSMenuItem>
+{
+ id _nextResponder;
+}
+@end
+
+@interface Object(NSMenuValidation)
+- (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem;
+@end
+
+@interface NSResponder (NSStandardKeyBindingMethods)
+- (void)insertText:(id)insertString;
+- (void)doCommandBySelector:(SEL)aSelector;
+@end
+
+@interface NSView : NSResponder
+{
+ id _superview;
+ id _subviews;
+}
+@end
+
+@interface SKTGraphicView : NSView {
+ @private
+ float _gridSpacing;
+}
+@end
+
+@implementation SKTGraphicView
+- (BOOL)validateMenuItem:(NSMenuItem *)item {
+ return (BOOL)1;
+}
+- (void)insertText:(NSString *)str {
+}
+@end