[PATCH] c++/modules: Prevent revealing a using-decl affecting cached overloads [PR114867]

2024-05-26 Thread Nathaniel Shead
Log: * name-lookup.cc (do_nonmember_using_decl): Don't remove the existing overload. gcc/testsuite/ChangeLog: * g++.dg/modules/using-17_a.C: New test. * g++.dg/modules/using-17_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/name-lookup.cc |

Re: [PATCH] c++/modules: Improve diagnostic when redeclaring builtin in module [PR102345]

2024-05-24 Thread Nathaniel Shead
On Fri, May 24, 2024 at 11:24:38AM -0400, Jason Merrill wrote: > On 5/24/24 11:20, Nathaniel Shead wrote: > > This is just a small improvement to a diagnostic. I thought about also > > adding an inform to suggest something like "standard library headers > > sho

[PATCH] c++/modules: Improve diagnostic when redeclaring builtin in module [PR102345]

2024-05-24 Thread Nathaniel Shead
ith builtin" error. This patch updates the message to include "in module", to help guide the user towards the likely cause. gcc/cp/ChangeLog: * module.cc (module_may_redeclare): Update error message. gcc/testsuite/ChangeLog: * g++.dg/modules/enum-12.C: Test for updated

Re: [PATCH][14 backport] c++: Fix instantiation of imported temploid friends [PR114275]

2024-05-24 Thread Nathaniel Shead
On Fri, May 24, 2024 at 09:54:31AM -0400, Jason Merrill wrote: > On 5/24/24 04:06, Nathaniel Shead wrote: > > On Thu, May 23, 2024 at 06:41:06PM -0400, Jason Merrill wrote: > > > On 5/13/24 07:56, Nathaniel Shead wrote: > > > > > > @@ -11751,9 +11767,16 @@ t

Re: [PATCH][14 backport] c++: Fix instantiation of imported temploid friends [PR114275]

2024-05-24 Thread Nathaniel Shead
On Thu, May 23, 2024 at 06:41:06PM -0400, Jason Merrill wrote: > On 5/13/24 07:56, Nathaniel Shead wrote: > > > > @@ -11751,9 +11767,16 @@ tsubst_friend_class (tree friend_tmpl, tree > > > > args) > > > > if (tmpl != error_mark_node) > > &g

Re: [PATCH 1/2] c++/modules: Fix treatment of unnamed types

2024-05-23 Thread Nathaniel Shead
On Thu, May 23, 2024 at 03:36:48PM -0400, Jason Merrill wrote: > On 5/23/24 09:27, Nathaniel Shead wrote: > > On Mon, May 20, 2024 at 06:00:09PM -0400, Jason Merrill wrote: > > > On 5/17/24 02:14, Nathaniel Shead wrote: > > > > On Tue, May 14, 2024 at 06:21:4

[PATCH v2] c++/modules: Improve errors for bad module-directives [PR115200]

2024-05-23 Thread Nathaniel Shead
On Thu, May 23, 2024 at 05:11:39PM -0400, Jason Merrill wrote: > On 5/23/24 10:54, Nathaniel Shead wrote: > > Bootstrapped and regtested (so far just modules.exp and dg.exp) on > > x86_64-pc-linux-gnu, OK for trunk if full regtest succeeds? > > > > -- >8 -- &

[PATCH] c++/modules: Improve errors for bad module-directives [PR115200]

2024-05-23 Thread Nathaniel Shead
ges. * g++.dg/modules/mod-decl-6.C: New test. * g++.dg/modules/mod-decl-7.C: New test. * g++.dg/modules/mod-decl-8.C: New test. * g++.dg/modules/mod-decl-8.h: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/parser.cc |

Re: [PATCH] c++/modules: Ensure all partial specialisations are tracked [PR114947]

2024-05-23 Thread Nathaniel Shead
On Sun, May 12, 2024 at 11:29:39PM +1000, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > Constrained partial specialisations aren't all necessarily tracked on > the instantiation table. The modules

[PATCH 2/2] c++/modules: Remember that header units have CMIs

2024-05-23 Thread Nathaniel Shead
i_p): Update comment. * module.cc (set_defining_module): Only need to track declarations for later exporting if the module may have a CMI. * name-lookup.cc (pushdecl): Likewise. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 7 +++ gcc/cp/module.cc

[PATCH 1/2] c++/modules: Fix treatment of unnamed types

2024-05-23 Thread Nathaniel Shead
On Mon, May 20, 2024 at 06:00:09PM -0400, Jason Merrill wrote: > On 5/17/24 02:14, Nathaniel Shead wrote: > > On Tue, May 14, 2024 at 06:21:48PM -0400, Jason Merrill wrote: > > > On 5/12/24 22:58, Nathaniel Shead wrote: > > > > Bootstrapped and regtested on x86

Re: [PATCH v2] c++/modules: Remember that header units have CMIs

2024-05-17 Thread Nathaniel Shead
On Fri, May 17, 2024 at 04:14:31PM +1000, Nathaniel Shead wrote: > On Tue, May 14, 2024 at 06:21:48PM -0400, Jason Merrill wrote: > > On 5/12/24 22:58, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > OK. > &g

[PATCH v2] c++: Strengthen checks on 'main'

