[PATCH] c++/modules: Merge PARM_DECL properties from function definitions [PR121238]

2025-07-30 Thread Nathaniel Shead
.cc (trees_in::fn_parms_fini): Merge properties for definitions. gcc/testsuite/ChangeLog: * g++.dg/modules/merge-19.h: New test. * g++.dg/modules/merge-19_a.H: New test. * g++.dg/modules/merge-19_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module

[PATCH v2] c++: Don't assume trait funcs return error_mark_node when tf_error is passed [PR121291]

2025-07-30 Thread Nathaniel Shead
On Tue, Jul 29, 2025 at 03:45:29PM -0400, Patrick Palka wrote: > On Tue, 29 Jul 2025, Nathaniel Shead wrote: > > > Tested on x86_64-pc-linux-gnu, OK for trunk if full bootstrap+regtest > > passes? > > > > -- >8 -- > > > > For the sake of determin

[PATCH] c++: Don't assume trait funcs return error_mark_node when tf_error is passed [PR121291]

2025-07-29 Thread Nathaniel Shead
voke): Adjust comment. (is_nothrow_convertible): Check for errorcount changes. gcc/testsuite/ChangeLog: * g++.dg/ext/is_invocable7.C: New test. * g++.dg/ext/is_nothrow_convertible5.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/constraint.cc

Re: [PATCH] c++/modules: Give a sorry for target attributes [PR108080]

2025-07-29 Thread Nathaniel Shead
On Tue, Jul 29, 2025 at 02:04:52PM +0200, Jakub Jelinek wrote: > On Tue, Jul 29, 2025 at 09:57:19PM +1000, Nathaniel Shead wrote: > > @@ -7114,8 +7121,10 @@ trees_in::core_vals (tree t) > > } > > > > RT (t->function_de

[PATCH] c++/modules: Give a sorry for target attributes [PR108080]

2025-07-29 Thread Nathaniel Shead
rees_out::core_vals): Sorry when streaming target/optimize node. Adjust comments. (trees_in::core_vals): Don't stream a target/optimize node. gcc/testsuite/ChangeLog:Patrick Palka * g++.dg/modules/pr108080.H: New test. Signed-off-by: Nathaniel Shead --- gcc

Re: [PATCH] c++/modules: Stream some missing lang_type flags

2025-07-29 Thread Nathaniel Shead
On Mon, Jul 28, 2025 at 10:08:34AM +0200, Rainer Orth wrote: > Patrick Palka writes: > > > On Sat, 26 Jul 2025, Nathaniel Shead wrote: > > > >> On Fri, Jul 25, 2025 at 08:58:47AM -0400, Patrick Palka wrote: > >> > On Fri, 25 Jul 2025, Nathaniel Shead w

[COMMITTED] testsuite: Fix C++14 test failure with modules test [PR121285]

2025-07-29 Thread Nathaniel Shead
d-off-by: Nathaniel Shead --- gcc/testsuite/g++.dg/modules/class-11_a.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/g++.dg/modules/class-11_a.H b/gcc/testsuite/g++.dg/modules/class-11_a.H index f7bbf9d1506..799dbdd733c 100644 --- a/gcc/testsuite/g++.dg

Re: [PATCH] c++/modules: Stream some missing lang_type flags

2025-07-25 Thread Nathaniel Shead
On Fri, Jul 25, 2025 at 08:58:47AM -0400, Patrick Palka wrote: > On Fri, 25 Jul 2025, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > I noticed that C++26 trivial relocation didn

[PATCH] Prevent mixups of IDENTIFIER_TRANSPARENT_ALIAS and IDENTIFIER_INTERNAL_P better [PR120855]

2025-07-24 Thread Nathaniel Shead
bler_name): Likewise. * varasm.cc (assemble_name_resolve): Check for IDENTIFIER_TRANSPARENT_ALIAS instead of just TREE_CHAIN. Signed-off-by: Nathaniel Shead --- gcc/cgraphunit.cc | 7 --- gcc/symtab.cc | 1 + gcc/varasm.cc | 2 +- 3 files changed, 6 insertions(+), 4 de

Re: [PATCH v5] c++: Unwrap type traits defined in terms of builtins within diagnostics [PR117294]

2025-07-24 Thread Nathaniel Shead
On Thu, Jul 24, 2025 at 01:16:24PM -0400, Jason Merrill wrote: > On 7/24/25 8:40 AM, Nathaniel Shead wrote: > > On Thu, Jul 24, 2025 at 09:02:24PM +1000, Nathaniel Shead wrote: > > > On Tue, Jul 08, 2025 at 12:51:37PM -0400, Jason Merrill wrote: > > > > I'm r

[PATCH] c++/modules: Stream some missing lang_type flags

2025-07-24 Thread Nathaniel Shead
ools): Stream new flags, use gcc_checking_assert. (trees_in::lang_type_bools): Likewise. gcc/testsuite/ChangeLog: * g++.dg/modules/class-11_a.H: New test. * g++.dg/modules/class-11_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h

Re: [PATCH v5] c++: Unwrap type traits defined in terms of builtins within diagnostics [PR117294]

2025-07-24 Thread Nathaniel Shead
On Thu, Jul 24, 2025 at 09:02:24PM +1000, Nathaniel Shead wrote: > On Tue, Jul 08, 2025 at 12:51:37PM -0400, Jason Merrill wrote: > > I'm resistant to moving functions around unnecessarily, as it makes git > > change tracking a lot harder. Especially when it means moving a fu

