Skip to content

Make iOS Color default constructor constexpr (#59060) - #59060

Closed
j-piasecki wants to merge 1 commit into
react:mainfrom
j-piasecki:export-D125189249
Closed

j-piasecki wants to merge 1 commit into
react:mainfrom
j-piasecki:export-D125189249

Conversation

@j-piasecki

@j-piasecki j-piasecki commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 14, 2026
@facebook-github-tools facebook-github-tools Bot added p: Software Mansion Partner: Software Mansion Partner labels Oct 14, 2026
@meta-codesync

meta-codesync Bot commented Oct 14, 2026

Copy link
Copy Markdown

@j-piasecki has exported this pull request. If you are a Meta employee, you can view the originating Diff in D125189249.

@facebook-github-tools facebook-github-tools Bot added the p: Facebook Partner: Facebook label Oct 14, 2026

@cortinico cortinico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@meta-codesync meta-codesync Bot changed the title Make iOS Color default constructor constexpr Make iOS Color default constructor constexpr (#59060) Oct 14, 2026
@meta-codesync meta-codesync Bot closed this in a443ea4 Oct 14, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Oct 14, 2026
@meta-codesync

meta-codesync Bot commented Oct 14, 2026

Copy link
Copy Markdown

This pull request has been merged in a443ea4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants