Skip to content

Commit f2f17e5

Browse files
authored
[clang-format][NFC] Remove \brief from comments (#145853)
This was done before in https://reviews.llvm.org/D46320
1 parent ad6b597 commit f2f17e5

File tree

6 files changed

+34
-38
lines changed

6 files changed

+34
-38
lines changed

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,9 +1702,9 @@ the configuration (without a prefix: ``Auto``).
17021702
.. _AllowAllArgumentsOnNextLine:
17031703

17041704
**AllowAllArgumentsOnNextLine** (``Boolean``) :versionbadge:`clang-format 9` :ref:`<AllowAllArgumentsOnNextLine>`
1705-
If a function call or braced initializer list doesn't fit on a
1706-
line, allow putting all arguments onto the next line, even if
1707-
``BinPackArguments`` is ``false``.
1705+
If a function call or braced initializer list doesn't fit on a line, allow
1706+
putting all arguments onto the next line, even if ``BinPackArguments`` is
1707+
``false``.
17081708

17091709
.. code-block:: c++
17101710

@@ -5528,8 +5528,7 @@ the configuration (without a prefix: ``Auto``).
55285528
.. _ReferenceAlignment:
55295529

55305530
**ReferenceAlignment** (``ReferenceAlignmentStyle``) :versionbadge:`clang-format 13` :ref:`<ReferenceAlignment>`
5531-
Reference alignment style (overrides ``PointerAlignment`` for
5532-
references).
5531+
Reference alignment style (overrides ``PointerAlignment`` for references).
55335532

55345533
Possible values:
55355534

@@ -6885,8 +6884,8 @@ the configuration (without a prefix: ``Auto``).
68856884
.. _TypenameMacros:
68866885

68876886
**TypenameMacros** (``List of Strings``) :versionbadge:`clang-format 9` :ref:`<TypenameMacros>`
6888-
A vector of macros that should be interpreted as type declarations
6889-
instead of as function calls.
6887+
A vector of macros that should be interpreted as type declarations instead
6888+
of as function calls.
68906889

68916890
These are expected to be macros of the form:
68926891

clang/include/clang/Format/Format.h

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -651,9 +651,9 @@ struct FormatStyle {
651651
/// \version 3.7
652652
TrailingCommentsAlignmentStyle AlignTrailingComments;
653653

654-
/// \brief If a function call or braced initializer list doesn't fit on a
655-
/// line, allow putting all arguments onto the next line, even if
656-
/// ``BinPackArguments`` is ``false``.
654+
/// If a function call or braced initializer list doesn't fit on a line, allow
655+
/// putting all arguments onto the next line, even if ``BinPackArguments`` is
656+
/// ``false``.
657657
/// \code
658658
/// true:
659659
/// callFunction(
@@ -3956,7 +3956,7 @@ struct FormatStyle {
39563956
/// \version 6
39573957
std::vector<RawStringFormat> RawStringFormats;
39583958

3959-
/// \brief The ``&`` and ``&&`` alignment style.
3959+
/// The ``&`` and ``&&`` alignment style.
39603960
enum ReferenceAlignmentStyle : int8_t {
39613961
/// Align reference like ``PointerAlignment``.
39623962
RAS_Pointer,
@@ -3977,13 +3977,12 @@ struct FormatStyle {
39773977
RAS_Middle
39783978
};
39793979

3980-
/// \brief Reference alignment style (overrides ``PointerAlignment`` for
3981-
/// references).
3980+
/// Reference alignment style (overrides ``PointerAlignment`` for references).
39823981
/// \version 13
39833982
ReferenceAlignmentStyle ReferenceAlignment;
39843983

39853984
// clang-format off
3986-
/// \brief Types of comment reflow style.
3985+
/// Types of comment reflow style.
39873986
enum ReflowCommentsStyle : int8_t {
39883987
/// Leave comments untouched.
39893988
/// \code
@@ -4016,7 +4015,7 @@ struct FormatStyle {
40164015
};
40174016
// clang-format on
40184017

4019-
/// \brief Comment reformatting style.
4018+
/// Comment reformatting style.
40204019
/// \version 3.8
40214020
ReflowCommentsStyle ReflowComments;
40224021

@@ -4151,9 +4150,8 @@ struct FormatStyle {
41514150
/// \version 16
41524151
bool RemoveSemicolon;
41534152

4154-
/// \brief The possible positions for the requires clause. The
4155-
/// ``IndentRequires`` option is only used if the ``requires`` is put on the
4156-
/// start of a line.
4153+
/// The possible positions for the requires clause. The ``IndentRequires``
4154+
/// option is only used if the ``requires`` is put on the start of a line.
41574155
enum RequiresClausePositionStyle : int8_t {
41584156
/// Always put the ``requires`` clause on its own line (possibly followed by
41594157
/// a semicolon).
@@ -4251,7 +4249,7 @@ struct FormatStyle {
42514249
RCPS_SingleLine,
42524250
};
42534251

4254-
/// \brief The position of the ``requires`` clause.
4252+
/// The position of the ``requires`` clause.
42554253
/// \version 15
42564254
RequiresClausePositionStyle RequiresClausePosition;
42574255

@@ -4281,7 +4279,7 @@ struct FormatStyle {
42814279
/// \version 16
42824280
RequiresExpressionIndentationKind RequiresExpressionIndentation;
42834281

4284-
/// \brief The style if definition blocks should be separated.
4282+
/// The style if definition blocks should be separated.
42854283
enum SeparateDefinitionStyle : int8_t {
42864284
/// Leave definition blocks as they are.
42874285
SDS_Leave,
@@ -5188,8 +5186,8 @@ struct FormatStyle {
51885186
/// \version 17
51895187
std::vector<std::string> TypeNames;
51905188

5191-
/// \brief A vector of macros that should be interpreted as type declarations
5192-
/// instead of as function calls.
5189+
/// A vector of macros that should be interpreted as type declarations instead
5190+
/// of as function calls.
51935191
///
51945192
/// These are expected to be macros of the form:
51955193
/// \code

clang/lib/Format/ContinuationIndenter.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ struct ParenState {
210210
IsChainedConditional(false), IsWrappedConditional(false),
211211
UnindentOperator(false) {}
212212

213-
/// \brief The token opening this parenthesis level, or nullptr if this level
214-
/// is opened by fake parenthesis.
213+
/// The token opening this parenthesis level, or nullptr if this level is
214+
/// opened by fake parenthesis.
215215
///
216216
/// Not considered for memoization as it will always have the same value at
217217
/// the same token.
@@ -344,16 +344,15 @@ struct ParenState {
344344

345345
bool IsCSharpGenericTypeConstraint : 1;
346346

347-
/// \brief true if the current \c ParenState represents the false branch of
348-
/// a chained conditional expression (e.g. else-if)
347+
/// true if the current \c ParenState represents the false branch of a chained
348+
/// conditional expression (e.g. else-if)
349349
bool IsChainedConditional : 1;
350350

351-
/// \brief true if there conditionnal was wrapped on the first operator (the
352-
/// question mark)
351+
/// true if there conditionnal was wrapped on the first operator (the question
352+
/// mark)
353353
bool IsWrappedConditional : 1;
354354

355-
/// \brief Indicates the indent should be reduced by the length of the
356-
/// operator.
355+
/// Indicates the indent should be reduced by the length of the operator.
357356
bool UnindentOperator : 1;
358357

359358
bool operator<(const ParenState &Other) const {

clang/lib/Format/UnwrappedLineParser.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ bool UnwrappedLineParser::precededByCommentOrPPDirective() const {
340340
(Previous->IsMultiline || Previous->NewlinesBefore > 0);
341341
}
342342

343-
/// \brief Parses a level, that is ???.
343+
/// Parses a level, that is ???.
344344
/// \param OpeningBrace Opening brace (\p nullptr if absent) of that level.
345345
/// \param IfKind The \p if statement kind in the level.
346346
/// \param IfLeftBrace The left brace of the \p if block in the level.
@@ -2574,7 +2574,7 @@ bool UnwrappedLineParser::parseBracedList(bool IsAngleBracket, bool IsEnum) {
25742574
return false;
25752575
}
25762576

2577-
/// \brief Parses a pair of parentheses (and everything between them).
2577+
/// Parses a pair of parentheses (and everything between them).
25782578
/// \param AmpAmpTokenType If different than TT_Unknown sets this type for all
25792579
/// double ampersands. This applies for all nested scopes as well.
25802580
///
@@ -3438,7 +3438,7 @@ void UnwrappedLineParser::parseAccessSpecifier() {
34383438
addUnwrappedLine();
34393439
}
34403440

3441-
/// \brief Parses a requires, decides if it is a clause or an expression.
3441+
/// Parses a requires, decides if it is a clause or an expression.
34423442
/// \pre The current token has to be the requires keyword.
34433443
/// \returns true if it parsed a clause.
34443444
bool UnwrappedLineParser::parseRequires(bool SeenEqual) {
@@ -3582,7 +3582,7 @@ bool UnwrappedLineParser::parseRequires(bool SeenEqual) {
35823582
return true;
35833583
}
35843584

3585-
/// \brief Parses a requires clause.
3585+
/// Parses a requires clause.
35863586
/// \param RequiresToken The requires keyword token, which starts this clause.
35873587
/// \pre We need to be on the next token after the requires keyword.
35883588
/// \sa parseRequiresExpression
@@ -3612,7 +3612,7 @@ void UnwrappedLineParser::parseRequiresClause(FormatToken *RequiresToken) {
36123612
FormatTok->Previous->ClosesRequiresClause = true;
36133613
}
36143614

3615-
/// \brief Parses a requires expression.
3615+
/// Parses a requires expression.
36163616
/// \param RequiresToken The requires keyword token, which starts this clause.
36173617
/// \pre We need to be on the next token after the requires keyword.
36183618
/// \sa parseRequiresClause
@@ -3636,7 +3636,7 @@ void UnwrappedLineParser::parseRequiresExpression(FormatToken *RequiresToken) {
36363636
}
36373637
}
36383638

3639-
/// \brief Parses a constraint expression.
3639+
/// Parses a constraint expression.
36403640
///
36413641
/// This is the body of a requires clause. It returns, when the parsing is
36423642
/// complete, or the expression is incorrect.

clang/lib/Format/WhitespaceManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class WhitespaceManager {
212212
/// \c EscapedNewlineColumn for the first tokens or token parts in a line.
213213
void calculateLineBreakInformation();
214214

215-
/// \brief Align consecutive C/C++ preprocessor macros over all \c Changes.
215+
/// Align consecutive C/C++ preprocessor macros over all \c Changes.
216216
void alignConsecutiveMacros();
217217

218218
/// Align consecutive assignments over all \c Changes.

clang/unittests/Format/FormatTestBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class FormatTestBase : public testing::Test {
137137
_verifyFormat(File, Line, Code, Code, Style);
138138
}
139139

140-
/// \brief Verify that clang-format does not crash on the given input.
140+
/// Verify that clang-format does not crash on the given input.
141141
void verifyNoCrash(StringRef Code,
142142
const std::optional<FormatStyle> &Style = {}) {
143143
format(Code, Style, SC_DoNotCheck);

0 commit comments

Comments
 (0)