diff options
author | Chris Lattner <sabre@nondot.org> | 2008-02-17 19:31:09 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-02-17 19:31:09 +0000 |
commit | 5280408ab323a213ac63d5b557475ea5037aa553 (patch) | |
tree | 85b66eb4b7235ee0a48a5b8788d28027e8c3cb4a /Sema/SemaDecl.cpp | |
parent | a9b20e57d407dfc8bd260e6228ba40f64439869c (diff) |
Fix PR2042. One remaining issue: we don't currently diagnose
int foobar(int);
int foobar() {}
which requires ifdef'ing out a testcase in predefined-function.c.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47236 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Sema/SemaDecl.cpp')
-rw-r--r-- | Sema/SemaDecl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp index 24013cd9dd..6a718aef91 100644 --- a/Sema/SemaDecl.cpp +++ b/Sema/SemaDecl.cpp @@ -1010,10 +1010,11 @@ Sema::DeclTy *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) { FTI.ArgInfo[i].TypeInfo = Context.IntTy.getAsOpaquePtr(); } } - + // Since this is a function definition, act as though we have information // about the arguments. - FTI.hasPrototype = true; + if (FTI.NumArgs) + FTI.hasPrototype = true; } else { // FIXME: Diagnose arguments without names in C. |