[cfe-commits] r172780 - in /cfe/trunk: lib/Sema/SemaDeclObjC.cpp test/SemaObjC/arc.m
Douglas Gregor
dgregor at apple.com
Thu Jan 17 17:41:41 PST 2013
Author: dgregor
Date: Thu Jan 17 19:41:40 2013
New Revision: 172780
URL: http://llvm.org/viewvc/llvm-project?rev=172780&view=rev
Log:
When checking the parameter types of an Objective-C method, don't
decay the parameter type immediately; let CheckParameter() do its
job. Fixes <rdar://problem/12071218>.
Modified:
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
cfe/trunk/test/SemaObjC/arc.m
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=172780&r1=172779&r2=172780&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Thu Jan 17 19:41:40 2013
@@ -2906,8 +2906,6 @@
DI = 0;
} else {
ArgType = GetTypeFromParser(ArgInfo[i].Type, &DI);
- // Perform the default array/function conversions (C99 6.7.5.3p[7,8]).
- ArgType = Context.getAdjustedParameterType(ArgType);
}
LookupResult R(*this, ArgInfo[i].Name, ArgInfo[i].NameLoc,
Modified: cfe/trunk/test/SemaObjC/arc.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc.m?rev=172780&r1=172779&r2=172780&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/arc.m (original)
+++ cfe/trunk/test/SemaObjC/arc.m Thu Jan 17 19:41:40 2013
@@ -11,7 +11,7 @@
@end
@class NSFastEnumerationState;
@protocol NSFastEnumeration
-- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id [])buffer count:(NSUInteger)len;
+- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id __unsafe_unretained [])buffer count:(NSUInteger)len;
@end
@interface NSNumber
+ (NSNumber *)numberWithInt:(int)value;
@@ -752,3 +752,7 @@
e = @(42); // expected-warning {{assigning numeric literal to a weak variable; object will be released after assignment}}
m = @(41 + 1); // expected-warning {{assigning boxed expression to a weak variable; object will be released after assignment}}
}
+
+ at interface C
+- (void)method:(id[])objects; // expected-error{{must explicitly describe intended ownership of an object array parameter}}
+ at end
More information about the cfe-commits
mailing list