diff --git a/.bazelrc b/.bazelrc index 6532c3cafd9..92a9f9a87ce 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1 +1 @@ -build --action_env=BAZEL_CXXOPTS="-std=c++17" +build --action_env=BAZEL_CXXOPTS="-std=c++20" diff --git a/.clang-format b/.clang-format index 49d5d1b0ad8..016d57a6e86 100644 --- a/.clang-format +++ b/.clang-format @@ -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>' diff --git a/CMakeLists.txt b/CMakeLists.txt index cb848e2bab9..bdffa4660b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/bazel/example/.bazelrc b/bazel/example/.bazelrc index 6532c3cafd9..92a9f9a87ce 100644 --- a/bazel/example/.bazelrc +++ b/bazel/example/.bazelrc @@ -1 +1 @@ -build --action_env=BAZEL_CXXOPTS="-std=c++17" +build --action_env=BAZEL_CXXOPTS="-std=c++20" diff --git a/docs/C++.md b/docs/C++.md index bee36272a44..09b96bf53dc 100644 --- a/docs/C++.md +++ b/docs/C++.md @@ -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.