[PATCH v5] c++: Unwrap type traits defined in terms of builtins within diagnostics [PR117294]

2025-07-24 Thread Nathaniel Shead
signable2.C: New test. * g++.dg/ext/is_constructible9.C: New test. * g++.dg/ext/is_convertible7.C: New test. * g++.dg/ext/is_destructible3.C: New test. * g++.dg/ext/is_invocable6.C: New test. * g++.dg/ext/is_virtual_base_of_diagnostic2.C: New test.

Re: [PATCH 1/4] c++: Add flag to detect underlying representative of bitfield decls

2025-06-27 Thread Nathaniel Shead
On Wed, Jun 25, 2025 at 01:05:39PM -0400, Jason Merrill wrote: > On 5/21/25 10:14 PM, Nathaniel Shead wrote: > > This patch isn't currently necessary with how I've currently done the > > follow-up patches, but is needed for avoiding any potential issues in > > t

Re: [PATCH] c++/modules: Ensure type of partial spec VAR_DECL is consistent with its template [PR120644]

2025-06-27 Thread Nathaniel Shead
On Wed, Jun 25, 2025 at 11:52:14AM -0400, Jason Merrill wrote: > On 6/25/25 9:02 AM, Nathaniel Shead wrote: > > On Tue, Jun 24, 2025 at 12:10:09PM -0400, Patrick Palka wrote: > > > On Tue, 24 Jun 2025, Jason Merrill wrote: > > > > > > > On

[PATCH] c++/modules: Ensure type of partial spec VAR_DECL is consistent with its template [PR120644]

2025-06-25 Thread Nathaniel Shead
On Tue, Jun 24, 2025 at 12:10:09PM -0400, Patrick Palka wrote: > On Tue, 24 Jun 2025, Jason Merrill wrote: > > > On 6/23/25 5:41 PM, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/15? > > > > > > -- >8 --

Re: [PATCH] c++: Implement C++26 P3618R0 - Allow attaching main to the global module [PR120773]

2025-06-25 Thread Nathaniel Shead
On Tue, Jun 24, 2025 at 11:14:51AM -0400, Jason Merrill wrote: > On 6/24/25 10:16 AM, Nathaniel Shead wrote: > > On Tue, Jun 24, 2025 at 01:03:53PM +0200, Jakub Jelinek wrote: > > > Hi! > > > > > > The following patch implements the P3618R0 paper by tweakin

Re: [PATCH] c++: Implement C++26 P3618R0 - Allow attaching main to the global module [PR120773]

2025-06-24 Thread Nathaniel Shead
On Tue, Jun 24, 2025 at 01:03:53PM +0200, Jakub Jelinek wrote: > Hi! > > The following patch implements the P3618R0 paper by tweaking pedwarn > condition, adjusting pedwarn wording, adjusting one testcase and adding 4 > new ones. The paper was voted in as DR, so it isn't guarded on C++ version. >

[PATCH] c++/modules: Only compare types of DECL_TEMPLATE_RESULTs [PR120644]

2025-06-23 Thread Nathaniel Shead
auto-7.h: New test. * g++.dg/modules/auto-7_a.H: New test. * g++.dg/modules/auto-7_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl.cc | 6 -- gcc/cp/module.cc| 5 +++-- gcc/testsuite/g++.dg/modules/auto-7.

Re: [PATCH] c++/modules: Support re-streaming TU_LOCAL_ENTITYs [PR120412]

2025-06-21 Thread Nathaniel Shead
Ping for this patch. On Wed, May 28, 2025 at 02:19:11PM -0400, Patrick Palka wrote: > On Sat, 24 May 2025, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/15? > > LGTM FWIW > > > > > -- >8 -- > > > &

Re: [PATCH 3/4] c++/modules: Support streaming new size cookie for constexpr [PR120040]

2025-06-21 Thread Nathaniel Shead
Ping. On Thu, May 22, 2025 at 12:15:34PM +1000, Nathaniel Shead wrote: > This type currently has a DECL_NAME of an IDENTIFIER_DECL. Although the > documentation indicates this is legal, this confuses modules streaming > which expects all RECORD_TYPEs to have a TYPE_DECL, which i

Re: [PATCH v4] c++: Unwrap type traits defined in terms of builtins within diagnostics [PR117294]

2025-06-21 Thread Nathaniel Shead
Ping for this patch. On Sun, Jun 01, 2025 at 11:23:01PM -0400, Patrick Palka wrote: > On Sat, 31 May 2025, Nathaniel Shead wrote: > > > On Fri, May 30, 2025 at 11:10:08AM -0400, Patrick Palka wrote: > > > On Fri, 30 May 2025, Patrick Palka wrote: > > > > >

Re: [PATCH 4/4] c++/modules: Avoid name clashes when streaming internal labels [PR98375,PR118904]

2025-06-21 Thread Nathaniel Shead
On Thu, May 22, 2025 at 12:16:07PM +1000, Nathaniel Shead wrote: > I'm not sure if there might be a better way to retrieve the prefix back > off an IDENTIFIER_NODE? I'm also not sure if IDENTIFIER_INTERNAL_P > could ever clash with IDENTIFIER_TRANSPARENT_ALIAS; I'm pretty

Re: [PATCH 1/4] c++: Add flag to detect underlying representative of bitfield decls