2024-05-17 Thread Nathaniel Shead
On Tue, May 14, 2024 at 06:25:29PM -0400, Jason Merrill wrote: > On 5/11/24 08:32, Nathaniel Shead wrote: > > I wasn't entirely sure what to do with the 'abi/main.C' testcase here; > > is this OK, or should I e.g. lower the linkage error to a pedwarn for > > the purposes of th

[PATCH v2] c++/modules: Remember that header units have CMIs

2024-05-17 Thread Nathaniel Shead
On Tue, May 14, 2024 at 06:21:48PM -0400, Jason Merrill wrote: > On 5/12/24 22:58, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > OK. > I realised as I was looking over this again that I might have spoken too soon with the h

Re: [PATCH] testsuite: c++: Allow for std::printf in g++.dg/modules/stdio-1_a.H [PR98529]

2024-05-13 Thread Nathaniel Shead
On Mon, May 13, 2024 at 01:59:51PM +0200, Rainer Orth wrote: > Hi Nathaniel, > > > On Mon, May 13, 2024 at 10:40:30AM +0200, Rainer Orth wrote: > >> g++.dg/modules/stdio-1_a.H currently FAILs on Solaris: > >> > >> FAIL: g++.dg/modules/stdio-1_a.H -std=c++17 scan-lang-dump module > >> "Depset:0

[PATCH][14 backport] c++: Fix instantiation of imported temploid friends [PR114275]

2024-05-13 Thread Nathaniel Shead
. * g++.dg/modules/tpl-friend-14_b.C: New test. * g++.dg/modules/tpl-friend-14_c.C: New test. * g++.dg/modules/tpl-friend-14_d.C: New test. * g++.dg/modules/tpl-friend-9.C: New test. Signed-off-by: Nathaniel Shead Reviewed-by: Jason Me

Re: [PATCH] testsuite: c++: Allow for std::printf in g++.dg/modules/stdio-1_a.H [PR98529]

2024-05-13 Thread Nathaniel Shead
On Mon, May 13, 2024 at 10:40:30AM +0200, Rainer Orth wrote: > g++.dg/modules/stdio-1_a.H currently FAILs on Solaris: > > FAIL: g++.dg/modules/stdio-1_a.H -std=c++17 scan-lang-dump module "Depset:0 > decl entity:[0-9]* function_decl:'::printf'" > FAIL: g++.dg/modules/stdio-1_a.H -std=c++2a

[PATCH] c++/modules: Remember that header units have CMIs

2024-05-12 Thread Nathaniel Shead
a.H: New test. * g++.dg/modules/linkage-3_b.C: New test. * g++.dg/modules/linkage-3_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 2 +- gcc/testsuite/g++.dg/modules/linkage-3_a.H | 19 +++ gcc/testsuite/g++.dg/modu

[PATCH] c++/modules: Ensure all partial specialisations are tracked [PR114947]

2024-05-12 Thread Nathaniel Shead
est. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 1 + gcc/cp/module.cc | 22 ++ gcc/cp/pt.cc | 2 ++ gcc/testsuite/g++.dg/modules/partial-4_a.C | 8 gcc/testsuite/g++.dg/modu

[PATCH] c++: Strengthen checks on 'main'

2024-05-11 Thread Nathaniel Shead
ned-off-by: Nathaniel Shead --- gcc/cp/decl.cc | 19 ++--- gcc/testsuite/g++.dg/abi/main.C | 29 gcc/testsuite/g++.dg/modules/contracts-1_b.C | 4 --- gcc/testsuite/g++.dg/modules/contracts-3_b.C | 4 --- gcc/testsuite/g++

Re: [PATCH] c++/modules: Stream unmergeable temporaries by value again [PR114856]

2024-05-06 Thread Nathaniel Shead
On Thu, May 02, 2024 at 01:53:44PM -0400, Jason Merrill wrote: > On 5/2/24 10:40, Patrick Palka wrote: > > On Thu, 2 May 2024, Nathaniel Shead wrote: > > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/14.2? > > > > > > Another alte

[PATCH] c++: Allow IS_FAKE_BASE_TYPE for union types [PR114954]

2024-05-06 Thread Nathaniel Shead
lso apply to unions. gcc/testsuite/ChangeLog: * g++.dg/modules/pr114954.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h| 2 +- gcc/testsuite/g++.dg/modules/pr114954.C | 14 ++ 2 files changed, 15 insertions(+), 1 deletion(-) cre

[PATCH v3] c++/modules: Fix dangling pointer with imported_temploid_friends

2024-05-03 Thread Nathaniel Shead
On Thu, May 02, 2024 at 02:05:38PM -0400, Jason Merrill wrote: > On 5/1/24 21:34, Nathaniel Shead wrote: > > On Thu, May 02, 2024 at 12:15:44AM +1000, Nathaniel Shead wrote: > > > On Wed, May 01, 2024 at 09:57:38AM -0400, Patrick Palka wrote: > > > > > > >

[PATCH] c++: Clear is_unbraced_* when parsing declaration_seq_opt [PR114917]

2024-05-01 Thread Nathaniel Shead
a.C: New test. * g++.dg/modules/export-5_b.C: New test. * g++.dg/parse/linkage4.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/parser.cc | 15 +++ gcc/testsuite/g++.dg/modules/export-5_a.C | 17 + gcc/testsuite/g++.dg

