about summary refs log tree commit diff
path: root/absl
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2019-06-10T19·49-0700
committerGennadiy Civil <misterg@google.com>2019-06-11T16·50-0400
commitb1dd425423380126f6441ce4fbb6f8f6c75b793a (patch)
tree7f0afd4a0265a7c17db907c1f587d966be8fe912 /absl
parent361cb8a9db2f2130442389fd80593255be26d681 (diff)
Export of internal Abseil changes.
--
3febef1a42d092676134bd0b0d54d13a878198a2 by Derek Mauro <dmauro@google.com>:

Update to LLVM r361107 and Bazel 0.26.1

PiperOrigin-RevId: 252463968

--
0408a7f5c1f990414b2ee6efb615238fc44bcd3a by Gennadiy Civil <misterg@google.com>:

Import of CCTZ from GitHub.

PiperOrigin-RevId: 252432385
GitOrigin-RevId: 3febef1a42d092676134bd0b0d54d13a878198a2
Change-Id: I9edade19982dfe490c7c4b894e094c4e7d80adb1
Diffstat (limited to 'absl')
-rw-r--r--absl/copts/GENERATED_AbseilCopts.cmake2
-rw-r--r--absl/copts/GENERATED_copts.bzl2
-rw-r--r--absl/copts/copts.py2
-rw-r--r--absl/time/internal/cctz/src/time_zone_fixed.cc16
4 files changed, 8 insertions, 14 deletions
diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
index c4948d42d495..927ef290f90c 100644
--- a/absl/copts/GENERATED_AbseilCopts.cmake
+++ b/absl/copts/GENERATED_AbseilCopts.cmake
@@ -77,7 +77,6 @@ list(APPEND ABSL_CLANG_CL_TEST_FLAGS
     "-Wno-unused-template"
     "-Wno-used-but-marked-unused"
     "-Wno-zero-as-null-pointer-constant"
-    "-Wno-gnu-include-next"
     "-Wno-gnu-zero-variadic-macro-arguments"
 )
 
@@ -181,7 +180,6 @@ list(APPEND ABSL_LLVM_TEST_FLAGS
     "-Wno-unused-template"
     "-Wno-used-but-marked-unused"
     "-Wno-zero-as-null-pointer-constant"
-    "-Wno-gnu-include-next"
     "-Wno-gnu-zero-variadic-macro-arguments"
 )
 
diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
index 422b3a9b1c3a..58bdfef9378d 100644
--- a/absl/copts/GENERATED_copts.bzl
+++ b/absl/copts/GENERATED_copts.bzl
@@ -78,7 +78,6 @@ ABSL_CLANG_CL_TEST_FLAGS = [
     "-Wno-unused-template",
     "-Wno-used-but-marked-unused",
     "-Wno-zero-as-null-pointer-constant",
-    "-Wno-gnu-include-next",
     "-Wno-gnu-zero-variadic-macro-arguments",
 ]
 
@@ -182,7 +181,6 @@ ABSL_LLVM_TEST_FLAGS = [
     "-Wno-unused-template",
     "-Wno-used-but-marked-unused",
     "-Wno-zero-as-null-pointer-constant",
-    "-Wno-gnu-include-next",
     "-Wno-gnu-zero-variadic-macro-arguments",
 ]
 
diff --git a/absl/copts/copts.py b/absl/copts/copts.py
index 5bede34cb8e7..4594fda222f4 100644
--- a/absl/copts/copts.py
+++ b/absl/copts/copts.py
@@ -105,8 +105,6 @@ LLVM_TEST_DISABLE_WARNINGS_FLAGS = [
     "-Wno-unused-template",
     "-Wno-used-but-marked-unused",
     "-Wno-zero-as-null-pointer-constant",
-    # For a libc++ bug fixed in r357267
-    "-Wno-gnu-include-next",
     # gtest depends on this GNU extension being offered.
     "-Wno-gnu-zero-variadic-macro-arguments",
 ]
diff --git a/absl/time/internal/cctz/src/time_zone_fixed.cc b/absl/time/internal/cctz/src/time_zone_fixed.cc
index 81ece72b79e8..b0d159a2e522 100644
--- a/absl/time/internal/cctz/src/time_zone_fixed.cc
+++ b/absl/time/internal/cctz/src/time_zone_fixed.cc
@@ -27,7 +27,7 @@ namespace cctz {
 namespace {
 
 // The prefix used for the internal names of fixed-offset zones.
-const char kFixedOffsetPrefix[] = "Fixed/UTC";
+const char kFixedZonePrefix[] = "Fixed/UTC";
 
 const char kDigits[] = "0123456789";
 
@@ -55,11 +55,11 @@ bool FixedOffsetFromName(const std::string& name, seconds* offset) {
     return true;
   }
 
-  const std::size_t prefix_len = sizeof(kFixedOffsetPrefix) - 1;
-  const char* const ep = kFixedOffsetPrefix + prefix_len;
+  const std::size_t prefix_len = sizeof(kFixedZonePrefix) - 1;
+  const char* const ep = kFixedZonePrefix + prefix_len;
   if (name.size() != prefix_len + 9)  // <prefix>+99:99:99
     return false;
-  if (!std::equal(kFixedOffsetPrefix, ep, name.begin()))
+  if (!std::equal(kFixedZonePrefix, ep, name.begin()))
     return false;
   const char* np = name.data() + prefix_len;
   if (np[0] != '+' && np[0] != '-')
@@ -102,9 +102,9 @@ std::string FixedOffsetToName(const seconds& offset) {
   }
   int hours = minutes / 60;
   minutes %= 60;
-  char buf[sizeof(kFixedOffsetPrefix) - 1 + sizeof("-24:00:00")];
-  std::strcpy(buf, kFixedOffsetPrefix);
-  char* ep = buf + sizeof(kFixedOffsetPrefix) - 1;
+  const std::size_t prefix_len = sizeof(kFixedZonePrefix) - 1;
+  char buf[prefix_len + sizeof("-24:00:00")];
+  char* ep = std::copy(kFixedZonePrefix, kFixedZonePrefix + prefix_len, buf);
   *ep++ = sign;
   ep = Format02d(ep, hours);
   *ep++ = ':';
@@ -118,7 +118,7 @@ std::string FixedOffsetToName(const seconds& offset) {
 
 std::string FixedOffsetToAbbr(const seconds& offset) {
   std::string abbr = FixedOffsetToName(offset);
-  const std::size_t prefix_len = sizeof(kFixedOffsetPrefix) - 1;
+  const std::size_t prefix_len = sizeof(kFixedZonePrefix) - 1;
   if (abbr.size() == prefix_len + 9) {         // <prefix>+99:99:99
     abbr.erase(0, prefix_len);                 // +99:99:99
     abbr.erase(6, 1);                          // +99:9999