2025-06-21 Thread Nathaniel Shead
On Thu, May 22, 2025 at 12:14:34PM +1000, Nathaniel Shead wrote: > This patch isn't currently necessary with how I've currently done the > follow-up patches, but is needed for avoiding any potential issues in > the future with DECL_CONTEXT'ful types getting created in the

[PATCH v3] c++: Unwrap type traits defined in terms of builtins within diagnostics [PR117294]

2025-05-29 Thread Nathaniel Shead
On Wed, May 28, 2025 at 02:14:06PM -0400, Patrick Palka wrote: > On Tue, 27 May 2025, Nathaniel Shead wrote: > > > On Wed, Nov 27, 2024 at 11:45:40AM -0500, Patrick Palka wrote: > > > On Fri, 8 Nov 2024, Nathaniel Shead wrote: > > > > > > > Does this

Re: [PATCH RFC] c++: modules and using-directives

2025-05-27 Thread Nathaniel Shead
On Wed, May 28, 2025 at 12:24:54AM -0400, Jason Merrill wrote: > On 11/27/24 11:17 AM, Jason Merrill wrote: > > On 11/27/24 1:43 AM, Nathaniel Shead wrote: > > > On Wed, Nov 27, 2024 at 12:03:23AM -0500, Jason Merrill wrote: > > > > Tested x86_64-pc-linux-gnu. >

Re: [PATCH v2] c++: Unwrap type traits defined in terms of builtins within diagnostics [PR117294]

2025-05-26 Thread Nathaniel Shead
On Wed, Nov 27, 2024 at 11:45:40AM -0500, Patrick Palka wrote: > On Fri, 8 Nov 2024, Nathaniel Shead wrote: > > > Does this approach seem reasonable? I'm pretty sure that the way I've > > handled the templating here is unideal but I'm not sure what a neat way >

Re: [PATCH 2/4] c++/modules: Implement streaming of uncontexted TYPE_DECLs [PR98735]

2025-05-26 Thread Nathaniel Shead
On Fri, May 23, 2025 at 11:31:26AM -0400, Jason Merrill wrote: > On 5/21/25 10:15 PM, Nathaniel Shead wrote: > > Another approach would be to fix 'write_class_def' to handle these > > declarations better, but that ended up being more work and felt fragile. > > It

[PATCH] c++/modules: Support re-streaming TU_LOCAL_ENTITYs [PR120412]

2025-05-23 Thread Nathaniel Shead
gcc/testsuite/ChangeLog: * g++.dg/modules/internal-14_a.C: New test. * g++.dg/modules/internal-14_b.C: New test. * g++.dg/modules/internal-14_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 15 ++- gcc/testsuite/g++

[PATCH] c++/modules: Fix stream-in of member using-decls [PR120414]

2025-05-23 Thread Nathaniel Shead
est. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 3 ++- gcc/testsuite/g++.dg/modules/using-31_a.C | 18 ++ gcc/testsuite/g++.dg/modules/using-31_b.C | 5 + 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++

[PATCH v2] c++/modules: Fix merge of TLS init functions [PR120363]

2025-05-23 Thread Nathaniel Shead
On Fri, May 23, 2025 at 10:23:51AM -0400, Jason Merrill wrote: > On 5/22/25 8:22 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/15? > > > > (Also is renaming the old test OK/appropriate? Or should I keep it > > before and

[PATCH] c++/modules: Fix merge of TLS import functions [PR120363]

2025-05-22 Thread Nathaniel Shead
/tls-3.h: New test. * g++.dg/modules/tls-3_a.H: New test. * g++.dg/modules/tls-3_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl2.cc | 3 +- .../modules/{pr113292_a.H => tls-1_a.H} | 0 .../modules/{pr113292_b.C => tls-1_b.C}

Re: [PATCH 2/4] c++/modules: Implement streaming of uncontexted TYPE_DECLs [PR98735]

2025-05-21 Thread Nathaniel Shead
On Thu, May 22, 2025 at 12:15:02PM +1000, Nathaniel Shead wrote: > Another approach would be to fix 'write_class_def' to handle these > declarations better, but that ended up being more work and felt fragile. > It also meant streaming a lot more information that we don't ne

[PATCH 3/4] c++/modules: Support streaming new size cookie for constexpr [PR120040]

2025-05-21 Thread Nathaniel Shead
::type_node): Add some assertions. gcc/testsuite/ChangeLog: * g++.dg/modules/pr120040_a.C: New test. * g++.dg/modules/pr120040_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/constexpr.cc | 2 +- gcc/cp/init.cc| 10

[PATCH 4/4] c++/modules: Avoid name clashes when streaming internal labels [PR98375,PR118904]

2025-05-21 Thread Nathaniel Shead
New test. * g++.dg/ubsan/module-1-aux.cc: New test. * g++.dg/ubsan/module-1.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-gimplify.cc | 5 +-- gcc/cp/module.cc | 51 +++--- gcc/testsuite/g++.dg/modules/sr

[PATCH 2/4] c++/modules: Implement streaming of uncontexted TYPE_DECLs [PR98735]

2025-05-21 Thread Nathaniel Shead
ensure that all parts of a by-value decl are marked for streaming. (trees_out::get_merge_kind): Treat members of uncontexted types as always unique. gcc/testsuite/ChangeLog: * g++.dg/modules/pr120040_a.C: New test. * g++.dg/modules/pr120040_b.C: New tes

