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

Kim Gräsman via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 13 02:45:49 PDT 2024


kimgr wrote:

Thanks!

Could you add this DeclPrinterTest unittest for regression?
```
TEST(DeclPrinter, TestTemplateFinal) {
  ASSERT_TRUE(PrintedDeclCXX11Matches(
    "template<typename T>"
    "class FinalTemplate final {};",
    classTemplateDecl(hasName("FinalTemplate")).bind("id"),
    "template <typename T> class FinalTemplate final {}"));
}
```
This is my expectation for correct output, but the current branch seems to disagree -- now there's two spaces between `final` and `{}`. Not sure if that's a problem. IWYU has enough post-processing that it doesn't break us either way.

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


More information about the cfe-commits mailing list