[clang] ad183b9 - [Format] Modernize SpaceBeforeParensCustom (NFC)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 27 16:14:01 PDT 2023


Author: Kazu Hirata
Date: 2023-08-27T16:13:47-07:00
New Revision: ad183b927bfc9f0e558c00f1167add3e390b0c91

URL: https://github.com/llvm/llvm-project/commit/ad183b927bfc9f0e558c00f1167add3e390b0c91
DIFF: https://github.com/llvm/llvm-project/commit/ad183b927bfc9f0e558c00f1167add3e390b0c91.diff

LOG: [Format] Modernize SpaceBeforeParensCustom (NFC)

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 eb47715e71ca01..b641b313e32d98 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -4021,35 +4021,35 @@ struct FormatStyle {
     ///    true:                                  false:
     ///    if (...) {}                     vs.    if(...) {}
     /// \endcode
-    bool AfterControlStatements;
+    bool AfterControlStatements = false;
     /// If ``true``, put space between foreach macros and opening parentheses.
     /// \code
     ///    true:                                  false:
     ///    FOREACH (...)                   vs.    FOREACH(...)
     ///      <loop-body>                            <loop-body>
     /// \endcode
-    bool AfterForeachMacros;
+    bool AfterForeachMacros = false;
     /// If ``true``, put a space between function declaration name and opening
     /// parentheses.
     /// \code
     ///    true:                                  false:
     ///    void f ();                      vs.    void f();
     /// \endcode
-    bool AfterFunctionDeclarationName;
+    bool AfterFunctionDeclarationName = false;
     /// If ``true``, put a space between function definition name and opening
     /// parentheses.
     /// \code
     ///    true:                                  false:
     ///    void f () {}                    vs.    void f() {}
     /// \endcode
-    bool AfterFunctionDefinitionName;
+    bool AfterFunctionDefinitionName = false;
     /// If ``true``, put space between if macros and opening parentheses.
     /// \code
     ///    true:                                  false:
     ///    IF (...)                        vs.    IF(...)
     ///      <conditional-body>                     <conditional-body>
     /// \endcode
-    bool AfterIfMacros;
+    bool AfterIfMacros = false;
     /// If ``true``, put a space between operator overloading and opening
     /// parentheses.
     /// \code
@@ -4057,7 +4057,7 @@ struct FormatStyle {
     ///    void operator++ (int a);        vs.    void operator++(int a);
     ///    object.operator++ (10);                object.operator++(10);
     /// \endcode
-    bool AfterOverloadedOperator;
+    bool AfterOverloadedOperator = false;
     /// If ``true``, put space between requires keyword in a requires clause and
     /// opening parentheses, if there is one.
     /// \code
@@ -4066,7 +4066,7 @@ struct FormatStyle {
     ///    requires (A<T> && B<T>)                requires(A<T> && B<T>)
     ///    ...                                    ...
     /// \endcode
-    bool AfterRequiresInClause;
+    bool AfterRequiresInClause = false;
     /// If ``true``, put space between requires keyword in a requires expression
     /// and opening parentheses.
     /// \code
@@ -4076,7 +4076,7 @@ struct FormatStyle {
     ///                  ...                                    ...
     ///                }                                      }
     /// \endcode
-    bool AfterRequiresInExpression;
+    bool AfterRequiresInExpression = false;
     /// If ``true``, put a space before opening parentheses only if the
     /// parentheses are not empty.
     /// \code
@@ -4084,14 +4084,9 @@ struct FormatStyle {
     ///    void f (int a);                 vs.    void f();
     ///    f (a);                                 f();
     /// \endcode
-    bool BeforeNonEmptyParentheses;
+    bool BeforeNonEmptyParentheses = false;
 
-    SpaceBeforeParensCustom()
-        : AfterControlStatements(false), AfterForeachMacros(false),
-          AfterFunctionDeclarationName(false),
-          AfterFunctionDefinitionName(false), AfterIfMacros(false),
-          AfterOverloadedOperator(false), AfterRequiresInClause(false),
-          AfterRequiresInExpression(false), BeforeNonEmptyParentheses(false) {}
+    SpaceBeforeParensCustom() = default;
 
     bool operator==(const SpaceBeforeParensCustom &Other) const {
       return AfterControlStatements == Other.AfterControlStatements &&


        


More information about the cfe-commits mailing list