[PATCH 1/4] c++: Add flag to detect underlying representative of bitfield decls

2025-05-21 Thread Nathaniel Shead
nd): Use new flag. gcc/ChangeLog: * stor-layout.cc (start_bitfield_representative): Mark with DECL_BIT_FIELD_UNDERLYING_REPR_P. * tree-core.h (struct tree_decl_common): Add comment. * tree.h (DECL_BIT_FIELD_UNDERLYING_REPR_P): New accessor. Signed-off-by: Natha

[PATCH 0/4] c++: Support modules streaming some internal structures with no DECL_CONTEXT

2025-05-21 Thread Nathaniel Shead
fined'. Nathaniel Shead (4): c++: Add flag to detect underlying representative of bitfield decls c++/modules: Implement streaming of uncontexted TYPE_DECLs [PR98735] c++/modules: Support streaming new size cookie for constexpr [PR120040] c++/modules: Avoid name clashes when streamin

[PATCH v2] c++/modules: Ensure vtables are emitted when needed [PR120349]

2025-05-19 Thread Nathaniel Shead
On Mon, May 19, 2025 at 04:56:38PM -0400, Jason Merrill wrote: > On 5/19/25 8:27 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > Alternatively could go back to always marking vtables as DECL_EXTERNAL > > as well

[PATCH] c++/modules: Always mark tinfo vars as TREE_ADDRESSABLE [PR120350]

2025-05-19 Thread Nathaniel Shead
gcc/cp/ChangeLog: * rtti.c (get_tinfo_decl_direct): Mark TREE_ADDRESSABLE. gcc/testsuite/ChangeLog: * g++.dg/modules/tinfo-3_a.H: New test. * g++.dg/modules/tinfo-3_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/rtti.cc | 1 + gcc/tes

[PATCH] c++/modules: Ensure vtables are emitted when needed [PR120349]

2025-05-19 Thread Nathaniel Shead
RN. gcc/testsuite/ChangeLog: * g++.dg/modules/vtt-3_a.C: New test. * g++.dg/modules/vtt-3_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 2 +- gcc/testsuite/g++.dg/modules/vtt-3_a.C | 29 ++ gcc/testsuite/g++.dg

[PATCH] c++/modules: Fix ICE on merge of instantiation with partial spec [PR120013]

2025-05-17 Thread Nathaniel Shead
ial specialisation. gcc/testsuite/ChangeLog: * g++.dg/modules/partial-8.h: New test. * g++.dg/modules/partial-8_a.C: New test. * g++.dg/modules/partial-8_b.C: New test. * g++.dg/modules/partial-8_c.C: New test. * g++.dg/modules/partial-8_d.C: New test. Signed

[PATCH] c++/modules: Clean up importer_interface

2025-05-16 Thread Nathaniel Shead
g: * module.cc (importer_interface): Adjust flags. (get_importer_interface): Rename flags. (trees_out::core_bools): Clean up special casing. (trees_out::write_function_def): Rename flag. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 50 +---

[14 PATCH] c++: Partially revert "Support lambdas attached to more places in modules" [PR118245]

2025-05-14 Thread Nathaniel Shead
-by: Nathaniel Shead --- gcc/cp/parser.cc | 10 ++ gcc/testsuite/g++.dg/cpp2a/lambda-uneval23.C | 7 +++ gcc/testsuite/g++.dg/modules/lambda-7_a.H| 2 +- gcc/testsuite/g++.dg/modules/lambda-7_b.C| 1 + gcc/testsuite/g++.dg/modules/lambda-7_c.C|

Re: [PATCH] c++/modules: Fix handling of -fdeclone-ctor-dtor with explicit instantiations [PR120125]

2025-05-14 Thread Nathaniel Shead
On Tue, May 13, 2025 at 12:40:30PM -0400, Jason Merrill wrote: > On 5/9/25 11:48 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/15? > > > > One slight concern I have is why we end up in 'maybe_thunk_body' to > >

[PATCH] c++/modules: Fix handling of -fdeclone-ctor-dtor with explicit instantiations [PR120125]

2025-05-09 Thread Nathaniel Shead
out::write_function_def): Only set DECL_NOT_REALLY_EXTERN if the importer might need to emit it. * optimize.cc (maybe_thunk_body): Don't assume 'fn' has a cgraph node created. gcc/testsuite/ChangeLog: * g++.dg/modules/clone-4_a.C: New test. * g++.d

[PATCH] c++/modules: Revert "Remove unnecessary lazy_load_pendings"

2025-05-09 Thread Nathaniel Shead
On Fri, May 09, 2025 at 08:18:58AM -0400, Jason Merrill wrote: > On 4/21/25 6:22 AM, Nathaniel Shead wrote: > > This call is not necessary, as we don't access the bodies of any classes > > that we instantiate here. > > This turns out to break > > 20_util/func

Re: [PATCH 2/2] c++/modules: Remove unnecessary lazy_load_pendings

2025-05-09 Thread Nathaniel Shead
On Fri, May 09, 2025 at 08:18:58AM -0400, Jason Merrill wrote: > On 4/21/25 6:22 AM, Nathaniel Shead wrote: > > This call is not necessary, as we don't access the bodies of any classes > > that we instantiate here. > > This turns out to break > > 20_util/func

[PATCH] c++/modules: Ensure deduction guides for imported types are reachable [PR120023]

