Apply the latest clang-format

I ran tools/run_formatter.sh.

Change-Id: I4e37b24f3f3de1c301ea057ace3f8f66e70c3940
Reviewed-on: https://gn-review.googlesource.com/c/gn/+/18361
Reviewed-by: David Turner <digit@google.com>
Commit-Queue: David Turner <digit@google.com>
diff --git a/src/base/json/json_value_converter.h b/src/base/json/json_value_converter.h
index 1adc93d..c7ee3a3 100644
--- a/src/base/json/json_value_converter.h
+++ b/src/base/json/json_value_converter.h
@@ -115,7 +115,7 @@
 class FieldConverter : public FieldConverterBase<StructType> {
  public:
   explicit FieldConverter(const std::string& path,
-                          FieldType StructType::*field,
+                          FieldType StructType::* field,
                           ValueConverter<FieldType>* converter)
       : FieldConverterBase<StructType>(path),
         field_pointer_(field),
@@ -126,7 +126,7 @@
   }
 
  private:
-  FieldType StructType::*field_pointer_;
+  FieldType StructType::* field_pointer_;
   std::unique_ptr<ValueConverter<FieldType>> value_converter_;
   FieldConverter(const FieldConverter&) = delete;
   FieldConverter& operator=(const FieldConverter&) = delete;
@@ -366,21 +366,22 @@
  public:
   JSONValueConverter() { StructType::RegisterJSONConverter(this); }
 
