Fixed ParamDecl source range for implicit typed k&r parameters.

llvm-svn: 165256
This commit is contained in:
Abramo Bagnara 2012-10-04 21:38:29 +00:00
parent 0d67f5106c
commit 71f32c14b1
1 changed files with 3 additions and 0 deletions

View File

@ -7574,6 +7574,9 @@ void Sema::ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D,
unsigned DiagID; // unused
DS.SetTypeSpecType(DeclSpec::TST_int, FTI.ArgInfo[i].IdentLoc,
PrevSpec, DiagID);
// Use the identifier location for the type source range.
DS.SetRangeStart(FTI.ArgInfo[i].IdentLoc);
DS.SetRangeEnd(FTI.ArgInfo[i].IdentLoc);
Declarator ParamD(DS, Declarator::KNRTypeListContext);
ParamD.SetIdentifier(FTI.ArgInfo[i].Ident, FTI.ArgInfo[i].IdentLoc);
FTI.ArgInfo[i].Param = ActOnParamDeclarator(S, ParamD);