[PATCH v2] c++/modules: Fix dangling pointer with imported_temploid_friends

2024-05-01 Thread Nathaniel Shead
On Thu, May 02, 2024 at 12:15:44AM +1000, Nathaniel Shead wrote: > On Wed, May 01, 2024 at 09:57:38AM -0400, Patrick Palka wrote: > > > > On Wed, 1 May 2024, Nathaniel Shead wrote: > > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk (and >

[PATCH] c++/modules: Stream unmergeable temporaries by value again [PR114856]

2024-05-01 Thread Nathaniel Shead
temporary_var): Revert to only set context when in a function decl. gcc/testsuite/ChangeLog: * g++.dg/modules/pr114856.h: New test. * g++.dg/modules/pr114856_a.H: New test. * g++.dg/modules/pr114856_b.C: New test. Signed-off-by: Nathaniel Shead --- g

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

2024-05-01 Thread Nathaniel Shead
On Wed, May 01, 2024 at 10:11:20AM -0400, Patrick Palka wrote: > On Wed, 1 May 2024, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > When calling instantiate_pending_templates a

Re: [PATCH] c++/modules: Fix dangling pointer with imported_temploid_friends

2024-05-01 Thread Nathaniel Shead
On Wed, May 01, 2024 at 09:57:38AM -0400, Patrick Palka wrote: > > On Wed, 1 May 2024, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk (and > > later 14.2)? I don't think making it a GTY root is necessary but I felt > > per

[PATCH] c++: Implement modules ABI for vtable emissions

2024-05-01 Thread Nathaniel Shead
ise. * g++.dg/modules/virt-4_a.C: New test. * g++.dg/modules/virt-4_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/class.cc | 7 +- gcc/cp/decl.cc | 8 +- gcc/cp/decl2.cc |

[PATCH 4/4] c++: Add new xtreme-header testcase for GMF discarding

2024-05-01 Thread Nathaniel Shead
Log: * g++.dg/modules/xtreme-header.h: Update. * g++.dg/modules/xtreme-header-8.C: New test. Signed-off-by: Nathaniel Shead --- .../g++.dg/modules/xtreme-header-8.C | 9 +++ gcc/testsuite/g++.dg/modules/xtreme-header.h | 24 --- 2 files changed,

[PATCH 3/4] c++/modules: Also track module purview from deferred vtable instantiation [PR114630]

2024-05-01 Thread Nathaniel Shead
ave and restore module_kind. gcc/testsuite/ChangeLog: * g++.dg/modules/gmf-4.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl2.cc | 11 +-- gcc/testsuite/g++.dg/modules/gmf-4.C | 27 +++ 2 files changed, 36 insertions(+), 2 deleti

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

2024-05-01 Thread Nathaniel Shead
vel. (instantiate_pending_templates): Save and restore module_kind so it isn't affected by reopen_tinst_level. gcc/testsuite/ChangeLog: * g++.dg/modules/gmf-3.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 3 +++ gcc/cp/pt.cc | 4

[PATCH 1/4] c++/modules: Don't emit unused GMF partial specializations [PR114630]

2024-05-01 Thread Nathaniel Shead
Log: * g++.dg/modules/partial-3.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 75 +++- gcc/testsuite/g++.dg/modules/partial-3.C | 20 +++ 2 files changed, 66 insertions(+), 29 deletions(-) create mode 100644 gcc/testsuit

[PATCH 0/4] c++/modules: Fix missed GMF discarding

2024-05-01 Thread Nathaniel Shead
by an 'import'; this should go away once we implement deduplication of textual redefinitions, but it's still worth discarding as it otherwise inflates the size of the CMI with unused declarations. Nathaniel Shead (4): c++: Don't emit unused GMF partial specializations [PR114630] c++: Track module purview

[PATCH] c++/modules: Fix dangling pointer with imported_temploid_friends

2024-04-30 Thread Nathaniel Shead
ate from GGC. (trees_in::decl_value): Only write to imported_temploid_friends for new decls. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 5b8ff5bc

Re: [PATCH 2/3] c++/modules: Propagate using decls from partitions

2024-04-30 Thread Nathaniel Shead
On Sun, Apr 14, 2024 at 01:40:18AM +1000, Nathaniel Shead wrote: > On Fri, Apr 12, 2024 at 01:50:47PM -0400, Jason Merrill wrote: > > On 4/11/24 20:40, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > > > --

[PATCH v4 2/2] c++: Fix instantiation of imported temploid friends [PR114275]

2024-04-29 Thread Nathaniel Shead
On Fri, Apr 26, 2024 at 09:16:40PM -0400, Jason Merrill wrote: > On 4/19/24 09:29, Nathaniel Shead wrote: > > On Fri, Apr 19, 2024 at 12:14:06PM +1000, Nathaniel Shead wrote: > > > On Wed, Apr 17, 2024 at 02:02:21PM -0400, Patrick Palka wrote: > > > > On Mon, 15 A

[PATCH] c++: Check if allocation functions are xobj members [PR114078]

2024-04-20 Thread Nathaniel Shead
ion functions for xobj parameters. gcc/testsuite/ChangeLog: * g++.dg/cpp23/explicit-obj-ops-alloc.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl.cc | 6 ++ gcc/testsuite/g++.dg/cpp23/explicit-obj-ops-alloc.C | 11 +++

