Commit d84f20a9 by Abseil Team Committed by Copybara-Service

absl qualify HasAbslStringify in log_message.h.

This works around a Clang bug, https://github.com/llvm/llvm-project/issues/25168

PiperOrigin-RevId: 588491254
Change-Id: Ia59afae4df45474d6025a2ab1ca487b381c9ee66
parent a436472b
...@@ -170,13 +170,15 @@ class LogMessage { ...@@ -170,13 +170,15 @@ class LogMessage {
// Types that support `AbslStringify()` are serialized that way. // Types that support `AbslStringify()` are serialized that way.
template <typename T, template <typename T,
typename std::enable_if<HasAbslStringify<T>::value, int>::type = 0> typename std::enable_if<absl::HasAbslStringify<T>::value,
int>::type = 0>
LogMessage& operator<<(const T& v) ABSL_ATTRIBUTE_NOINLINE; LogMessage& operator<<(const T& v) ABSL_ATTRIBUTE_NOINLINE;
// Types that don't support `AbslStringify()` but do support streaming into a // Types that don't support `AbslStringify()` but do support streaming into a
// `std::ostream&` are serialized that way. // `std::ostream&` are serialized that way.
template <typename T, template <typename T,
typename std::enable_if<!HasAbslStringify<T>::value, int>::type = 0> typename std::enable_if<!absl::HasAbslStringify<T>::value,
int>::type = 0>
LogMessage& operator<<(const T& v) ABSL_ATTRIBUTE_NOINLINE; LogMessage& operator<<(const T& v) ABSL_ATTRIBUTE_NOINLINE;
// Note: We explicitly do not support `operator<<` for non-const references // Note: We explicitly do not support `operator<<` for non-const references
...@@ -281,7 +283,7 @@ class StringifySink final { ...@@ -281,7 +283,7 @@ class StringifySink final {
// Note: the following is declared `ABSL_ATTRIBUTE_NOINLINE` // Note: the following is declared `ABSL_ATTRIBUTE_NOINLINE`
template <typename T, template <typename T,
typename std::enable_if<HasAbslStringify<T>::value, int>::type> typename std::enable_if<absl::HasAbslStringify<T>::value, int>::type>
LogMessage& LogMessage::operator<<(const T& v) { LogMessage& LogMessage::operator<<(const T& v) {
StringifySink sink(*this); StringifySink sink(*this);
// Replace with public API. // Replace with public API.
...@@ -291,7 +293,7 @@ LogMessage& LogMessage::operator<<(const T& v) { ...@@ -291,7 +293,7 @@ LogMessage& LogMessage::operator<<(const T& v) {
// Note: the following is declared `ABSL_ATTRIBUTE_NOINLINE` // Note: the following is declared `ABSL_ATTRIBUTE_NOINLINE`
template <typename T, template <typename T,
typename std::enable_if<!HasAbslStringify<T>::value, int>::type> typename std::enable_if<!absl::HasAbslStringify<T>::value, int>::type>
LogMessage& LogMessage::operator<<(const T& v) { LogMessage& LogMessage::operator<<(const T& v) {
OstreamView view(*data_); OstreamView view(*data_);
view.stream() << log_internal::NullGuard<T>().Guard(v); view.stream() << log_internal::NullGuard<T>().Guard(v);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment