[Bug modula2/120474] InOut buffering should flush the WriteLn before the Read
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120474 --- Comment #2 from GCC Commits --- The master branch has been updated by Gaius Mulley : https://gcc.gnu.org/g:13498bf4fcff4c0633678c53a46b6be425d2904c commit r16-1037-g13498bf4fcff4c0633678c53a46b6be425d2904c Author: Gaius Mulley Date: Sun Jun 1 11:25:25 2025 +0100 PR modula2/120474: InOut buffering should flush the WriteLn before the Read This patch adds a BufferFlush to InOut.mod:LocalWrite. gcc/m2/ChangeLog: PR modula2/120474 * gm2-libs-log/InOut.mod (LocalWrite): Call FIO.FlushBuffer. Signed-off-by: Gaius Mulley
[Bug modula2/120474] InOut buffering should flush the WriteLn before the Read
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120474 Gaius Mulley changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED|RESOLVED --- Comment #3 from Gaius Mulley --- Closing now that the patch has been applied.
[Bug c++/120499] import std: indirect use of an exported class using a vector yields undefined symbol
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120499 Nathaniel Shead changed: What|Removed |Added CC||nshead at gcc dot gnu.org Ever confirmed|0 |1 Last reconfirmed||2025-06-01 Blocks||103524 Status|UNCONFIRMED |NEW --- Comment #1 from Nathaniel Shead --- Confirmed. Minimal reproduction (without 'std'): // a.cpp export module A; struct allocator { ~allocator() {} }; export template struct vector { struct _Vector_impl : public allocator {}; _Vector_impl _M_impl; vector() = default; }; template struct regex_token_iterator { vector _M_subs; }; using cregex_token_iterator = regex_token_iterator; // b.cpp export module B; import A; class Coll { vector vals; }; export Coll createColl() { return Coll{}; } // c.cpp import B; int main() { createColl(); } Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103524 [Bug 103524] [meta-bug] modules issue
[Bug libstdc++/120465] std::erase_if for std::flat_map calls predicate with incorrect type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120465 --- Comment #5 from GCC Commits --- The releases/gcc-15 branch has been updated by Patrick Palka : https://gcc.gnu.org/g:48d6f5dbb0e412266ebb77def04ed378ca856029 commit r15-9751-g48d6f5dbb0e412266ebb77def04ed378ca856029 Author: Patrick Palka Date: Thu May 29 10:11:57 2025 -0400 libstdc++: Fix tuple/pair confusion with std::erase_if(flat_map) [PR120465] std::erase_if for flat_map/multimap is implemented via ranges::erase_if over a zip_view of the keys and values, the value_type of which is a tuple, but the given predicate needs to be called with a pair (flat_map's value_type). So use a projection to convert the tuple into a suitable pair. PR libstdc++/120465 libstdc++-v3/ChangeLog: * include/std/flat_map (_Flat_map_impl::_M_erase_if): Use a projection with ranges::remove_if to pass a pair instead of a tuple to the predicate. * testsuite/23_containers/flat_map/1.cc (test07): Strengthen to expect the argument passed to the predicate is a pair. * testsuite/23_containers/flat_multimap/1.cc (test07): Likewise. Co-authored-by: Jonathan Wakely Reviewed-by: Tomasz KamiÅski Reviewed-by: Jonathan Wakely (cherry picked from commit 589b27ec5769410e036df57645ff1eb7c765f692)
[Bug c++/120502] New: GCC Crash at cp/constexpr.cc:5462 when trying to constant evaluate constructor
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120502 Bug ID: 120502 Summary: GCC Crash at cp/constexpr.cc:5462 when trying to constant evaluate constructor Product: gcc Version: 15.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nikolasklauser at berlin dot de Target Milestone: --- ``` struct non_trivial_if { constexpr non_trivial_if() {} }; struct allocator : non_trivial_if {}; struct padding {}; struct __short { [[no_unique_address]] padding p; }; struct basic_string { union { __short s; int l; }; [[no_unique_address]] allocator a; constexpr basic_string() {} ~basic_string(); }; struct time_zone { basic_string __abbrev; long __offset; }; time_zone convert_to_time_zone() { return {}; } ``` The code above crashes GCC when compiling with `-std=c++23 -O1` (Godbolt: https://godbolt.org/z/xnEx8E7nc). This is a reduced test-case from libc++.
[Bug libstdc++/120465] std::erase_if for std::flat_map calls predicate with incorrect type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120465 Patrick Palka changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org --- Comment #6 from Patrick Palka --- Fixed for 15.2, thanks for the bug report.
[Bug cobol/120501] New: Error parsing ">>turn"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120501 Bug ID: 120501 Summary: Error parsing ">>turn" Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: cobol Assignee: unassigned at gcc dot gnu.org Reporter: rdubner at gcc dot gnu.org Target Milestone: --- This program: program-id. parsing-bug. procedure division. display function exception-status >>turn ec-all checking on goback. results in this error playpen.cbl:4:9: error: syntax error, unexpected '>' 4 | >>turn ec-all checking on | ^ cobol1: error: failed compiling playpen.cbl
[Bug cobol/120501] Error parsing ">>turn"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120501 Robert Dubner changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |jklowden at gcc dot gnu.org CC||rdubner at gcc dot gnu.org Status|UNCONFIRMED |ASSIGNED Last reconfirmed||2025-06-01 Ever confirmed|0 |1
[Bug translation/79093] Hard coded plural in builtins.c:3203
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79093 Magnus Morton changed: What|Removed |Added CC||magnusmorton at gmail dot com --- Comment #3 from Magnus Morton --- I think this now might be moot; builtins.c no longer exists and all the equivalent code in builtins.cc now uses warning_n
[Bug libstdc++/120465] std::erase_if for std::flat_map calls predicate with incorrect type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120465 --- Comment #7 from Eligor Kadaf --- Thank you for the fast fix.
[Bug translation/79093] Hard coded plural in builtins.c:3203
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79093 Andrew Pinski changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=84818 Resolution|--- |FIXED Status|NEW |RESOLVED Target Milestone|--- |8.0 --- Comment #4 from Andrew Pinski --- The warning was moved in r12-2581-g2a837de28ee94b to gimple-ssa-warn-access.cc But it looks like it was fixed before that. It was fixed by r8-7579-g457442eb8afcd9.
[Bug translation/79093] Hard coded plural in builtins.c:3203
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79093 Andrew Pinski changed: What|Removed |Added Resolution|FIXED |DUPLICATE --- Comment #5 from Andrew Pinski --- The code here actually changed into the code referenced in PR 84818 by r8-424-gd9c5a8b98a21ab . So this is just a dup of bug 84818 . *** This bug has been marked as a duplicate of bug 84818 ***
[Bug tree-optimization/84818] integer_onep must not be used for i18n
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84818 Andrew Pinski changed: What|Removed |Added CC||fmarchal at perso dot be --- Comment #5 from Andrew Pinski --- *** Bug 79093 has been marked as a duplicate of this bug. ***
[Bug c++/120504] [16 Regression] gcc-16 fails to build llvm-20 and gdb-16.3 unique_ptr.h:91:23: error: invalid application of 'sizeof' to incomplete type ... since r16-944-g0629924777ea20
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120504 Xi Ruoyao changed: What|Removed |Added CC||xry111 at gcc dot gnu.org Priority|P3 |P1 --- Comment #1 from Xi Ruoyao --- Failing to build two well-known open source projects should be P1 (unless both GDB code and LLVM code are invalid).
[Bug other/120493] 2 different functions to get call RTX from CALL_INSN
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120493 H.J. Lu changed: What|Removed |Added Status|NEW |RESOLVED Target Milestone|--- |16.0 Resolution|--- |FIXED --- Comment #3 from H.J. Lu --- Fixed.
[Bug other/120493] 2 different functions to get call RTX from CALL_INSN
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120493 --- Comment #2 from GCC Commits --- The master branch has been updated by H.J. Lu : https://gcc.gnu.org/g:2da641d01700907d600ff9027ecfc82500342428 commit r16-1041-g2da641d01700907d600ff9027ecfc82500342428 Author: H.J. Lu Date: Sun Jun 1 09:29:48 2025 +0800 Move get_call_rtx_from to final.c Move get_call_rtx_from to final.c and call call_from_call_insn. PR other/120493 * final.cc (call_from_call_insn): Change the argument type to const rtx_call_insn *. (get_call_rtx_from): New. * rtl.h (is_a_helper ::test): New. (get_call_rtx_from): Moved to the final.cc section. * rtlanal.cc (get_call_rtx_from): Removed. Signed-off-by: H.J. Lu
[Bug c++/120495] error: non-template type 'coroutine_handle' used as a template
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120495 Iain Sandoe changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |iains at gcc dot gnu.org CC||iains at gcc dot gnu.org Status|UNCONFIRMED |ASSIGNED Last reconfirmed||2025-06-02 Ever confirmed|0 |1 --- Comment #1 from Iain Sandoe --- I have a patch under test.
[Bug bootstrap/98324] [11 Regression] bootstrap broken with a LTO build configured with --enable-default-pie
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98324 --- Comment #8 from GCC Commits --- The master branch has been updated by Kito Cheng : https://gcc.gnu.org/g:3f1f99ef82a65d66e3aaa429bf4fb746b93da0db commit r16-1046-g3f1f99ef82a65d66e3aaa429bf4fb746b93da0db Author: Kito Cheng Date: Tue May 27 10:10:15 2025 +0800 c++tools: Don't check --enable-default-pie. `--enable-default-pie` is an option to specify whether to enable position-independent executables by default for `target`. However c++tools is build for `host`, so it should just follow `--enable-host-pie` option to determine whether to build with position-independent executables or not. NOTE: I checked PR 98324 and build with same configure option (`--enable-default-pie` and lto bootstrap) on x86-64 linux to make sure it won't cause same problem. c++tools/ChangeLog: * configure.ac: Don't check `--enable-default-pie`. * configure: Regen.
[Bug c++/120504] [16 Regression] gcc-16 fails to build llvm-20 and gdb-16.3 unique_ptr.h:91:23: error: invalid application of 'sizeof' to incomplete type ... since r16-944-g0629924777ea20
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120504 Sam James changed: What|Removed |Added CC||sjames at gcc dot gnu.org Last reconfirmed||2025-06-01 Status|UNCONFIRMED |NEW Ever confirmed|0 |1
[Bug fortran/120483] [15/16 Regression] character(len=:), allocatable, save variable returns incorrect substring since r15-2131
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120483 --- Comment #5 from anlauf at gcc dot gnu.org --- Instead of adding the SAVE attribute to the declaration, one can get the same wrong code with -fno-automatic. The decl generated by gfc_sym_type() looks suspicious in the case when the SAVE attribute is present. Reverting that particular hunk of commit r15-2131 fixes the present testcase for me, but I haven't investigated further.
[Bug translation/40883] [meta-bug] Translation breakage with trivial fixes
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40883 Bug 40883 depends on bug 79093, which changed state. Bug 79093 Summary: Hard coded plural in builtins.c:3203 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79093 What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED
[Bug fortran/119856] Missing commas in I/O formats not diagnosed by default at compile time.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119856 --- Comment #15 from GCC Commits --- The master branch has been updated by Jerry DeLisle : https://gcc.gnu.org/g:5ff48aabf76c8913c013f233d3f42bb217a16e7b commit r16-1040-g5ff48aabf76c8913c013f233d3f42bb217a16e7b Author: Jerry DeLisle Date: Sat May 31 08:57:22 2025 -0700 Fortran: Fix handling of parsed format strings. Previously parsed strings with errors were being cached such that subsequent use of the format string were not being checked for errors. PR libfortran/119856 libgfortran/ChangeLog: * io/format.c (parse_format_list): Set the fmt->error message for missing comma. (parse_format): Do not cache the parsed format string if a previous error ocurred. gcc/testsuite/ChangeLog: * gfortran.dg/pr119856.f90: New test.
[Bug fortran/119856] Missing commas in I/O formats not diagnosed by default at compile time.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119856 --- Comment #16 from GCC Commits --- The releases/gcc-15 branch has been updated by Jerry DeLisle : https://gcc.gnu.org/g:4856affe9e08a3562792d6cde217cd06c1ef93da commit r15-9754-g4856affe9e08a3562792d6cde217cd06c1ef93da Author: Jerry DeLisle Date: Wed May 28 07:56:12 2025 -0700 Fortran: Adjust handling of optional comma in FORMAT. This change adjusts the error messages for optional commas in format strings to give a warning at compile time unless -std=legacy is used. This is more consistant with the runtime library. A missing comma separator should not be encouraged as it is non-standard fortran. PR fortran/119856 gcc/fortran/ChangeLog: * io.cc: Set missing comma error checks to STD_STD_LEGACY. gcc/testsuite/ChangeLog: * gfortran.dg/comma_format_extension_1.f: Update dg-options to "-std=legacy". * gfortran.dg/comma_format_extension_3.f: Likewise. * gfortran.dg/continuation_13.f90: Likewise. (cherry picked from commit e2bf0b3910de7e65363435f0a7fa606e2448a677)
[Bug fortran/119856] Missing commas in I/O formats not diagnosed by default at compile time.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119856 --- Comment #17 from GCC Commits --- The releases/gcc-15 branch has been updated by Jerry DeLisle : https://gcc.gnu.org/g:21e0a742e7b70dcb9d8bed87a7d1b1b77b48b364 commit r15-9755-g21e0a742e7b70dcb9d8bed87a7d1b1b77b48b364 Author: Jerry DeLisle Date: Sat May 31 08:57:22 2025 -0700 Fortran: Fix handling of parsed format strings. Previously parsed strings with errors were being cached such that subsequent use of the format string were not being checked for errors. PR libfortran/119856 libgfortran/ChangeLog: * io/format.c (parse_format_list): Set the fmt->error message for missing comma. (parse_format): Do not cache the parsed format string if a previous error ocurred. gcc/testsuite/ChangeLog: * gfortran.dg/pr119856.f90: New test. (cherry picked from commit 5ff48aabf76c8913c013f233d3f42bb217a16e7b)
[Bug c/120180] [OpenMP] ICE in C (c_parser_consume_token) / C++ cp_parser_skip_to_pragma_eol in error recovery for metadirective
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120180 --- Comment #7 from Tobias Burnus --- The ICE is now fixed (GCC mainline/16 + GCC 15). [Thanks!] Open are the issues (or "issues") → comment 3 * non-executable directives (like 'omp nothing' or 'omp error at(compile)') as intervening code [OpenMP 6 feature] * RFC how to handle 'omp metadirective when(cond1 : ... collapse(2)', 'for', 'omp metadirective when(cond2 : simd)', 'for' when cond1 or cond2 condition is 'false'
[Bug libfortran/116400] [15/16 Regression] Regenerated files are no longer written to the source directory
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116400 --- Comment #17 from Iain Sandoe --- on macOS we have to use gm4 (the installed version does not recognise -g or --gnu). Having said that, *developers* working on GCC on macOS most likely do have a newer version installed, since the OS one is old). End users do not need to do this. So, I suppose, the trick will be to lift the mechanism used by the configure scripts and apply that.
[Bug c/120380] [14/15/16 Regression] internal compiler error: error reporting routines re-entered
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120380 --- Comment #5 from GCC Commits --- The master branch has been updated by Martin Uecker : https://gcc.gnu.org/g:b2c8d3064764f1f4bfd41d8791d06f2206b42780 commit r16-1036-gb2c8d3064764f1f4bfd41d8791d06f2206b42780 Author: Martin Uecker Date: Thu May 29 17:17:12 2025 +0200 c: fix ICE related to tagged types with attributes in diagnostics [PR120380] get_aka_type will create a new type for diagnostics, but for tagged types attributes will then be ignored with a warning. This can lead to reentering warning code which leads to an ICE. Fix this by ignoring the attributes for tagged types. PR c/120380 gcc/c/ChangeLog: * c-objc-common.cc (get_aka_type): Ignore attributes for tagged types. gcc/testsuite/ChangeLog: * gcc.dg/pr120380.c: New test.
[Bug c++/120500] New: Template argument deduction fails when using a template-member-function of a template-type with the same fixed sequence
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120500 Bug ID: 120500 Summary: Template argument deduction fails when using a template-member-function of a template-type with the same fixed sequence Product: gcc Version: 15.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: pro.guillaume.dua at gmail dot com Target Milestone: --- The following MVE fails to compile on GCC, while Clang and MSVC accept it. (See it here on godbolt https://godbolt.org/z/7GzGhKx3n) #include template struct Leaf{}; template struct S; template struct S> { template S(Leaf...) {} }; int main() { [[maybe_unused]] S> s{ Leaf<0, char>{}, Leaf<1, int>{} }; } Also, changing the S constructor to template S(Leaf...) {} make it compile. Same MVE, but using a non-constructor member function, and a TTPs instead of an index_sequence: https://godbolt.org/z/osb48T7nx
[Bug c++/120500] Template argument deduction fails when using a template-member-function of a template-type with the same fixed sequence
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120500 --- Comment #1 from Andrew Pinski --- Created attachment 61558 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61558&action=edit Reduced, removed includes
[Bug c++/120500] Template argument deduction fails when using a template-member-function of a template-type with the same fixed sequence
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120500 Andrew Pinski changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed||2025-06-01 See Also||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=84857, ||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=57527 Status|UNCONFIRMED |NEW --- Comment #2 from Andrew Pinski --- Confirmed.
[Bug c++/120502] [15/16 Regression] ICE in verify_ctor_sanity with -std=c++20 -O1 and no_unique_address
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120502 Andrew Pinski changed: What|Removed |Added Target Milestone|--- |15.2 Keywords||ice-on-valid-code Summary|GCC Crash at|[15/16 Regression] ICE in |cp/constexpr.cc:5462 when |verify_ctor_sanity with |trying to constant evaluate |-std=c++20 -O1 and |constructor |no_unique_address
[Bug cobol/119524] cobol: gg_printf assumes target characteristics
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119524 Robert Dubner changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #5 from Robert Dubner --- As recommended, I moved the call to fprintf() into libgcobol. I am optimistically closing this out, because, well, optimism. If it doesn't work, you know where to find me.
[Bug c++/120502] [15/16 Regression] ICE in verify_ctor_sanity with -std=c++20 -O1 and no_unique_address
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120502 Andrew Pinski changed: What|Removed |Added Last reconfirmed||2025-06-01 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Keywords||needs-bisection --- Comment #1 from Andrew Pinski --- Confirmed.
[Bug cobol/120422] Reducing strcmp() and strlen() gcc/cobol/genapi.cc at f3a62dcfc96cb24127385a7e668133e037b6085d
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120422 Robert Dubner changed: What|Removed |Added CC||rdubner at gcc dot gnu.org --- Comment #2 from Robert Dubner --- (In reply to Kael Franco from comment #0) > Created attachment 61512 [details] > Patch > > strcmp() and strlen() are used a lot. This patch should reduce both > functions usage by putting it in local variables. Please check if I missed > anything. Karl, I am a bit perplexed as to what problem you are trying to solve, and how you think your patch is going to solve anything. If I understand what you are proposing, you want to replace strcmp() calls with memcmp() calls. A typical example: - else if( strcmp(function_name, "__gg__when_compiled") == 0 ) + else if( function_namelen == 19 && memcmp(function_name, "__gg__when_compiled", 19) == 0 ) I wrote some code that runs on an x86_64 box, with the code compiled by GCC-16. I'll include it at the end of this comment, so that you can see what I did. Compiled with -00, one billion 26-character strcmp() comparisons take about 14 seconds and the same number of memcmp comparisons take 13 seconds. Compiled with -O3, the times are 13 seconds and 11 seconds. Perhaps if these comparisons were being done deep in an inner loop there would be more justification for using strlen() to determine the string length and cut down on the number of comparisons by checking the lengths first. But the code you are suggesting changing is hardly inner loop. It executes during compilation -- not during executable execution -- when calls to COBOL intrinsic functions are being generated. And my test program suggests that if a COBOL program had 1,000 such calls to intrinsic functions... Well, each one might do six or so comparisons at about 10 nanoseconds each. The execution time for all of those comparisons would be about 60 microseconds on my machine. To my eye, the almost insignificant execution time savings resulting from changing from strcmp to memcmp is far overwhelmed by the increased complexity of the memcmp() code. So, I am not going to sign off on it. I can't know why you think memcmp() is significantly superior to strcmp(). Perhaps you have seen something in the past, or perhaps you see something on some other system. I am curious as to why you think so. Here's the timing program I wrote: === #include #include #include #include int main(int argc, char **argv) { static const int outer = 1000; static const int inner = 100; static const char ref[27] = "abcdefghijklmnopqrstuvwxyz"; char ach[27] = "abcdefghijklmnopqrstuvwxyz"; int matches; time_t start; time_t end; srand(0); matches = 0; start = time(NULL); for(int i=0; i
[Bug c++/120498] error: either all initializer clauses should be designated or none of them should be when designated-initialising nested union members(?) (same code accepted as C)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120498 --- Comment #7 from Jonathan Wakely --- What isn't helpful about them? It tells you exactly what is wrong with the code: "either all initializer clauses should be designated or none of them should be" GCC didn't decide this is an error, the C++ standard did.
[Bug c++/120498] error: either all initializer clauses should be designated or none of them should be when designated-initialising nested union members(?) (same code accepted as C)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120498 --- Comment #9 from Jonathan Wakely --- The correct way to do it is to provide an initializer for sa.u, and that initializer can initialize .sa_handler i.e. struct sa sa = {.sa_flags = 0, .u = {.sa_handler = 0} };
[Bug c++/120498] error: either all initializer clauses should be designated or none of them should be when designated-initialising nested union members(?) (same code accepted as C)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120498 --- Comment #8 from Jonathan Wakely --- And "expected primary-expression before '.' token" because that syntax for initializing a member of a subobject isn't valid at all in C++. So you're not initializing 'sa.u' and that's why you get an error.
[Bug c++/120498] error: either all initializer clauses should be designated or none of them should be when designated-initialising nested union members(?) (same code accepted as C)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120498 --- Comment #11 from Jonathan Wakely --- .sa_handler is not a real member of the struct, it's a macro referring to a nested member. So you can't use designated initializers with that type in C++.
[Bug c++/120498] error: either all initializer clauses should be designated or none of them should be when designated-initialising nested union members(?) (same code accepted as C)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120498 --- Comment #10 from наб --- Cool. Can you reach the same conclusion about the original unminified sample which uses struct sigaction's sa_handler member directly? #include struct sigaction sa = {.sa_flags = SA_RESETHAND, .sa_handler = 0}; How do you decode and fix the error produced thusly?
[Bug c++/120498] error: either all initializer clauses should be designated or none of them should be when designated-initialising nested union members(?) (same code accepted as C)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120498 --- Comment #12 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #11) > So you can't use designated initializers with that type in C++. This is true for *most* POSIX structs, because POSIX does not guarantee the order of members, or whether there are other non-standard members. e.g. for struct sigaction it only says: The structure sigaction, used to describe an action to be taken, is defined in the header to include at least the following members: ^^ So there can be additional unspecified members, and the order of members is not specified. Since C++ designated initializers require all members to be explicitly initialized in the correct order, you can't do that in portable code. POSIX also says: The storage occupied by sa_handler and sa_sigaction may overlap, and a conforming application shall not use both simultaneously. So they might be union members, or they might be separate members. For C++ designated initializers, you need to know which it is.
[Bug libfortran/116400] [15/16 Regression] Regenerated files are no longer written to the source directory
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116400 --- Comment #18 from Jonathan Wakely --- for ac_prog in gm4 gnum4 m4 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_M4+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$M4"; then ac_cv_prog_M4="$M4" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_M4="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi M4=$ac_cv_prog_M4 if test -n "$M4"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $M4" >&5 $as_echo "$M4" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$M4" && break done test -n "$M4" || M4="$MISSING m4" case " $build_configdirs " in *" m4 "*) M4='$$r/$(BUILD_SUBDIR)/m4/m4' ;; esac
[Bug cobol/119524] cobol: gg_printf assumes target characteristics
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119524 --- Comment #4 from GCC Commits --- The master branch has been updated by Robert Dubner : https://gcc.gnu.org/g:213cb633e7ec9b291768a4da0cd6d67679221aeb commit r16-1038-g213cb633e7ec9b291768a4da0cd6d67679221aeb Author: Robert Dubner Date: Sun Jun 1 12:32:37 2025 -0400 cobol: Wrap the call to fprintf in a libgcobol routine. [PR119524] gcc/cobol/ChangeLog: PR cobol/119524 * gengen.cc (gg_printf): Use the new __gg__fprintf_stderr() function instead of generating a call to fprintf(). libgcobol/ChangeLog: PR cobol/119524 * libgcobol.cc (__gg__fprintf_stderr): New function.
[Bug c++/120503] P2115R0 (merging unnamed enumerations) is not fully implemented
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120503 --- Comment #1 from Andrew Pinski --- An unnamed enumeration that does not have a typedef name for linkage purposes (9.2.3) and that has a first enumerator is denoted, for linkage purposes (6.6), by its underlying type and its first enumerator; such an enumeration is said to have an enumerator as a name for linkage purposes.
[Bug c++/107600] New __is_destructible built-in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107600 --- Comment #6 from Jonathan Wakely --- This regressed the following testcase: struct X; template struct default_delete { void operator()(T*) { static_assert(sizeof(T), "type is not incomplete"); } }; template> struct unique_ptr { ~unique_ptr() { del(ptr); } T* ptr; D del; }; constexpr bool b = __has_trivial_destructor(unique_ptr); Previously this compiled without error, the compiler could tell immediately that ~unique_ptr() is not trivial. Now it seems to instantiate it, which then requires X to be complete. up.cc: In instantiation of 'void default_delete::operator()(T*) [with T = X]': up.cc:12:22: required from 'unique_ptr::~unique_ptr() [with T = X; D = default_delete]' 12 | ~unique_ptr() { del(ptr); } | ~~~^ up.cc:19:58: required from here 19 | constexpr bool b = __has_trivial_destructor(unique_ptr); | ^ up.cc:6:39: error: invalid application of 'sizeof' to incomplete type 'X' 6 | void operator()(T*) { static_assert(sizeof(T), "type is not incomplete"); } | ^
[Bug c++/120503] New: P2115R0 (merging unnamed enumerations) is not fully implemented
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120503 Bug ID: 120503 Summary: P2115R0 (merging unnamed enumerations) is not fully implemented Product: gcc Version: 15.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gulackeg at gmail dot com Target Milestone: --- On the webpage "C++ Standards Support in GCC"[1], P2115R0[2] is marked as available since GCC 11. However, this does not appear to reflect the current state of implementation. The following test code[3], derived from the paper, illustrates the issue: // Frob.cpp template int Frob() { return int(V); } enum { A = 195'936'478 }; template int Frob(); // main.cpp enum { Noise }; template int Frob() { return int(V); } enum { A = 195'936'478 }; extern template int Frob(); int main() { Frob(); } Linking the above code results in the following error: main.cpp:7:(.text+0x5): undefined reference to `_Z4FrobITnDaL8._anon_1195936478EEiv' According to the paper, this code should be well-formed, as the mangled name for the type of `A` is expected to remain consistent across translation units (by using the name of the first enumerator—`A`). [1] https://gcc.gnu.org/projects/cxx-status.html#cxx20 [2] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2115r0.html [3] https://godbolt.org/z/coxPKrGva
[Bug c++/120504] New: [16 Regression] gcc-16 fails to build llvm-20 and gdb-16.3 unique_ptr.h:91:23: error: invalid application of 'sizeof' to incomplete type ... since r16-944-g0629924777ea20
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120504 Bug ID: 120504 Summary: [16 Regression] gcc-16 fails to build llvm-20 and gdb-16.3 unique_ptr.h:91:23: error: invalid application of 'sizeof' to incomplete type ... since r16-944-g0629924777ea20 Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at gcc dot gnu.org Target Milestone: --- Initially bisected against gdb-16.3 down to r16-944-g0629924777ea20 "c++: add __is_*destructible builtins [PR107600]" I'll steal Jonathan's https://gcc.gnu.org/PR107600#c6 example as is. Filing a bug to make sure it does not get lost. // $ cat a.cc struct X; template struct default_delete { void operator()(T*) { static_assert(sizeof(T), "type is not incomplete"); } }; template> struct unique_ptr { ~unique_ptr() { del(ptr); } T* ptr; D del; }; constexpr bool b = __has_trivial_destructor(unique_ptr); $ g++-15 -c a.cc # ok $ g++-16 -c a.cc a.cc: In instantiation of 'void default_delete::operator()(T*) [with T = X]': a.cc:12:22: required from 'unique_ptr::~unique_ptr() [with T = X; D = default_delete]' 12 | ~unique_ptr() { del(ptr); } | ~~~^ a.cc:19:58: required from here 19 | constexpr bool b = __has_trivial_destructor(unique_ptr); | ^ a.cc:6:39: error: invalid application of 'sizeof' to incomplete type 'X' 6 | void operator()(T*) { static_assert(sizeof(T), "type is not incomplete"); } | ^
[Bug c++/120504] [16 Regression] gcc-16 fails to build llvm-20 and gdb-16.3 unique_ptr.h:91:23: error: invalid application of 'sizeof' to incomplete type ... since r16-944-g0629924777ea20
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120504 Andrew Pinski changed: What|Removed |Added Target Milestone|--- |16.0 Keywords||rejects-valid