From f5a567908a2782dcab8004cc008e1c13a5705099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Tue, 22 Aug 2023 14:51:19 +0200 Subject: [PATCH] added preliminary C++26 `-std=` support and improved comments (#303) --- simplecpp.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/simplecpp.cpp b/simplecpp.cpp index 2a91c3b3..ced7ab93 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 ""; }