Improve on flexible array diagnostics (PR7029).

llvm-svn: 104739
This commit is contained in:
Fariborz Jahanian 2010-05-26 20:46:24 +00:00
parent 27311269cb
commit b0e28471a6
3 changed files with 3 additions and 3 deletions

View File

@ -1829,7 +1829,7 @@ def ext_variable_sized_type_in_struct : ExtWarn<
def err_flexible_array_empty_struct : Error<
"flexible array %0 not allowed in otherwise empty struct">;
def err_flexible_array_has_nonpod_type : Error<
"flexible array %0 must have a non-dependent, non-POD type">;
"flexible array member %0 of non-POD element type %1">;
def ext_flexible_array_in_struct : Extension<
"%0 may not be nested in a struct due to flexible array member">;
def ext_flexible_array_in_array : Extension<

View File

@ -6139,7 +6139,7 @@ void Sema::ActOnFields(Scope* S,
if (!FD->getType()->isDependentType() &&
!Context.getBaseElementType(FD->getType())->isPODType()) {
Diag(FD->getLocation(), diag::err_flexible_array_has_nonpod_type)
<< FD->getDeclName();
<< FD->getDeclName() << FD->getType();
FD->setInvalidDecl();
EnclosingDecl->setInvalidDecl();
continue;

View File

@ -41,5 +41,5 @@ struct S {
struct X {
int blah;
S strings[]; // expected-error {{flexible array 'strings' must have a non-dependent, non-POD type}}
S strings[]; // expected-error {{flexible array member 'strings' of non-POD element type 'S []'}}
};