Fix possible compile issue with PeerConnectionInterface::AsString.

AsString is constexpr, but RTC_CHECK_NOTREACHED is not. Using some gcc
compile rules, having a constexpr make use of RTC_CHECK_NOTREACHED does
not compile.

See internal issue number 215785261. We could either remove constexpr
or remove the RTC_CHECK_NOTREACHED. This CL does the latter.

Bug: None
Change-Id: I7ea84b345e9abdba60a7620e1d92c3159c0d7974
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/248167
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35768}
This commit is contained in:
Henrik Boström
2022-01-24 09:19:42 +01:00
committed by WebRTC LUCI CQ
parent 347488e450
commit 49a1d621be

View File

@ -1625,7 +1625,8 @@ inline constexpr absl::string_view PeerConnectionInterface::AsString(
case SignalingState::kClosed:
return "closed";
}
RTC_CHECK_NOTREACHED();
// This cannot happen.
// Not using "RTC_CHECK_NOTREACHED()" because AsString() is constexpr.
return "";
}
@ -1640,7 +1641,8 @@ inline constexpr absl::string_view PeerConnectionInterface::AsString(
case IceGatheringState::kIceGatheringComplete:
return "complete";
}
RTC_CHECK_NOTREACHED();
// This cannot happen.
// Not using "RTC_CHECK_NOTREACHED()" because AsString() is constexpr.
return "";
}
@ -1661,7 +1663,8 @@ inline constexpr absl::string_view PeerConnectionInterface::AsString(
case PeerConnectionState::kClosed:
return "closed";
}
RTC_CHECK_NOTREACHED();
// This cannot happen.
// Not using "RTC_CHECK_NOTREACHED()" because AsString() is constexpr.
return "";
}
@ -1683,10 +1686,12 @@ inline constexpr absl::string_view PeerConnectionInterface::AsString(
case kIceConnectionClosed:
return "closed";
case kIceConnectionMax:
RTC_CHECK_NOTREACHED();
// This cannot happen.
// Not using "RTC_CHECK_NOTREACHED()" because AsString() is constexpr.
return "";
}
RTC_CHECK_NOTREACHED();
// This cannot happen.
// Not using "RTC_CHECK_NOTREACHED()" because AsString() is constexpr.
return "";
}