diff options
author | Matt Beaumont-Gay <matthewbg@google.com> | 2012-08-15 19:53:19 +0000 |
---|---|---|
committer | Matt Beaumont-Gay <matthewbg@google.com> | 2012-08-15 19:53:19 +0000 |
commit | 99570a58b09fca5d0b328733ab8b6717a1a04f4a (patch) | |
tree | 920477ad23c8fa4f798fb6135942015fa3536f72 /lib/Sema/SemaType.cpp | |
parent | a8ac203967adaa18c5cbf869e368f7103060be1a (diff) |
Allow 'static' and type qualifiers in K&R parameter type lists.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161980 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 7b7cc99dff..54f8dbaf01 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -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. |