Skip to content

Introduce detected_formatter to IR#415

Open
copybara-service[bot] wants to merge 1 commit intomainfrom
test_866117160
Open

Introduce detected_formatter to IR#415
copybara-service[bot] wants to merge 1 commit intomainfrom
test_866117160

Conversation

@copybara-service
Copy link

Introduce detected_formatter to IR

Detects the two main ways in google3 to format a type in C++:

  • AbslStringify
  • operator<<(std::ostream&)

Should work for common use cases, though unsupported edge cases (for now) include:

  • Correctly handling constrained template parameters e.g.,

    template <typename T>
    requires (absl::HasOstreamOperator<T>::value)
    std::ostream& operator<<(std::ostream&, const Foo<T>&);
  • Templated std::basic_ostream e.g.,

    template <typename CharType, typename Traits>
    std::basic_ostream<CharType, Traits>&
    operator<<(std::basic_ostream<CharType, Traits>&, const Foo&);
  • Correctly handling delete-d functions

PiperOrigin-RevId: 866117160
@google-cla
Copy link

google-cla bot commented Feb 5, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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.

0 participants