Upgrade "array of interface" warning to an error. In addition to being a
terrible idea, this crashes codegen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70178
91177308-0d34-0410-b5e6-
96231b3b80d8
"C++ requires a type specifier for all declarations">;
def err_missing_param_declspec : Error<
"parameter requires a declaration specifier">;
-def warn_objc_array_of_interfaces : Warning<
- "array of interface %0 should probably be an array of pointers">;
+def err_objc_array_of_interfaces : Error<
+ "array of interface %0 is invalid (probably should be an array of pointers)">;
def ext_c99_array_usage : Extension<
"use of C99-specific array features, accepted as an extension">;
def err_invalid_protocol_qualifiers : Error<
if (EltTy->getDecl()->hasFlexibleArrayMember())
Diag(Loc, diag::ext_flexible_array_in_array) << T;
} else if (T->isObjCInterfaceType()) {
- Diag(Loc, diag::warn_objc_array_of_interfaces) << T;
+ Diag(Loc, diag::err_objc_array_of_interfaces) << T;
+ return QualType();
}
// C99 6.7.5.2p1: The size expression shall have integer type.
// RUN: grep -e "\^{Innermost=CC}" %t | count 1 &&
// RUN: grep -e "{Derived=#ib32b8b3b8sb16b8b8b2b8ccb6}" %t | count 1 &&
// RUN: grep -e "{B1=#@c}" %t | count 1 &&
-// RUN: grep -e "v12@0:4\[3\[4{Test=i}]]8" %t | count 1 &&
+// RUN: grep -e "v12@0:4\[3\[4@]]8" %t | count 1 &&
// RUN: grep -e "r\^{S=i}" %t | count 1 &&
// RUN: grep -e "\^{Object=#}" %t | count 1
{
int ivar;
}
--(void) test3: (Test [3] [4])b ;
+-(void) test3: (Test* [3] [4])b ;
@end
@implementation Test
--(void) test3: (Test [3] [4])b {}
+-(void) test3: (Test* [3] [4])b {}
@end
struct S { int iS; };
@end
void test2() {
- INT1 b[3]; // expected-warning {{array of interface 'INT1' should probably be an array of pointers}}
+ // rdar://6827200
+ INT1 b[3]; // expected-error {{array of interface 'INT1' is invalid (probably should be an array of pointers)}}
INT1 *c = &b[0];
++c;
}