================ @@ -20029,6 +20029,52 @@ TEST_F(FormatTest, AlignConsecutiveDeclarations) { Alignment); } +TEST_F(FormatTest, AlignConsecutiveDeclarationsBlockComments) { + FormatStyle Style = getLLVMStyleWithColumns(80); + Style.AlignConsecutiveDeclarations.Enabled = true; + Style.AlignConsecutiveDeclarations.AlignBlockComments = true; + Style.BinPackParameters = FormatStyle::BPPS_OnePerLine; + Style.BinPackArguments = false; + + verifyFormat( + "bool SomeLongMethodName(int longParameterNameA,\n" + " bool /*longParameterNameB*/,\n" + " const std::string &longParameterNameC);", + "bool SomeLongMethodName(int longParameterNameA,\n" + " bool /*longParameterNameB*/,\n" + " const std::string &longParameterNameC);", + Style); + + verifyFormat( + "const bool ret = SomeLongMethodName(4 /*parameterNameA*/,\n" + " true /*longParameterNameB*/,\n" + " str /*longestParameterNameC*/);", ---------------- JessehMSFT wrote:
Thanks @owenca , did you have a suggestion? I thought mostly the argument alignment would follow the declaration parameter alignment for consistency. https://github.com/llvm/llvm-project/pull/109497 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits