зеркало из https://github.com/microsoft/clang-1.git
Improve on diagnostics when an objc class is used as
a stand-alone type declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100588 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
e8f5a1710a
Коммит
e9f5581ad4
|
@ -215,7 +215,8 @@ def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">;
|
|||
def err_statically_allocated_object : Error<
|
||||
"interface type cannot be statically allocated">;
|
||||
def err_object_cannot_be_passed_returned_by_value : Error<
|
||||
"interface type %1 cannot be %select{returned|passed}0 by value">;
|
||||
"interface type %1 cannot be %select{returned|passed}0 by value"
|
||||
"; did you forget * in %1">;
|
||||
def warn_enum_value_overflow : Warning<"overflow in enumeration value">;
|
||||
def warn_pragma_pack_invalid_alignment : Warning<
|
||||
"expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">;
|
||||
|
|
|
@ -14,7 +14,7 @@ void test1() {
|
|||
id objects[] = {[NSNumber METH]};
|
||||
}
|
||||
|
||||
void test2(NSNumber x) { // expected-error {{Objective-C interface type 'NSNumber' cannot be passed by value}}
|
||||
void test2(NSNumber x) { // expected-error {{Objective-C interface type 'NSNumber' cannot be passed by value; did you forget * in 'NSNumber'}}
|
||||
id objects[] = {[x METH]};
|
||||
}
|
||||
|
||||
|
|
|
@ -39,10 +39,10 @@ void foo7(id (^x)(int)) {
|
|||
@end
|
||||
|
||||
void foo8() {
|
||||
void *P = ^(itf x) {}; // expected-error {{Objective-C interface type 'itf' cannot be passed by value}}
|
||||
P = ^itf(int x) {}; // expected-error {{Objective-C interface type 'itf' cannot be returned by value}}
|
||||
P = ^itf() {}; // expected-error {{Objective-C interface type 'itf' cannot be returned by value}}
|
||||
P = ^itf{}; // expected-error {{Objective-C interface type 'itf' cannot be returned by value}}
|
||||
void *P = ^(itf x) {}; // expected-error {{Objective-C interface type 'itf' cannot be passed by value; did you forget * in 'itf'}}
|
||||
P = ^itf(int x) {}; // expected-error {{Objective-C interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
|
||||
P = ^itf() {}; // expected-error {{Objective-C interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
|
||||
P = ^itf{}; // expected-error {{Objective-C interface type 'itf' cannot be returned by value; did you forget * in 'itf'}}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ struct whatever {
|
|||
}
|
||||
@end
|
||||
|
||||
Super foo( // expected-error{{interface interface type 'Super' cannot be returned by value}}
|
||||
Super parm1) { // expected-error{{interface interface type 'Super' cannot be passed by value}}
|
||||
Super foo( // expected-error{{interface interface type 'Super' cannot be returned by value; did you forget * in 'Super'}}
|
||||
Super parm1) { // expected-error{{interface interface type 'Super' cannot be passed by value; did you forget * in 'Super'}}
|
||||
Super p1; // expected-error{{interface type cannot be statically allocated}}
|
||||
return p1;
|
||||
}
|
||||
|
|
|
@ -7,21 +7,21 @@
|
|||
@end
|
||||
|
||||
@interface bar
|
||||
-(void) my_method:(foo) my_param; // expected-error {{Objective-C interface type 'foo' cannot be passed by value}}
|
||||
- (foo)cccccc:(long)ddddd; // expected-error {{Objective-C interface type 'foo' cannot be returned by value}}
|
||||
-(void) my_method:(foo) my_param; // expected-error {{Objective-C interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
|
||||
- (foo)cccccc:(long)ddddd; // expected-error {{Objective-C interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
|
||||
@end
|
||||
|
||||
@implementation bar
|
||||
-(void) my_method:(foo) my_param // expected-error {{Objective-C interface type 'foo' cannot be passed by value}}
|
||||
-(void) my_method:(foo) my_param // expected-error {{Objective-C interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
|
||||
{
|
||||
}
|
||||
- (foo)cccccc:(long)ddddd // expected-error {{Objective-C interface type 'foo' cannot be returned by value}}
|
||||
- (foo)cccccc:(long)ddddd // expected-error {{Objective-C interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
|
||||
{
|
||||
}
|
||||
@end
|
||||
|
||||
void somefunc(foo x) {} // expected-error {{Objective-C interface type 'foo' cannot be passed by value}}
|
||||
foo somefunc2() {} // expected-error {{Objective-C interface type 'foo' cannot be returned by value}}
|
||||
void somefunc(foo x) {} // expected-error {{Objective-C interface type 'foo' cannot be passed by value; did you forget * in 'foo'}}
|
||||
foo somefunc2() {} // expected-error {{Objective-C interface type 'foo' cannot be returned by value; did you forget * in 'foo'}}
|
||||
|
||||
// rdar://6780761
|
||||
void f0(foo *a0) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче