From 43a4b77b93e190a193348a8402efab7589ae83e5 Mon Sep 17 00:00:00 2001 From: firewave Date: Thu, 10 Aug 2023 12:37:52 +0200 Subject: [PATCH] added preliminary C++26 `-std=` support and improved comments --- simplecpp.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/simplecpp.cpp b/simplecpp.cpp index 5444238c..b02ed2bc 100755 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -3631,7 +3631,8 @@ std::string simplecpp::getCStdString(const std::string &std) if (std == "c17" || std == "c18" || std == "iso9899:2017" || std == "iso9899:2018" || std == "gnu17"|| std == "gnu18") return "201710L"; if (std == "c2x" || std == "gnu2x") { - // Clang 11, 12, 13 return "201710L" - correct in 14 + // supported by GCC 9+ and Clang 9+ + // Clang 9, 10, 11, 12, 13 return "201710L" return "202000L"; } return ""; @@ -3653,8 +3654,14 @@ std::string simplecpp::getCppStdString(const std::string &std) } if (std == "c++23" || std == "c++2b" || std == "gnu++23" || std == "gnu++2b") { // supported by GCC 11+ and Clang 12+ - // Clang 12, 13, 14 do not support "c++23" and "gnu++23" - return "202100L"; + // GCC 11, 12, 13 return "202100L" + // Clang 12, 13, 14, 15, 16 do not support "c++23" and "gnu++23" and return "202101L" + // Clang 17, 18 return "202302L" + return "202100L"; // TODO: update value? + } + if (std == "c++26" || std == "c++2c" || std == "gnu++26" || std == "gnu++2c") { + // supported by Clang 17+ + return "202400L"; } return ""; }