require C++17

This aligns the project with:
https://github.com/google/oss-policies-info/blob/48076331a/foundational-cxx-support-matrix.md

and makes newer versions of Abseil and Googletest available.

PiperOrigin-RevId: 796656277
Change-Id: Ic2e073c4f7d88e0174d63fb4ff1e41d50414ee2a
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 73f27a1..d688385 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,9 +15,8 @@
 # libgav1 requires modern CMake.
 cmake_minimum_required(VERSION 3.7.1 FATAL_ERROR)
 
-# libgav1 requires C++11.
-set(CMAKE_CXX_STANDARD 11)
-set(ABSL_CXX_STANDARD 11)
+# libgav1 requires C++17.
+set(CMAKE_CXX_STANDARD 17)
 # libgav1 requires C99.
 set(CMAKE_C_STANDARD 99)
 
@@ -144,7 +143,7 @@
         " examples & tests and libgav1 when LIBGAV1_THREADPOOL_USE_STD_MUTEX is"
         " not defined. To continue, download the Abseil repository to"
         " third_party/abseil-cpp:\n  git \\\n    -C ${libgav1_root} \\\n"
-        "    clone -b 20220623.0 --depth 1 \\\n"
+        "    clone -b 20250512.1 --depth 1 \\\n"
         "    https://github.com/abseil/abseil-cpp.git third_party/abseil-cpp")
   endif()
 endif()
diff --git a/README.md b/README.md
index 03eef8f..ea44b51 100644
--- a/README.md
+++ b/README.md
@@ -10,8 +10,11 @@
 
 ### Prerequisites
 
-1.  A C++11 compiler. gcc 6+, clang 7+ or Microsoft Visual Studio 2017+ are
-    recommended.
+1.  A C++17 compiler.
+
+    See the
+    [Foundational C++ Support Matrix](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md)
+    for supported compiler versions.
 
 2.  [CMake >= 3.7.1](https://cmake.org/download/)
 
@@ -20,7 +23,7 @@
     From within the libgav1 directory:
 
     ```shell
-    $ git clone -b 20220623.0 --depth 1 \
+    $ git clone -b 20250512.1 --depth 1 \
       https://github.com/abseil/abseil-cpp.git third_party/abseil-cpp
     ```
 
@@ -32,7 +35,7 @@
     From within the libgav1 directory:
 
     ```shell
-    $ git clone -b release-1.12.1 --depth 1 \
+    $ git clone -b v1.17.0 --depth 1 \
       https://github.com/google/googletest.git third_party/googletest
     ```
 
diff --git a/examples/file_reader.cc b/examples/file_reader.cc
index 39820f8..dc7ede3 100644
--- a/examples/file_reader.cc
+++ b/examples/file_reader.cc
@@ -83,14 +83,7 @@
     return nullptr;
   }
 
-  // With C++11, to return |file|, an explicit move is required as the return
-  // type differs from the local variable. Overload resolution isn't guaranteed
-  // in this case, though some compilers may adopt the C++14 behavior (C++
-  // Standard Core Language Issue #1579, Return by converting move
-  // constructor):
-  // https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579
-  // To keep things simple we opt for the following compatible form.
-  return std::unique_ptr<FileReaderInterface>(file.release());
+  return file;
 }
 
 // IVF Frame Header format, from https://wiki.multimedia.cx/index.php/IVF
diff --git a/src/dsp/convolve_test.cc b/src/dsp/convolve_test.cc
index b8c1f1d..2b9d7f8 100644
--- a/src/dsp/convolve_test.cc
+++ b/src/dsp/convolve_test.cc
@@ -95,11 +95,6 @@
   int height;
 };
 
