================
@@ -778,6 +778,48 @@ void BreakableBlockComment::reflow(unsigned LineIndex,
void BreakableBlockComment::adaptStartOfLine(
unsigned LineIndex, WhitespaceManager &Whitespaces) const {
if (LineIndex == 0) {
+ StringRef Text = tokenAt(LineIndex).TokenText;
+ if (Style.SpacesInComments != FormatStyle::SICS_Leave &&
+ Lines.size() == 1 && Text.size() >= 4) {
+ const bool IsDocComment =
+ Text.starts_with("/**") || Text.starts_with("/*!");
+ const bool IsParamComment =
Text.drop_back(2).trim(Blanks).ends_with("=");
+ if (!IsDocComment && !IsParamComment) {
+ StringRef AfterOpening = Text.drop_front(2);
+ if (!AfterOpening.empty()) {
----------------
HazardyKnusperkeks wrote:
```suggestion
if (const StringRef AfterOpening = Text.drop_front(2);
!AfterOpening.empty()) {
```
Same below.
https://github.com/llvm/llvm-project/pull/204727
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits