aboutsummaryrefslogtreecommitdiff
path: root/libcpp
AgeCommit message (Collapse)AuthorFilesLines
2024-12-17Daily bump.GCC Administrator1-0/+4
2024-12-16Update cpplib sr.poJoseph Myers1-30/+19
* sr.po: Update.
2024-11-26Daily bump.GCC Administrator1-0/+6
2024-11-25libcpp: Fix ICE lexing invalid raw string in a deferred pragma [PR117118]Lewis Hyatt1-1/+2
The PR shows that we ICE after lexing an invalid unterminated raw string, because lex_raw_string() pops the main buffer unexpectedly. Resolve by handling this case the same way as for other directives. libcpp/ChangeLog: PR preprocessor/117118 * lex.cc (lex_raw_string): Treat an unterminated raw string the same way for a deferred pragma as is done for other directives. gcc/testsuite/ChangeLog: PR preprocessor/117118 * c-c++-common/raw-string-directive-3.c: New test. * c-c++-common/raw-string-directive-4.c: New test.
2024-11-21Daily bump.GCC Administrator1-0/+9
2024-11-20diagnostics: fixes to SARIF output [PR109360]David Malcolm1-0/+2
When adding validation of .sarif files against the schema (PR testsuite/109360) I discovered various issues where we were generating invalid .sarif files. Specifically, in c-c++-common/diagnostic-format-sarif-file-bad-utf8-pr109098-1.c the relatedLocations for the "note" diagnostics were missing column numbers, leading to validation failure due to non-unique elements, such as multiple: "message": {"text": "invalid UTF-8 character <bf>"}}, on line 25 with no column information. Root cause is that for some diagnostics in libcpp we have a location_t representing the line as a whole, setting a column_override on the rich_location (since the line hasn't been fully read yet). We were handling this column override for plain text output, but not for .sarif output. Similarly, in diagnostic-format-sarif-file-pr111700.c there is a warning emitted on "line 0" of the file, whereas SARIF requires line numbers to be positive. We also use column == 0 internally to mean "the line as a whole", whereas SARIF required column numbers to be positive. This patch fixes these various issues. gcc/ChangeLog: PR testsuite/109360 * diagnostic-format-sarif.cc (sarif_builder::make_location_object): Pass any column override from rich_loc to maybe_make_physical_location_object. (sarif_builder::maybe_make_physical_location_object): Add "column_override" param and pass it to maybe_make_region_object. (sarif_builder::maybe_make_region_object): Add "column_override" param and use it when the location has 0 for a column. Don't add "startLine", "startColumn", "endLine", or "endColumn" if the values aren't positive. (sarif_builder::maybe_make_region_object_for_context): Don't add "startLine" or "endLine" if the values aren't positive. libcpp/ChangeLog: PR testsuite/109360 * include/rich-location.h (rich_location::get_column_override): New accessor. Signed-off-by: David Malcolm <dmalcolm@redhat.com> (cherry picked from commit 9f4fdc3acebcf6b045edea1361570658da4bc0ab)
2024-09-20Daily bump.GCC Administrator1-0/+4
2024-09-19Update cpplib zh_CN.poJoseph Myers1-198/+121
* zh_CN.po: Update.
2024-08-01Update ChangeLog and version files for releasereleases/gcc-14.2.0Jakub Jelinek2-0/+8
2024-05-07Update ChangeLog and version files for releasereleases/gcc-14.1.0Jakub Jelinek2-0/+8
2024-04-18Daily bump.GCC Administrator1-0/+6
2024-04-17libcpp: Regenerate aclocal.m4 and configure [PR 114748]Christophe Lyon2-0/+4
As discussed in the PR, aclocal.m4 and configure were incorrectly regenerated at some point. 2024-04-17 Christophe Lyon <christophe.lyon@linaro.org> PR preprocessor/114748 libcpp/ * aclocal.m4: Regenerate. * configure: Regenerate.
2024-03-15Daily bump.GCC Administrator1-0/+16
2024-03-14libcpp: Fix macro expansion for argument of __has_include [PR110558]Lewis Hyatt1-0/+3
When the file name for a #include directive is the result of stringifying a macro argument, libcpp needs to take some care to get the whitespace correct; in particular stringify_arg() needs to see a CPP_PADDING token between macro tokens so that it can figure out when to output space between tokens. The CPP_PADDING tokens are not normally generated when handling a preprocessor directive, but for #include-like directives, libcpp sets the state variable pfile->state.directive_wants_padding to TRUE so that the CPP_PADDING tokens will be output, and then everything works fine for computed includes. As the PR points out, things do not work fine for __has_include. Fix that by setting the state variable the same as is done for #include. libcpp/ChangeLog: PR preprocessor/110558 * macro.cc (builtin_has_include): Set pfile->state.directive_wants_padding prior to lexing the file name, in case it comes from macro expansion. gcc/testsuite/ChangeLog: PR preprocessor/110558 * c-c++-common/cpp/has-include-2.c: New test. * c-c++-common/cpp/has-include-2.h: New test.
2024-03-14libcpp: Fix __has_include_next ICE in the last directory of the path [PR80755]Lewis Hyatt1-4/+8
In libcpp/files.cc, the function _cpp_has_header(), which implements __has_include and __has_include_next, does not check for a NULL return value from search_path_head(), leading to an ICE tripping an assert when _cpp_find_file() tries to use it. Fix it by checking for that case and silently returning false instead. As suggested by the PR author, it is easiest to make a testcase by using the -idirafter option. To enable that, also modify the dg-additional-options testsuite procedure to make the global $srcdir available, since -idirafter requires the full path. libcpp/ChangeLog: PR preprocessor/80755 * files.cc (search_path_head): Add SUPPRESS_DIAGNOSTIC argument defaulting to false. (_cpp_has_header): Silently return false if the search path has been exhausted, rather than issuing a diagnostic and then hitting an assert. gcc/testsuite/ChangeLog: * lib/gcc-defs.exp (dg-additional-options): Make $srcdir usable in a dg-additional-options directive. * c-c++-common/cpp/has-include-next-2-dir/has-include-next-2.h: New test. * c-c++-common/cpp/has-include-next-2.c: New test.
2024-02-23Daily bump.GCC Administrator1-0/+8
2024-02-22c: Handle scoped attributes in __has*attribute and scoped attribute parsing ↵Jakub Jelinek2-2/+8
changes in -std=c11 etc. modes [PR114007] We aren't able to parse __has_attribute (vendor::attr) (and __has_c_attribute and __has_cpp_attribute) in strict C < C23 modes. While in -std=gnu* modes or in -std=c23 there is CPP_SCOPE token, in -std=c* (except for -std=c23) there are is just a pair of CPP_COLON tokens. The c-lex.cc hunk adds support for that. That leads to a question if we should return 1 or 0 from __has_attribute (gnu::unused) or not, because while [[gnu::unused]] is parsed fine in -std=gnu*/-std=c23 modes (sure, with pedwarn for < C23), we do not parse it at all in -std=c* (except for -std=c23), we only parse [[__extension__ gnu::unused]] there. While the __extension__ in there helps to avoid the pedwarn, I think it is better to be consistent between GNU and strict C < C23 modes and parse [[gnu::unused]] too; on the other side, I think parsing [[__extension__ gnu : : unused]] is too weird and undesirable. So, the following patch adds a flag during preprocessing at the point where we normally create CPP_SCOPE tokens out of 2 consecutive colons on the first CPP_COLON to mark the consecutive case (as we are tight on the bits, I've reused the PURE_ZERO flag, which is used just by the C++ FE and only ever set (both C and C++) on CPP_NUMBER tokens, this new flag has the same value and is only ever used on CPP_COLON tokens) and instead of checking loose_scope_p argument (i.e. whether it is [[__extension__ ...]] or not), it just parses CPP_SCOPE or CPP_COLON with CLONE_SCOPE flag followed by another CPP_COLON the same. The latter will never appear in >= C23 or -std=gnu* modes, though guarding its use say with flag_iso && !flag_isoc23 && doesn't really work because the __extension__ case temporarily clears flag_iso flag. This makes the -std=c11 etc. behavior more similar to -std=gnu11 or -std=c23, the only difference I'm aware of are the #define JOIN2(A, B) A##B [[vendor JOIN2(:,:) attr]] [[__extension__ vendor JOIN2(:,:) attr]] cases, which are accepted in the latter modes, but results in error in -std=c11; but the error is during preprocessing that :: doesn't form a valid preprocessing token, which is true, so just don't do that if you try to have __STRICT_ANSI__ && __STDC_VERSION__ <= 201710L compatibility. 2024-02-22 Jakub Jelinek <jakub@redhat.com> PR c/114007 gcc/ * doc/extend.texi: (__extension__): Remove comments about scope tokens vs. two colons. gcc/c-family/ * c-lex.cc (c_common_has_attribute): Parse 2 CPP_COLONs with the first one with COLON_SCOPE flag the same as CPP_SCOPE. gcc/c/ * c-parser.cc (c_parser_std_attribute): Remove loose_scope_p argument. Instead of checking it, parse 2 CPP_COLONs with the first one with COLON_SCOPE flag the same as CPP_SCOPE. (c_parser_std_attribute_list): Remove loose_scope_p argument, don't pass it to c_parser_std_attribute. (c_parser_std_attribute_specifier): Adjust c_parser_std_attribute_list caller. gcc/testsuite/ * gcc.dg/c23-attr-syntax-6.c: Adjust testcase for :: being valid even in -std=c11 even without __extension__ and : : etc. not being valid anymore even with __extension__. * gcc.dg/c23-attr-syntax-7.c: Likewise. * gcc.dg/c23-attr-syntax-8.c: New test. libcpp/ * include/cpplib.h (COLON_SCOPE): Define to PURE_ZERO. * lex.cc (_cpp_lex_direct): When lexing CPP_COLON with another colon after it, if !CPP_OPTION (pfile, scope) set COLON_SCOPE flag on the first CPP_COLON token.
2024-02-22Daily bump.GCC Administrator1-0/+4
2024-02-21Update cpplib de.poJoseph Myers1-33/+22
* de.po: Update.
2024-02-21Daily bump.GCC Administrator1-0/+4
2024-02-20Update cpplib sv.poJoseph Myers1-38/+19
* sv.po: Update.
2024-02-20Daily bump.GCC Administrator1-0/+10
2024-02-19Update cpplib es.poJoseph Myers1-29/+18
* es.po: Update.
2024-02-19Update .po filesJoseph Myers23-5579/+6721
gcc/po/ * be.po, da.po, de.po, el.po, es.po, fi.po, fr.po, hr.po, id.po, ja.po, nl.po, ru.po, sr.po, sv.po, tr.po, uk.po, vi.po, zh_CN.po, zh_TW.po: Update. libcpp/po/ * be.po, ca.po, da.po, de.po, el.po, eo.po, es.po, fi.po, fr.po, id.po, ja.po, ka.po, nl.po, pt_BR.po, ro.po, ru.po, sr.po, sv.po, tr.po, uk.po, vi.po, zh_CN.po, zh_TW.po: Update.
2024-02-17Daily bump.GCC Administrator1-0/+4
2024-02-16Regenerate .pot filesJoseph Myers1-256/+287
gcc/po/ * gcc.pot: Regenerate. libcpp/po/ * cpplib.pot: Regenerate.
2024-02-02Daily bump.GCC Administrator1-0/+6
2024-02-01libcpp: Stabilize the location for macros restored after PCH load [PR105608]Lewis Hyatt1-1/+8
libcpp currently lacks the infrastructure to assign correct locations to macros that were defined prior to loading a PCH and then restored afterwards. While I plan to address that fully for GCC 15, this patch improves things by using at least a valid location, even if it's not the best one. Without this change, libcpp uses pfile->directive_line as the location for the restored macros, but this location_t applies to the old line map, not the one that was just restored from the PCH, so the resulting location is unpredictable and depends on what was stored in the line maps before. With this change, all restored macros get assigned locations at the line of the #include that triggered the PCH restore. A future patch will store the actual file name and line number of each definition and then synthesize locations in the new line map pointing to the right place. gcc/c-family/ChangeLog: PR preprocessor/105608 * c-pch.cc (c_common_read_pch): Adjust line map so that libcpp assigns a location to restored macros which is the same location that triggered the PCH include. libcpp/ChangeLog: PR preprocessor/105608 * pch.cc (cpp_read_state): Set a valid location for restored macros.
2024-01-05Daily bump.GCC Administrator1-0/+7
2024-01-04libcpp: add function to check XID propertiesRaiki Tamura2-0/+43
This commit adds a new function intended for checking the XID properties of a possibly unicode character, as well as the accompanying enum describing the possible properties. libcpp/ChangeLog: * charset.cc (cpp_check_xid_property): New. * include/cpplib.h (cpp_check_xid_property): New. (enum cpp_xid_property): New. Signed-off-by: Raiki Tamura <tamaron1203@gmail.com>
2024-01-03Update copyright years.Jakub Jelinek27-29/+29
2024-01-03Update Copyright year in ChangeLog filesJakub Jelinek1-1/+1
2023 -> 2024
2023-12-14Daily bump.GCC Administrator1-0/+7
2023-12-13libcpp: Fix valgrind errors on pr88974.c [PR112956]Jakub Jelinek1-1/+4
On the c-c++-common/cpp/pr88974.c testcase I'm seeing ==600549== Conditional jump or move depends on uninitialised value(s) ==600549== at 0x1DD3A05: cpp_get_token_1(cpp_reader*, unsigned int*) (macro.cc:3050) ==600549== by 0x1DBFC7F: _cpp_parse_expr (expr.cc:1392) ==600549== by 0x1DB9471: do_if(cpp_reader*) (directives.cc:2087) ==600549== by 0x1DBB4D8: _cpp_handle_directive (directives.cc:572) ==600549== by 0x1DCD488: _cpp_lex_token (lex.cc:3682) ==600549== by 0x1DD3A97: cpp_get_token_1(cpp_reader*, unsigned int*) (macro.cc:2936) ==600549== by 0x7F7EE4: scan_translation_unit (c-ppoutput.cc:350) ==600549== by 0x7F7EE4: preprocess_file(cpp_reader*) (c-ppoutput.cc:106) ==600549== by 0x7F6235: c_common_init() (c-opts.cc:1280) ==600549== by 0x704C8B: lang_dependent_init (toplev.cc:1837) ==600549== by 0x704C8B: do_compile (toplev.cc:2135) ==600549== by 0x704C8B: toplev::main(int, char**) (toplev.cc:2306) ==600549== by 0x7064BA: main (main.cc:39) error. The problem is that _cpp_lex_direct can leave result->src_loc uninitialized in some cases and later on we use that location_t. _cpp_lex_direct essentially does: cppchar_t c; ... cpp_token *result = pfile->cur_token++; fresh_line: result->flags = 0; ... if (buffer->need_line) { if (pfile->state.in_deferred_pragma) { result->type = CPP_PRAGMA_EOL; ... // keeps result->src_loc uninitialized; return result; } if (!_cpp_get_fresh_line (pfile)) { result->type = CPP_EOF; if (!pfile->state.in_directive && !pfile->state.parsing_args) { result->src_loc = pfile->line_table->highest_line; ... } ... // otherwise result->src_loc is sometimes uninitialized here return result; } ... } ... result->src_loc = pfile->line_table->highest_line; ... c = *buffer->cur++; switch (c) { ... case '\n': ... buffer->need_line = true; if (pfile->state.in_deferred_pragma) { result->type = CPP_PRAGMA_EOL; ... return result; } goto fresh_line; ... } ... So, if _cpp_lex_direct is called without buffer->need_line initially set, result->src_loc is always initialized (and actually hundreds of tests rely on that exact value it has), even when c == '\n' and we set that flag later on and goto fresh_line. For CPP_PRAGMA_EOL case we have in that case separate handling and don't goto. But if _cpp_lex_direct is called with buffer->need_line initially set and either decide to return a CPP_PRAGMA_EOL token or if getting a new line fails for some reason and we return an CPP_ERROR token and we are in directive or parsing args state, it is kept uninitialized and can be whatever the allocation left it there as. The following patch attempts to keep the status quo, use value that was returned previously if it was initialized (i.e. we went through the goto fresh_line; statement in c == '\n' handling) and only initialize result->src_loc if it was uninitialized before. 2023-12-13 Jakub Jelinek <jakub@redhat.com> PR preprocessor/112956 * lex.cc (_cpp_lex_direct): Initialize c to 0. For CPP_PRAGMA_EOL tokens and if c == 0 also for CPP_EOF set result->src_loc to highest locus.
2023-11-29Daily bump.GCC Administrator1-0/+6
2023-11-27libcpp: Fix unsigned promotion for unevaluated divide by zero [PR112701]Lewis Hyatt1-0/+1
When libcpp encounters a divide by zero while processing a constant expression "x/y", it returns "x" as a fallback. The value of the fallback is not normally important, since an error will be generated anyway, but if the expression appears in an unevaluated context, such as "0 ? 0/0u : -1", then there will be no error, and the fallback value will be meaningful to the extent that it may cause promotion from signed to unsigned of an operand encountered later. As the PR notes, libcpp does not do the unsigned promotion correctly in this case; fix it by making the fallback return value unsigned as necessary. libcpp/ChangeLog: PR preprocessor/112701 * expr.cc (num_div_op): Set unsignedp appropriately when returning a stub value for divide by 0. gcc/testsuite/ChangeLog: PR preprocessor/112701 * gcc.dg/cpp/expr.c: Add additional tests to cover divide by 0 in an unevaluated context, where the unsignedness still matters.
2023-11-28Daily bump.GCC Administrator1-0/+10
2023-11-27c-family: Implement __has_feature and __has_extension [PR60512]Alex Coplan3-1/+14
This patch implements clang's __has_feature and __has_extension in GCC. Currently the patch aims to implement all documented features (and some undocumented ones) following the documentation at https://clang.llvm.org/docs/LanguageExtensions.html with the exception of the legacy features for C++ type traits. These are omitted, since as the clang documentation notes, __has_builtin is the correct "modern" way to query for these (which GCC already implements). gcc/c-family/ChangeLog: PR c++/60512 * c-common.cc (struct hf_feature_info): New. (c_common_register_feature): New. (init_has_feature): New. (has_feature_p): New. * c-common.h (c_common_has_feature): New. (c_family_register_lang_features): New. (c_common_register_feature): New. (has_feature_p): New. * c-lex.cc (init_c_lex): Plumb through has_feature callback. (c_common_has_builtin): Generalize and move common part ... (c_common_lex_availability_macro): ... here. (c_common_has_feature): New. * c-ppoutput.cc (init_pp_output): Plumb through has_feature. gcc/c/ChangeLog: PR c++/60512 * c-lang.cc (c_family_register_lang_features): New. * c-objc-common.cc (struct c_feature_info): New. (c_register_features): New. * c-objc-common.h (c_register_features): New. gcc/cp/ChangeLog: PR c++/60512 * cp-lang.cc (c_family_register_lang_features): New. * cp-objcp-common.cc (struct cp_feature_selector): New. (cp_feature_selector::has_feature): New. (struct cp_feature_info): New. (cp_register_features): New. * cp-objcp-common.h (cp_register_features): New. gcc/ChangeLog: PR c++/60512 * doc/cpp.texi: Document __has_{feature,extension}. gcc/objc/ChangeLog: PR c++/60512 * objc-act.cc (struct objc_feature_info): New. (objc_nonfragile_abi_p): New. (objc_common_register_features): New. * objc-act.h (objc_common_register_features): New. * objc-lang.cc (c_family_register_lang_features): New. gcc/objcp/ChangeLog: PR c++/60512 * objcp-lang.cc (c_family_register_lang_features): New. libcpp/ChangeLog: PR c++/60512 * include/cpplib.h (struct cpp_callbacks): Add has_feature. (enum cpp_builtin_type): Add BT_HAS_{FEATURE,EXTENSION}. * init.cc: Add __has_{feature,extension}. * macro.cc (_cpp_builtin_macro_text): Handle BT_HAS_{FEATURE,EXTENSION}. gcc/testsuite/ChangeLog: PR c++/60512 * c-c++-common/has-feature-common.c: New test. * c-c++-common/has-feature-pedantic.c: New test. * g++.dg/ext/has-feature.C: New test. * gcc.dg/asan/has-feature-asan.c: New test. * gcc.dg/has-feature.c: New test. * gcc.dg/ubsan/has-feature-ubsan.c: New test. * obj-c++.dg/has-feature.mm: New test. * objc.dg/has-feature.m: New test. Co-Authored-By: Iain Sandoe <iain@sandoe.co.uk>
2023-11-25Daily bump.GCC Administrator1-0/+10
2023-11-24libcpp: configure: drop unused Valgrind detectionAlexander Monakov4-131/+9
When top-level configure has either --enable-checking=valgrind or --enable-valgrind-annotations, we want to activate a couple of workarounds in libcpp. They do not use anything from the Valgrind API, so just delete all detection. libcpp/ChangeLog: * config.in: Regenerate. * configure: Regenerate. * configure.ac (ENABLE_VALGRIND_CHECKING): Delete. (ENABLE_VALGRIND_ANNOTATIONS): Rename to ENABLE_VALGRIND_WORKAROUNDS. Delete Valgrind header checks. * lex.cc (new_buff): Adjust for renaming. (_cpp_free_buff): Ditto.
2023-11-21Daily bump.GCC Administrator1-0/+5
2023-11-20Trivial typo fix in variadicMarc Poulhiès1-10/+10
Fix all occurences of varadic, except for Rust (will be part of another change). gcc/ChangeLog: * config/nvptx/nvptx.h (struct machine_function): Fix typo in variadic. * config/nvptx/nvptx.cc (nvptx_function_arg_advance): Adjust to use fixed name. (nvptx_declare_function_name): Likewise. (nvptx_call_args): Likewise. (nvptx_expand_call): Likewise. gcc/cp/ChangeLog: * lambda.cc (compare_lambda_sig): Fix typo in variadic. libcpp/ChangeLog: * macro.cc (parse_params): Fix typo in variadic. (create_iso_definition): Likewise. Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2023-11-20Daily bump.GCC Administrator1-0/+11
2023-11-19libcpp: split decls out to rich-location.hDavid Malcolm5-672/+701
The various decls relating to rich_location are in libcpp/include/line-map.h, but they don't relate to line maps. Split them out to their own header: libcpp/include/rich-location.h No functional change intended. gcc/ChangeLog: * Makefile.in (CPPLIB_H): Add libcpp/include/rich-location.h. * coretypes.h (class rich_location): New forward decl. gcc/analyzer/ChangeLog: * analyzer.h: Include "rich-location.h". gcc/c-family/ChangeLog: * c-lex.cc: Include "rich-location.h". gcc/cp/ChangeLog: * mapper-client.cc: Include "rich-location.h". gcc/ChangeLog: * diagnostic.h: Include "rich-location.h". * edit-context.h (class fixit_hint): New forward decl. * gcc-rich-location.h: Include "rich-location.h". * genmatch.cc: Likewise. * pretty-print.h: Likewise. gcc/rust/ChangeLog: * rust-location.h: Include "rich-location.h". libcpp/ChangeLog: * Makefile.in (TAGS_SOURCES): Add "include/rich-location.h". * include/cpplib.h (class rich_location): New forward decl. * include/line-map.h (class range_label) (enum range_display_kind, struct location_range) (class semi_embedded_vec, class rich_location, class label_text) (class range_label, class fixit_hint): Move to... * include/rich-location.h: ...this new file. * internal.h: Include "rich-location.h". Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2023-11-15Daily bump.GCC Administrator1-0/+29
2023-11-14libcpp, contrib: Update to Unicode 15.1Jakub Jelinek5-12820/+12830
The following patch (in plaintext just a pseudo-patch where I've left out the too big parts of either wget downloaded or regenerated files out with ..., full patch attached compressed) updates to Unicode 15.1 from 15.0 we had last year. Apparently Unicode forgot to add a new range to 4-8 Table we are using, but from the other files it is clear what should have been added; I've filed a bugreport against Unicode. 2023-11-14 Jakub Jelinek <jakub@redhat.com> contrib/ * unicode/README: Adjust glibc git commit hash, number of Unicode data files to be updated and latest Unicode version. * unicode/from_glibc/utf8_gen.py: Update from glibc. * unicode/UnicodeData.txt: Update from Unicode 15.1. * unicode/EastAsianWidth.txt: Likewise. * unicode/DerivedNormalizationProps.txt: Likewise. * unicode/NameAliases.txt: Likewise. * unicode/DerivedCoreProperties.txt: Likewise. * unicode/PropList.txt: Likewise. libcpp/ * makeucnid.cc (write_copyright): Update copyright year. * makeuname2c.cc (write_copyright): Likewise. (struct generated): Update latest Unicode version. (generated_ranges): Add 2ebf0-2ee5d CJK UNIFIED IDEOGRAPH range which was forgotten to be added to 4-8 table, but clearly is expected to be there from the 15.1 additions. * ucnid.h: Regenerated. * uname2c.h: Regenerated. * generated_cpp_wcwidth.h: Regenerated.
2023-11-14c++: Implement C++26 P1854R4 - Making non-encodable string literals ↵Jakub Jelinek1-17/+177
ill-formed [PR110341] This paper voted in as DR makes some multi-character literals ill-formed. 'abcd' stays valid, but e.g. 'á' is newly invalid in UTF-8 exec charset while valid e.g. in ISO-8859-1, because it is a single character which needs 2 bytes to be encoded. The following patch does that by checking (only pedantically, especially because it is a DR) if we'd emit a -Wmultichar warning because character constant has more than one byte in it whether the number of source characters is equal to the number of bytes in the multichar string. If it is, it is normal multi-character literal constant and is diagnosed normally with -Wmultichar, otherwise at least one of the c-chars in the sequence was encoded as 2+ bytes. 2023-11-14 Jakub Jelinek <jakub@redhat.com> PR c++/110341 libcpp/ * charset.cc: Implement C++26 P1854R4 - Making non-encodable string literals ill-formed. (one_count_chars, convert_count_chars, count_source_chars): New functions. (narrow_str_to_charconst): Change last arg type from cpp_ttype to const cpp_token *. For C++ if pedantic and i > 1 in CPP_CHAR interpret token also as CPP_STRING32 and if number of characters in the CPP_STRING32 is larger than number of bytes in CPP_CHAR, pedwarn on it. Make the diagnostics more detailed. (wide_str_to_charconst): Change last arg type from cpp_ttype to const cpp_token *. Make the diagnostics more detailed. (cpp_interpret_charconst): Adjust narrow_str_to_charconst and wide_str_to_charconst callers. gcc/testsuite/ * g++.dg/cpp26/literals1.C: New test. * g++.dg/cpp26/literals2.C: New test. * g++.dg/cpp23/wchar-multi1.C: Adjust expected diagnostic wordings. * g++.dg/cpp23/wchar-multi2.C: Likewise. * gcc.dg/c23-utf8char-3.c: Likewise. * gcc.dg/cpp/charconst-4.c: Likewise. * gcc.dg/cpp/charconst.c: Likewise. * gcc.dg/cpp/if-2.c: Likewise. * gcc.dg/utf16-4.c: Likewise. * gcc.dg/utf32-4.c: Likewise. * g++.dg/cpp1z/utf8-neg.C: Likewise. * g++.dg/cpp2a/ucn2.C: Likewise. * g++.dg/ext/utf16-4.C: Likewise. * g++.dg/ext/utf32-4.C: Likewise.
2023-11-14Daily bump.GCC Administrator1-0/+26
2023-11-14libcpp: Regenerate config.inArsen Arsenović1-1/+16
The previous commit did not include regenerating files maintained by autoheader. libcpp/ChangeLog: * config.in: Regenerate.
2023-11-14*: add modern gettextArsen Arsenović2-205/+1869
This patch updates gettext.m4 and related .m4 files and adds gettext-runtime as a gmp/mpfr/... style host library, allowing newer libintl to be used. This patch /does not/ add build-time tools required for internationalizing (msgfmt et al), instead, it just updates the runtime library. The result should be a distribution that acts exactly the same when a copy of gettext is present, and disables internationalization otherwise. There should be no changes in behavior when gettext is included in-tree. When gettext is not included in tree, nor available on the system, the programs will be built without localization. ChangeLog: PR bootstrap/12596 * .gitignore: Add '/gettext*'. * configure.ac (host_libs): Replace intl with gettext. (hbaseargs, bbaseargs, baseargs): Split baseargs into {h,b}baseargs. (skip_barg): New flag. Skips appending current flag to bbaseargs. <library exemptions>: Exempt --with-libintl-{type,prefix} from target and build machine argument passing. * configure: Regenerate. * Makefile.def (host_modules): Replace intl module with gettext module. (configure-ld): Depend on configure-gettext. * Makefile.in: Regenerate. config/ChangeLog: * intlmacosx.m4: Import from gettext-0.22 (serial 8). * gettext.m4: Sync with gettext-0.22 (serial 77). * gettext-sister.m4 (ZW_GNU_GETTEXT_SISTER_DIR): Load gettext's uninstalled-config.sh, or call AM_GNU_GETTEXT if missing. * iconv.m4: Sync with gettext-0.22 (serial 26). contrib/ChangeLog: * prerequisites.sha512: Add gettext. * prerequisites.md5: Add gettext. * download_prerequisites: Add gettext. gcc/ChangeLog: * configure: Regenerate. * aclocal.m4: Regenerate. * Makefile.in (LIBDEPS): Remove (potential) ./ prefix from LIBINTL_DEP. * doc/install.texi: Document new (notable) flags added by the optional gettext tree and by AM_GNU_GETTEXT. Document libintl/libc with gettext dependency. libcpp/ChangeLog: * configure: Regenerate. * aclocal.m4: Regenerate. libstdc++-v3/ChangeLog: * configure: Regenerate.