Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fmt as a dependency #244

Merged
merged 25 commits into from
Jun 4, 2023
Merged

Add fmt as a dependency #244

merged 25 commits into from
Jun 4, 2023

Conversation

danakj
Copy link
Collaborator

@danakj danakj commented May 27, 2023

Pull fmt into third_party, and define formatters for all useful-to-print public types.

Pulling fmt 10.0.0 into third_party
@danakj danakj force-pushed the add-fmt branch 5 times, most recently from 25167e6 to 8e8e26a Compare May 31, 2023 02:32
@danakj danakj marked this pull request as ready for review May 31, 2023 03:32
So that we can use fmt when rtti is disabled on clang/gcc
This allows IDEs and compiler errors to find the right
source locations.
@danakj danakj force-pushed the add-fmt branch 6 times, most recently from 5abab8f to 1d6b6db Compare June 4, 2023 04:11
If the inner type is unformattable, it will be formatted as a string
of byte values for the memory in the type.

To do this we have helper formatters AnyFormatter and AnyOrVoidFormatter.
If you resolve the gtest templates in one TU to say that
a type is not printable then it seems to cache it and
affect other TUs. So stick it in prelude.h so it's always
there.
This ensures that it is not possible for gtest users to end up
including the type and printing it in one TU without stream support
which then breaks printing it in another TU that also includes the
stream support. They will simply always be printable by streams.
This is done without including anything other than iosfwd (and string
and fmt) in header files.
@danakj danakj force-pushed the add-fmt branch 4 times, most recently from c20e0d2 to 634288c Compare June 4, 2023 04:51
@danakj danakj linked an issue Jun 4, 2023 that may be closed by this pull request
@danakj danakj merged commit 2cd7a01 into chromium:main Jun 4, 2023
5 checks passed
@danakj danakj deleted the add-fmt branch June 4, 2023 05:16
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.

Debug/Display for numeric types
1 participant