2025-04-30 Thread Nathaniel Shead
est. * g++.dg/modules/dguide-7_b.C: New test. * g++.dg/modules/dguide-7_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 7 +++ gcc/testsuite/g++.dg/modules/dguide-7_a.C | 9 + gcc/testsuite/g++.dg/modules/dguide-7_b.C |

[PATCH] c++/modules: Catch exposures of TU-local values through inline references [PR119996]

2025-04-29 Thread Nathaniel Shead
et::hash::finalize_dependencies): Add error message for inline variables. gcc/testsuite/ChangeLog: * g++.dg/modules/internal-13.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 27 +- gcc/testsuite/g++.dg/modules/internal-1

[PATCH v2] c++: Fix OpenMP support with C++20 modules [PR119864]

2025-04-28 Thread Nathaniel Shead
ules, as both the host and target constructors were given the same mangled name. This patch ensures that only the host constructor gets the module name mangling for now, and stops forcing the creation of the target constructor even when no such initialization is required. PR c++/119864

[PATCH] c++/modules: Ensure DECL_FRIEND_CONTEXT is streamed [PR119939]

2025-04-25 Thread Nathaniel Shead
ngeLog: * g++.dg/modules/concept-11_a.H: New test. * g++.dg/modules/concept-11_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc| 4 ++-- gcc/testsuite/g++.dg/modules/concept-11_a.H | 9 + gcc/testsuite/g++.dg/modules/concept-11_b

[PATCH] c++/modules: Fix imported CNTTPs being considered non-constant [PR119938]

2025-04-25 Thread Nathaniel Shead
eally is constant and mark decl as such. gcc/testsuite/ChangeLog: * g++.dg/modules/tpl-nttp-2_a.H: New test. * g++.dg/modules/tpl-nttp-2_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/pt.cc| 7 ++- gcc/testsuite/g++.dg/modules/tpl-nt

[PATCH] c++: Fix OpenMP support with C++20 modules [PR119864]

2025-04-21 Thread Nathaniel Shead
estsuite/ChangeLog: * g++.dg/modules/openmp-1.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl2.cc | 4 +++- gcc/testsuite/g++.dg/modules/openmp-1.C | 9 + 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg

[PATCH 2/2] c++/modules: Remove unnecessary lazy_load_pendings

2025-04-21 Thread Nathaniel Shead
pendings. Signed-off-by: Nathaniel Shead --- gcc/cp/name-lookup.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc index 165c26bb578..aa2dc0e47d3 100644 --- a/gcc/cp/name-lookup.cc +++ b/gcc/cp/name-lookup.cc @@ -4556,8

[PATCH 1/2] c++/modules: Find non-exported reachable decls when instantiating friend classes [PR119863]

2025-04-21 Thread Nathaniel Shead
/modules/tpl-friend-18_a.C: New test. * g++.dg/modules/tpl-friend-18_b.C: New test. * g++.dg/modules/tpl-friend-18_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/name-lookup.cc | 43 ++- .../g++.dg/modules/tpl-friend-18_a.C

Re: [PATCH] c++: Prune lambda captures from more places [PR119755]

2025-04-15 Thread Nathaniel Shead
On Tue, Apr 15, 2025 at 09:16:46AM -0400, Jason Merrill wrote: > On 4/15/25 2:56 AM, Nathaniel Shead wrote: > > On Mon, Apr 14, 2025 at 05:33:05PM -0400, Jason Merrill wrote: > > > On 4/13/25 6:32 AM, Nathaniel Shead wrote: > > > > Bootstrapped and regtested on x86

Re: [PATCH] c++: Prune lambda captures from more places [PR119755]

2025-04-15 Thread Nathaniel Shead
On Tue, Apr 15, 2025 at 11:39:21PM +1000, Nathaniel Shead wrote: > On Tue, Apr 15, 2025 at 09:16:46AM -0400, Jason Merrill wrote: > > On 4/15/25 2:56 AM, Nathaniel Shead wrote: > > > On Mon, Apr 14, 2025 at 05:33:05PM -0400, Jason Merrill wrote: > > > > On 4/13/25

Re: [PATCH] c++: Prune lambda captures from more places [PR119755]

2025-04-14 Thread Nathaniel Shead
On Mon, Apr 14, 2025 at 05:33:05PM -0400, Jason Merrill wrote: > On 4/13/25 6:32 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > Currently, pruned lambda captures are still leftover in

[PATCH] c++: Prune lambda captures from more places [PR119755]

2025-04-13 Thread Nathaniel Shead
test. * g++.dg/modules/lambda-10_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/lambda.cc | 22 ++ gcc/testsuite/g++.dg/modules/lambda-10_a.H | 17 + gcc/testsuite/g++.dg/modules/lambda-10_b.C | 7 +++ 3

Re: [PATCH v2] c++/modules: More fixes for merging DECL_MAYBE_DELETED functions

2025-04-10 Thread Nathaniel Shead
On Thu, Apr 10, 2025 at 12:19:57PM -0400, Jason Merrill wrote: > On 4/10/25 8:46 AM, Nathaniel Shead wrote: > > Regression raised with my by private correspondance. > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > >

[PATCH] c++/modules: More fixes for merging DECL_MAYBE_DELETED functions