[PATCH] c++: Fix ICE with xobj parms and maybe incomplete decl-specifiers

2024-04-20 Thread Nathaniel Shead
ite/ChangeLog: * g++.dg/cpp23/explicit-obj-basic7.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/parser.cc | 5 +++-- gcc/testsuite/g++.dg/cpp23/explicit-obj-basic7.C | 9 + 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100

[PATCH v3 2/2] c++: Fix instantiation of imported temploid friends [PR114275]

2024-04-19 Thread Nathaniel Shead
On Fri, Apr 19, 2024 at 12:14:06PM +1000, Nathaniel Shead wrote: > On Wed, Apr 17, 2024 at 02:02:21PM -0400, Patrick Palka wrote: > > On Mon, 15 Apr 2024, Nathaniel Shead wrote: > > > > > I'm not a huge fan of always streaming 'imported_temploid_friends' for > >

Re: [PATCH v2 1/2] c++: Standardise errors for module_may_redeclare

2024-04-19 Thread Nathaniel Shead
On Mon, Apr 15, 2024 at 02:49:35PM +1000, Nathaniel Shead wrote: > I took another look at this patch and have split it into two, one (this > one) to standardise the error messages used and prepare > 'module_may_redeclare' for use with temploid friends, and another > followup patch

Re: [PATCH v2 2/2] c++/modules: Fix instantiation of imported temploid friends [PR114275]

2024-04-18 Thread Nathaniel Shead
On Wed, Apr 17, 2024 at 02:02:21PM -0400, Patrick Palka wrote: > On Mon, 15 Apr 2024, Nathaniel Shead wrote: > > > I'm not a huge fan of always streaming 'imported_temploid_friends' for > > all decls, but I don't think it adds much performance cost over adding a > > new

[PATCH v2 2/2] c++/modules: Fix instantiation of imported temploid friends [PR114275]

2024-04-14 Thread Nathaniel Shead
New test. * g++.dg/modules/tpl-friend-13_d.C: New test. * g++.dg/modules/tpl-friend-13_e.C: New test. * g++.dg/modules/tpl-friend-9.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 2 + gcc/cp/decl

[PATCH v2 1/2] c++: Standardise errors for module_may_redeclare

2024-04-14 Thread Nathaniel Shead
ise. * g++.dg/modules/shadow-1_b.C: Likewise. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 2 +- gcc/cp/decl.cc| 28 + gcc/cp/module.cc | 120 ++ gcc/cp/semantics

Re: [PATCH] c++/modules: Setup aliases imported from modules [PR106820]

2024-04-14 Thread Nathaniel Shead
On Fri, Apr 12, 2024 at 03:54:21PM -0400, Jason Merrill wrote: > On 3/26/24 09:24, Nathaniel Shead wrote: > > > > I wonder if more generally we need to be doing more work when importing > > definitions from header units especially to handle all the work that > >

Re: [PATCH 2/3] c++/modules: Propagate using decls from partitions

2024-04-13 Thread Nathaniel Shead
On Fri, Apr 12, 2024 at 01:50:47PM -0400, Jason Merrill wrote: > On 4/11/24 20:40, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > The modules code currently neglects to set OVL_USING_P on th

[PATCH 3/3] c++/modules: Propagate hidden flag on decls from partitions

2024-04-11 Thread Nathaniel Shead
.dg/modules/using-16_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/name-lookup.cc | 10 +- gcc/testsuite/g++.dg/modules/using-16_a.C | 11 +++ gcc/testsuite/g++.dg/modules/using-16_b.C | 12 gcc/testsuite/g++.dg/modules/using-16_c.C |

[PATCH 2/3] c++/modules: Propagate using decls from partitions

2024-04-11 Thread Nathaniel Shead
est. * g++.dg/modules/using-15_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 4 gcc/testsuite/g++.dg/modules/using-15_a.C | 13 + gcc/testsuite/g++.dg/modules/using-15_b.C | 5 + gcc/testsuite/g++.dg/modules/using-15_c.C |

[PATCH 1/3] c++/modules: Only emit exported GMF usings [PR114600]

2024-04-11 Thread Nathaniel Shead
ash::add_binding_entity): Require both WMB_Using and WMB_Export for GMF entities. gcc/testsuite/ChangeLog: * g++.dg/modules/using-14.C: New test. Signed-off-by: Nathaniel Shead Co-authored-by: Patrick Palka --- gcc/cp/module.cc| 2 +- gcc/testsuite/g++.dg/modu

[PATCH 0/3] c++/modules: Fix some small issues with exported using-decls

2024-04-11 Thread Nathaniel Shead
to be appropriate. Nathaniel Shead (3): c++: Only emit exported GMF usings [PR114600] c++: Propagate using decls from partitions c++: Propagate hidden flag on decls from partitions gcc/cp/module.cc | 6 +- gcc/cp/name-lookup.cc | 10 +- gcc

Re: [PATCH] c++: Keep DECL_SAVED_TREE of destructor instantiations in modules [PR104040]

