Skip to content

Commit 7a03cdb

Browse files
derekmaurocopybara-github
authored andcommitted
Require C++17
Policy information: https://opensource.google/documentation/policies/cplusplus-support#c_language_standard https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md PiperOrigin-RevId: 723589409 Change-Id: Ia8665c052ed40f2a78308f7eb0c330191b0cf981
1 parent 69b58f9 commit 7a03cdb

19 files changed

+49
-41
lines changed

CMake/AbseilDll.cmake

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -731,10 +731,8 @@ int main() { return 0; }
731731

732732
if(ABSL_INTERNAL_AT_LEAST_CXX20)
733733
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_20)
734-
elseif(ABSL_INTERNAL_AT_LEAST_CXX17)
735-
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_17)
736734
else()
737-
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_14)
735+
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_17)
738736
endif()
739737

740738
function(absl_internal_dll_contains)
@@ -899,7 +897,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
899897
)
900898

901899
if(ABSL_PROPAGATE_CXX_STD)
902-
# Abseil libraries require C++14 as the current minimum standard. When
900+
# Abseil libraries require C++17 as the current minimum standard. When
903901
# compiled with a higher minimum (either because it is the compiler's
904902
# default or explicitly requested), then Abseil requires that standard.
905903
target_compile_features(${_dll} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})

CMake/AbseilHelpers.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
301301
endif()
302302

303303
if(ABSL_PROPAGATE_CXX_STD)
304-
# Abseil libraries require C++14 as the current minimum standard. When
304+
# Abseil libraries require C++17 as the current minimum standard. When
305305
# compiled with a higher standard (either because it is the compiler's
306306
# default or explicitly requested), then Abseil requires that standard.
307307
target_compile_features(${_NAME} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})
@@ -338,7 +338,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
338338
target_compile_definitions(${_NAME} INTERFACE ${ABSL_CC_LIB_DEFINES})
339339

340340
if(ABSL_PROPAGATE_CXX_STD)
341-
# Abseil libraries require C++14 as the current minimum standard.
341+
# Abseil libraries require C++17 as the current minimum standard.
342342
# Top-level application CMake projects should ensure a consistent C++
343343
# standard for all compiled sources by setting CMAKE_CXX_STANDARD.
344344
target_compile_features(${_NAME} INTERFACE ${ABSL_INTERNAL_CXX_STD_FEATURE})
@@ -450,7 +450,7 @@ function(absl_cc_test)
450450
set_property(TARGET ${_NAME} PROPERTY FOLDER ${ABSL_IDE_FOLDER}/test)
451451

452452
if(ABSL_PROPAGATE_CXX_STD)
453-
# Abseil libraries require C++14 as the current minimum standard.
453+
# Abseil libraries require C++17 as the current minimum standard.
454454
# Top-level application CMake projects should ensure a consistent C++
455455
# standard for all compiled sources by setting CMAKE_CXX_STANDARD.
456456
target_compile_features(${_NAME} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})

CMake/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ cmake_minimum_required(VERSION 3.16)
4343
project(my_app_project)
4444
4545
# Pick the C++ standard to compile with.
46-
# Abseil currently supports C++14, C++17, and C++20.
47-
set(CMAKE_CXX_STANDARD 14)
46+
# Abseil currently supports C++17 and C++20.
47+
set(CMAKE_CXX_STANDARD 17)
4848
set(CMAKE_CXX_STANDARD_REQUIRED ON)
4949
5050
add_subdirectory(abseil-cpp)

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
4646
set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
4747

4848
option(ABSL_PROPAGATE_CXX_STD
49-
"Use CMake C++ standard meta features (e.g. cxx_std_14) that propagate to targets that link to Abseil"
49+
"Use CMake C++ standard meta features (e.g. cxx_std_17) that propagate to targets that link to Abseil"
5050
ON)
5151