2025-04-10 Thread Nathaniel Shead
* g++.dg/modules/noexcept-4_a.H: New test. * g++.dg/modules/noexcept-4_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 66 +++- gcc/testsuite/g++.dg/modules/lambda-8_b.C| 2 +- gcc/testsuite/g++.dg/modules/leg-merge-4_c.C |

[PATCH] c++: Rename -fmodules-ts to -fmodules in diagnostics

2025-04-04 Thread Nathaniel Shead
ace fmodules-ts with fmodules. (cp_parser_template_declaration): Likewise. Signed-off-by: Nathaniel Shead --- gcc/cp/parser.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 88e722d8406..f2eea4c70fd 100644 --- a/

[PATCH] c++/modules: Propagate bits to DECL_MAYBE_DELETED dups [PR119462]

2025-04-04 Thread Nathaniel Shead
f appropriate. gcc/testsuite/ChangeLog: * g++.dg/modules/noexcept-3_a.C: New test. * g++.dg/modules/noexcept-3_b.C: New test. * g++.dg/modules/noexcept-3_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc| 16 +++- gc

[PATCH] c++/modules: Fix divergence in streaming/non-streaming tree walks [PR119608]

2025-04-03 Thread Nathaniel Shead
cl_node): Maybe require by-value walking not just when streaming. gcc/testsuite/ChangeLog: * g++.dg/modules/pr119608_a.C: New test. * g++.dg/modules/pr119608_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 39 --

[PATCH] c++: Fix GC with TU_LOCAL_ENTITY [PR119564]

2025-04-03 Thread Nathaniel Shead
.cc (cp_tree_node_structure): Add TU_LOCAL_ENTITY; fix formatting. gcc/testsuite/ChangeLog: * g++.dg/modules/gc-3_a.C: New test. * g++.dg/modules/gc-3_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl.cc| 7 --- gcc/testsuite/g++.dg/modules

[PATCH] c++/modules: Forbid exposures of TU-local entities in inline variables [PR119551]

2025-04-01 Thread Nathaniel Shead
es/internal-12_a.C: New test. * g++.dg/modules/internal-12_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 7 +++--- gcc/testsuite/g++.dg/modules/internal-11.C | 24 gcc/testsuite/g++.dg/modules/internal-12_a.C | 1

Re: [pushed] c++/modules: unexported friend template

2025-03-31 Thread Nathaniel Shead
On Sat, Mar 29, 2025 at 11:14:46AM -0400, Jason Merrill wrote: > Tested x86_64-pc-linux-gnu, applying to trunk. Do you agree with my choice of > how to adjust duplicate_decls? Yes, that looks reasonable to me. The point of this block is just to ensure that we export any entities declared in the

Re: [PATCH v2] c++/modules: Fix modules and LTO with header units [PR118961]

2025-03-28 Thread Nathaniel Shead
On Thu, Mar 27, 2025 at 10:38:02AM -0400, Jason Merrill wrote: > On 3/27/25 3:35 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested (so far just dg.exp and modules.exp) on > > x86_64-pc-linux-gnu, OK for trunk if full regtest succeeds? > > > > Rather than updatin

Re: [PATCH 2/2] c++/modules: Handle conflicting ABI tags [PR118920]

2025-03-27 Thread Nathaniel Shead
On Thu, Mar 27, 2025 at 08:02:20AM -0400, Jason Merrill wrote: > On 3/26/25 9:24 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > The ICE in the linked PR is caused because out_ptr_t inhe

[PATCH] c++/modules: Fix modules and LTO with header units [PR118961]

2025-03-27 Thread Nathaniel Shead
. * g++.dg/modules/lto-1_b.C: New test. * g++.dg/modules/lto-2_a.H: New test. * g++.dg/modules/lto-2_b.C: New test. * g++.dg/modules/lto-3_a.H: New test. * g++.dg/modules/lto-3_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/class.cc

Re: [PATCH 1/2] c++/modules: Fix tsubst of global module friend classes [PR118920]

2025-03-27 Thread Nathaniel Shead
On Wed, Mar 26, 2025 at 11:40:16PM -0400, Jason Merrill wrote: > On 3/26/25 9:23 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > When doing tsubst_friend_class, we need to first check if

[PATCH 1/2] c++/modules: Fix tsubst of global module friend classes [PR118920]

2025-03-26 Thread Nathaniel Shead
module entity rather than just module import. gcc/testsuite/ChangeLog: * g++.dg/modules/tpl-friend-17.h: New test. * g++.dg/modules/tpl-friend-17_a.C: New test. * g++.dg/modules/tpl-friend-17_b.C: New test. Signed-off-by: Nathaniel Shead

[PATCH 2/2] c++/modules: Handle conflicting ABI tags [PR118920]

2025-03-26 Thread Nathaniel Shead
* g++.dg/modules/attrib-3_b.C: New test. * g++.dg/modules/pr118920.h: New test. * g++.dg/modules/pr118920_a.H: New test. * g++.dg/modules/pr118920_b.H: New test. * g++.dg/modules/pr118920_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tre

Re: [PATCH 2/1] c++/modules: Handle gnu_inline, again [PR119154]

2025-03-22 Thread Nathaniel Shead
On Mon, Mar 17, 2025 at 09:42:13AM -0400, Jason Merrill wrote: > On 3/14/25 9:28 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > Alternatively, could still mark gnu_inline functions as non-vague, we > > just need

[PATCH 2/1] c++/modules: Handle gnu_inline, again [PR119154]

