Skip to content

Commit

Permalink
Switch from C++17 to C++20.
Browse files Browse the repository at this point in the history
  • Loading branch information
fruffy committed Jul 3, 2024
1 parent a484745 commit 1d6b4c5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
build --action_env=BAZEL_CXXOPTS="-std=c++17"
build --action_env=BAZEL_CXXOPTS="-std=c++20"
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ IncludeBlocks: Regroup
# Force pointers to the type for C++.
DerivePointerAlignment: false
PointerAlignment: Right
Standard: c++17
Standard: c++20
IncludeCategories:
# Matches common headers first and sorts them before project includes
- Regex: '^<.+/.*\.h>'
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ endif()

project (P4C)

# set (CMAKE_CXX_EXTENSIONS OFF) # prefer using -std=c++17 rather than -std=gnu++17
set (CMAKE_CXX_STANDARD 17)
# set (CMAKE_CXX_EXTENSIONS OFF) # prefer using -std=c++20 rather than -std=gnu++20
set (CMAKE_CXX_STANDARD 20)
set (CMAKE_CXX_STANDARD_REQUIRED ON)

set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
Expand Down
2 changes: 1 addition & 1 deletion bazel/example/.bazelrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
build --action_env=BAZEL_CXXOPTS="-std=c++17"
build --action_env=BAZEL_CXXOPTS="-std=c++20"
2 changes: 1 addition & 1 deletion docs/C++.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
C++ (following the C++ 11 standard) is the implementation language for
C++ (following the C++ 20 standard) is the implementation language for
the compiler. This file contains notes on how we use C++ and conventions
we use for things that C++ does not handle well.

Expand Down

0 comments on commit 1d6b4c5

Please sign in to comment.