UPSTREAM PR #2024: Fix ambiguous FormatConvertImpl when type has both AbslStringify and AbslFormatConvert - #13
Open
loci-dev wants to merge 1 commit into
Open
Conversation
…AbslFormatConvert When a type defines both AbslStringify and AbslFormatConvert, FormatConvertImpl overload resolution was ambiguous, causing a compilation error. Fix by giving AbslStringify priority over AbslFormatConvert when both are defined, consistent with the intended use of AbslStringify as the preferred extension mechanism. Fixes #1966
loci-dev
had a problem deploying
to
abseil-cpp-prod
March 13, 2026 07:23 — with
GitHub Actions
Failure
loci-dev
force-pushed
the
main
branch
5 times, most recently
from
March 21, 2026 06:44
df20b95 to
eacc875
Compare
loci-dev
force-pushed
the
main
branch
6 times, most recently
from
March 31, 2026 06:00
f6fa226 to
c186bfe
Compare
loci-dev
force-pushed
the
main
branch
5 times, most recently
from
April 8, 2026 06:01
2b7f675 to
d969ff5
Compare
loci-dev
force-pushed
the
main
branch
4 times, most recently
from
April 15, 2026 06:08
cde405e to
1d13d48
Compare
loci-dev
force-pushed
the
main
branch
5 times, most recently
from
April 25, 2026 06:01
1c2844b to
7abb8d9
Compare
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.
Note
Source pull request: abseil/abseil-cpp#2024
When a type defines both
AbslStringifyandAbslFormatConvert, callingabsl::StrFormat("%v", value)caused a compilation error due to ambiguous overload resolution inFormatConvertImpl.This fix gives
AbslStringifypriority overAbslFormatConvertwhen both are defined, by:!HasAbslStringify<T>::valueguard to theAbslFormatConvertoverload ofFormatConvertImplArgumentToConv()to returnvconversion char set when both methods are presentA test is added to verify that
AbslStringifyis called when both methods are defined.Fixes #1966