Skip to content

Commit b8b4ca7

Browse files
committed
added support for c2y and gnu2y as standards
1 parent 37fa4f4 commit b8b4ca7

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

simplecpp.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3751,6 +3751,8 @@ simplecpp::cstd_t simplecpp::getCStd(const std::string &std)
37513751
return C17;
37523752
if (std == "c23" || std == "gnu23" || std == "c2x" || std == "gnu2x")
37533753
return C23;
3754+
if (std == "c2y" || std == "gnu2y")
3755+
return C2Y;
37543756
return CUnknown;
37553757
}
37563758

@@ -3772,6 +3774,10 @@ std::string simplecpp::getCStdString(cstd_t std)
37723774
// Clang 14, 15, 16, 17 return "202000L"
37733775
// Clang 9, 10, 11, 12, 13, 14, 15, 16, 17 do not support "c23" and "gnu23"
37743776
return "202311L";
3777+
case C2Y:
3778+
// supported by GCC 15+ and Clang 19+
3779+
// Clang 19, 20, 21, 22 return "202400L"
3780+
return "202500L";
37753781
case CUnknown:
37763782
return "";
37773783
}
@@ -3823,7 +3829,7 @@ std::string simplecpp::getCppStdString(cppstd_t std)
38233829
// Clang 17, 18 return "202302L"
38243830
return "202302L";
38253831
case CPP26:
3826-
// supported by Clang 17+
3832+
// supported by GCC 14+ and Clang 17+
38273833
return "202400L";
38283834
case CPPUnknown:
38293835
return "";

simplecpp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767

6868
namespace simplecpp {
6969
/** C code standard */
70-
enum cstd_t { CUnknown=-1, C89, C99, C11, C17, C23 };
70+
enum cstd_t { CUnknown=-1, C89, C99, C11, C17, C23, C2Y };
7171

7272
/** C++ code standard */
7373
enum cppstd_t { CPPUnknown=-1, CPP03, CPP11, CPP14, CPP17, CPP20, CPP23, CPP26 };

0 commit comments

Comments
 (0)