diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-02-22 06:58:32 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-02-22 06:58:32 +0000 |
commit | d5668a2447c2afeea38815b51a80a5a6ac235599 (patch) | |
tree | 3c96839e397d512441ad18569f5ac358291e010e /lib/Sema/SemaType.cpp | |
parent | 28965bfa833926fd908a902cf2373d07c47b9067 (diff) |
When a parameter list in a C function has an error, recover by forming a K&R function,
instead of a non-function type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175868 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 209699f4b8..c47a7f59ac 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -2580,6 +2580,8 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, // definition. S.Diag(FTI.ArgInfo[0].IdentLoc, diag::err_ident_list_in_fn_declaration); D.setInvalidType(true); + // Recover by creating a K&R-style function type. + T = Context.getFunctionNoProtoType(T); break; } |