-  void RegisterIntField(const std::string& field_name, int StructType::*field) {
+  void RegisterIntField(const std::string& field_name,
+                        int StructType::* field) {
     fields_.push_back(
         std::make_unique<internal::FieldConverter<StructType, int>>(
             field_name, field, new internal::BasicValueConverter<int>));
   }
 
   void RegisterStringField(const std::string& field_name,
-                           std::string StructType::*field) {
+                           std::string StructType::* field) {
     fields_.push_back(
         std::make_unique<internal::FieldConverter<StructType, std::string>>(
             field_name, field, new internal::BasicValueConverter<std::string>));
   }
 
   void RegisterStringField(const std::string& field_name,
-                           std::u16string StructType::*field) {
+                           std::u16string StructType::* field) {
     fields_.push_back(
         std::make_unique<internal::FieldConverter<StructType, std::u16string>>(
             field_name, field,
@@ -388,14 +389,14 @@
   }
 
   void RegisterBoolField(const std::string& field_name,
-                         bool StructType::*field) {
+                         bool StructType::* field) {
     fields_.push_back(
         std::make_unique<internal::FieldConverter<StructType, bool>>(
             field_name, field, new internal::BasicValueConverter<bool>));
   }
 
   void RegisterDoubleField(const std::string& field_name,
-                           double StructType::*field) {
+                           double StructType::* field) {
     fields_.push_back(
         std::make_unique<internal::FieldConverter<StructType, double>>(
             field_name, field, new internal::BasicValueConverter<double>));
@@ -403,7 +404,7 @@
 
   template <class NestedType>
   void RegisterNestedField(const std::string& field_name,
-                           NestedType StructType::*field) {
+                           NestedType StructType::* field) {
     fields_.push_back(
         std::make_unique<internal::FieldConverter<StructType, NestedType>>(
             field_name, field, new internal::NestedValueConverter<NestedType>));
@@ -411,7 +412,7 @@
 
   template <typename FieldType>
   void RegisterCustomField(const std::string& field_name,
-                           FieldType StructType::*field,
+                           FieldType StructType::* field,
                            bool (*convert_func)(std::string_view, FieldType*)) {
     fields_.push_back(
         std::make_unique<internal::FieldConverter<StructType, FieldType>>(
@@ -421,7 +422,7 @@
 
   template <typename FieldType>
   void RegisterCustomValueField(const std::string& field_name,
-                                FieldType StructType::*field,
+                                FieldType StructType::* field,
                                 bool (*convert_func)(const base::Value*,
                                                      FieldType*)) {
     fields_.push_back(
@@ -432,7 +433,7 @@
 
   void RegisterRepeatedInt(
       const std::string& field_name,
-      std::vector<std::unique_ptr<int>> StructType::*field) {
+      std::vector<std::unique_ptr<int>> StructType::* field) {
     fields_.push_back(std::make_unique<internal::FieldConverter<
                           StructType, std::vector<std::unique_ptr<int>>>>(
         field_name, field, new internal::RepeatedValueConverter<int>));
@@ -440,7 +441,7 @@
 
   void RegisterRepeatedString(
       const std::string& field_name,
-      std::vector<std::unique_ptr<std::string>> StructType::*field) {
+      std::vector<std::unique_ptr<std::string>> StructType::* field) {
     fields_.push_back(
         std::make_unique<internal::FieldConverter<
             StructType, std::vector<std::unique_ptr<std::string>>>>(
@@ -450,7 +451,7 @@
 
   void RegisterRepeatedString(
       const std::string& field_name,
-      std::vector<std::unique_ptr<std::u16string>> StructType::*field) {
+      std::vector<std::unique_ptr<std::u16string>> StructType::* field) {
     fields_.push_back(
         std::make_unique<internal::FieldConverter<
             StructType, std::vector<std::unique_ptr<std::u16string>>>>(
@@ -460,7 +461,7 @@
 
   void RegisterRepeatedDouble(
       const std::string& field_name,
-      std::vector<std::unique_ptr<double>> StructType::*field) {
+      std::vector<std::unique_ptr<double>> StructType::* field) {
     fields_.push_back(std::make_unique<internal::FieldConverter<
                           StructType, std::vector<std::unique_ptr<double>>>>(
         field_name, field, new internal::RepeatedValueConverter<double>));
@@ -468,7 +469,7 @@
 
   void RegisterRepeatedBool(
       const std::string& field_name,
-      std::vector<std::unique_ptr<bool>> StructType::*field) {
+      std::vector<std::unique_ptr<bool>> StructType::* field) {
     fields_.push_back(std::make_unique<internal::FieldConverter<
                           StructType, std::vector<std::unique_ptr<bool>>>>(
         field_name, field, new internal::RepeatedValueConverter<bool>));
@@ -477,7 +478,7 @@
   template <class NestedType>
   void RegisterRepeatedCustomValue(
       const std::string& field_name,
-      std::vector<std::unique_ptr<NestedType>> StructType::*field,
+      std::vector<std::unique_ptr<NestedType>> StructType::* field,
       bool (*convert_func)(const base::Value*, NestedType*)) {
     fields_.push_back(
         std::make_unique<internal::FieldConverter<
@@ -490,7 +491,7 @@
   template <class NestedType>
   void RegisterRepeatedMessage(
       const std::string& field_name,
-      std::vector<std::unique_ptr<NestedType>> StructType::*field) {
+      std::vector<std::unique_ptr<NestedType>> StructType::* field) {
     fields_.push_back(
         std::make_unique<internal::FieldConverter<
             StructType, std::vector<std::unique_ptr<NestedType>>>>(
diff --git a/src/base/numerics/safe_conversions_impl.h b/src/base/numerics/safe_conversions_impl.h
index fd437c4..101e65e 100644
--- a/src/base/numerics/safe_conversions_impl.h
+++ b/src/base/numerics/safe_conversions_impl.h
@@ -275,8 +275,7 @@
 
 template <typename Dst,
           typename Src,
-          template <typename>
-          class Bounds,
+          template <typename> class Bounds,
           IntegerRepresentation DstSign = std::is_signed<Dst>::value
                                               ? INTEGER_REPRESENTATION_SIGNED
                                               : INTEGER_REPRESENTATION_UNSIGNED,
@@ -294,8 +293,7 @@
 // Same sign narrowing: The range is contained for normal limits.
 template <typename Dst,
           typename Src,
-          template <typename>
-          class Bounds,
+          template <typename> class Bounds,
           IntegerRepresentation DstSign,
           IntegerRepresentation SrcSign>
 struct DstRangeRelationToSrcRangeImpl<Dst,
diff --git a/src/base/posix/safe_strerror.cc b/src/base/posix/safe_strerror.cc
index 9084a2f..252b5df 100644
--- a/src/base/posix/safe_strerror.cc
+++ b/src/base/posix/safe_strerror.cc
@@ -39,11 +39,11 @@
 // glibc has two strerror_r functions: a historical GNU-specific one that
 // returns type char *, and a POSIX.1-2001 compliant one available since 2.3.4
 // that returns int. This wraps the GNU-specific one.
-static void POSSIBLY_UNUSED wrap_posix_strerror_r(
-    char* (*strerror_r_ptr)(int, char*, size_t),
-    int err,
-    char* buf,
-    size_t len) {
+static void POSSIBLY_UNUSED
+wrap_posix_strerror_r(char* (*strerror_r_ptr)(int, char*, size_t),
+                      int err,
+                      char* buf,
+                      size_t len) {
   // GNU version.
   char* rc = (*strerror_r_ptr)(err, buf, len);
   if (rc != buf) {
diff --git a/src/gn/escape.h b/src/gn/escape.h
index c46d42d..f536517 100644
--- a/src/gn/escape.h
+++ b/src/gn/escape.h
@@ -6,8 +6,8 @@
 #define TOOLS_GN_ESCAPE_H_
 
 #include <iosfwd>
-#include <string_view>
 #include <string>
+#include <string_view>
 
 enum EscapingMode {
   // No escaping.
diff --git a/src/gn/file_writer.cc b/src/gn/file_writer.cc
index 7f0bb3f..1733ae6 100644
--- a/src/gn/file_writer.cc
+++ b/src/gn/file_writer.cc
@@ -34,9 +34,9 @@
   const std::u16string& path = file_path.value();
 
   file_path_ = base::UTF16ToUTF8(path);
-  file_ = base::win::ScopedHandle(::CreateFile(
-      reinterpret_cast<LPCWSTR>(path.c_str()), GENERIC_WRITE,
-      FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, NULL));
+  file_ = base::win::ScopedHandle(
+      ::CreateFile(reinterpret_cast<LPCWSTR>(path.c_str()), GENERIC_WRITE,
+                   FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, NULL));
 
   valid_ = file_.IsValid();
   if (!valid_) {
@@ -44,10 +44,11 @@
 
     // Determine whether the path need long path support.
     if (path.size() >= MAX_PATH && !IsLongPathsSupportEnabled()) {
-      LOG(ERROR) << "You might need to enable Long Path Support on Windows: "
-        << "https://learn.microsoft.com/en-us/windows/win32/fileio/"
-        "maximum-file-path-limitation?tabs=registry#enable-long-paths"
-        "-in-windows-10-version-1607-and-later";
+      LOG(ERROR)
+          << "You might need to enable Long Path Support on Windows: "
+          << "https://learn.microsoft.com/en-us/windows/win32/fileio/"
+             "maximum-file-path-limitation?tabs=registry#enable-long-paths"
+             "-in-windows-10-version-1607-and-later";
     }
   }
   return valid_;
diff --git a/src/gn/file_writer_unittest.cc b/src/gn/file_writer_unittest.cc
index 16f333d..a7ddf75 100644
--- a/src/gn/file_writer_unittest.cc
+++ b/src/gn/file_writer_unittest.cc
@@ -55,7 +55,8 @@
 
   const std::string data = "Hello World!";
 
-  base::FilePath file_path = temp_dir.GetPath().AppendASCII(std::string(255, 'A'));
+  base::FilePath file_path =
+      temp_dir.GetPath().AppendASCII(std::string(255, 'A'));
 
   EXPECT_GE(file_path.value().size(), MAX_PATH);
 
diff --git a/src/gn/filesystem_utils.cc b/src/gn/filesystem_utils.cc
index 672c7f5..ec1d093 100644
--- a/src/gn/filesystem_utils.cc
+++ b/src/gn/filesystem_utils.cc
@@ -662,8 +662,8 @@
   bool is_start_slash = IsSlash(path[0]);
 
   // 1. /C:/ -> C:/
-  if (path.size() > 3 && is_start_slash &&
-        base::IsAsciiAlpha(path[1]) && path[2] == ':') {
+  if (path.size() > 3 && is_start_slash && base::IsAsciiAlpha(path[1]) &&
+      path[2] == ':') {
     return RegulatePathIfAbsolute(path.substr(1));
   }
 
@@ -684,8 +684,7 @@
 }
 #endif
 
-std::string MakeRelativePath(std::string_view input,
-                             std::string_view dest) {
+std::string MakeRelativePath(std::string_view input, std::string_view dest) {
 #if defined(OS_WIN)
   // Regulate the paths.
   std::string input_regulated = RegulatePathIfAbsolute(input);
diff --git a/src/gn/filesystem_utils_unittest.cc b/src/gn/filesystem_utils_unittest.cc
index 6f5baa3..c1a0ae8 100644
--- a/src/gn/filesystem_utils_unittest.cc
+++ b/src/gn/filesystem_utils_unittest.cc
@@ -546,21 +546,16 @@
 
   // Should be absolute path of destination if the drive letters are
   // different between two paths.
-  EXPECT_EQ("C:/path/to/foo",
-            RebasePath("C:/path/to/foo", SourceDir("//a/b"),
-                       std::string_view("D:/source/root")));
-  EXPECT_EQ("D:/path/to/foo",
-            RebasePath("D:/path/to/foo", SourceDir("//a/b"),
-                       std::string_view("C:/source/root")));
-  EXPECT_EQ("E:/path/to/foo",
-            RebasePath("/E:/path/to/foo", SourceDir("//a/b"),
-                       std::string_view("/c:/source/root")));
-  EXPECT_EQ("E:/path/to/foo",
-            RebasePath("/e:/path/to/foo", SourceDir("//a/b"),
-                       std::string_view("c:/source/root")));
-  EXPECT_EQ("C:/path/to/foo",
-            RebasePath("/c:/path/to/foo", SourceDir("//a/b"),
-                       std::string_view("D:/source/root")));
+  EXPECT_EQ("C:/path/to/foo", RebasePath("C:/path/to/foo", SourceDir("//a/b"),
+                                         std::string_view("D:/source/root")));
+  EXPECT_EQ("D:/path/to/foo", RebasePath("D:/path/to/foo", SourceDir("//a/b"),
+                                         std::string_view("C:/source/root")));
+  EXPECT_EQ("E:/path/to/foo", RebasePath("/E:/path/to/foo", SourceDir("//a/b"),
+                                         std::string_view("/c:/source/root")));
+  EXPECT_EQ("E:/path/to/foo", RebasePath("/e:/path/to/foo", SourceDir("//a/b"),
+                                         std::string_view("c:/source/root")));
+  EXPECT_EQ("C:/path/to/foo", RebasePath("/c:/path/to/foo", SourceDir("//a/b"),
+                                         std::string_view("D:/source/root")));
 #endif
 }
 
diff --git a/src/gn/function_path_exists.cc b/src/gn/function_path_exists.cc
index a858961..a3cb349 100644
--- a/src/gn/function_path_exists.cc
+++ b/src/gn/function_path_exists.cc
@@ -38,13 +38,11 @@
   if (as_dir) {
     system_path = scope->settings()->build_settings()->GetFullPath(
         cur_dir.ResolveRelativeDir(
-            value, err,
-            scope->settings()->build_settings()->root_path_utf8()));
+            value, err, scope->settings()->build_settings()->root_path_utf8()));
   } else {
     system_path = scope->settings()->build_settings()->GetFullPath(
         cur_dir.ResolveRelativeFile(
-            value, err,
-            scope->settings()->build_settings()->root_path_utf8()));
+            value, err, scope->settings()->build_settings()->root_path_utf8()));
   }
   if (err->has_error()) {
     return value;
diff --git a/src/gn/function_path_exists_unittest.cc b/src/gn/function_path_exists_unittest.cc
index 516f551..402f5dd 100644
--- a/src/gn/function_path_exists_unittest.cc
+++ b/src/gn/function_path_exists_unittest.cc
@@ -20,7 +20,7 @@
   EXPECT_FALSE(err.has_error());
   return !err.has_error() && result.boolean_value();
 }
-} // namespace
+}  // namespace
 
 TEST(PathExistsTest, FileExists) {
   TestWithScope setup;
@@ -84,4 +84,3 @@
     EXPECT_TRUE(err.has_error());
   }
 }
-
diff --git a/src/gn/functions.h b/src/gn/functions.h
index 5d8fdac..59325ec 100644
--- a/src/gn/functions.h
+++ b/src/gn/functions.h
@@ -166,17 +166,17 @@
 extern const char kFilterLabelsInclude_HelpShort[];
 extern const char kFilterLabelsInclude_Help[];
 Value RunFilterLabelsInclude(Scope* scope,
-                      const FunctionCallNode* function,
-                      const std::vector<Value>& args,
-                      Err* err);
+                             const FunctionCallNode* function,
+                             const std::vector<Value>& args,
+                             Err* err);
 
 extern const char kFilterLabelsExclude[];
 extern const char kFilterLabelsExclude_HelpShort[];
 extern const char kFilterLabelsExclude_Help[];
 Value RunFilterLabelsExclude(Scope* scope,
-                      const FunctionCallNode* function,
-                      const std::vector<Value>& args,
-                      Err* err);
+                             const FunctionCallNode* function,
+                             const std::vector<Value>& args,
+                             Err* err);
 
 extern const char kForEach[];
 extern const char kForEach_HelpShort[];
diff --git a/src/gn/functions_target.cc b/src/gn/functions_target.cc
index df43109..b12150f 100644
--- a/src/gn/functions_target.cc
+++ b/src/gn/functions_target.cc
@@ -172,7 +172,8 @@
     R"(
 Variables
 
-)" CONFIG_VALUES_VARS_HELP DEPENDENT_CONFIG_VARS DEPS_VARS GENERAL_TARGET_VARS ACTION_VARS
+)" CONFIG_VALUES_VARS_HELP DEPENDENT_CONFIG_VARS DEPS_VARS
+        GENERAL_TARGET_VARS ACTION_VARS
 
     R"(  * = required
 
@@ -242,7 +243,8 @@
     R"(
 Variables
 
-)" CONFIG_VALUES_VARS_HELP DEPENDENT_CONFIG_VARS DEPS_VARS GENERAL_TARGET_VARS ACTION_VARS
+)" CONFIG_VALUES_VARS_HELP DEPENDENT_CONFIG_VARS DEPS_VARS
+        GENERAL_TARGET_VARS ACTION_VARS
 
     R"(  * = required
 
@@ -857,8 +859,8 @@
 Variables
 
   complete_static_lib
-)" CONFIG_VALUES_VARS_HELP DEPS_VARS DEPENDENT_CONFIG_VARS GENERAL_TARGET_VARS RUST_VARS
-        LANGUAGE_HELP;
+)" CONFIG_VALUES_VARS_HELP DEPS_VARS DEPENDENT_CONFIG_VARS GENERAL_TARGET_VARS
+        RUST_VARS LANGUAGE_HELP;
 
 Value RunStaticLibrary(Scope* scope,
                        const FunctionCallNode* function,
diff --git a/src/gn/header_checker.cc b/src/gn/header_checker.cc
index 9978a88..705b892 100644
--- a/src/gn/header_checker.cc
+++ b/src/gn/header_checker.cc
@@ -654,8 +654,9 @@
       1)
     msg += "at least one of ";
   msg += "which should somehow be reachable.\n";
-  msg += "This might be a false alarm if you are using conditional include. "
-         "See \"gn help nogncheck\".";
+  msg +=
+      "This might be a false alarm if you are using conditional include. "
+      "See \"gn help nogncheck\".";
 
   // Danger: must call CreatePersistentRange to put in Err.
   return Err(CreatePersistentRange(source_file, range), "Include not allowed.",
diff --git a/src/gn/ninja_c_binary_target_writer.cc b/src/gn/ninja_c_binary_target_writer.cc
index 96907f7..b3a4f2c 100644
--- a/src/gn/ninja_c_binary_target_writer.cc
+++ b/src/gn/ninja_c_binary_target_writer.cc
@@ -525,8 +525,9 @@
 
   for (const Target* swiftmodule :
        resolved().GetSwiftModuleDependencies(target_)) {
-      CHECK(swiftmodule->has_dependency_output()); {
-    swift_order_only_deps.push_back(swiftmodule->dependency_output());
+    CHECK(swiftmodule->has_dependency_output());
+    {
+      swift_order_only_deps.push_back(swiftmodule->dependency_output());
     }
   }
 
diff --git a/src/gn/rust_variables.cc b/src/gn/rust_variables.cc
index 7474286..b208aab 100644
--- a/src/gn/rust_variables.cc
+++ b/src/gn/rust_variables.cc
@@ -99,7 +99,7 @@
 const char kRustflags_HelpShort[] =
     "rustflags: [string list] Flags passed to the Rust compiler.";
 const char kRustflags_Help[] =
-      R"(rustflags: Flags passed to the Rust compiler.
+    R"(rustflags: Flags passed to the Rust compiler.
 
   A list of strings.
 
@@ -120,8 +120,7 @@
       kRustCrateRoot,
       VariableInfo(kRustCrateRoot_HelpShort, kRustCrateRoot_Help)));
   info_map->insert(std::make_pair(
-      kRustflags,
-      VariableInfo(kRustflags_HelpShort, kRustflags_Help)));
+      kRustflags, VariableInfo(kRustflags_HelpShort, kRustflags_Help)));
 }
 
 }  // namespace variables
diff --git a/src/gn/scope_unittest.cc b/src/gn/scope_unittest.cc
index c16cb3a..c4b966f 100644
--- a/src/gn/scope_unittest.cc
+++ b/src/gn/scope_unittest.cc
@@ -27,7 +27,8 @@
 bool ContainsBuildDependencyFile(const Scope* scope,
                                  const SourceFile& source_file) {
   const auto& build_dependency_files = scope->CollectBuildDependencyFiles();
-  return build_dependency_files.find(source_file) != build_dependency_files.end();
+  return build_dependency_files.find(source_file) !=
+         build_dependency_files.end();
 }
 
 }  // namespace
diff --git a/src/gn/setup.cc b/src/gn/setup.cc
index 912f378..f9c6dfe 100644
--- a/src/gn/setup.cc
+++ b/src/gn/setup.cc
@@ -1100,7 +1100,7 @@
   if (!exec_script_allowlist_value) {
     // Check for this value as well, for backwards-compatibility.
     exec_script_allowlist_value =
-      dotfile_scope_.GetValue("exec_script_whitelist", true);
+        dotfile_scope_.GetValue("exec_script_whitelist", true);
   }
 
   if (exec_script_allowlist_value) {
diff --git a/src/gn/variables.cc b/src/gn/variables.cc
index 200de32..230427c 100644
--- a/src/gn/variables.cc
+++ b/src/gn/variables.cc
@@ -1469,7 +1469,8 @@
   Specifies additional directories passed to the linker for searching for the
   required libraries. If an item is not an absolute path, it will be treated as
   being relative to the current build file.
-)" COMMON_LIB_INHERITANCE_HELP COMMON_ORDERING_HELP LIBS_AND_LIB_DIRS_ORDERING_HELP
+)" COMMON_LIB_INHERITANCE_HELP
+        COMMON_ORDERING_HELP LIBS_AND_LIB_DIRS_ORDERING_HELP
     R"(
 Example
 
diff --git a/src/gn/xml_element_writer_unittest.cc b/src/gn/xml_element_writer_unittest.cc
index 6a4cfed..4ac6a85 100644
--- a/src/gn/xml_element_writer_unittest.cc
+++ b/src/gn/xml_element_writer_unittest.cc
@@ -23,7 +23,9 @@
 
 TEST(XmlElementWriter, EmptyElement) {
   std::ostringstream out;
-  { XmlElementWriter writer(out, "foo", XmlAttributes()); }
+  {
+    XmlElementWriter writer(out, "foo", XmlAttributes());
+  }
   EXPECT_EQ("<foo />\n", out.str());
 
   std::ostringstream out_attr;
diff --git a/src/util/sys_info.cc b/src/util/sys_info.cc
index 20bbdf7..cc75c45 100644
--- a/src/util/sys_info.cc
+++ b/src/util/sys_info.cc
@@ -35,7 +35,8 @@
 
       // If the ntdll approach failed, the registry approach is still reliable,
       // because the manifest should've always be linked with gn.exe in Windows.
-      const char16_t key_name[] = uR"(SYSTEM\CurrentControlSet\Control\FileSystem)";
+      const char16_t key_name[] =
+          uR"(SYSTEM\CurrentControlSet\Control\FileSystem)";
       const char16_t value_name[] = u"LongPathsEnabled";
 
       base::win::RegKey key(HKEY_LOCAL_MACHINE, key_name, KEY_READ);