-#if !LIBGAV1_CXX17
-constexpr int ConvolveTestParam::kBlockWidth[kNumBlockSizes];   // static.
-constexpr int ConvolveTestParam::kBlockHeight[kNumBlockSizes];  // static.
-#endif
-
 const char* GetConvolveDigest8bpp(int id) {
   // Entries containing 'XXXXX...' are skipped. See the test for details.
   static const char* const kDigest[ConvolveTestParam::kNumBlockSizes * 16] = {
diff --git a/src/libgav1_decoder.cmake b/src/libgav1_decoder.cmake
index 1314d0b..8ed5dae 100644
--- a/src/libgav1_decoder.cmake
+++ b/src/libgav1_decoder.cmake
@@ -23,7 +23,6 @@
             "${libgav1_source}/decoder_impl.cc"
             "${libgav1_source}/decoder_impl.h"
             "${libgav1_source}/decoder_state.h"
-            "${libgav1_source}/tile_scratch_buffer.cc"
             "${libgav1_source}/tile_scratch_buffer.h"
             "${libgav1_source}/film_grain.cc"
             "${libgav1_source}/film_grain.h"
diff --git a/src/tile_scratch_buffer.cc b/src/tile_scratch_buffer.cc
deleted file mode 100644
index 0b5ac96..0000000
--- a/src/tile_scratch_buffer.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2019 The libgav1 Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "src/tile_scratch_buffer.h"
-
-#include "src/utils/compiler_attributes.h"
-
-namespace libgav1 {
-
-#if !LIBGAV1_CXX17
-// static
-constexpr int TileScratchBuffer::kBlockDecodedStride;
-#endif
-
-}  // namespace libgav1
diff --git a/src/utils/compiler_attributes.h b/src/utils/compiler_attributes.h
index 33fbe16..7148966 100644
--- a/src/utils/compiler_attributes.h
+++ b/src/utils/compiler_attributes.h
@@ -23,14 +23,12 @@
 //------------------------------------------------------------------------------
 // Language version, attribute and feature helpers.
 
-// Detect c++17 support. Visual Studio sets __cplusplus to 199711L by default
+// Detect C++17 support. Visual Studio sets __cplusplus to 199711L by default
 // unless compiled with /Zc:__cplusplus, use the value controlled by /std
 // instead.
 // https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus
-#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
-#define LIBGAV1_CXX17 1
-#else
-#define LIBGAV1_CXX17 0
+#if __cplusplus < 201703L && (!defined(_MSVC_LANG) || _MSVC_LANG < 201703L)
+#error "C++ versions less than C++17 are not supported."
 #endif
 
 #if defined(__has_attribute)
diff --git a/src/utils/entropy_decoder.cc b/src/utils/entropy_decoder.cc
index 3d97e69..b74b7b9 100644
--- a/src/utils/entropy_decoder.cc
+++ b/src/utils/entropy_decoder.cc
@@ -565,10 +565,6 @@
 
 }  // namespace
 
-#if !LIBGAV1_CXX17
-constexpr int EntropyDecoder::kWindowSize;  // static.
-#endif
-
 EntropyDecoder::EntropyDecoder(const uint8_t* data, size_t size,
                                bool allow_update_cdf)
     : data_(data),
diff --git a/src/utils/memory.h b/src/utils/memory.h
index d1762a2..d2743a3 100644
--- a/src/utils/memory.h
+++ b/src/utils/memory.h
@@ -173,8 +173,7 @@
 
 // A variant of Allocable that forces allocations to be aligned to
 // kMaxAlignment bytes. This is intended for use with classes that use
-// alignas() with this value. C++17 aligned new/delete are used if available,
-// otherwise we use AlignedAlloc/Free.
+// alignas() with this value.
 struct MaxAlignedAllocable {
   // Class-specific allocation functions.
   static void* operator new(size_t size) = delete;
@@ -183,58 +182,30 @@
   // Class-specific non-throwing allocation functions
   static void* operator new(size_t size, const std::nothrow_t& tag) noexcept {
     if (size > 0x40000000) return nullptr;
-#ifdef __cpp_aligned_new
     return ::operator new(size, std::align_val_t(kMaxAlignment), tag);
-#else
-    static_cast<void>(tag);
-    return AlignedAlloc(kMaxAlignment, size);
-#endif
   }
   static void* operator new[](size_t size, const std::nothrow_t& tag) noexcept {
     if (size > 0x40000000) return nullptr;
-#ifdef __cpp_aligned_new
     return ::operator new[](size, std::align_val_t(kMaxAlignment), tag);
-#else
-    static_cast<void>(tag);
-    return AlignedAlloc(kMaxAlignment, size);
-#endif
   }
 
   // Class-specific deallocation functions.
   static void operator delete(void* ptr) noexcept {
-#ifdef __cpp_aligned_new
     ::operator delete(ptr, std::align_val_t(kMaxAlignment));
-#else
-    AlignedFree(ptr);
-#endif
   }
   static void operator delete[](void* ptr) noexcept {
-#ifdef __cpp_aligned_new
     ::operator delete[](ptr, std::align_val_t(kMaxAlignment));
-#else
-    AlignedFree(ptr);
-#endif
   }
 
   // Only called if new (std::nothrow) is used and the constructor throws an
   // exception.
   static void operator delete(void* ptr, const std::nothrow_t& tag) noexcept {
-#ifdef __cpp_aligned_new
     ::operator delete(ptr, std::align_val_t(kMaxAlignment), tag);
-#else
-    static_cast<void>(tag);
-    AlignedFree(ptr);
-#endif
   }
   // Only called if new[] (std::nothrow) is used and the constructor throws an
   // exception.
   static void operator delete[](void* ptr, const std::nothrow_t& tag) noexcept {
-#ifdef __cpp_aligned_new
     ::operator delete[](ptr, std::align_val_t(kMaxAlignment), tag);
-#else
-    static_cast<void>(tag);
-    AlignedFree(ptr);
-#endif
   }
 };
 
diff --git a/src/utils/unbounded_queue.h b/src/utils/unbounded_queue.h
index fa0d303..9ac085c 100644
--- a/src/utils/unbounded_queue.h
+++ b/src/utils/unbounded_queue.h
@@ -235,11 +235,6 @@
   size_t back_ = 0;
 };
 
-#if !LIBGAV1_CXX17
-template <typename T>
-constexpr size_t UnboundedQueue<T>::kBlockCapacity;
-#endif
-
 }  // namespace libgav1
 
 #endif  // LIBGAV1_SRC_UTILS_UNBOUNDED_QUEUE_H_
diff --git a/tests/libgav1_tests.cmake b/tests/libgav1_tests.cmake
index eefa1bf..e1ec7f9 100644
--- a/tests/libgav1_tests.cmake
+++ b/tests/libgav1_tests.cmake
@@ -28,7 +28,7 @@
       "GoogleTest not found, setting LIBGAV1_ENABLE_TESTS to false.\n"
       "To enable tests download the GoogleTest repository to"
       " third_party/googletest:\n\n  git \\\n    -C ${libgav1_root} \\\n"
-      "    clone -b release-1.12.1 --depth 1 \\\n"
+      "    clone -b v1.17.0 --depth 1 \\\n"
       "    https://github.com/google/googletest.git third_party/googletest\n")
     set(LIBGAV1_ENABLE_TESTS FALSE CACHE BOOL "Enables tests." FORCE)
   endif()