[PATCH] c++: Add missing auto_diagnostic_groups to constexpr.cc

2023-10-17 Thread Nathaniel Shead
ise. (diag_array_subscript): Likewise. (outside_lifetime_error): Likewise. (potential_constant_expression_1): Likewise. Signed-off-by: Nathaniel Shead --- gcc/cp/constexpr.cc | 9 + 1 file changed, 9 insertions(+) diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc index dde4fec4

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

2023-10-28 Thread Nathaniel Shead
* g++.dg/ext/is_nothrow_constructible8.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/call.cc| 17 ++--- gcc/cp/method.cc | 19 -- gcc/testsuite/g++.dg/cpp0x/noexcept81.C | 36 +++ .../g++.dg/

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

2023-11-02 Thread Nathaniel Shead
p2a/bitfield2.C: Likewise. * g++.dg/cpp2a/constexpr-new3.C: Likewise. New check. * g++.dg/cpp1y/constexpr-lifetime7.C: New test. * g++.dg/cpp2a/constexpr-lifetime1.C: New test. * g++.dg/cpp2a/constexpr-lifetime2.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/call

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

2023-11-02 Thread Nathaniel Shead
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, 2023 at 12:18:29PM +1100, Nathaniel Shead wrote: > Bootstrapped and regtested on x86-64_pc_linux_gnu. > > I'm not entirely sure if the change I made to have de

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

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

2023-09-22 Thread Nathaniel Shead
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 > > > while r

[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 v3] c++: Catch indirect change of active union member in constexpr [PR101631]

2023-09-21 Thread Nathaniel Shead
g/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 +- gcc/cp/cp

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

2023-09-28 Thread Nathaniel Shead
On Wed, Sep 27, 2023 at 03:13:35PM +0100, Jonathan Wakely wrote: > On Sat, 23 Sept 2023 at 08:30, Nathaniel Shead via Libstdc++ > wrote: > > > > On Sat, Sep 23, 2023 at 07:40:48AM +0100, Jonathan Wakely wrote: > > > On Sat, 23 Sept 2023, 01:39 Nathaniel Shead vi

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

2023-09-29 Thread Nathaniel Shead
On Fri, Sep 29, 2023 at 04:06:33PM +0100, Jonathan Wakely wrote: > On Fri, 29 Sept 2023 at 10:32, Jonathan Wakely wrote: > > > Thanks for the comments, here's an updated version of the patch. > > > Bootstrapped and regtested on x86_64-pc-linux-gnu. > > > > Great, I'll get this committed today -

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

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

2023-10-10 Thread Nathaniel Shead
On Mon, Oct 09, 2023 at 04:46:46PM -0400, Jason Merrill wrote: > On 10/8/23 21:03, Nathaniel Shead wrote: > > Ping for > > https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631203.html > > > > + && (TREE_CODE (t) == MODIFY_EXPR > > +

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

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

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

2023-10-12 Thread Nathaniel Shead
On Wed, Oct 11, 2023 at 12:48:12AM +1100, Nathaniel Shead wrote: > On Mon, Oct 09, 2023 at 04:46:46PM -0400, Jason Merrill wrote: > > On 10/8/23 21:03, Nathaniel Shead wrote: > > > Ping for > > > https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631203.html >

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

2023-10-12 Thread Nathaniel Shead
On Thu, Oct 12, 2023 at 04:24:00PM -0400, Jason Merrill wrote: > On 10/12/23 04:53, Nathaniel Shead wrote: > > On Wed, Oct 11, 2023 at 12:48:12AM +1100, Nathaniel Shead wrote: > > > On Mon, Oct 09, 2023 at 04:46:46PM -0400, Jason Merrill wrote: > > > > On 10/8/2

[PATCH] c++: Improve diagnostics for constexpr cast from void*

2023-10-09 Thread Nathaniel Shead
ite/ChangeLog: * g++.dg/cpp0x/constexpr-cast4.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/constexpr.cc | 83 +--- gcc/testsuite/g++.dg/cpp0x/constexpr-cast4.C | 7 ++ 2 files changed, 78 insertions(+), 12 deletions(-) create mode 100

[PATCH v2] c++: Improve diagnostics for constexpr cast from void*

2023-10-10 Thread Nathaniel Shead
On Mon, Oct 09, 2023 at 04:10:20PM -0400, Jason Merrill wrote: > On 10/9/23 06:03, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu with > > GXX_TESTSUITE_STDS=98,11,14,17,20,23,26,impcx. > > > > -- >8 -- > > > > This patch i

[PATCH] c++/modules: fix virtual destructors [PR103499]

2023-11-09 Thread Nathaniel Shead
.dg/modules/pr103499_a.C: New test. * g++.dg/modules/pr103499_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 6 ++ gcc/testsuite/g++.dg/modules/pr103499_a.C | 12 gcc/testsuite/g++.dg/modules/pr103499_b.C | 8 3 fi

[PATCH] c++/modules: more checks for exporting names with using-declarations

2023-11-10 Thread Nathaniel Shead
.cc (check_can_export_using_decl): New. (do_nonmember_using_decl): Use above to check if names can be exported. gcc/testsuite/ChangeLog: * g++.dg/modules/using-10.C: New test. * g++.dg/modules/using-enum-2.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/name-lookup

[PATCH] c++/modules: handle templates in exported using-declarations [PR106849]

2023-11-09 Thread Nathaniel Shead
ote. PR c++/106849 gcc/cp/ChangeLog: * name-lookup.cc (do_nonmember_using_decl): Handle TEMPLATE_DECLs when checking module attachment. gcc/testsuite/ChangeLog: * g++.dg/modules/using-9.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/name-lookup

Re: [PATCH] c++/modules: fix virtual destructors [PR103499]

2023-11-09 Thread Nathaniel Shead
On Thu, Nov 09, 2023 at 05:57:39PM -0500, Nathan Sidwell wrote: > On 11/9/23 04:55, Nathaniel Shead wrote: > > I'm not sure if this is just papering over a general issue of clones not > > being > > exported/imported, or if this is just an exception to the general case of

[PATCH] testsuite: Disable test for PR113292 on targets without TLS support

2024-01-18 Thread Nathaniel Shead
ite/ChangeLog: * g++.dg/modules/pr113292_c.C: Require TLS. Signed-off-by: Nathaniel Shead --- gcc/testsuite/g++.dg/modules/pr113292_c.C | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/testsuite/g++.dg/modules/pr113292_c.C b/gcc/testsuite/g++.dg/modules/pr113292_c.C in

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

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

[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

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

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

Re: [PATCH] c++: Check null pointer deref when calling memfn in constexpr [PR102420]

2023-12-19 Thread Nathaniel Shead
On Mon, Dec 18, 2023 at 01:32:58PM -0500, Jason Merrill wrote: > On 12/17/23 16:51, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > An alternative approach for the lambda issue would be to modify > > 'maybe_add_lambda_

[PATCH] c++: Fix unchecked use of CLASSTYPE_AS_BASE [PR113031]

2023-12-15 Thread Nathaniel Shead
): Check for CLASS_TYPE before using CLASSTYPE_AS_BASE. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/pr113031.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/constexpr.cc | 3 ++- gcc/testsuite/g++.dg/cpp0x/pr113031.C | 34 +++ 2 files chang

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

2023-12-16 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637768.html. (I've changed the summary message a little from that email but the patch is otherwise unchanged.) On Wed, Nov 22, 2023 at 10:33:15PM +1100, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu

Re: [PATCH] c++/modules: seed namespaces for bindings [PR106363]

2023-12-16 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2023-November/636159.html On Sun, Nov 12, 2023 at 12:59:36PM +1100, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write > access. > > -- >8 -- > > Currently the first dep

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

2023-12-16 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2023-November/638089.html On Fri, Nov 24, 2023 at 10:32:13PM +1100, Nathaniel Shead wrote: > 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

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

2023-12-10 Thread Nathaniel Shead
On Sat, Dec 09, 2023 at 03:40:44PM -0500, Jason Merrill wrote: > On 11/27/23 06:07, Nathaniel Shead wrote: > > Ping for https://gcc.gnu.org/pipermail/gcc-patches/2023-October/634626.html. > > > > I've been made aware since constructing this patch of CWG2820, which has >

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

2024-01-02 Thread Nathaniel Shead
(Whoops, forgot the '[PATCH]', fixed the subject in email.) On Wed, Jan 03, 2024 at 09:40:55AM +1100, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > Static data members marked 'inline' should be emitted in TUs where t

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

2024-01-02 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2023-November/638089.html. On Fri, Nov 24, 2023 at 10:32:13PM +1100, Nathaniel Shead wrote: > 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

Re: [PATCH] c++/modules: Prevent treating suppressed debug info as extern template [PR112820]

2024-01-02 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2023-December/639082.html. On Sun, Dec 03, 2023 at 11:46:36PM +1100, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > The TYPE_DECL_SUPPRESS_DEBUG and DECL_EXTERNAL

[PATCH] c++/modules: Fix ICE when writing nontrivial variable initializers

2024-01-02 Thread Nathaniel Shead
* g++.dg/modules/init-5_a.C: New test. * g++.dg/modules/init-5_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc| 3 ++- gcc/testsuite/g++.dg/modules/init-5_a.C | 9 + gcc/testsuite/g++.dg/modules/init-5_b.C | 10 ++ 3 files chan

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

2024-01-02 Thread Nathaniel Shead
.dg/modules/init-4_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h| 2 +- gcc/cp/decl2.cc | 4 ++-- gcc/cp/module.cc| 4 gcc/cp/pt.cc| 2 +- gcc/testsuite/g++.dg/modules/i

Re: [PATCH] c++/modules: Prevent overwriting arguments when merging duplicates [PR112588]

2024-01-02 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637768.html. On Sat, Dec 16, 2023 at 09:50:10PM +1100, Nathaniel Shead wrote: > Ping for https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637768.html. > (I've changed the summary message a little from that email but the

[PATCH] c++: Export usings referring to global module fragment [PR109679]

2024-01-03 Thread Nathaniel Shead
.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 6 -- gcc/testsuite/g++.dg/modules/using-11.h | 2 ++ gcc/testsuite/g++.dg/modules/using-11_a.C | 9 + gcc/testsuite/g++.dg/modules/using-11_b.C | 8 4 files changed, 23 insertion

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

2024-01-04 Thread Nathaniel Shead
On Thu, Jan 04, 2024 at 03:31:50PM -0500, Jason Merrill wrote: > On 1/2/24 17:40, Nathaniel Shead wrote: > > Static data members marked 'inline' should be emitted in TUs where they > > are ODR-used. We need to make sure that statics imported from modules > >

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

2024-01-04 Thread Nathaniel Shead
On Thu, Jan 04, 2024 at 05:42:34PM -0500, Jason Merrill wrote: > On 1/4/24 17:24, Nathaniel Shead wrote: > > On Thu, Jan 04, 2024 at 03:31:50PM -0500, Jason Merrill wrote: > > > On 1/2/24 17:40, Nathaniel Shead wrote: > > > > Static data members marked 'inline'

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

2024-01-03 Thread Nathaniel Shead
est. * g++.dg/modules/init-4_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h| 2 +- gcc/cp/decl2.cc | 4 ++-- gcc/cp/module.cc| 5 + gcc/cp/pt.cc| 2 +- gcc/testsuit

[PATCH] c++/modules: Support thread_local statics in header modules [PR113292]

2024-01-10 Thread Nathaniel Shead
ite/ChangeLog: * g++.dg/modules/pr113292_a.H: New test. * g++.dg/modules/pr113292_b.C: New test. * g++.dg/modules/pr113292_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl2.cc | 10 --- gcc/cp/module.cc |

[PATCH] c++: Fix ENABLE_SCOPE_CHECKING printing

2024-01-15 Thread Nathaniel Shead
ing output. This patch brings the list into line. gcc/cp/ChangeLog: * name-lookup.cc (cp_binding_level_descriptor): Add missing scope kinds. Signed-off-by: Nathaniel Shead --- gcc/cp/name-lookup.cc | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/cp/n

Re: [PATCH v2] c++: Fix ENABLE_SCOPE_CHECKING printing

2024-01-16 Thread Nathaniel Shead
On Mon, Jan 15, 2024 at 04:04:49PM -0500, Jason Merrill wrote: > On 1/15/24 04:41, Nathaniel Shead wrote: > > While working on another bug, I noticed the ENABLE_SCOPE_CHECKING macro > > and thought to try it out. It caused selftest to ICE. This patch is a > > minimal fix to

Re: [PATCH] c++/modules: Support thread_local statics in header modules [PR113292]

2024-01-16 Thread Nathaniel Shead
On Mon, Jan 15, 2024 at 05:38:25PM -0500, Jason Merrill wrote: > On 1/11/24 01:12, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu. OK for trunk? > > > > -- >8 -- > > > > Currently, thread_locals in header modules cause ICEs. This

Re: [PATCH v2] c++/modules: Differentiate extern templates and TYPE_DECL_SUPPRESS_DEBUG [PR112820]

2024-01-16 Thread Nathaniel Shead
On Mon, Jan 15, 2024 at 06:10:55PM -0500, Jason Merrill wrote: > On 1/8/24 10:27, Patrick Palka wrote: > > On Mon, 8 Jan 2024, Nathaniel Shead wrote: > > > On Thu, Jan 04, 2024 at 03:39:15PM -0500, Patrick Palka wrote: > > > > On Sun, 3 D

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

2024-01-07 Thread Nathaniel Shead
So I took a bit of a closer look and this is actually a regression, seeming to start with r13-3134-g09df0d8b14dda6. I haven't looked more closely at the actual change though to see whether this implies a different fix yet though. Nathaniel > On 11/22/23 06:33, Nathaniel Shead wrote: > > Bo

[PATCH v2] c++/modules: Differentiate extern templates and TYPE_DECL_SUPPRESS_DEBUG [PR112820]

2024-01-08 Thread Nathaniel Shead
On Thu, Jan 04, 2024 at 03:39:15PM -0500, Patrick Palka wrote: > On Sun, 3 Dec 2023, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > The TYPE_DECL_SUPPRESS_DEBUG and DECL_EXTERNA

[PATCH] c++: Check null pointer deref when calling memfn in constexpr [PR102420]

2023-12-17 Thread Nathaniel Shead
xpr-memfn2.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/constexpr.cc | 17 + gcc/testsuite/g++.dg/cpp0x/constexpr-memfn2.C | 10 ++ 2 files changed, 27 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-memfn2.C diff --

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 > access. > &g

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

2023-11-23 Thread Nathaniel Shead
/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 changed,

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

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

[PATCH] c++/modules: Prevent treating suppressed debug info as extern template [PR112820]

2023-12-03 Thread Nathaniel Shead
bug-2_a.C: New test. * g++.dg/modules/debug-2_b.C: New test. * g++.dg/modules/debug-2_c.C: New test. * g++.dg/modules/debug-3_a.C: New test. * g++.dg/modules/debug-3_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 4 +++-

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

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

2023-11-27 Thread Nathaniel Shead
), 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 -- > > This patch s

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

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

[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 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: Allow exporting const-qualified namespace-scope variables [PR99232]

2023-11-15 Thread Nathaniel Shead
age 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-by: Nathan

[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

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

2023-11-16 Thread Nathaniel Shead
ort 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/cp-tre

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

2023-11-13 Thread Nathaniel Shead
* 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 Shead --- gcc/cp/parser

[PATCH] c++/modules: seed namespaces for bindings [PR106363]

2023-11-11 Thread Nathaniel Shead
ter): Don't skip first depset for bindings. gcc/testsuite/ChangeLog: * g++.dg/modules/pr106363_a.C: New test. * g++.dg/modules/pr106363_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 4 +--- gcc/testsuite/g++.dg/modu

[PATCH] c++/modules: check mismatching exports for class tags [PR98885]

2023-11-12 Thread Nathaniel Shead
ady declared as non-exporting. gcc/testsuite/ChangeLog: * g++.dg/modules/export-1.C: Adjust error messages. Remove xfails for working case. Add new test case. Signed-off-by: Nathaniel Shead --- gcc/cp/decl.cc | 21 ++--- gcc/testsuite/g++

[PATCH 2/1] c++/modules: Allow exporting a typedef redeclaration

2023-11-12 Thread Nathaniel Shead
.cc (duplicate_decls): Allow exporting a redeclaration of a typedef. gcc/testsuite/ChangeLog: * g++.dg/modules/export-1.C: Adjust test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl.cc | 5 - gcc/testsuite/g++.dg/modules/export-1.C | 6 +- 2 files chan

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

2023-11-13 Thread Nathaniel Shead
.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_b.C |

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

2023-11-22 Thread Nathaniel Shead
Log: * 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 Shead --- gcc

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

2024-01-16 Thread Nathaniel Shead
* g++.dg/modules/debug-2_c.C: New test. * g++.dg/modules/debug-3_a.C: New test. * g++.dg/modules/debug-3_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 36 +--- gcc/testsuite/g++.dg/modules/debug-2_a.C | 9 ++ gcc

[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

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

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

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

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

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

[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

[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

  1   2   3   >