Skip to content

Commit

Permalink
added preliminary C++26 -std= support and improved comments (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave authored Aug 22, 2023
1 parent 03a3613 commit f5a5679
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions simplecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 "";
Expand All @@ -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 "";
}
Expand Down

0 comments on commit f5a5679

Please sign in to comment.