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}
diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h
index 72a0765..0b402c9 100644
--- a/api/peer_connection_interface.h
+++ b/api/peer_connection_interface.h
@@ -1625,7 +1625,8 @@
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 @@
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 @@
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 @@
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 "";
}