2025-03-15 Thread Nathaniel Shead
-inline-1_c.C: New test. * g++.dg/modules/gnu-inline-2_a.C: New test. * g++.dg/modules/gnu-inline-2_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl2.cc | 4 +-- gcc/cp/module.cc | 27 +--

Re: [PATCH v2] c++/modules: Always treat explicit instantiations as external

2025-03-13 Thread Nathaniel Shead
On Thu, Mar 13, 2025 at 01:37:37PM -0400, Jason Merrill wrote: > On 3/13/25 11:16 AM, Nathaniel Shead wrote: > > I discovered from some further testing that I broke 'import std' in some > > cases with my last patch; this fixes that. > > > > This still isn&#x

[PATCH] c++: Make explicit instantiations not vague linkage

2025-03-13 Thread Nathaniel Shead
/modules/extern-tpl-3_a.C: New test. * g++.dg/modules/extern-tpl-3_b.C: New test. * g++.dg/modules/extern-tpl-4_a.C: New test. * g++.dg/modules/extern-tpl-4_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl2.cc | 3 ++ gcc/test

Re: c++/modules: Stream section, tls_model, and comdat_group

2025-03-12 Thread Nathaniel Shead
On Mon, Mar 10, 2025 at 02:52:07PM -0400, Jason Merrill wrote: > On 3/10/25 9:52 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > Or should this wait for GCC16? > > > > -- >8 -- > > > > While lo

Re: [PATCH v2] c++/modules: Handle gnu_inline attribute, cleanup linkage determination [PR119154]

2025-03-12 Thread Nathaniel Shead
On Wed, Mar 12, 2025 at 08:52:19AM -0400, Jason Merrill wrote: > On 3/10/25 9:50 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > Alternatively, a more minimal fix for the PR would be to just special > > case the

c++/modules: Handle gnu_inline attribute, cleanup linkage determination [PR119154]

2025-03-11 Thread Nathaniel Shead
had a definition at all. gcc/testsuite/ChangeLog: * g++.dg/modules/pr119154_a.C: New test. * g++.dg/modules/pr119154_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 33 --- gcc/cp/semantics.cc

c++/modules: Stream section, tls_model, and comdat_group

2025-03-11 Thread Nathaniel Shead
g_decl): Add checks for corresponding TLS model and section name. gcc/testsuite/ChangeLog: * g++.dg/modules/attrib-3_a.C: New test. * g++.dg/modules/attrib-3_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 104 ++

Re: [PATCH 2/4] c++/modules: Track module purview for deferred instantiations [PR114630]

2025-03-07 Thread Nathaniel Shead
On Thu, Mar 06, 2025 at 12:45:33PM -0500, Jason Merrill wrote: > On 3/5/25 7:54 AM, Nathaniel Shead wrote: > > On Wed, Feb 26, 2025 at 10:29:59AM -0500, Jason Merrill wrote: > > > On 2/21/25 6:05 AM, Nathaniel Shead wrote: > > > > After seeing PR c++/118964 I'm c

Re: [PATCH 3/3] c++/modules: Handle exposures of TU-local types in uninstantiated member templates

2025-03-07 Thread Nathaniel Shead
On Thu, Mar 06, 2025 at 11:00:46AM -0500, Jason Merrill wrote: > On 2/8/25 7:32 AM, Nathaniel Shead wrote: > > On Fri, Feb 07, 2025 at 11:11:21AM -0500, Jason Merrill wrote: > > > On 2/7/25 9:28 AM, Nathaniel Shead wrote: > > > > On Fri, Feb 07, 2025 at 08:14:2

Re: [PATCH] c++/modules: Better handle no-linkage decls in unnamed namespaces [PR118799]

2025-03-07 Thread Nathaniel Shead
On Fri, Mar 07, 2025 at 09:48:27PM +1100, Nathaniel Shead wrote: > On Thu, Mar 06, 2025 at 11:20:59AM -0500, Jason Merrill wrote: > > On 2/9/25 6:38 AM, Nathaniel Shead wrote: > > > On Sun, Feb 09, 2025 at 01:16:00AM +1100, Nathaniel Shead wrote: > > > > Tested on x86

Re: [PATCH] c++/modules: Better handle no-linkage decls in unnamed namespaces [PR118799]

2025-03-07 Thread Nathaniel Shead
On Thu, Mar 06, 2025 at 11:20:59AM -0500, Jason Merrill wrote: > On 2/9/25 6:38 AM, Nathaniel Shead wrote: > > On Sun, Feb 09, 2025 at 01:16:00AM +1100, Nathaniel Shead wrote: > > > Tested on x86_64-pc-linux-gnu, OK for trunk if full bootstrap + regtest > > >

Re: [PATCH 2/4] c++/modules: Track module purview for deferred instantiations [PR114630]

2025-03-05 Thread Nathaniel Shead
On Wed, Feb 26, 2025 at 10:29:59AM -0500, Jason Merrill wrote: > On 2/21/25 6:05 AM, Nathaniel Shead wrote: > > After seeing PR c++/118964 I'm coming back around to this [1] patch > > series, since it appears that this can cause errors on otherwise valid > > code by

Re: [PATCH v3 2/5] c++/modules: Ignore TU-local entities where necessary

