diff options
| author | Steve Naroff <snaroff@apple.com> | 2007-10-09 22:01:59 +0000 |
|---|---|---|
| committer | Steve Naroff <snaroff@apple.com> | 2007-10-09 22:01:59 +0000 |
| commit | c62adb6d1a185870ce57766cd20e793545863683 (patch) | |
| tree | fd8e64929f7a19fa5b2d94cbc4eb53beb5db3ba1 /clang/test/Sema/selector-overload.m | |
| parent | 230c6cc51682b935cb4204b2eb77e990b352e02d (diff) | |
| download | bcm5719-llvm-c62adb6d1a185870ce57766cd20e793545863683.tar.gz bcm5719-llvm-c62adb6d1a185870ce57766cd20e793545863683.zip | |
Make sure methods with no return type default to "id".
This fixes a crasher in Sema::MatchTwoMethodDeclarations(), identified by selector-overload.m (just added).
Added Action::ActOnTranslationUnitScope() and renamed Action::PopScope to ActOnPopScope.
Added a Translation Unit Scope instance variable to Sema (will be very useful to ObjC-related actions, since ObjC declarations are always file-scoped).
llvm-svn: 42817
Diffstat (limited to 'clang/test/Sema/selector-overload.m')
| -rw-r--r-- | clang/test/Sema/selector-overload.m | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/clang/test/Sema/selector-overload.m b/clang/test/Sema/selector-overload.m new file mode 100644 index 00000000000..8b433a48030 --- /dev/null +++ b/clang/test/Sema/selector-overload.m @@ -0,0 +1,43 @@ +// RUN: clang %s -parse-ast +#import <Foundation/NSObject.h> + +struct D { + double d; +}; + +@interface Foo : NSObject + +- method:(int)a; +- method:(int)a; + +@end + +@interface Bar : NSObject + +- method:(void *)a; + +@end + +@interface Car : NSObject + +- method:(struct D)a; + +@end + +@interface Zar : NSObject + +- method:(float)a; + +@end + +@interface Rar : NSObject + +- method:(float)a; + +@end + +int main() { +// id xx = [[Car alloc] init]; + +// [xx method:4]; +} |

