[cfe-commits] r48568 - /cfe/trunk/lib/Sema/SemaDecl.cpp
Steve Naroff
snaroff at apple.com
Wed Mar 19 16:07:49 PDT 2008
Author: snaroff
Date: Wed Mar 19 18:07:49 2008
New Revision: 48568
URL: http://llvm.org/viewvc/llvm-project?rev=48568&view=rev
Log:
Fix http://llvm.org/bugs/show_bug.cgi?id=2161.
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=48568&r1=48567&r2=48568&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Mar 19 18:07:49 2008
@@ -1089,8 +1089,19 @@
// empty arg list, don't push any params.
} else {
for (unsigned i = 0, e = FTI.NumArgs; i != e; ++i) {
- Params.push_back(ActOnParamDeclarator(D.getTypeObject(0).Fun.ArgInfo[i],
- FnBodyScope));
+ ParmVarDecl *parmDecl;
+
+ parmDecl = ActOnParamDeclarator(D.getTypeObject(0).Fun.ArgInfo[i],
+ FnBodyScope);
+ // C99 6.7.5.3p4: the parameters in a parameter type list in a function
+ // declarator that is part of a function definition of that function
+ // shall not have incomplete type.
+ if (parmDecl->getType()->isIncompleteType()) {
+ Diag(parmDecl->getLocation(), diag::err_typecheck_decl_incomplete_type,
+ parmDecl->getType().getAsString());
+ parmDecl->setInvalidDecl();
+ }
+ Params.push_back(parmDecl);
}
}
More information about the cfe-commits
mailing list