2025-03-05 Thread Nathaniel Shead
Ping for this. Or should this cleanup wait till GCC16? On Wed, Feb 12, 2025 at 12:49:03AM +1100, Nathaniel Shead wrote: > On Mon, Jan 27, 2025 at 10:20:05AM -0500, Patrick Palka wrote: > > [snip] > > > > > @@ -18486,6 +18562,12 @@ dependent_operand_p (tree t) > >

Re: [PATCH 3/3] c++/modules: Handle exposures of TU-local types in uninstantiated member templates

2025-03-05 Thread Nathaniel Shead
Ping for this; was there any changes that you wanted me to make here? On Sat, Feb 08, 2025 at 11:32:28PM +1100, Nathaniel Shead wrote: > On Fri, Feb 07, 2025 at 11:11:21AM -0500, Jason Merrill wrote: > > On 2/7/25 9:28 AM, Nathaniel Shead wrote: > > > On Fri, Feb 07, 2025 a

Re: [PATCH] c++/modules: Better handle no-linkage decls in unnamed namespaces [PR118799]

2025-03-05 Thread Nathaniel Shead
Ping for this fix for a P1 issue. On Sun, Feb 09, 2025 at 10:38:24PM +1100, Nathaniel Shead wrote: > On Sun, Feb 09, 2025 at 01:16:00AM +1100, Nathaniel Shead wrote: > > Tested on x86_64-pc-linux-gnu, OK for trunk if full bootstrap + regtest > > passes? > > > > -- &

Re: [PATCH 2/4] c++/modules: Track module purview for deferred instantiations [PR114630]

2025-02-21 Thread Nathaniel Shead
djust the streaming logic to handle this better. Thoughts? Nathaniel On Wed, May 01, 2024 at 08:00:22PM +1000, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > When calling instantiate_pending_templates at end of pa

[PATCH] c++: Constrain visibility for CNTTPs with internal types [PR118849]

2025-02-12 Thread Nathaniel Shead
849 gcc/cp/ChangeLog: * decl2.cc (min_vis_expr_r): Constrain visibility according to the type of decl_constant_var_p decls. gcc/testsuite/ChangeLog: * g++.dg/template/linkage6.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl2.cc

[PATCH] c++/modules: Don't treat template parameters as TU-local [PR118846]

2025-02-12 Thread Nathaniel Shead
* g++.dg/modules/pr118846_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 1 + gcc/cp/decl2.cc | 22 ++ gcc/testsuite/g++.dg/modules/pr118846_a.C | 18 ++ gcc/testsuite/g++.dg/modules

Re: [PATCH v3 2/5] c++/modules: Ignore TU-local entities where necessary

2025-02-11 Thread Nathaniel Shead
l_entity): Remove. (function_contains_tu_local_entity): Remove. (dependent_operand_p): Remove special handling for TU_LOCAL_ENTITY. (tsubst_expr): Handle TU_LOCAL_ENTITY when tsubsting OVERLOADs; remove now-unnecessary extra handling. (type_de

[PATCH] c++: Fix use-after-free of replaced friend instantiation [PR118807]

2025-02-10 Thread Nathaniel Shead
hangeLog: * pt.cc (reregister_specialization): Remove spec from DECL_TEMPLATE_INSTANTIATIONS. gcc/testsuite/ChangeLog: * g++.dg/modules/pr118807.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/pt.cc| 11 +++ gcc/testsuite/g++.dg

Re: [PATCH] c++/modules: Better handle no-linkage decls in unnamed namespaces [PR118799]

2025-02-09 Thread Nathaniel Shead
On Sun, Feb 09, 2025 at 01:16:00AM +1100, Nathaniel Shead wrote: > Tested on x86_64-pc-linux-gnu, OK for trunk if full bootstrap + regtest > passes? > > -- >8 -- > > There are two issues with no-linkage decls (e.g. explicit type aliases) > in unnamed namespac

[PATCH] c++/modules: Better handle no-linkage decls in unnamed namespaces [PR118799]

2025-02-08 Thread Nathaniel Shead
g-30_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc| 35 - gcc/testsuite/g++.dg/modules/export-6.C | 33 ++- gcc/testsuite/g++.dg/modules/internal-4_b.C | 4 +-- gcc/testsuite/g++.dg/modules/using-30_a.C |

Re: [PATCH 3/3] c++/modules: Handle exposures of TU-local types in uninstantiated member templates

2025-02-08 Thread Nathaniel Shead
On Fri, Feb 07, 2025 at 11:11:21AM -0500, Jason Merrill wrote: > On 2/7/25 9:28 AM, Nathaniel Shead wrote: > > On Fri, Feb 07, 2025 at 08:14:23AM -0500, Jason Merrill wrote: > > > On 1/31/25 8:46 AM, Nathaniel Shead wrote: > > > > Bootstrapped and regtested on x86

Re: [PATCH 3/3] c++/modules: Handle exposures of TU-local types in uninstantiated member templates

2025-02-07 Thread Nathaniel Shead
On Fri, Feb 07, 2025 at 08:14:23AM -0500, Jason Merrill wrote: > On 1/31/25 8:46 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > Happy to remove the custom inform for lambdas, but I felt that the > > original m

Re: [PATCH 1/3] c++: Fix mangling of lambas in static member template initializers [PR107741]

2025-02-07 Thread Nathaniel Shead
On Fri, Feb 07, 2025 at 08:05:54AM -0500, Jason Merrill wrote: > On 1/31/25 8:44 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > My fix for this issue in r15-7147 turns out to not be

  1   2   3   4   5   >