[libc-commits] [libc] [libc] Implement IPv6 (AF_INET6) support in inet_pton (PR #226550)

Pavel Labath via libc-commits libc-commits at lists.llvm.org
Tue Sep 29 05:17:21 PDT 2026


================
@@ -67,6 +69,109 @@ namespace net {
   return true;
 }
 
+[[nodiscard]] bool str_to_ipv6(cpp::string_view src, struct in6_addr &dst) {
+  if (src.empty())
+    return false;
+
+  bool has_double_colon = false;
----------------
labath wrote:

We can drop this, as it's equivalent to `part_idx > 0`. If you think it has documentational value, you can make it a lambda (so it's automatically updated).

https://github.com/llvm/llvm-project/pull/226550


More information about the libc-commits mailing list