diff options
author | Thomas Schwinge <tschwinge@baylibre.com> | 2024-03-10 23:42:46 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@baylibre.com> | 2024-03-10 23:42:46 +0100 |
commit | 6915bdb8fcdaeee585bbc9aaa52311e8c695da01 (patch) | |
tree | fb2227327879ffdd1d6a3d652a70043afb7db58e /libcpp | |
parent | ffba2ab00fb01d77dfc4103bfffabebfc2568d9a (diff) | |
parent | 5f5e37dcbc19cbbaec58789fc532cb9940413258 (diff) | |
download | gcc-6915bdb8fcdaeee585bbc9aaa52311e8c695da01.zip gcc-6915bdb8fcdaeee585bbc9aaa52311e8c695da01.tar.gz gcc-6915bdb8fcdaeee585bbc9aaa52311e8c695da01.tar.bz2 |
Merge commit 'f4a2ae2338962208b8039f154f5912402e94c378^' into HEAD
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 27 | ||||
-rw-r--r-- | libcpp/charset.cc | 2 | ||||
-rw-r--r-- | libcpp/include/cpplib.h | 2 | ||||
-rw-r--r-- | libcpp/init.cc | 13 |
4 files changed, 38 insertions, 6 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 48acad7..390d8e1 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,30 @@ +2023-06-23 Marek Polacek <polacek@redhat.com> + + * include/cpplib.h (c_lang): Add CXX26 and GNUCXX26. + * init.cc (lang_defaults): Add rows for CXX26 and GNUCXX26. + (cpp_init_builtins): Set __cplusplus to 202400L for C++26. + Set __cplusplus to 202302L for C++23. + +2023-06-23 Ben Boeckel <me@benboeckel.net> + + * charset.cc: Allow `UCS_LIMIT` in UTF-8 strings. + +2023-06-22 David Malcolm <dmalcolm@redhat.com> + + * charset.cc (get_cppchar_property): New function template, based + on... + (cpp_wcwidth): ...this function. Rework to use the above. + Include "combining-chars.inc". + (cpp_is_combining_char): New function + Include "printable-chars.inc". + (cpp_is_printable_char): New function + * combining-chars.inc: New file, generated by + contrib/unicode/gen-combining-chars.py. + * include/cpplib.h (cpp_is_combining_char): New function decl. + (cpp_is_printable_char): New function decl. + * printable-chars.inc: New file, generated by + contrib/unicode/gen-printable-chars.py. + 2023-06-20 Lewis Hyatt <lhyatt@gmail.com> PR c++/66290 diff --git a/libcpp/charset.cc b/libcpp/charset.cc index 3041e0b..5d6d7ae 100644 --- a/libcpp/charset.cc +++ b/libcpp/charset.cc @@ -1927,7 +1927,7 @@ cpp_valid_utf8_p (const char *buffer, size_t num_bytes) invalid because they cannot be represented in UTF-16. Reject such values.*/ - if (cp >= UCS_LIMIT) + if (cp > UCS_LIMIT) return false; } /* No problems encountered. */ diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 282d1c8..9f212a6 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -174,7 +174,7 @@ enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_GNUC11, CLK_GNUC17, CLK_GNUC2X, CLK_GNUCXX, CLK_CXX98, CLK_GNUCXX11, CLK_CXX11, CLK_GNUCXX14, CLK_CXX14, CLK_GNUCXX17, CLK_CXX17, CLK_GNUCXX20, CLK_CXX20, CLK_GNUCXX23, CLK_CXX23, - CLK_ASM}; + CLK_GNUCXX26, CLK_CXX26, CLK_ASM}; /* Payload of a NUMBER, STRING, CHAR or COMMENT token. */ struct GTY(()) cpp_string { diff --git a/libcpp/init.cc b/libcpp/init.cc index c508f06..693feaa 100644 --- a/libcpp/init.cc +++ b/libcpp/init.cc @@ -127,6 +127,8 @@ static const struct lang_flags lang_defaults[] = /* CXX20 */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1 }, /* GNUCXX23 */ { 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1 }, /* CXX23 */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1 }, + /* GNUCXX26 */ { 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1 }, + /* CXX26 */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1 }, /* ASM */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; @@ -561,11 +563,14 @@ cpp_init_builtins (cpp_reader *pfile, int hosted) if (CPP_OPTION (pfile, cplusplus)) { - /* C++23 is not yet a standard. For now, use an invalid - * year/month, 202100L, which is larger than 202002L. */ - if (CPP_OPTION (pfile, lang) == CLK_CXX23 + /* C++26 is not yet a standard. For now, use an invalid + year/month, 202400L, which is larger than 202302L. */ + if (CPP_OPTION (pfile, lang) == CLK_CXX26 + || CPP_OPTION (pfile, lang) == CLK_GNUCXX26) + _cpp_define_builtin (pfile, "__cplusplus 202400L"); + else if (CPP_OPTION (pfile, lang) == CLK_CXX23 || CPP_OPTION (pfile, lang) == CLK_GNUCXX23) - _cpp_define_builtin (pfile, "__cplusplus 202100L"); + _cpp_define_builtin (pfile, "__cplusplus 202302L"); else if (CPP_OPTION (pfile, lang) == CLK_CXX20 || CPP_OPTION (pfile, lang) == CLK_GNUCXX20) _cpp_define_builtin (pfile, "__cplusplus 202002L"); |