Repository navigation
Make iOS Color default constructor constexpr (#59060) - #59060
Closed
j-piasecki wants to merge 1 commit into
Closed
j-piasecki wants to merge 1 commit into
j-piasecki wants to merge 1 commit into
Conversation
|
@j-piasecki has exported this pull request. If you are a Meta employee, you can view the originating Diff in D125189249. |
cortinico
approved these changes
Oct 14, 2026
cortinico
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Summary: `UndefinedColor` in the iOS `HostPlatformColor.h` is a namespace-scope `static const Color` built with a non-`constexpr` `Color()`, so every Objective-C++ file that includes the header runs a static initializer before `main`. Make `Color()` `constexpr` (and zero-initialize `uiColorHashValue_`) so it is constant-initialized instead. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D125189249
j-piasecki
force-pushed
the
export-D125189249
branch
from
October 14, 2026 12:05
b169e5d to
6f3ab6d
Compare
|
This pull request has been merged in a443ea4. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
UndefinedColorin the iOSHostPlatformColor.his a namespace-scopestatic const Colorbuilt with a non-constexprColor(), so every Objective-C++ file that includes the header runs a static initializer beforemain. MakeColor()constexpr(and zero-initializeuiColorHashValue_) so it is constant-initialized instead.Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D125189249