aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-02 03:14:12 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-02 03:14:12 +0000
commit261034861d2c8cfbd6036e56f22f57d7a3736861 (patch)
treed2f920e1dcc2ec4ba1ae573f71d80212c3fd844c /lib/Sema/SemaDecl.cpp
parentb8adaf905342129a62c989739d113a7cec7c5ff3 (diff)
Clean up -fixit output slightly
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index f67b417ddd..7cf44bf6ac 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2706,11 +2706,12 @@ void Sema::ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D,
// Verify 6.9.1p6: 'every identifier in the identifier list shall be declared'
// for a K&R function.
if (!FTI.hasPrototype) {
- for (unsigned i = 0, e = FTI.NumArgs; i != e; ++i) {
+ for (int i = FTI.NumArgs; i != 0; /* decrement in loop */) {
+ --i;
if (FTI.ArgInfo[i].Param == 0) {
- std::string Code = "int ";
+ std::string Code = " int ";
Code += FTI.ArgInfo[i].Ident->getName();
- Code += ";\n ";
+ Code += ";\n";
Diag(FTI.ArgInfo[i].IdentLoc, diag::ext_param_not_declared)
<< FTI.ArgInfo[i].Ident
<< CodeModificationHint::CreateInsertion(LocAfterDecls, Code);