[PATCH] c++/modules: Support lambdas in static template member initialisers [PR107398]

2023-11-13 Thread Nathaniel Shead
* g++.dg/modules/lambda-6_a.C: New test. * g++.dg/modules/lambda-6_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 35 +-- gcc/testsuite/g++.dg/modules/lambda-6_a.C | 16 +++ gcc/testsuite/g++.dg/modules/lambda-6_

[PATCH] c++/modules: Restrict partitions when parsing import declarations [PR110808]

2023-11-13 Thread Nathaniel Shead
uite/ChangeLog: * g++.dg/modules/part-hdr-1_c.C: Fix syntax. * g++.dg/modules/part-mac-1_c.C: Likewise. * g++.dg/modules/part-8_a.C: New test. * g++.dg/modules/part-8_b.C: New test. * g++.dg/modules/part-8_c.C: New test. Signed-off-by: Nathaniel

[PATCH] c++/modules: Allow exporting const-qualified namespace-scope variables [PR99232]

2023-11-15 Thread Nathaniel Shead
if it is exported, see p4.8). PR c++/99232 gcc/cp/ChangeLog: * decl.cc (grokvardecl): Don't mark variables attached to modules as internal. gcc/testsuite/ChangeLog: * g++.dg/modules/pr99232_a.C: New test. * g++.dg/modules/pr99232_b.C: New test. Signed-off-

[PATCH] c++: Set DECL_CONTEXT for __cxa_thread_atexit [PR99187]

2023-11-16 Thread Nathaniel Shead
support functions. PR c++/99187 gcc/cp/ChangeLog: * cp-tree.h (enum cp_tree_index): (thread_atexit_node): * decl.cc (get_thread_atexit_node): gcc/testsuite/ChangeLog: * g++.dg/modules/pr99187.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/c

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

2023-11-20 Thread Nathaniel Shead
Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write access. -- >8 -- Block-scope declarations of functions or extern values are not allowed when attached to a named module. Similarly, class member functions are not inline if attached to a named module. However, in both these cas

[PATCH] c++/modules: Prevent overwriting arguments for duplicates [PR112588]

2023-11-22 Thread Nathaniel Shead
/cp/ChangeLog: * module.cc (trees_in::read_function_def): Don't overwrite arguments. gcc/testsuite/ChangeLog: * g++.dg/modules/merge-16.h: New test. * g++.dg/modules/merge-16_a.C: New test. * g++.dg/modules/merge-16_b.C: New test. Signed-off-by: Nathaniel

[PATCH] c++: Clear uninstantiated friend flag when instantiating [PR104234]

2023-11-23 Thread Nathaniel Shead
gcc/cp/ChangeLog: * pt.cc (tsubst_template_decl): gcc/testsuite/ChangeLog: * g++.dg/modules/pr104234.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/pt.cc| 2 ++ gcc/testsuite/g++.dg/modules/pr104234.C | 16 2 files cha

Re: [PATCH] c++: Clear uninstantiated friend flag when instantiating [PR104234]

2023-11-23 Thread Nathaniel Shead
Sorry, I just noticed I hadn't actually filled in the changelog. It should say "Clear DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P." On Thu, Nov 23, 2023 at 11:54 PM Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write > acces

[COMMITTED] MAINTAINERS: Add myself to write after approval and DCO

2023-11-23 Thread Nathaniel Shead
ChangeLog: * MAINTAINERS: Add myself to write after approval and DCO Signed-off-by: Nathaniel Shead --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index b70336761ab..0dbcbadcfd7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -653,6 +653,7

[PATCH] c++: Allow exporting a typedef redeclaration [PR102341]

2023-11-23 Thread Nathaniel Shead
On Thu, Nov 23, 2023 at 11:45:31AM -0500, Nathan Sidwell wrote: > On 11/13/23 01:09, Nathaniel Shead wrote: > > I happened to be browsing the standard a bit later and noticed that we > > incorrectly reject the example given below. > > > > Bootstrapped on x86_64-pc-li

Re: [PATCH] c++/modules: Support lambdas in static template member initialisers [PR107398]

2023-11-23 Thread Nathaniel Shead
On Thu, Nov 23, 2023 at 11:49:39AM -0500, Nathan Sidwell wrote: > On 11/13/23 06:58, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write > > access. > > > > -- >8 -- > > > > The testcase noted in th

[PATCH v2] c++: Follow module grammar more closely [PR110808]

2023-11-24 Thread Nathaniel Shead
On Thu, Nov 23, 2023 at 12:11:58PM -0500, Nathan Sidwell wrote: > On 11/14/23 01:24, Nathaniel Shead wrote: > > I'll also note that the comments above the parsing functions here no > > longer exactly match with the grammar in the standard, should they be > > updated as w

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

2023-11-26 Thread Nathaniel Shead
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 > > access. > > > > -- >8 -- > > > > Block-scope declaration

Re: [PATCH] c++: fix noexcept checking for trivial operations [PR96090]

2023-11-27 Thread Nathaniel Shead
tin), but as it hasn't yet been accepted I think at least ensuring the builtin matches the behaviour of the operator is probably still sensible. On Sun, Oct 29, 2023 at 12:43:28PM +1100, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu. > > -- >8 -- >

Re: [PATCH] c++: End lifetime of objects in constexpr after destructor call [PR71093]

2023-11-27 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2023-November/635071.html. On Fri, Nov 03, 2023 at 12:34:06PM +1100, Nathaniel Shead wrote: > Oh, this also fixes PR102284 and its other linked PRs (apart from > fields); I forgot to note that in the commit. > > On Fri, Nov 03, 2

Re: [PATCH v2] c++: Catch indirect change of active union member in constexpr [PR101631]

2023-09-19 Thread Nathaniel Shead
On Tue, Sep 19, 2023 at 05:25:20PM -0400, Jason Merrill wrote: > On 9/1/23 08:22, Nathaniel Shead wrote: > > On Wed, Aug 30, 2023 at 04:28:18PM -0400, Jason Merrill wrote: > > > On 8/29/23 09:35, Nathaniel Shead wrote: > > > > This is an attempt to improve the con

[PATCH v3] c++: Catch indirect change of active union member in constexpr [PR101631]

2023-09-21 Thread Nathaniel Shead
4.C: New test. * g++.dg/cpp2a/constexpr-union5.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/call.cc| 11 +- gcc/cp/class.cc | 8 ++ gcc/cp/constexpr.cc | 129 +

[PATCH v4] c++: Check for indirect change of active union member in constexpr [PR101631,PR102286]

2023-09-22 Thread Nathaniel Shead
On Fri, Sep 22, 2023 at 02:21:15PM +0100, Jason Merrill wrote: > On 9/21/23 09:41, Nathaniel Shead wrote: > > I've updated the error messages, and also fixed another bug I found > > while retesting (value-initialised unions weren't considered to have

[PATCH v4] c++: Check for indirect change of active union member in constexpr [PR101631,PR102286]

2023-09-22 Thread Nathaniel Shead
fixed for that? On Sat, Sep 23, 2023 at 01:01:20AM +1000, Nathaniel Shead wrote: > On Fri, Sep 22, 2023 at 02:21:15PM +0100, Jason Merrill wrote: > > On 9/21/23 09:41, Nathaniel Shead wrote: > > > I've updated the error messages, and also fixed another bug I found > > &g

[PATCH] libstdc++: Ensure active union member is correctly set

2023-09-23 Thread Nathaniel Shead
On Sat, Sep 23, 2023 at 07:40:48AM +0100, Jonathan Wakely wrote: > On Sat, 23 Sept 2023, 01:39 Nathaniel Shead via Libstdc++, < > libstd...@gcc.gnu.org> wrote: > > > Now that bootstrap has finished, I have gotten regressions in the > > following libstdc++ tests: > &

[PATCH 1/3] c++: Introduce USING_DECLs for non-function usings [PR114683]

2024-07-06 Thread Nathaniel Shead
ion. * g++.dg/lookup/using68.C: New test. * g++.dg/modules/using-24_a.C: New test. * g++.dg/modules/using-24_b.C: New test. * g++.dg/modules/using-enum-4_a.C: New test. * g++.dg/modules/using-enum-4_b.C: New test. * g++.dg/modules/using-enum-4_c.C: New test.

[PATCH 2/3] c++/modules: Handle redefinitions of using-decls

2024-07-06 Thread Nathaniel Shead
e_override): Check for conflicting types and using-decls. gcc/testsuite/ChangeLog: * g++.dg/modules/using-19_a.C: New test. * g++.dg/modules/using-19_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl.cc| 6 +++-- gcc

[PATCH 3/3] c++: Add locations to using_p OVERLOADs

2024-07-06 Thread Nathaniel Shead
* ptree.cc (cxx_print_xnode): Write using location. * tree.cc (ovl_insert): Initialise source location for usings. (lookup_maybe_add): Propagate source location for usings. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 6 ++ gcc/cp/module.cc | 29

Re: [PATCH] c++/modules: Ensure deduction guides are always reachable [PR115231]

2024-07-06 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2024-June/654792.html On Sun, Jun 16, 2024 at 3:41 PM Nathaniel Shead wrote: > > On Sun, Jun 16, 2024 at 12:29:23PM +1000, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > >

[PATCH] c++/modules: Stream warning suppressions [PR115757]

2024-07-06 Thread Nathaniel Shead
(get_warning_spec): New function. (put_warning_spec): New function. gcc/testsuite/ChangeLog: * g++.dg/modules/warn-spec-1_a.C: New test. * g++.dg/modules/warn-spec-1_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 12

[PATCH] c++/modules: Conditionally start timer during lazy load [PR115165]

2024-07-07 Thread Nathaniel Shead
c++/115165 gcc/cp/ChangeLog: * module.cc (lazy_load_binding): Use 'timevar_cond*' APIs. (lazy_load_pendings): Likewise. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/cp/module.c

[committed] c++: Simplify uses of LAMBDA_EXPR_EXTRA_SCOPE

2024-07-07 Thread Nathaniel Shead
On Sun, Jun 16, 2024 at 12:18:10PM +1000, Nathaniel Shead wrote: > No functional change intended; OK for trunk? > In retrospect, committing as obvious after bootstrap+regtest. > -- >8 -- > > I noticed there already exists a getter to get the scope of a lambda > from its

[PATCH] c++/modules: Keep entity mapping info across duplicate_decls [PR99241]

2024-07-07 Thread Nathaniel Shead
gcc/cp/ChangeLog: * decl.cc (duplicate_decls): Merge module entity information. gcc/testsuite/ChangeLog: * g++.dg/modules/pr99241_a.H: New test. * g++.dg/modules/pr99241_b.H: New test. * g++.dg/modules/pr99241_c.C: New test. Signed-off-by

[PATCH] c++/modules: Propagate BINDING_VECTOR_*_DUPS_P on realloc [PR99242]

2024-07-08 Thread Nathaniel Shead
gcc/testsuite/ChangeLog: * g++.dg/modules/pr99242_a.H: New test. * g++.dg/modules/pr99242_b.H: New test. * g++.dg/modules/pr99242_c.H: New test. * g++.dg/modules/pr99242_d.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/name-lookup.cc

[PATCH v2] c++/modules: Keep entity mapping info across duplicate_decls [PR99241]

2024-07-09 Thread Nathaniel Shead
On Mon, Jul 08, 2024 at 11:21:55AM -0400, Patrick Palka wrote: > On Mon, 8 Jul 2024, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/14? > > > > -- >8 -- > > > > When duplicate_decls finds a match with an exist

[PATCH v2 1/3] c++: Introduce USING_DECLs for non-function usings [PR114683]

2024-07-09 Thread Nathaniel Shead
On Mon, Jul 08, 2024 at 12:26:41PM -0400, Jason Merrill wrote: > On 7/6/24 10:06 PM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > With modules, a non-function using-declaration is not co

Re: [PATCH 2/3] c++/modules: Handle redefinitions of using-decls

2024-07-09 Thread Nathaniel Shead
On Mon, Jul 08, 2024 at 02:21:41PM -0400, Jason Merrill wrote: > On 7/6/24 10:07 PM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > This fixes an ICE exposed by supporting exported non-funct

Re: [PATCH 3/3] c++: Add locations to using_p OVERLOADs

2024-07-09 Thread Nathaniel Shead
On Mon, Jul 08, 2024 at 02:24:14PM -0400, Jason Merrill wrote: > On 7/6/24 10:13 PM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > I have also been working on a patch that uses the locations of > > using-decls in &

Re: [PATCH v2 1/3] c++: Introduce USING_DECLs for non-function usings [PR114683]

2024-07-11 Thread Nathaniel Shead
On Tue, Jul 09, 2024 at 05:43:59PM -0400, Jason Merrill wrote: > On 7/9/24 9:44 AM, Nathaniel Shead wrote: > > On Mon, Jul 08, 2024 at 12:26:41PM -0400, Jason Merrill wrote: > > > For a using-decl in the same scope as the original decl, won't this > > > replace &g

[committed] c++/modules: Add testcase for fixed issue with usings [PR115798]

2024-07-12 Thread Nathaniel Shead
est. * g++.dg/modules/using-26_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/testsuite/g++.dg/modules/using-26_a.C | 15 +++ gcc/testsuite/g++.dg/modules/using-26_b.C | 10 ++ gcc/testsuite/g++.dg/modules/using-26_c.C | 9 + 3 files changed, 34 inserti

Re: [PATCH] c++/modules: Conditionally start timer during lazy load [PR115165]

2024-07-17 Thread Nathaniel Shead
On Wed, Jul 17, 2024 at 04:31:21PM -0400, Jason Merrill wrote: > On 7/7/24 9:29 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > Or should I include a testcase? I haven't reduced one from using the > > full

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

2024-07-17 Thread Nathaniel Shead
On Wed, Jul 17, 2024 at 01:12:34PM -0400, Jason Merrill wrote: > On 5/1/24 11:27 AM, Jason Merrill wrote: > > On 5/1/24 07:11, Patrick Palka wrote: > > > On Wed, 1 May 2024, Nathaniel Shead wrote: > > > > > > > Bootstrapped and regtest

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

2024-07-17 Thread Nathaniel Shead
On Wed, Jul 17, 2024 at 11:36:26PM -0400, Jason Merrill wrote: > On 7/17/24 11:04 PM, Nathaniel Shead wrote: > > On Wed, Jul 17, 2024 at 01:12:34PM -0400, Jason Merrill wrote: > > > On 5/1/24 11:27 AM, Jason Merrill wrote: > > > > On 5/1/24 07:11, Patrick Palka wrote

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

2024-07-18 Thread Nathaniel Shead
On Thu, Jul 18, 2024 at 02:33:56PM -0400, Jason Merrill wrote: > On 7/18/24 12:33 AM, Nathaniel Shead wrote: > > On Wed, Jul 17, 2024 at 11:36:26PM -0400, Jason Merrill wrote: > > > On 7/17/24 11:04 PM, Nathaniel Shead wrote: > > > > On Wed, Jul 17, 2024 at 01:12:3

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

2024-05-16 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

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

2024-05-16 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

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 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

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

2024-05-23 Thread Nathaniel Shead
ybe_has_cmi_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/modul

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 mo

[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 |

[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 -- >

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

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) > > >

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

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

2024-05-24 Thread Nathaniel Shead
s with 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 f

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 > > should

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

2024-05-26 Thread Nathaniel Shead
ration. PR c++/114867 gcc/cp/ChangeLog: * 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

[PATCH v2] c++/modules: Fix revealing with using-decls [PR114867]

2024-05-31 Thread Nathaniel Shead
On Tue, May 28, 2024 at 02:57:09PM -0400, Jason Merrill wrote: > On 5/26/24 09:01, Nathaniel Shead wrote: > > Is this approach OK? Alternatively I suppose we could do a deep copy of > > the overload list when this occurs to ensure we don't affect existing > > referents

[PATCH v3] c++/modules: Handle instantiating already tsubsted template friend classes [PR115801]

2024-08-07 Thread Nathaniel Shead
On Wed, Aug 07, 2024 at 09:12:13PM -0400, Patrick Palka wrote: > On Wed, 7 Aug 2024, Patrick Palka wrote: > > > On Thu, 8 Aug 2024, Nathaniel Shead wrote: > > > > > On Wed, Aug 07, 2024 at 01:44:31PM -0400, Jason Merrill wrote: > > > > O

Re: [PATCH] c++/modules: Fix merging of GM entities in partitions [PR114950]

2024-08-07 Thread Nathaniel Shead
On Wed, Aug 07, 2024 at 08:45:03PM -0400, Jason Merrill wrote: > On 8/7/24 7:22 PM, Nathaniel Shead wrote: > > On Wed, Aug 07, 2024 at 04:18:47PM -0400, Jason Merrill wrote: > > > On 8/5/24 9:16 AM, Nathaniel Shead wrote: > > > > Bootstrapped and regteste

[PATCH] c++: Propagate TREE_ADDRESSABLE in fixup_type_variants [PR115062]

2024-08-08 Thread Nathaniel Shead
ite/ChangeLog: * g++.dg/modules/pr115062_a.H: New test. * g++.dg/modules/pr115062_b.H: New test. * g++.dg/modules/pr115062_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/class.cc | 31 ++- gcc/testsuite/g++.dg/modules/pr11

[PATCH] c++/modules: Assume header bindings are global module

2024-08-08 Thread Nathaniel Shead
hangeLog: * module.cc (module_state::read_cluster): Assume header module declarations will require GM merging. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 58a

Re: [PATCH] c++: Add missing auto_diagnostic_groups

2024-08-08 Thread Nathaniel Shead
On Thu, Aug 08, 2024 at 03:16:24PM -0400, Marek Polacek wrote: > On Thu, Aug 08, 2024 at 09:13:05AM +1000, Nathaniel Shead wrote: > > diff --git a/gcc/cp/error.cc b/gcc/cp/error.cc > > index 6c22ff55b46..03c19e4a7e4 100644 > > --- a/gcc/cp/error.cc > > +++ b/gcc/

Re: [PATCH] c++: Add missing auto_diagnostic_groups

2024-08-08 Thread Nathaniel Shead
On Fri, Aug 09, 2024 at 11:03:24AM +1000, Nathaniel Shead wrote: > On Thu, Aug 08, 2024 at 03:16:24PM -0400, Marek Polacek wrote: > > On Thu, Aug 08, 2024 at 09:13:05AM +1000, Nathaniel Shead wrote: > > > diff --git a/gcc/cp/error.cc b/gcc/cp/error.cc > > > index 6c22

[PATCH] c++/modules: Merge default arguments [PR99274]

2024-08-11 Thread Nathaniel Shead
dg/modules/default-arg-2_b.C: New test. * g++.dg/modules/default-arg-3.h: New test. * g++.dg/modules/default-arg-3_a.H: New test. * g++.dg/modules/default-arg-3_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 62 ++-

[PATCH] c++/modules: Fix type lookup in DECL_TEMPLATE_INSTANTIATIONS [PR116364]

2024-08-15 Thread Nathaniel Shead
pec-9_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h| 3 ++- gcc/cp/module.cc| 3 ++- gcc/cp/pt.cc| 8 +--- gcc/testsuite/g++.dg/modules/tpl-spec-9_a.C | 12 gcc/testsuit

[PATCH] c++/modules: Avoid rechecking initializers when streaming NTTPs [PR116382]

2024-08-15 Thread Nathaniel Shead
ing NTTPs. * pt.cc (get_template_parm_object): Prevent cp_finish_decl from validating the initializer when check_init=false. gcc/testsuite/ChangeLog: * g++.dg/modules/tpl-nttp-1_a.C: New test. * g++.dg/modules/tpl-nttp-1_b.C: New test. Signed-off-by: Nathaniel Sh

[PATCH] c++/modules: Disable streaming definitions of non-vague-linkage GMF decls [PR115020]

2024-08-17 Thread Nathaniel Shead
p/ChangeLog: * module.cc (has_definition): Only force writing definitions for header_module_p. gcc/testsuite/ChangeLog: * g++.dg/modules/pr115020_a.C: New test. * g++.dg/modules/pr115020_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc

[PATCH] c++/modules: Handle transitive reachability for deduction guides [PR116403]

2024-08-17 Thread Nathaniel Shead
EACHABLE'. gcc/testsuite/ChangeLog: * g++.dg/modules/dguide-4_a.C: New test. * g++.dg/modules/dguide-4_b.C: New test. * g++.dg/modules/dguide-4_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 7 + gcc/cp/n

[PATCH] c++/modules: Slightly clean up error for referencing TU-local entity

2024-08-18 Thread Nathaniel Shead
ailed write_begin and disable module writing in that case. gcc/testsuite/ChangeLog: * g++.dg/modules/block-decl-2.C: Adjust error message. * g++.dg/modules/internal-1.C: Likewise. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc| 30 +

[PATCH v2] c++/modules: Remove unnecessary errors when not writing compiled module

2024-08-20 Thread Nathaniel Shead
On Mon, Aug 19, 2024 at 12:55:22PM -0400, Jason Merrill wrote: > On 8/18/24 8:11 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > Or should we even just remove the warning entirely? I'm not sure it > > reall

Re: [PATCH] c++/modules: Avoid rechecking initializers when streaming NTTPs [PR116382]

2024-08-20 Thread Nathaniel Shead
On Mon, Aug 19, 2024 at 01:38:56PM -0400, Jason Merrill wrote: > On 8/16/24 2:55 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > Maybe also skip the unshare_constructor when !check_init? OK either way. > Makes sense, thanks.

[PATCH 1/3] c++: Handle ABI for non-polymorphic dynamic classes

2024-08-20 Thread Nathaniel Shead
rt-5_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl2.cc | 4 ++-- gcc/testsuite/g++.dg/modules/virt-5_a.C | 16 gcc/testsuite/g++.dg/modules/virt-5_b.C | 11 +++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 10

[PATCH 2/3] c++/modules: Prevent maybe_clone_decl being called multiple times [PR115007]

2024-08-20 Thread Nathaniel Shead
* g++.dg/modules/virt-6_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc| 7 --- gcc/cp/semantics.cc | 2 +- gcc/testsuite/g++.dg/modules/virt-6_a.C | 13 + gcc/testsuite/g++.dg/modules/virt-6_b.C | 6 ++

[PATCH 3/3] c++/modules: Support decloned cdtors

2024-08-20 Thread Nathaniel Shead
odules/clone-2_a.C: New test. * g++.dg/modules/clone-2_b.C: New test. * g++.dg/modules/clone-3_a.C: New test. * g++.dg/modules/clone-3_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 20 gcc/testsuite/g++.dg/modules/c

[PATCH 1/2] c++/modules: Clean up include translation [PR110980]

2024-08-22 Thread Nathaniel Shead
gcc/testsuite/ChangeLog: * g++.dg/modules/inc-xlate-2_a.H: New test. * g++.dg/modules/inc-xlate-2_b.H: New test. * g++.dg/modules/inc-xlate-3.h: New test. * g++.dg/modules/inc-xlate-3_a.H: New test. Signed-off-by: Nathaniel Shead --- gcc

[PATCH 2/2] c++/modules: Fix include translation for already-seen headers [PR99243]

2024-08-22 Thread Nathaniel Shead
ew test. * g++.dg/modules/inc-xlate-4_b.H: New test. * g++.dg/modules/inc-xlate-4_c.H: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 18 +- gcc/testsuite/g++.dg/modules/inc-xlate-4_a.H | 5 + gcc/testsuite/g+

Re: [PATCH] c++/modules: Merge default arguments [PR99274]

2024-08-22 Thread Nathaniel Shead
On Thu, Aug 22, 2024 at 02:20:14PM -0400, Patrick Palka wrote: > On Mon, 12 Aug 2024, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > I tried to implement a remapping of the slots for TARGET_EXPRs for the > > F

[PATCH] c++: Simplify uses of LAMBDA_EXPR_EXTRA_SCOPE

2024-06-15 Thread Nathaniel Shead
Use LAMBDA_TYPE_EXTRA_SCOPE instead of LAMBDA_EXPR_EXTRA_SCOPE. (trees_out::key_mergeable): Likewise. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index ea7ad0c1

[PATCH] c++/modules: Ensure deduction guides are always reachable [PR115231]

2024-06-15 Thread Nathaniel Shead
ules/dguide-3_a.C: New test. * g++.dg/modules/dguide-3_b.C: New test. * g++.dg/modules/dguide-3_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/error.cc | 1 + gcc/cp/module.cc | 60 +++ gcc/cp/pt.cc

Re: [PATCH] c++/modules: Ensure deduction guides are always reachable [PR115231]

2024-06-15 Thread Nathaniel Shead
On Sun, Jun 16, 2024 at 12:29:23PM +1000, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > This probably isn't the most efficient approach, since we need to do > name lookup to find deduction guides for a type which will also > po

Re: [PATCH] c++/modules: Ensure deduction guides are always reachable [PR115231]

2024-07-25 Thread Nathaniel Shead
On Tue, Jul 23, 2024 at 04:17:22PM -0400, Jason Merrill wrote: > On 6/15/24 10:29 PM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > This probably isn't the most efficient approach, since we need to do > > name

Re: [PATCH] c++/modules: Stream warning suppressions [PR115757]

2024-07-25 Thread Nathaniel Shead
On Tue, Jul 23, 2024 at 05:14:30PM -0400, Patrick Palka wrote: > On Tue, 23 Jul 2024, Jason Merrill wrote: > > > On 7/7/24 12:39 AM, Nathaniel Shead wrote: > > > Bootstrapped on x86_64-pc-linux-gnu, successfully regtested modules.exp; > > > OK for trunk if full regte

Re: [PATCH] c++/modules: Ensure deduction guides are always reachable [PR115231]

2024-07-26 Thread Nathaniel Shead
On Fri, Jul 26, 2024 at 01:17:57PM -0400, Jason Merrill wrote: > On 7/26/24 12:52 AM, Nathaniel Shead wrote: > > On Tue, Jul 23, 2024 at 04:17:22PM -0400, Jason Merrill wrote: > > > On 6/15/24 10:29 PM, Nathaniel Shead wrote: > > > > Bootstrapped and regtested on x86

[PATCH] c++/modules: Fix merging of GM entities in partitions [PR114950]

2024-08-05 Thread Nathaniel Shead
test. * g++.dg/modules/tpl-friend-15_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 55 ++-- gcc/cp/name-lookup.cc | 65 ++- gcc/cp/name-lookup.h | 2 +- gc

[PATCH] c++/modules: Handle instantiating qualified template friend classes [PR115801]

2024-08-05 Thread Nathaniel Shead
on is seen (lazy loaded). PR c++/115801 gcc/cp/ChangeLog: * pt.cc (tsubst_friend_class): Handle friend_tmpl without extra template parms. gcc/testsuite/ChangeLog: * g++.dg/modules/tpl-friend-16_a.C: New test. * g++.dg/modules/tpl-friend-16_b.C: New test. S

[PATCH] c++: Improve fixits for incorrect explicit instantiations

2024-08-06 Thread Nathaniel Shead
: * parser.cc (cp_parser_class_head): Clarify error message for explicit instantiations. gcc/testsuite/ChangeLog: * g++.dg/template/explicit-instantiation9.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/parser.cc | 19 ++- .../g+

[PATCH v2] c++/modules: Ensure deduction guides are always reachable [PR115231]

2024-08-06 Thread Nathaniel Shead
On Fri, Jul 26, 2024 at 01:17:57PM -0400, Jason Merrill wrote: > On 7/26/24 12:52 AM, Nathaniel Shead wrote: > > On Tue, Jul 23, 2024 at 04:17:22PM -0400, Jason Merrill wrote: > > > On 6/15/24 10:29 PM, Nathaniel Shead wrote: > > > > Bootstrapped and regtested on x86

[PATCH] c++/modules: Clarify error message in read_enum_def

2024-08-07 Thread Nathaniel Shead
ror. gcc/testsuite/ChangeLog: * g++.dg/modules/enum-bad-1_b.C: Update error message. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc| 4 ++-- gcc/testsuite/g++.dg/modules/enum-bad-1_b.C | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --gi

[PATCH] c++: Add missing auto_diagnostic_groups

2024-08-07 Thread Nathaniel Shead
ild_x_unary_op): Likewise. (cp_build_unary_op): Likewise. (build_static_cast): Likewise. (cp_build_modify_expr): Likewise. (get_delta_difference): Likewise. (convert_for_assignment): Widen scope of auto_diagnostic_group. (check_return_expr): Add missing auto_diagn

Re: [PATCH] c++/modules: Fix merging of GM entities in partitions [PR114950]

2024-08-07 Thread Nathaniel Shead
On Wed, Aug 07, 2024 at 04:18:47PM -0400, Jason Merrill wrote: > On 8/5/24 9:16 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested (so far just modules.exp) on > > x86_64-pc-linux-gnu, OK for trunk if full regtest passes? > > OK. > > > -- >8 -- > &g

Re: [PATCH v2] c++/modules: Handle instantiating qualified template friend classes [PR115801]

2024-08-07 Thread Nathaniel Shead
On Wed, Aug 07, 2024 at 01:44:31PM -0400, Jason Merrill wrote: > On 8/6/24 2:35 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > Another potential approach would be to go searching for this unexported > > type and

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

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 > > '

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

2024-04-14 Thread Nathaniel Shead
dg/modules/friend-5_b.C: Likewise. * 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 ++

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

2024-04-14 Thread Nathaniel Shead
nd-13_b.C: New test. * g++.dg/modules/tpl-friend-13_c.C: 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 ---

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 add

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 > foll

[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' fo

[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] c++: Check if allocation functions are xobj members [PR114078]

2024-04-20 Thread Nathaniel Shead
ck allocation 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 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

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] c++/modules: Fix dangling pointer with imported_temploid_friends

2024-04-30 Thread Nathaniel Shead
Mark GTY, and... (init_modules): ...allocate 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/

<    1   2   3   4   5   >