Skip to content

Add missing <optional> include#337

Merged
yhirose merged 1 commit intoyhirose:masterfrom
chenrui333:fix-missing-optional-include
Mar 13, 2026
Merged

Add missing <optional> include#337
yhirose merged 1 commit intoyhirose:masterfrom
chenrui333:fix-missing-optional-include

Conversation

@chenrui333
Copy link
Copy Markdown
Contributor

@chenrui333 chenrui333 commented Mar 12, 2026

Adds the missing <optional> include to peglib.h.

Ref: Homebrew/homebrew-core#271855

Signed-off-by: Rui Chen <rui@chenrui.dev>
@yhirose
Copy link
Copy Markdown
Owner

yhirose commented Mar 12, 2026

@chenrui333 thanks for the report! I am a bit curious because GitHub Actions workflow shows no problem to build.

@chenrui333 chenrui333 force-pushed the fix-missing-optional-include branch from 033ea18 to 41e4b3c Compare March 12, 2026 14:37
@chenrui333
Copy link
Copy Markdown
Contributor Author

I force-pushed this branch to a single repro-only commit that adds a standalone #include <peglib.h> compile target.

This reproduces the Homebrew GCC failure on my side with g++-15: the new target fails because peglib.h uses std::optional without including <optional>.

The reason the current GitHub Actions workflow stayed green is that the test TUs include gtest/gtest.h before peglib.h, and GoogleTest itself pulls in <optional>, which masks the missing direct include.

Once this repro is clear, I can stack the one-line <optional> fix back on top.

@yhirose
Copy link
Copy Markdown
Owner

yhirose commented Mar 12, 2026

@chenrui333, thank you for the detailed information. I'm fine with the original change containing just the <optional> include. Could you revert your pull request to its original state?

@chenrui333
Copy link
Copy Markdown
Contributor Author

yeah, totally.

@chenrui333 chenrui333 force-pushed the fix-missing-optional-include branch from 41e4b3c to 033ea18 Compare March 13, 2026 15:25
@chenrui333
Copy link
Copy Markdown
Contributor Author

updated.

@yhirose yhirose merged commit 3e88335 into yhirose:master Mar 13, 2026
10 checks passed
@yhirose
Copy link
Copy Markdown
Owner

yhirose commented Mar 13, 2026

@chenrui333 thanks for your contribution!

@chenrui333 chenrui333 deleted the fix-missing-optional-include branch March 14, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants