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).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42817 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/selector-overload.m b/test/Sema/selector-overload.m
new file mode 100644
index 0000000..8b433a4
--- /dev/null
+++ b/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];
+}