5252
option(ABSL_USE_SYSTEM_INCLUDES

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Abseil - C++ Common Libraries
22

33
The repository contains the Abseil C++ library code. Abseil is an open-source
4-
collection of C++ code (compliant to C++14) designed to augment the C++
4+
collection of C++ code (compliant to C++17) designed to augment the C++
55
standard library.
66

77
## Table of Contents
@@ -99,8 +99,8 @@ Abseil contains the following C++ library components:
9999
<br /> The `memory` library contains memory management facilities that augment
100100
C++'s `<memory>` library.
101101
* [`meta`](absl/meta/)
102-
<br /> The `meta` library contains compatible versions of type checks
103-
available within C++14 and C++17 versions of the C++ `<type_traits>` library.
102+
<br /> The `meta` library contains type checks
103+
similar to those available in the C++ `<type_traits>` library.
104104
* [`numeric`](absl/numeric/)
105105
<br /> The `numeric` library contains 128-bit integer types as well as
106106
implementations of C++20's bitwise math functions.
@@ -115,8 +115,7 @@ Abseil contains the following C++ library components:
115115
specifically `absl::Status` and `absl::StatusOr<T>`.
116116
* [`strings`](absl/strings/)
117117
<br /> The `strings` library contains a variety of strings routines and
118-
utilities, including a C++14-compatible version of the C++17
119-
`std::string_view` type.
118+
utilities.
120119
* [`synchronization`](absl/synchronization/)
121120
<br /> The `synchronization` library contains concurrency primitives (Abseil's
122121
`absl::Mutex` class, an alternative to `std::mutex`) and a variety of
@@ -126,8 +125,7 @@ Abseil contains the following C++ library components:
126125
points in time, durations of time, and formatting and parsing time within
127126
time zones.
128127
* [`types`](absl/types/)
129-
<br /> The `types` library contains non-container utility types, like a
130-
C++14-compatible version of the C++17 `std::optional` type.
128+
<br /> The `types` library contains non-container utility types.
131129
* [`utility`](absl/utility/)
132130
<br /> The `utility` library contains utility and helper code.
133131

absl/base/policy_checks.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@
7171
// C++ Version Check
7272
// -----------------------------------------------------------------------------
7373

74-
// Enforce C++14 as the minimum.
74+
// Enforce C++17 as the minimum.
7575
#if defined(_MSVC_LANG)
76-
#if _MSVC_LANG < 201402L
77-
#error "C++ versions less than C++14 are not supported."
78-
#endif // _MSVC_LANG < 201402L
76+
#if _MSVC_LANG < 201703L
77+
#error "C++ versions less than C++17 are not supported."
78+
#endif // _MSVC_LANG < 201703L
7979
#elif defined(__cplusplus)
80-
#if __cplusplus < 201402L
81-
#error "C++ versions less than C++14 are not supported."
82-
#endif // __cplusplus < 201402L
80+
#if __cplusplus < 201703L
81+
#error "C++ versions less than C++17 are not supported."
82+
#endif // __cplusplus < 201703L
8383
#endif
8484

8585
// -----------------------------------------------------------------------------

ci/linux_arm_clang-latest_libcxx_bazel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if [[ -z ${ABSEIL_ROOT:-} ]]; then
2525
fi
2626

2727
if [[ -z ${STD:-} ]]; then
28-
STD="c++14 c++17 c++20"
28+
STD="c++17 c++20"
2929
fi
3030

3131
if [[ -z ${COMPILATION_MODE:-} ]]; then

ci/linux_clang-latest_libcxx_asan_bazel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if [[ -z ${ABSEIL_ROOT:-} ]]; then
2525
fi
2626

2727
if [[ -z ${STD:-} ]]; then
28-
STD="c++14 c++17 c++20"
28+
STD="c++17 c++20"
2929
fi
3030

3131
if [[ -z ${COMPILATION_MODE:-} ]]; then

ci/linux_clang-latest_libcxx_bazel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if [[ -z ${ABSEIL_ROOT:-} ]]; then
2525
fi
2626

2727
if [[ -z ${STD:-} ]]; then
28-
STD="c++14 c++17 c++20"
28+
STD="c++17 c++20"
2929
fi
3030

3131
if [[ -z ${COMPILATION_MODE:-} ]]; then

ci/linux_clang-latest_libcxx_tsan_bazel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if [[ -z ${ABSEIL_ROOT:-} ]]; then
2525
fi
2626

2727
if [[ -z ${STD:-} ]]; then
28-
STD="c++14 c++17 c++20"
28+
STD="c++17 c++20"
2929
fi
3030

3131
if [[ -z ${COMPILATION_MODE:-} ]]; then

0 commit comments

Comments
 (0)