mirror of https://github.com/microsoft/clang.git
objective-C: don't crash after diagnosing
using object subscripting without declaring objectForKeyedSubscript: // rdar://13333205 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176539 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b4e82454b6
commit
75525c4cce
|
@ -547,7 +547,7 @@ ExprResult Sema::UsualUnaryConversions(Expr *E) {
|
|||
// First, convert to an r-value.
|
||||
ExprResult Res = DefaultFunctionArrayLvalueConversion(E);
|
||||
if (Res.isInvalid())
|
||||
return Owned(E);
|
||||
return ExprError();
|
||||
E = Res.take();
|
||||
|
||||
QualType Ty = E->getType();
|
||||
|
@ -598,7 +598,7 @@ ExprResult Sema::DefaultArgumentPromotion(Expr *E) {
|
|||
|
||||
ExprResult Res = UsualUnaryConversions(E);
|
||||
if (Res.isInvalid())
|
||||
return Owned(E);
|
||||
return ExprError();
|
||||
E = Res.take();
|
||||
|
||||
// If this is a 'float' or '__fp16' (CVR qualified or typedef) promote to
|
||||
|
|
|
@ -56,3 +56,20 @@ void testEnum(void *p) {
|
|||
box = @(ME_foo);
|
||||
box = @(*(enum ForwE*)p); // expected-error {{incomplete type 'enum ForwE' used in a boxed expression}}
|
||||
}
|
||||
|
||||
// rdar://13333205
|
||||
@class NSMutableDictionary;
|
||||
|
||||
@interface NSMutableArray
|
||||
+ (NSMutableArray*) array;
|
||||
@end
|
||||
|
||||
NSMutableDictionary* mBars;
|
||||
|
||||
__attribute((objc_root_class)) @interface rdar13333205 @end
|
||||
|
||||
@implementation rdar13333205
|
||||
- (void) insertBar:(id)preset ofKind:(id) kind atIndex:(int)index {
|
||||
NSMutableArray* presetArray = mBars[kind] ?: [NSMutableArray array]; // expected-error {{expected method to read dictionary element not found on object of type 'NSMutableDictionary *'}}
|
||||
}
|
||||
@end
|
Loading…
Reference in New Issue