Skip to content

Commit 2459240

Browse files
committed
added support for c2y and gnu2y [skip ci]
1 parent 871dc30 commit 2459240

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
@@ -3759,6 +3759,8 @@ simplecpp::cstd_t simplecpp::getCStd(const std::string &std)
37593759
return C17;
37603760
if (std == "c23" || std == "gnu23" || std == "c2x" || std == "gnu2x")
37613761
return C23;
3762+
if (std == "c2y" || std == "gnu2y")
3763+
return C2Y;
37623764
return CUnknown;
37633765
}
37643766

@@ -3780,6 +3782,10 @@ std::string simplecpp::getCStdString(cstd_t std)
37803782
// Clang 14, 15, 16, 17 return "202000L"
37813783
// Clang 9, 10, 11, 12, 13, 14, 15, 16, 17 do not support "c23" and "gnu23"
37823784
return "202311L";
3785+
case C2Y:
3786+
// supported by GCC 15+ and Clang 19+
3787+
// Clang 19, 20, 21, 22 return "202400L"
3788+
return "202500L";
37833789
case CUnknown:
37843790
return "";
37853791
}
@@ -3831,7 +3837,7 @@ std::string simplecpp::getCppStdString(cppstd_t std)
38313837
// Clang 17, 18 return "202302L"
38323838
return "202302L";
38333839
case CPP26:
3834-
// supported by Clang 17+
3840+
// supported by GCC 14+ and Clang 17+
38353841
return "202400L";
38363842
case CPPUnknown:
38373843
return "";

simplecpp.h

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

4949
namespace simplecpp {
5050
/** C code standard */
51-
enum cstd_t { CUnknown=-1, C89, C99, C11, C17, C23 };
51+
enum cstd_t { CUnknown=-1, C89, C99, C11, C17, C23, C2Y };
5252

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

0 commit comments

Comments
 (0)