From 20be015b9374aeebef54b80db4cb7de5b1c8b997 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 5 Dec 2023 12:08:51 -0800 Subject: [PATCH] Avoid non-const sizes in VLAs. I was shocked this was even legal earlier. But a new Clang roll makes this an a warning which gets converted into an error. I attempted to roll to the Clang roll the roller did and fixed the issues I found. Hopefully, the next roll is unblocked. Original failure: https://github.com/flutter/engine/pull/48563 --- .../ios/framework/Source/FlutterPlatformViews_Internal.mm | 4 ++-- .../accessibility/ax/platform/ax_unique_id_unittest.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm index e84b5746d167f..ced139de2c9c1 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.mm @@ -8,8 +8,8 @@ #include "flutter/fml/platform/darwin/cf_utils.h" #import "flutter/shell/platform/darwin/ios/ios_surface.h" -static int kMaxPointsInVerb = 4; -static const NSUInteger kFlutterClippingMaskViewPoolCapacity = 5; +static constexpr int kMaxPointsInVerb = 4; +static constexpr NSUInteger kFlutterClippingMaskViewPoolCapacity = 5; namespace flutter { diff --git a/third_party/accessibility/ax/platform/ax_unique_id_unittest.cc b/third_party/accessibility/ax/platform/ax_unique_id_unittest.cc index 5f62ad3d115f7..d6e791ffc7d56 100644 --- a/third_party/accessibility/ax/platform/ax_unique_id_unittest.cc +++ b/third_party/accessibility/ax/platform/ax_unique_id_unittest.cc @@ -54,7 +54,7 @@ TEST(AXPlatformUniqueIdTest, UnassignedIdsAreReused) { } TEST(AXPlatformUniqueIdTest, DoesCreateCorrectId) { - int kLargerThanMaxId = kMaxId * 2; + constexpr int kLargerThanMaxId = kMaxId * 2; std::unique_ptr ids[kLargerThanMaxId]; // Creates and releases to fill up the internal static counter. for (int i = 0; i < kLargerThanMaxId; i++) {