]> granicus.if.org Git - clang/commitdiff
Fixed ParamDecl source range for implicit typed k&r parameters.
authorAbramo Bagnara <abramo.bagnara@bugseng.com>
Thu, 4 Oct 2012 21:38:29 +0000 (21:38 +0000)
committerAbramo Bagnara <abramo.bagnara@bugseng.com>
Thu, 4 Oct 2012 21:38:29 +0000 (21:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165256 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index d177fd91034026c06dca1c0e24f58b6594e1bb7c..7ca1f29aa3f3ce749e9111a19920fe70b67e7e43 100644 (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);