[clang] Fix the double space and double attribute printing of the final keyword. (PR #88600)

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 17 00:38:28 PDT 2024


================
@@ -275,13 +278,15 @@ void DeclPrinter::prettyPrintAttributes(const Decl *D,
           if (Pos != AttrPosAsWritten::Left)
             Out << ' ';
           A->printPretty(Out, Policy);
+          hasPrinted = true;
           if (Pos == AttrPosAsWritten::Left)
             Out << ' ';
         }
         break;
       }
     }
   }
+  return hasPrinted;
----------------
vgvassilev wrote:

I was thinking to use something like that but I believe the boolean flag is more readable. I'd like to keep it the way it is.

https://github.com/llvm/llvm-project/pull/88600


More information about the cfe-commits mailing list