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 May 30, 2024
1 parent 675d5bc commit 0db2432
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 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"

0 comments on commit 0db2432

Please sign in to comment.