2024-04-09 Thread Nathaniel Shead
On Tue, Apr 09, 2024 at 10:28:01AM -0400, Jason Merrill wrote: > On 4/9/24 09:36, Nathaniel Shead wrote: > > On Mon, Apr 08, 2024 at 11:17:27PM -0400, Jason Merrill wrote: > > > On 4/4/24 07:27, Nathaniel Shead wrote: > > > > On Wed, Apr 03, 2024 at 11:18:0

Re: [PATCH] c++: Keep DECL_SAVED_TREE of destructor instantiations in modules [PR104040]

2024-04-09 Thread Nathaniel Shead
On Mon, Apr 08, 2024 at 11:17:27PM -0400, Jason Merrill wrote: > On 4/4/24 07:27, Nathaniel Shead wrote: > > On Wed, Apr 03, 2024 at 11:18:01AM -0400, Jason Merrill wrote: > > > On 4/2/24 20:57, Nathaniel Shead wrote: > > > > On Tue, Apr 02, 2024 at 01:18:1

[PATCH v2] c++/modules: Track declarations imported from partitions [PR99377]

2024-04-04 Thread Nathaniel Shead
On Wed, Apr 03, 2024 at 02:16:25PM -0400, Jason Merrill wrote: > On 3/28/24 08:22, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > The testcase in comment 15 of the linked PR is caused

Re: [PATCH] c++: Keep DECL_SAVED_TREE of destructor instantiations in modules [PR104040]

2024-04-04 Thread Nathaniel Shead
On Wed, Apr 03, 2024 at 11:18:01AM -0400, Jason Merrill wrote: > On 4/2/24 20:57, Nathaniel Shead wrote: > > On Tue, Apr 02, 2024 at 01:18:17PM -0400, Jason Merrill wrote: > > > On 3/28/24 23:21, Nathaniel Shead wrote: > > > > - && !(modu

Re: [PATCH] c++: Keep DECL_SAVED_TREE of destructor instantiations in modules [PR104040]

2024-04-02 Thread Nathaniel Shead
On Tue, Apr 02, 2024 at 01:18:17PM -0400, Jason Merrill wrote: > On 3/28/24 23:21, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > A template instantiation still needs to have its DECL_S

[PATCH] c++: Keep DECL_SAVED_TREE of destructor instantiations in modules [PR104040]

2024-03-28 Thread Nathaniel Shead
est. Signed-off-by: Nathaniel Shead --- gcc/cp/semantics.cc | 7 +-- gcc/testsuite/g++.dg/modules/pr104040_a.C | 14 ++ gcc/testsuite/g++.dg/modules/pr104040_b.C | 8 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuit

[PATCH] c++/modules: Prefer partition indexes when installing imported entities [PR99377]

2024-03-28 Thread Nathaniel Shead
g++.dg/modules/pr99377-3_d.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 13 + gcc/testsuite/g++.dg/modules/pr99377-3_a.H | 17 + gcc/testsuite/g++.dg/modules/pr99377-3_b.C | 10 ++ gcc/testsuite/g++.dg/modules/

[PATCH] c++/modules: Setup aliases imported from modules [PR106820]

2024-03-26 Thread Nathaniel Shead
est. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 9 + gcc/testsuite/g++.dg/modules/pr106820_a.H | 5 + gcc/testsuite/g++.dg/modules/pr106820_b.C | 8 3 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/g++.dg/modules/pr106820_

[PATCH] c++/modules: Fix instantiation of imported temploid friends [PR114275]

2024-03-25 Thread Nathaniel Shead
* g++.dg/modules/tpl-friend-13_e.C: New test. * g++.dg/modules/tpl-friend-9.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 3 + gcc/cp/module.cc | 96 +++ gcc/cp/name-lookup

[COMMITTED] testsuite: Fix excess errors for new modules testcases on powerpc [PR114320]

2024-03-18 Thread Nathaniel Shead
320 gcc/testsuite/ChangeLog: * g++.dg/modules/target-powerpc-1_a.C: Suppress -Wpsabi. * g++.dg/modules/target-powerpc-1_b.C: Likewise. Signed-off-by: Nathaniel Shead --- gcc/testsuite/g++.dg/modules/target-powerpc-1_a.C | 2 +- gcc/testsuite/g++.dg/modules/target-powerpc-1_b.C

[PATCH v3] c++: Fix handling of no-linkage decls for modules

2024-03-16 Thread Nathaniel Shead
On Mon, Mar 11, 2024 at 02:13:34PM -0400, Jason Merrill wrote: > On 3/8/24 18:18, Nathaniel Shead wrote: > > On Fri, Mar 08, 2024 at 10:19:52AM -0500, Jason Merrill wrote: > > > On 3/7/24 21:55, Nathaniel Shead wrote: > > > > On Mon, Nov 27, 2023 at 03:59:39P

Re: [PATCH v2] c++: Support target-specific nodes with streaming [PR98645,PR111224]

2024-03-12 Thread Nathaniel Shead
On Tue, Mar 12, 2024 at 11:11:40PM +1100, Nathaniel Shead wrote: > On Mon, Mar 11, 2024 at 10:36:06AM -0400, Patrick Palka wrote: > > On Sun, 10 Mar 2024, Nathaniel Shead wrote: > > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu and > > > aarch6

[PATCH v2] c++: Support target-specific nodes with streaming [PR98645,PR111224]

2024-03-12 Thread Nathaniel Shead
On Mon, Mar 11, 2024 at 10:36:06AM -0400, Patrick Palka wrote: > On Sun, 10 Mar 2024, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu and > > aarch64-unknown-linux-gnu, OK for trunk? > > > > It's worth noting that the AArch64 ma

[PATCH] c++/modules: Support target-specific nodes with streaming [PR111224]

2024-03-10 Thread Nathaniel Shead
* g++.dg/modules/pr111224_a.C: New test. * g++.dg/modules/pr111224_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 70 +++ gcc/testsuite/g++.dg/modules/pr111224_a.C | 17 ++ gcc/testsuite/g++.dg/modules/pr111224_b.C | 13 + 3 f

Re: [PATCH v2] c++: Check module attachment instead of just purview when necessary [PR112631]

2024-03-08 Thread Nathaniel Shead
On Fri, Mar 08, 2024 at 10:19:52AM -0500, Jason Merrill wrote: > On 3/7/24 21:55, Nathaniel Shead wrote: > > On Mon, Nov 27, 2023 at 03:59:39PM +1100, Nathaniel Shead wrote: > > > On Thu, Nov 23, 2023 at 03:03:37PM -0500, Nathan Sidwell wrote: > > > > On 11/20/2

[PATCH v2] c++: Check module attachment instead of just purview when necessary [PR112631]

2024-03-07 Thread Nathaniel Shead
On Mon, Nov 27, 2023 at 03:59:39PM +1100, Nathaniel Shead wrote: > On Thu, Nov 23, 2023 at 03:03:37PM -0500, Nathan Sidwell wrote: > > On 11/20/23 04:47, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write > > >

[PATCH v2] c++: Redetermine whether to write vtables on stream-in [PR114229]

2024-03-07 Thread Nathaniel Shead
On Wed, Mar 06, 2024 at 08:59:16AM -0500, Jason Merrill wrote: > On 3/5/24 22:06, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > Currently, reading a variable definition always marks tha

[PATCH v2] c++: Fix template deduction for conversion operators with xobj parameters [PR113629]

2024-03-05 Thread Nathaniel Shead
On Tue, Mar 05, 2024 at 06:19:07PM -0500, Jason Merrill wrote: > On 3/5/24 17:47, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > Unification for conversion operators (DEDUCE_CONV) does

[PATCH] c++/modules: Prevent emission of really-extern vtables in importers [PR114229]

2024-03-05 Thread Nathaniel Shead
* g++.dg/modules/virt-3_d.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc| 15 +-- gcc/testsuite/g++.dg/modules/virt-2_c.C | 14 +- gcc/testsuite/g++.dg/modules/virt-3_a.C | 9 + gcc/testsuite/g++.dg/modules/virt-3_b.C |

[PATCH] c++: Fix template deduction for conversion operators with xobj parameters [PR113629]

2024-03-05 Thread Nathaniel Shead
* g++.dg/cpp23/explicit-obj-conv-op.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/pt.cc | 15 +- .../g++.dg/cpp23/explicit-obj-conv-op.C | 49 +++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 gcc/tes

Re: [PATCH] c++: Don't set DECL_CONTEXT to nested template-template parameters [PR98881]

2024-03-04 Thread Nathaniel Shead
On Mon, Mar 04, 2024 at 10:07:33PM -0500, Patrick Palka wrote: > On Tue, 5 Mar 2024, Nathaniel Shead wrote: > > > On Mon, Mar 04, 2024 at 09:26:00PM -0500, Patrick Palka wrote: > > > On Tue, 5 Mar 2024, Nathaniel Shead wrote: > > > > > > > On Mon, Mar 0

Re: [PATCH] c++: Don't set DECL_CONTEXT to nested template-template parameters [PR98881]

2024-03-04 Thread Nathaniel Shead
On Mon, Mar 04, 2024 at 09:26:00PM -0500, Patrick Palka wrote: > On Tue, 5 Mar 2024, Nathaniel Shead wrote: > > > On Mon, Mar 04, 2024 at 07:14:54PM -0500, Patrick Palka wrote: > > > On Sat, 2 Mar 2024, Nathaniel Shead wrote: > > > > > > > Bootstrappe

Re: [PATCH] c++: Don't set DECL_CONTEXT to nested template-template parameters [PR98881]

2024-03-04 Thread Nathaniel Shead
On Mon, Mar 04, 2024 at 07:14:54PM -0500, Patrick Palka wrote: > On Sat, 2 Mar 2024, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > When streaming in a nested template-template parame

Re: [PATCH] c++: Don't set DECL_CONTEXT to nested template-template parameters [PR98881]

2024-03-04 Thread Nathaniel Shead
On Mon, Mar 04, 2024 at 06:01:48PM -0500, Jason Merrill wrote: > On 3/2/24 01:54, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > When streaming in a nested template-template parameter as in

[PATCH] c++: Fix ICE diagnosing incomplete type of overloaded function set [PR98356]

2024-03-04 Thread Nathaniel Shead
est. Signed-off-by: Nathaniel Shead --- gcc/cp/typeck2.cc | 11 +-- gcc/testsuite/g++.dg/pr98356.C | 9 + 2 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/g++.dg/pr98356.C diff --git a/gcc/cp/typeck2.cc b/gcc/cp/typeck2.cc in

[PATCH] c++/modules: Implement P2615 'Meaningful Exports' [PR107688]

2024-03-04 Thread Nathaniel Shead
g-1_c.C: Clarify now-legal syntax. * g++.dg/template/crash71.C: Update error messages. * g++.dg/cpp2a/linkage-spec1.C: New test. * g++.dg/modules/export-3.C: New test. * g++.dg/modules/export-4_a.C: New test. * g++.dg/modules/export-4_b.C: New test. Signed-off

[PATCH] c++/modules: Support exporting using-decls in same namespace as target

2024-03-03 Thread Nathaniel Shead
pes. gcc/testsuite/ChangeLog: * g++.dg/modules/using-12.C: New test. * g++.dg/modules/using-13.h: New test. * g++.dg/modules/using-13_a.C: New test. * g++.dg/modules/using-13_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/name-lookup.cc |

[PATCH] c++: Don't set DECL_CONTEXT to nested template-template parameters [PR98881]

2024-03-01 Thread Nathaniel Shead
ned-off-by: Nathaniel Shead --- gcc/cp/module.cc| 17 - gcc/testsuite/g++.dg/modules/tpl-tpl-parm-3_a.H | 11 +++ gcc/testsuite/g++.dg/modules/tpl-tpl-parm-3_b.C | 13 + 3 files changed, 36 insertions(+), 5 deletions(-) create m

Re: [PATCH] c++/modules: Stream definitions for implicit instantiations [PR114170]

2024-03-01 Thread Nathaniel Shead
On Fri, Mar 01, 2024 at 08:18:09AM -0500, Jason Merrill wrote: > On 2/29/24 20:08, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > An implicit instantiation has an initializer depending on w

[PATCH] c++/modules: Stream definitions for implicit instantiations [PR114170]

2024-02-29 Thread Nathaniel Shead
ate. (module_state::write_inits): Only increment count when initializers are actually written. gcc/testsuite/ChangeLog: * g++.dg/modules/var-tpl-2_a.H: New test. * g++.dg/modules/var-tpl-2_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module

[PATCH] c++: Ensure DECL_CONTEXT is set for temporary vars [PR114005]

2024-02-29 Thread Nathaniel Shead
/cp/ChangeLog: * init.cc (create_temporary_var): Set DECL_CONTEXT to current_namespace if at namespace scope. gcc/testsuite/ChangeLog: * g++.dg/modules/pr114005_a.C: New test. * g++.dg/modules/pr114005_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/init

Re: [PATCH v3] c++/modules: Support lambdas attached to more places in modules [PR111710]

2024-02-28 Thread Nathaniel Shead
On Wed, Feb 28, 2024 at 12:34:51PM -0500, Jason Merrill wrote: > On 2/27/24 23:12, Nathaniel Shead wrote: > > On Tue, Feb 27, 2024 at 11:59:46AM -0500, Patrick Palka wrote: > > > On Fri, 16 Feb 2024, Nathaniel Shead wrote: > > > > > > > On Tue, Feb 13,

[PATCH v3] c++/modules: Support lambdas attached to more places in modules [PR111710]

2024-02-27 Thread Nathaniel Shead
On Tue, Feb 27, 2024 at 11:59:46AM -0500, Patrick Palka wrote: > On Fri, 16 Feb 2024, Nathaniel Shead wrote: > > > On Tue, Feb 13, 2024 at 07:52:01PM -0500, Jason Merrill wrote: > > > On 2/10/24 17:57, Nathaniel Shead wrote: > > > > The fix for PR107398 weakened t

[PATCH] c++: Revert deferring emission of inline variables [PR114013]

2024-02-21 Thread Nathaniel Shead
My earlier patch appears to have caused some regressions. I've taken a quick look to see if there are obvious workarounds, but given the time frame and the fact that I still don't really understand all the details of how and when symbols get emitted, I felt it was safer to revert the non-modules

[PATCH v2] c++/modules: Support lambdas attached to more places in modules [PR111710]

2024-02-16 Thread Nathaniel Shead
On Tue, Feb 13, 2024 at 07:52:01PM -0500, Jason Merrill wrote: > On 2/10/24 17:57, Nathaniel Shead wrote: > > The fix for PR107398 weakened the restrictions that lambdas must belong > > to namespace scope. However this was not sufficient: we also need to > > allow lambdas

Re: [PATCH v2] c++: Defer emitting inline variables [PR113708]

2024-02-14 Thread Nathaniel Shead
On Tue, Feb 13, 2024 at 09:47:27PM -0500, Jason Merrill wrote: > On 2/13/24 20:34, Nathaniel Shead wrote: > > On Tue, Feb 13, 2024 at 06:08:42PM -0500, Jason Merrill wrote: > > > On 2/11/24 08:26, Nathaniel Shead wrote: > > > > > > > > Currently inline v

[PATCH v2] c++: Defer emitting inline variables [PR113708]

2024-02-13 Thread Nathaniel Shead
On Tue, Feb 13, 2024 at 06:08:42PM -0500, Jason Merrill wrote: > On 2/11/24 08:26, Nathaniel Shead wrote: > > > > Currently inline vars imported from modules aren't correctly finalised, > > which means that import_export_decl gets called at the end of TU > > process

Re: [PATCH] c++: Fix error recovery when redeclaring enum in different module [PR99573]

2024-02-13 Thread Nathaniel Shead
On Tue, Feb 13, 2024 at 06:12:51PM -0500, Jason Merrill wrote: > On 2/11/24 21:26, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > This ensures that with modules enabled, redecla

[PATCH] c++: Fix error recovery when redeclaring enum in different module [PR99573]

2024-02-11 Thread Nathaniel Shead
ces this check is done. PR c++/99573 gcc/cp/ChangeLog: * decl.cc (start_enum): Reorder check for redeclaring in module. Add missing auto_diagnostic_groups. gcc/testsuite/ChangeLog: * g++.dg/modules/enum-12.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl

[PATCH] c++/modules: Finalise non-local imported vars [PR113708]

2024-02-11 Thread Nathaniel Shead
Log: * module.cc (trees_in::read_var_def): Perform rest of decl compilation on non-local statics. gcc/testsuite/ChangeLog: * g++.dg/modules/init-7_a.H: New test. * g++.dg/modules/init-7_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module

Re: [PATCH 2/1] c++: Also support lambdas attached to TYPE_DECLs in modules

2024-02-10 Thread Nathaniel Shead
On Sat, Feb 10, 2024 at 08:01:46PM -0800, Andrew Pinski wrote: > On Sat, Feb 10, 2024 at 7:55 PM Nathaniel Shead > wrote: > > > > Bootstrapped and regtested (so far just modules.exp and dg.exp) on > > x86_64-pc-linux-gnu, OK for trunk if full regtest succeeds? > >

[PATCH 2/1] c++: Also support lambdas attached to TYPE_DECLs in modules

2024-02-10 Thread Nathaniel Shead
ise. * parser.cc (cp_parser_class_head): Start a lambda scope when parsing base classes. gcc/testsuite/ChangeLog: * g++.dg/modules/lambda-7_a.C: * g++.dg/modules/lambda-7_b.C: Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 8 +--- gcc/cp/parser

[PATCH] c++: Support lambdas attached to FIELD_DECLs in modules [PR111710]

2024-02-10 Thread Nathaniel Shead
a.C: New test. * g++.dg/modules/lambda-7_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 23 gcc/cp/module.cc | 70 +++ gcc/testsuite/g++.dg/modules/lambda-7_a.C | 20 +++ gcc/testsuit

[PATCH] c++/modules: Handle error header names in modules [PR107594]

2024-01-27 Thread Nathaniel Shead
off-by: Nathaniel Shead --- gcc/cp/module.cc | 6 ++ 1 file changed, 6 insertions(+) diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 840c7ef6dab..3c2fef0e3f4 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -14050,6 +14050,12 @@ get_primary (module_state *parent) module_state * get_mod

[PATCH] c++/modules: Stream additional fields for DECL_STRUCT_FUNCTION [PR113580]

2024-01-26 Thread Nathaniel Shead
ags into cfun. gcc/testsuite/ChangeLog: * g++.dg/modules/pr113580_a.C: New test. * g++.dg/modules/pr113580_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 47 ++- gcc/testsuite/g++.dg/modules/pr113580_a.C | 10 +

[PATCH v4] c++/modules: Emit definitions of ODR-used static members imported from modules [PR112899]

2024-01-25 Thread Nathaniel Shead
On Wed, Jan 24, 2024 at 03:24:42PM -0500, Jason Merrill wrote: > On 1/20/24 05:45, Nathaniel Shead wrote: > > I also included > > your change to only add class variable templates to 'pending_statics' > > (and the normal 'static_decl's for non-class otherwise) as otherwis

Re: [PATCH v3] c++/modules: Fix handling of extern templates in modules [PR112820]

2024-01-22 Thread Nathaniel Shead
On Wed, Jan 17, 2024 at 10:51:16AM -0500, Jason Merrill wrote: > On 1/17/24 01:33, Nathaniel Shead wrote: > > On Mon, Jan 15, 2024 at 06:10:55PM -0500, Jason Merrill wrote: > > > Under what circumstances does it make sense for CLASSTYPE_INTERFACE_ONLY > > > to

[PATCH] c++: Fix importing nested namespace declarations [PR100707]

2024-01-20 Thread Nathaniel Shead
les/namespace-5_a.C: New test. * g++.dg/modules/namespace-5_b.C: New test. * g++.dg/modules/namespace-5_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/name-lookup.cc| 1 - gcc/testsuite/g++.dg/modules/indirect-1_b.C | 20 ++--- gcc/testsuit

[PATCH v3] c++/modules: Emit definitions of ODR-used static members imported from modules [PR112899]

2024-01-20 Thread Nathaniel Shead
On Fri, Jan 19, 2024 at 01:57:18PM -0500, Patrick Palka wrote: > On Wed, 3 Jan 2024, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > Static data members marked 'inline' should be emi

[PATCH] c++/modules: Handle partial specialisations in GMF [PR113405]

2024-01-19 Thread Nathaniel Shead
b.C: New test. * g++.dg/modules/concept-10_a.H: New test. * g++.dg/modules/concept-10_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc| 5 - gcc/testsuite/g++.dg/modules/concept-10_a.H | 25 + gcc/testsuite/g++

  1   2   3   >