================ @@ -29096,6 +29096,63 @@ TEST_F(FormatTest, BreakBeforeClassName) { " ArenaSafeUniquePtr {};"); } +TEST_F(FormatTest, FunctionDeclarationWithKeywords) { + FormatStyle::FunctionDeclarationWithKeywords QPropertyDeclaration; + QPropertyDeclaration.Name = "Q_PROPERTY"; + QPropertyDeclaration.Keywords.push_back("READ"); + QPropertyDeclaration.Keywords.push_back("WRITE"); + QPropertyDeclaration.Keywords.push_back("NOTIFY"); + QPropertyDeclaration.Keywords.push_back("RESET"); + + auto Style40 = getLLVMStyleWithColumns(40); + Style40.FunctionDeclarationsWithKeywords.push_back(QPropertyDeclaration); + Style40.BinPackParameters = FormatStyle::BPPS_OnePerLine; + + verifyFormat( + "Q_PROPERTY(int name\n" + " READ name\n" + " WRITE setName\n" + " NOTIFY nameChanged)", + "Q_PROPERTY(int name READ name WRITE setName NOTIFY nameChanged)", + Style40); ---------------- HazardyKnusperkeks wrote:
```suggestion verifyFormat( "Q_PROPERTY(int name\n" " READ name\n" " WRITE setName\n" " NOTIFY nameChanged)", Style40); ``` `verifyFormat` has different runs, one of them removes all unneeded whitespace and line endings. https://github.com/llvm/llvm-project/pull/131605 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits