Skip to content

[clang-format][NFC] Remove \brief from comments #145853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions clang/docs/ClangFormatStyleOptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1702,9 +1702,9 @@ the configuration (without a prefix: ``Auto``).
.. _AllowAllArgumentsOnNextLine:

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

.. code-block:: c++

Expand Down Expand Up @@ -5528,8 +5528,7 @@ the configuration (without a prefix: ``Auto``).
.. _ReferenceAlignment:

**ReferenceAlignment** (``ReferenceAlignmentStyle``) :versionbadge:`clang-format 13` :ref:`¶ <ReferenceAlignment>`
Reference alignment style (overrides ``PointerAlignment`` for
references).
Reference alignment style (overrides ``PointerAlignment`` for references).

Possible values:

Expand Down Expand Up @@ -6885,8 +6884,8 @@ the configuration (without a prefix: ``Auto``).
.. _TypenameMacros:

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

These are expected to be macros of the form:

Expand Down
28 changes: 13 additions & 15 deletions clang/include/clang/Format/Format.h
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,9 @@ struct FormatStyle {
/// \version 3.7
TrailingCommentsAlignmentStyle AlignTrailingComments;

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

/// \brief The ``&`` and ``&&`` alignment style.
/// The ``&`` and ``&&`` alignment style.
enum ReferenceAlignmentStyle : int8_t {
/// Align reference like ``PointerAlignment``.
RAS_Pointer,
Expand All @@ -3977,13 +3977,12 @@ struct FormatStyle {
RAS_Middle
};

/// \brief Reference alignment style (overrides ``PointerAlignment`` for
/// references).
/// Reference alignment style (overrides ``PointerAlignment`` for references).
/// \version 13
ReferenceAlignmentStyle ReferenceAlignment;

// clang-format off
/// \brief Types of comment reflow style.
/// Types of comment reflow style.
enum ReflowCommentsStyle : int8_t {
/// Leave comments untouched.
/// \code
Expand Down Expand Up @@ -4016,7 +4015,7 @@ struct FormatStyle {
};
// clang-format on

/// \brief Comment reformatting style.
/// Comment reformatting style.
/// \version 3.8
ReflowCommentsStyle ReflowComments;

Expand Down Expand Up @@ -4151,9 +4150,8 @@ struct FormatStyle {
/// \version 16
bool RemoveSemicolon;

/// \brief The possible positions for the requires clause. The
/// ``IndentRequires`` option is only used if the ``requires`` is put on the
/// start of a line.
/// The possible positions for the requires clause. The ``IndentRequires``
/// option is only used if the ``requires`` is put on the start of a line.
enum RequiresClausePositionStyle : int8_t {
/// Always put the ``requires`` clause on its own line (possibly followed by
/// a semicolon).
Expand Down Expand Up @@ -4251,7 +4249,7 @@ struct FormatStyle {
RCPS_SingleLine,
};

/// \brief The position of the ``requires`` clause.
/// The position of the ``requires`` clause.
/// \version 15
RequiresClausePositionStyle RequiresClausePosition;

Expand Down Expand Up @@ -4281,7 +4279,7 @@ struct FormatStyle {
/// \version 16
RequiresExpressionIndentationKind RequiresExpressionIndentation;

/// \brief The style if definition blocks should be separated.
/// The style if definition blocks should be separated.
enum SeparateDefinitionStyle : int8_t {
/// Leave definition blocks as they are.
SDS_Leave,
Expand Down Expand Up @@ -5188,8 +5186,8 @@ struct FormatStyle {
/// \version 17
std::vector<std::string> TypeNames;

/// \brief A vector of macros that should be interpreted as type declarations
/// instead of as function calls.
/// A vector of macros that should be interpreted as type declarations instead
/// of as function calls.
///
/// These are expected to be macros of the form:
/// \code
Expand Down
15 changes: 7 additions & 8 deletions clang/lib/Format/ContinuationIndenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ struct ParenState {
IsChainedConditional(false), IsWrappedConditional(false),
UnindentOperator(false) {}

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

bool IsCSharpGenericTypeConstraint : 1;

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

/// \brief true if there conditionnal was wrapped on the first operator (the
/// question mark)
/// true if there conditionnal was wrapped on the first operator (the question
/// mark)
bool IsWrappedConditional : 1;

/// \brief Indicates the indent should be reduced by the length of the
/// operator.
/// Indicates the indent should be reduced by the length of the operator.
bool UnindentOperator : 1;

bool operator<(const ParenState &Other) const {
Expand Down
12 changes: 6 additions & 6 deletions clang/lib/Format/UnwrappedLineParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ bool UnwrappedLineParser::precededByCommentOrPPDirective() const {
(Previous->IsMultiline || Previous->NewlinesBefore > 0);
}

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

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

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

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

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

/// \brief Parses a constraint expression.
/// Parses a constraint expression.
///
/// This is the body of a requires clause. It returns, when the parsing is
/// complete, or the expression is incorrect.
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Format/WhitespaceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class WhitespaceManager {
/// \c EscapedNewlineColumn for the first tokens or token parts in a line.
void calculateLineBreakInformation();

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

/// Align consecutive assignments over all \c Changes.
Expand Down
2 changes: 1 addition & 1 deletion clang/unittests/Format/FormatTestBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class FormatTestBase : public testing::Test {
_verifyFormat(File, Line, Code, Code, Style);
}

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