aboutsummaryrefslogtreecommitdiff
path: root/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-02-17 19:31:09 +0000
committerChris Lattner <sabre@nondot.org>2008-02-17 19:31:09 +0000
commit5280408ab323a213ac63d5b557475ea5037aa553 (patch)
tree85b66eb4b7235ee0a48a5b8788d28027e8c3cb4a /Sema/SemaDecl.cpp
parenta9b20e57d407dfc8bd260e6228ba40f64439869c (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.cpp5
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.