Use std::nullptr_t in dynamic
[folly.git] / folly / IPAddress.cpp
index c4a51007d58504c766ecb52a4dec4a6c31db770c..792b75a4afac5a1da4b6c39580f4185e0bf517fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -89,7 +89,8 @@ CIDRNetwork IPAddress::createNetwork(StringPiece ipSlashCidr,
         "'"));
   }
   IPAddress subnet(vec.at(0));
-  uint8_t cidr = (defaultCidr > -1) ? defaultCidr : (subnet.isV4() ? 32 : 128);
+  auto cidr =
+      uint8_t((defaultCidr > -1) ? defaultCidr : (subnet.isV4() ? 32 : 128));
 
   if (elemCount == 2) {
     try {
@@ -419,7 +420,6 @@ IPAddress::longestCommonPrefix(const CIDRNetwork& one, const CIDRNetwork& two) {
   } else {
     throw std::invalid_argument("Unknown address family");
   }
-  return {IPAddress(0), 0};
 }
 
 [[noreturn]] void IPAddress::asV4Throw() const {