[clang] 4146b30 - Revert "[Format] Modernize SpaceBeforeParensCustom (NFC)"
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 5 12:04:13 PDT 2023
Author: Owen Pan
Date: 2023-09-05T12:03:14-07:00
New Revision: 4146b30785fb5db6fa4da47e6198f7bd961559c5
URL: https://github.com/llvm/llvm-project/commit/4146b30785fb5db6fa4da47e6198f7bd961559c5
DIFF: https://github.com/llvm/llvm-project/commit/4146b30785fb5db6fa4da47e6198f7bd961559c5.diff
LOG: Revert "[Format] Modernize SpaceBeforeParensCustom (NFC)"
This reverts commit ad183b927bfc which seems to break
clang/docs/tools/dump_format_style.py.
Added:
Modified:
clang/include/clang/Format/Format.h
Removed:
################################################################################
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index 3b30ee9b44e759..7ebde3c174d264 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -4050,35 +4050,35 @@ 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
@@ -4086,7 +4086,7 @@ struct FormatStyle {
/// 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
@@ -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
@@ -4105,7 +4105,7 @@ struct FormatStyle {
/// ... ...
/// } }
/// \endcode
- bool AfterRequiresInExpression = false;
+ bool AfterRequiresInExpression;
/// If ``true``, put a space before opening parentheses only if the
/// parentheses are not empty.
/// \code
@@ -4113,9 +4113,14 @@ struct FormatStyle {
/// 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 &&
More information about the cfe-commits
mailing list