Skip to content

Commit

Permalink
Revert "[Format] Modernize SpaceBeforeParensCustom (NFC)"
Browse files Browse the repository at this point in the history
This reverts commit ad183b9 which seems to break
clang/docs/tools/dump_format_style.py.
  • Loading branch information
owenca committed Sep 5, 2023
1 parent c8544d2 commit 4146b30
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions clang/include/clang/Format/Format.h
Original file line number Diff line number Diff line change
Expand Up @@ -4050,43 +4050,43 @@ struct FormatStyle {
/// true: false:
/// if (...) {} vs. if(...) {}
/// \endcode
bool AfterControlStatements = false;
bool AfterControlStatements;
/// If ``true``, put space between foreach macros and opening parentheses.
/// \code
/// true: false:
/// FOREACH (...) vs. FOREACH(...)
/// <loop-body> <loop-body>
/// \endcode
bool AfterForeachMacros = false;
bool AfterForeachMacros;
/// If ``true``, put a space between function declaration name and opening
/// parentheses.
/// \code
/// true: false:
/// void f (); vs. void f();
/// \endcode
bool AfterFunctionDeclarationName = false;
bool AfterFunctionDeclarationName;
/// If ``true``, put a space between function definition name and opening
/// parentheses.
/// \code
/// true: false:
/// void f () {} vs. void f() {}
/// \endcode
bool AfterFunctionDefinitionName = false;
bool AfterFunctionDefinitionName;
/// If ``true``, put space between if macros and opening parentheses.
/// \code
/// true: false:
/// IF (...) vs. IF(...)
/// <conditional-body> <conditional-body>
/// \endcode
bool AfterIfMacros = false;
bool AfterIfMacros;
/// If ``true``, put a space between operator overloading and opening
/// parentheses.
/// \code
/// true: false:
/// void operator++ (int a); vs. void operator++(int a);
/// object.operator++ (10); object.operator++(10);
/// \endcode
bool AfterOverloadedOperator = false;
bool AfterOverloadedOperator;
/// If ``true``, put space between requires keyword in a requires clause and
/// opening parentheses, if there is one.
/// \code
Expand All @@ -4095,7 +4095,7 @@ struct FormatStyle {
/// requires (A<T> && B<T>) requires(A<T> && B<T>)
/// ... ...
/// \endcode
bool AfterRequiresInClause = false;
bool AfterRequiresInClause;
/// If ``true``, put space between requires keyword in a requires expression
/// and opening parentheses.
/// \code
Expand All @@ -4105,17 +4105,22 @@ struct FormatStyle {
/// ... ...
/// } }
/// \endcode
bool AfterRequiresInExpression = false;
bool AfterRequiresInExpression;
/// If ``true``, put a space before opening parentheses only if the
/// parentheses are not empty.
/// \code
/// true: false:
/// void f (int a); vs. void f();
/// f (a); f();
/// \endcode
bool BeforeNonEmptyParentheses = false;
bool BeforeNonEmptyParentheses;

SpaceBeforeParensCustom() = default;
SpaceBeforeParensCustom()
: AfterControlStatements(false), AfterForeachMacros(false),
AfterFunctionDeclarationName(false),
AfterFunctionDefinitionName(false), AfterIfMacros(false),
AfterOverloadedOperator(false), AfterRequiresInClause(false),
AfterRequiresInExpression(false), BeforeNonEmptyParentheses(false) {}

bool operator==(const SpaceBeforeParensCustom &Other) const {
return AfterControlStatements == Other.AfterControlStatements &&
Expand Down

0 comments on commit 4146b30

Please sign in to comment.