From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/SemaObjC/method-conflict.m | 66 +++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 clang/test/SemaObjC/method-conflict.m (limited to 'clang/test/SemaObjC/method-conflict.m') diff --git a/clang/test/SemaObjC/method-conflict.m b/clang/test/SemaObjC/method-conflict.m new file mode 100644 index 0000000..2da629e --- /dev/null +++ b/clang/test/SemaObjC/method-conflict.m @@ -0,0 +1,66 @@ +// RUN: %clang_cc1 -Wmethod-signatures -fsyntax-only -verify -Wno-objc-root-class %s + +typedef signed char BOOL; +typedef unsigned int NSUInteger; +typedef struct _NSZone NSZone; +@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator; +@protocol NSObject - (BOOL)isEqual:(id)object; +@end @protocol NSCopying - (id)copyWithZone:(NSZone *)zone; +@end @protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone; +@end @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; +@end @interface NSObject { +} +@end extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone); +@interface NSValue : NSObject - (void)getValue:(void *)value; +@end @class NSString; +typedef struct _NSRange { +} + NSRange; +@interface NSValue (NSValueRangeExtensions) + (NSValue *)valueWithRange:(NSRange)range; +@end @interface NSAttributedString : NSObject - (NSString *)string; +@end @interface NSMutableAttributedString : NSAttributedString - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)str; +@end @class NSArray, NSDictionary, NSString, NSError; +@interface NSScanner : NSObject - (NSString *)string; +@end typedef struct { +} + CSSM_FIELDGROUP, *CSSM_FIELDGROUP_PTR; +@protocol XDUMLClassifier; +@protocol XDUMLClassInterfaceCommons +@end @protocol XDUMLImplementation; +@protocol XDUMLElement - (NSArray *) ownedElements; +@end @protocol XDUMLDataType; +@protocol XDUMLNamedElement - (NSString *) name; +@end enum _XDSourceLanguage { +XDSourceUnknown=0, XDSourceJava, XDSourceC, XDSourceCPP, XDSourceObjectiveC }; +typedef NSUInteger XDSourceLanguage; +@protocol XDSCClassifier - (XDSourceLanguage)language; +@end @class XDSCDocController; +@interface XDSCDisplaySpecification : NSObject { +} +@end @class XDSCOperation; +@interface XDSCClassFormatter : NSObject { +} ++ (NSUInteger) compartmentsForClassifier: (id ) classifier withSpecification: (XDSCDisplaySpecification *) displaySpec; // expected-note {{previous definition is here}} +@end +@class NSString; +@implementation XDSCClassFormatter + ++ appendVisibility: (id ) element withSpecification: (XDSCDisplaySpecification *) displaySpec to: (NSMutableAttributedString *) attributedString +{ + return 0; +} ++ (NSUInteger) compartmentsForClassifier: (id ) classifier withSpecification: (XDSCDisplaySpecification *) displaySpec { // expected-warning {{conflicting parameter types in implementation of 'compartmentsForClassifier:withSpecification:'}} + return 0; +} +@end + +// rdar: // 8006060 +@interface Bar +- (void)foo:(id)format, ...; // expected-note {{previous declaration is here}} +- (void)foo1:(id)format; // expected-note {{previous declaration is here}} +@end +@implementation Bar +- (void)foo:(id)format {}; // expected-warning {{conflicting variadic declaration of method and its implementation}} +- (void)foo1:(id)format, ... {}; // expected-warning {{conflicting variadic declaration of method and its implementation}} +@end + -- cgit v1.2.3