forked from OSchip/llvm-project
Allow 'static' and type qualifiers in K&R parameter type lists.
llvm-svn: 161980
This commit is contained in:
parent
135611f7fc
commit
22be8d5ab8
|
@ -2263,7 +2263,8 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
|
|||
// shall appear only in a declaration of a function parameter with an
|
||||
// array type, ...
|
||||
if (ASM == ArrayType::Static || ATI.TypeQuals) {
|
||||
if (!D.isPrototypeContext()) {
|
||||
if (!(D.isPrototypeContext() ||
|
||||
D.getContext() == Declarator::KNRTypeListContext)) {
|
||||
S.Diag(DeclType.Loc, diag::err_array_static_outside_prototype) <<
|
||||
(ASM == ArrayType::Static ? "'static'" : "type qualifier");
|
||||
// Remove the 'static' and the type qualifiers.
|
||||
|
|
|
@ -51,3 +51,7 @@ void n(int *(x)[static 10]); // no-warning
|
|||
void o(int (x[static 10])(void)); // expected-error{{'x' declared as array of functions of type 'int (void)'}}
|
||||
void p(int (^x)[static 10]); // expected-error{{block pointer to non-function type is invalid}}
|
||||
void q(int (^x[static 10])()); // no-warning
|
||||
|
||||
void r(x)
|
||||
int x[restrict]; // no-warning
|
||||
{}
|
||||
|
|
Loading…
Reference in New Issue