aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-10 02:22:51 +0000
committerChris Lattner <sabre@nondot.org>2008-04-10 02:22:51 +0000
commit8123a95c33b792d35c2e4992ba6e27882748fb0d (patch)
tree33cd02a28ced427832214e01d1cfdca997f262b3 /lib/Sema/SemaType.cpp
parent05cbe1a44e6143d44aac0e769ba120e8c45f34ce (diff)
Several improvements from Doug Gregor related to default
argument handling. I'll fix up the c89 (void) thing next. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49459 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 4393b80a66..5e155f8817 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -394,7 +394,8 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S) {
llvm::SmallVector<QualType, 16> ArgTys;
for (unsigned i = 0, e = FTI.NumArgs; i != e; ++i) {
- QualType ArgTy = ((ParmVarDecl *)FTI.ArgInfo[i].Param)->getType();
+ ParmVarDecl *Param = (ParmVarDecl *)FTI.ArgInfo[i].Param;
+ QualType ArgTy = Param->getType();
assert(!ArgTy.isNull() && "Couldn't parse type?");
//
// Perform the default function/array conversion (C99 6.7.5.3p[7,8]).
@@ -425,13 +426,13 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S) {
if (FTI.NumArgs != 1 || FTI.isVariadic) {
Diag(DeclType.Loc, diag::err_void_only_param);
ArgTy = Context.IntTy;
- ((ParmVarDecl *)FTI.ArgInfo[i].Param)->setType(ArgTy);
+ Param->setType(ArgTy);
} else if (FTI.ArgInfo[i].Ident) {
// Reject, but continue to parse 'int(void abc)'.
Diag(FTI.ArgInfo[i].IdentLoc,
diag::err_param_with_void_type);
ArgTy = Context.IntTy;
- ((ParmVarDecl *)FTI.ArgInfo[i].Param)->setType(ArgTy);
+ Param->setType(ArgTy);
} else {
// Reject, but continue to parse 'float(const void)'.
if (ArgTy.getCVRQualifiers())