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

2024-05-01 Thread Nathaniel Shead
'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++:

[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 2/4] c++/modules: Track module purview for deferred instantiations [PR114630]

2024-05-01 Thread Nathaniel Shead
le_kind from level. (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

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

2024-05-01 Thread Nathaniel Shead
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 4/4] c++: Add new xtreme-header testcase for GMF discarding

2024-05-01 Thread Nathaniel Shead
ite/ChangeLog: * 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 file

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

2024-05-01 Thread Nathaniel Shead
C: Likewise. * g++.dg/modules/virt-2_c.C: Likewise. * 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

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

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

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

2024-05-01 Thread Nathaniel Shead
c (create_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 She

[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++: Clear is_unbraced_* when parsing declaration_seq_opt [PR114917]

2024-05-01 Thread Nathaniel Shead
/export-5_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/testsu

[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++: Allow IS_FAKE_BASE_TYPE for union types [PR114954]

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

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++: Strengthen checks on 'main'

2024-05-11 Thread Nathaniel Shead
dg/parse/linkage6.C: New test. Signed-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/contract

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

2024-05-12 Thread Nathaniel Shead
* g++.dg/modules/partial-4_b.C: New test. 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

[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

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 scan

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

2024-05-13 Thread Nathaniel Shead
modules/tpl-friend-13_g.C: New test. * g++.dg/modules/tpl-friend-14_a.C: New test. * 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/modu

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

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

2024-09-02 Thread Nathaniel Shead
(convert_for_assignment): Widen scope of auto_diagnostic_group. (check_return_expr): Add missing auto_diagnostic_group. * typeck2.cc (cxx_incomplete_type_diagnostic): Likewise. Signed-off-by: Nathaniel Shead Reviewed-by: Marek Polacek --- gcc/cp/class.cc | 12 + gcc/cp/constrain

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

2024-09-02 Thread Nathaniel Shead
Ping. On Wed, Aug 21, 2024 at 09:38:44AM +1000, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > The Itanium ABI has specific rules for when virtual tables for dynamic > classes should be emitted. However we didn&

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

2024-09-02 Thread Nathaniel Shead
Ping. On Wed, Aug 21, 2024 at 09:40:25AM +1000, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > The ICE in the linked PR is caused because maybe_clone_decl is not > prepared to be called on a declaration that h

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

2024-09-02 Thread Nathaniel Shead
Ping. On Wed, Aug 21, 2024 at 09:41:31AM +1000, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > When compiling with '-fdeclone-ctor-dtor' (enabled by default with -Os), > we run into issues where we don&

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

2024-09-02 Thread Nathaniel Shead
Ping. On Fri, Aug 23, 2024 at 10:02:44AM +1000, Nathaniel Shead wrote: > 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? > > &

[PATCH] c++: Fix mangling of otherwise unattached class-scope lambdas [PR116568]

2024-09-05 Thread Nathaniel Shead
. * g++.dg/modules/lambda-8_a.H: New test. * g++.dg/modules/lambda-8_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 3 +- gcc/cp/parser.cc | 31 + gcc/cp/pt.cc

Re: [PATCH] c++: Implement for namespace statics CWG 2867 - Order of initialization for structured bindings [PR115769]

2024-09-11 Thread Nathaniel Shead
On Tue, Sep 10, 2024 at 08:29:58PM +0200, Jakub Jelinek wrote: > Hi! > > The following patch on top of the > https://gcc.gnu.org/pipermail/gcc-patches/2024-September/662507.html > patch adds CWG 2867 support for namespace locals. > > Those vars are just pushed into {static,tls}_aggregates chain,

[PATCH] c++/modules: Really always track partial specialisations [PR116496]

2024-09-11 Thread Nathaniel Shead
a.C: New test. * g++.dg/modules/partial-5_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 25 +++--- gcc/cp/pt.cc | 1 + gcc/testsuite/g++.dg/modules/partial-5_a.C | 9 gcc/testsuite/g++.dg/mo

Re: [PATCH] c++: Fix mangling of otherwise unattached class-scope lambdas [PR116568]

2024-10-14 Thread Nathaniel Shead
On Fri, Oct 11, 2024 at 10:37:11AM -0400, Jason Merrill wrote: > On 9/5/24 11:02 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested (so far just dg.exp) on x86_64-pc-linux-gnu, > > OK for trunk if full regtest passes? Or would it be better to try to > > implement all t

[PATCH] libgcc: Use inline variable instead of function-local static

2024-10-08 Thread Nathaniel Shead
e instead of a function. Ignore any resultant diagnostics. (__gthread_trigger): __gthread_active is now a variable. (__gthread_active_p): Likewise. Signed-off-by: Nathaniel Shead --- libgcc/gthr-posix.h | 39 +++ 1 file changed, 19 insert

[PATCH v3 4/5] c++/modules: Check linkage for exported declarations

2024-10-11 Thread Nathaniel Shead
put_location. gcc/testsuite/ChangeLog: * g++.dg/modules/export-3.C: Adjust error message. * g++.dg/modules/export-6.C: New test. Signed-off-by: Nathaniel Shead Reviewed-by: Jason Merrill --- gcc/cp/cp-tree.h| 1 + gcc/cp/decl2.cc

[PATCH] c++/modules: Handle forward-declared class types

2024-10-21 Thread Nathaniel Shead
* g++.dg/modules/class-9_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 54 +++ gcc/testsuite/g++.dg/modules/class-9_a.H | 8 +++ gcc/testsuite/g++.dg/modules/class-9_b.H | 7 +++ gcc/testsuite/g++.dg/modules/class-9_c.C

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

2024-10-04 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2024-August/660134.html. On Thu, Sep 12, 2024 at 01:35:38PM -0400, Patrick Palka wrote: > On Fri, 23 Aug 2024, Nathaniel Shead wrote: > > > On Thu, Aug 22, 2024 at 02:20:14PM -0400, Patrick Palka wrote: > > > On Mon, 12 Aug

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

2024-10-04 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2024-August/660956.html. On Wed, Aug 21, 2024 at 09:38:44AM +1000, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > The Itanium ABI has specific rules for when virtual

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

2024-10-04 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2024-August/660957.html On Wed, Aug 21, 2024 at 09:40:25AM +1000, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > The ICE in the linked PR is caused because maybe

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

2024-10-04 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2024-August/660958.html On Wed, Aug 21, 2024 at 09:41:31AM +1000, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > When compiling with '-fdeclone-ctor-dtor'

[PATCH] c++: Allow references to internal-linkage vars in C++11 [PR113266]

2024-10-03 Thread Nathaniel Shead
6.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/parser.cc | 17 - gcc/testsuite/g++.dg/cpp0x/nontype6.C | 19 +++ 2 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/nontype6.C diff --git a/

[PATCH] c++: Return the underlying decl rather than the USING_DECL from update_binding [PR116913]

2024-10-03 Thread Nathaniel Shead
now return USING_DECLs; this patch fixes the situation. PR c++/116913 gcc/cp/ChangeLog: * name-lookup.cc (update_binding): Return the strip_using'd old decl rather than the binding. gcc/testsuite/ChangeLog: * g++.dg/lookup/using70.C: New test. Signed-off-by: N

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

2024-10-22 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2024-August/660134.html. On Thu, Sep 12, 2024 at 01:35:38PM -0400, Patrick Palka wrote: > On Fri, 23 Aug 2024, Nathaniel Shead wrote: > > > On Thu, Aug 22, 2024 at 02:20:14PM -0400, Patrick Palka wrote: > > > On Mon, 12 Aug

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

2024-10-22 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2024-August/660956.html (and the rest of this series). On Wed, Aug 21, 2024 at 09:38:44AM +1000, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > The Itanium ABI has

[PATCH v3 0/5] c++/modules: Implement P1815 "Translation-unit-local entities"

2024-10-11 Thread Nathaniel Shead
; the main changes are responses to comments left on previous versions of this patch series. Nathaniel Shead (5): c++/modules: Detect exposures of TU-local entities c++/modules: Ignore TU-local entities where necessary c++/modules: Support unnamed namespaces in header units c++/modules: Check

[PATCH v3 1/5] c++/modules: Detect exposures of TU-local entities

2024-10-11 Thread Nathaniel Shead
.C: New test. * g++.dg/modules/internal-4_a.H: New test. * g++.dg/modules/internal-4_b.C: New test. Signed-off-by: Nathaniel Shead Reviewed-by: Jason Merrill --- gcc/cp/module.cc| 381 +--- gcc/testsuite/g++.dg/modules/block-decl-2.

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

2024-10-11 Thread Nathaniel Shead
odules/internal-5_a.C: New test. * g++.dg/modules/internal-5_b.C: New test. * g++.dg/modules/internal-6.C: New test. * g++.dg/modules/internal-7_a.C: New test. * g++.dg/modules/internal-7_b.C: New test. * g++.dg/modules/internal-8_a.C: New test. * g++.d

[PATCH v3 3/5] c++/modules: Support unnamed namespaces in header units

2024-10-11 Thread Nathaniel Shead
Adjust assertion. * name-lookup.cc (push_namespace): Move anon using-directive handling to... (make_namespace_finish): ...here. gcc/testsuite/ChangeLog: * g++.dg/modules/internal-9_a.H: New test. * g++.dg/modules/internal-9_b.C: New test. Signed-off-by

[PATCH v3 5/5] c++/modules: Validate external linkage definitions in header units [PR116401]

2024-10-11 Thread Nathaniel Shead
dg/modules/pragma-1_a.H: Likewise. * g++.dg/modules/tpl-ary-1.h: Likewise. * g++.dg/modules/hdr-2.H: New test. Signed-off-by: Nathaniel Shead Reviewed-by: Jason Merrill --- gcc/cp/decl.cc| 4 + gcc/cp/module.cc | 18 +++ gcc

Re: [PATCH 00/15] Support for 64-bit location_t

2024-11-03 Thread Nathaniel Shead
On Sun, Nov 03, 2024 at 05:22:05PM -0500, Lewis Hyatt wrote: > Hello- > > There is no shortage of PRs complaining about things that go wrong when the > line_maps data structure in libcpp starts to run into its limits. Being > restricted to a 32-bit location_t to cover all source locations means it

[PATCH] libstdc++: Remove workaround for modules issue [PR113814]

2024-11-04 Thread Nathaniel Shead
tdc++-v3/ChangeLog: * include/bits/stl_pair.h: Remove workaround. Signed-off-by: Nathaniel Shead --- libstdc++-v3/include/bits/stl_pair.h | 5 - 1 file changed, 5 deletions(-) diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h index 0d60eaba

[PATCH] c++/modules: Handle location exhaustion in write_location [PR105443]

2024-11-04 Thread Nathaniel Shead
(module_state::write_location): Check for writing module locations stored due to resource exhaustion. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 42 ++ 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/gcc/cp/module.c

[PATCH] c++/modules: Fix recursive dependencies [PR116317]

2024-10-31 Thread Nathaniel Shead
Find recursive deps and mark the entry point. (sort_cluster): Ensure that the entry dep is streamed first. gcc/testsuite/ChangeLog: * g++.dg/modules/late-ret-4_a.H: New test. * g++.dg/modules/late-ret-4_b.C: New test. Signed-off-by: Nathaniel Shead

Re: [PATCH v3 0/5] c++/modules: Implement P1815 "Translation-unit-local entities"

2024-10-31 Thread Nathaniel Shead
Gentle ping for the first two patches in this series: https://gcc.gnu.org/pipermail/gcc-patches/2024-October/665108.html On Sat, Oct 12, 2024 at 12:29:09AM +1100, Nathaniel Shead wrote: > This patch series implements most of the changes made by P1815. It also > cleans up a few bugs found

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

2024-11-02 Thread Nathaniel Shead
On Fri, Nov 01, 2024 at 11:23:41AM -0400, Jason Merrill wrote: > On 8/22/24 8:02 PM, Nathaniel Shead wrote: > > On Thu, Aug 22, 2024 at 02:20:14PM -0400, Patrick Palka wrote: > > > On Mon, 12 Aug 2024, Nathaniel Shead wrote: > > > > > > > Bootstrapped and r

Re: [PATCH] c++/modules: Fix recursive dependencies [PR116317]

2024-11-02 Thread Nathaniel Shead
On Fri, Nov 01, 2024 at 12:08:45PM -0400, Jason Merrill wrote: > On 10/31/24 6:09 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > In cases like the linked PR we sometimes get mutually

[PATCH v2 3/3] c++/modules: Prevent ICE when writing class-scope lambdas without mangling scope [PR116568]

2024-11-09 Thread Nathaniel Shead
+.dg/modules/lambda-8.h: New test. * g++.dg/modules/lambda-8_a.H: New test. * g++.dg/modules/lambda-8_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 30 ++- gcc/testsuite/g++.dg/modules/lambda-8.h | 7 +

[PATCH v2 1/3] c++: Fix mangling of otherwise unattached class-scope lambdas [PR107741]

2024-11-09 Thread Nathaniel Shead
g/abi/lambda-ctx4.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 3 ++- gcc/cp/parser.cc | 31 ++- gcc/cp/pt.cc | 14 ++- gcc/testsuite/g++.dg/abi/lambda-ctx2.C | 34 ++

[PATCH v2 2/3] c++: Update mangling of lambdas in expressions

2024-11-09 Thread Nathaniel Shead
gling for lambdas. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/lambda-generic-mangle1.C: Update mangling. * g++.dg/cpp2a/lambda-generic-mangle1a.C: Likewise. Signed-off-by: Nathaniel Shead --- gcc/cp/mangle.cc | 2 +- gcc/testsuite/g++.dg/cpp2a/l

[WIP][PATCH] c++: Fix ABI for lambdas declared in alias templates [PR116568]

2024-11-10 Thread Nathaniel Shead
ChangeLog: * g++.dg/abi/lambda-ctx4.C: Adjust mangling, include namespace scope alias templates (XFAILed for now). Signed-off-by: Nathaniel Shead --- gcc/cp/mangle.cc | 13 - gcc/cp/pt.cc | 23 ++-

Re: [PATCH 2/2] c++/modules: Retrofit imported partial specs over existing implicit instantiations [PR113814]

2024-10-24 Thread Nathaniel Shead
On Thu, Oct 24, 2024 at 12:05:18PM -0400, Jason Merrill wrote: > On 10/24/24 3:25 AM, Nathaniel Shead wrote: > > I wasn't sure whether I should include the ambiguity checking logic from > > process_partial_specialization; we don't do this anywhere else in the > > mod

Re: [PATCH 2/2] c++/modules: Retrofit imported partial specs over existing implicit instantiations [PR113814]

2024-10-31 Thread Nathaniel Shead
On Fri, Oct 25, 2024 at 11:25:15AM -0400, Jason Merrill wrote: > On 10/24/24 5:10 PM, Nathaniel Shead wrote: > > On Thu, Oct 24, 2024 at 12:05:18PM -0400, Jason Merrill wrote: > > > On 10/24/24 3:25 AM, Nathaniel Shead wrote: > > > > I wasn't sure whether I sh

[PATCH 00/10] c++/modules: Implement P1815 "Translation-unit-local entities"

2024-09-23 Thread Nathaniel Shead
This patch series implements most of the changes made by P1815. It also cleans up a few bugs found along the way that impacted tests I wrote. The whole patch series was bootstrapped on x86_64-pc-linux-gnu with no regressions. Nathaniel Shead (10): libstdc++: Remove unnecessary 'static&

[PATCH 04/10] c++/modules: Fix linkage checks for exported using-decls

2024-09-23 Thread Nathaniel Shead
age, fix expected linkage of aliases. * g++.dg/modules/using-12.C: Likewise. * g++.dg/modules/using-27.C: New test. * g++.dg/modules/using-28_a.C: New test. * g++.dg/modules/using-28_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/name-l

[PATCH 05/10] c++/modules: Allow imported references in constant expressions

2024-09-23 Thread Nathaniel Shead
est. * g++.dg/modules/cexpr-5_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 6 +- gcc/testsuite/g++.dg/modules/cexpr-5_a.C | 13 + gcc/testsuite/g++.dg/modules/cexpr-5_b.C | 9 + 3 files changed, 27 insertions(+)

[PATCH 07/10] c++/modules: Implement ignored TU-local exposures

2024-09-23 Thread Nathaniel Shead
g/modules/internal-5_a.C: New test. * g++.dg/modules/internal-5_b.C: New test. * g++.dg/modules/internal-6.C: New test. * g++.dg/modules/internal-7_a.C: New test. * g++.dg/modules/internal-7_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/c-family/c.opt

[PATCH 06/10] c++/modules: Detect exposures of TU-local entities

2024-09-23 Thread Nathaniel Shead
.dg/modules/linkage-2.C: Adjust messages, remove XFAILS. * g++.dg/modules/internal-3.C: New test. * g++.dg/modules/internal-4.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h| 7 +- gcc/cp/module.cc| 388 +

[PATCH 09/10] c++/modules: Check linkage for exported declarations

2024-09-23 Thread Nathaniel Shead
/modules/export-3.C: Adjust error message. * g++.dg/modules/export-6.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h| 1 + gcc/cp/decl2.cc | 1 + gcc/cp/module.cc| 29 +--- gcc/cp/name-l

[PATCH 02/10] c++: Update decl_linkage for C++11

2024-09-23 Thread Nathaniel Shead
g: * g++.dg/modules/mod-sym-4.C: Update test to account for non-static internal-linkage variables new mangling. Signed-off-by: Nathaniel Shead --- gcc/cp/name-lookup.cc| 1 + gcc/cp/tree.cc | 92 +++- gcc/testsuite/g++.d

[PATCH 01/10] libstdc++: Remove unnecessary 'static' from __is_specialization_of

2024-09-23 Thread Nathaniel Shead
Log: * include/std/format: Remove unnecessary 'static'. Signed-off-by: Nathaniel Shead --- libstdc++-v3/include/std/format | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index e963d7f79b3..d9014

[PATCH 03/10] c++/modules: Use decl_linkage in maybe_record_mergeable_decl

2024-09-23 Thread Nathaniel Shead
ot. gcc/cp/ChangeLog: * name-lookup.cc (maybe_record_mergeable_decl): Use decl_linkage instead of ad-hoc checks. Signed-off-by: Nathaniel Shead --- gcc/cp/name-lookup.cc | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/gcc/cp/name-lookup.cc b/gcc

[PATCH 10/10] c++/modules: Validate external linkage definitions in header units [PR116401]

2024-09-23 Thread Nathaniel Shead
ules/pragma-1_a.H: Likewise. * g++.dg/modules/tpl-ary-1.h: Likewise. * g++.dg/modules/hdr-2.H: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl.cc| 1 + gcc/cp/module.cc | 33 + gcc/testsuite/g++.dg/modules/hdr-2

[PATCH 08/10] c++/modules: Support anonymous namespaces in header units

2024-09-23 Thread Nathaniel Shead
irective handling to... (make_namespace_finish): ...here. gcc/testsuite/ChangeLog: * g++.dg/modules/internal-8_a.H: New test. * g++.dg/modules/internal-8_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc| 7 +++-- gcc/cp/name-lookup.cc

Re: [PATCH 10/10] c++/modules: Validate external linkage definitions in header units [PR116401]

2024-09-25 Thread Nathaniel Shead
On Tue, Sep 24, 2024 at 09:47:17AM +1000, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > [module.import] p6 says "A header unit shall not contain a definition of > a non-inline function or variable whose

[COMMITTED] testsuite: Fix testcase g++.dg/modules/indirect-1_b.C [PR116846]

2024-09-25 Thread Nathaniel Shead
the type anyway and importing the type also brings along the enumerators so it would be unnecessary to seed an import for them as well). PR c++/116846 gcc/testsuite/ChangeLog: * g++.dg/modules/indirect-1_b.C: Fix testcase. Signed-off-by: Nathaniel Shead --- gcc/testsuite/g++

Re: [PATCH] libgcc, libstdc++: Make more entities no longer TU-local [PR115126]

2024-09-25 Thread Nathaniel Shead
On Wed, Sep 25, 2024 at 01:30:55PM +0200, Jakub Jelinek wrote: > On Wed, Sep 25, 2024 at 12:18:07PM +0100, Jonathan Wakely wrote: > > > > And whether similarly we couldn't use > > > > __attribute__((__visibility__ ("hidden"))) on the static block scope > > > > vars for C++ (again, if compiler supp

[PATCH v2] libgcc, libstdc++: Make TU-local declarations in headers external linkage [PR115126]

2024-09-26 Thread Nathaniel Shead
On Thu, Sep 26, 2024 at 01:46:27PM +1000, Nathaniel Shead wrote: > On Wed, Sep 25, 2024 at 01:30:55PM +0200, Jakub Jelinek wrote: > > On Wed, Sep 25, 2024 at 12:18:07PM +0100, Jonathan Wakely wrote: > > > > > And whether similarly we couldn't use > > > >

[PATCH] libgcc, libstdc++: Make more entities no longer TU-local [PR115126]

2024-09-24 Thread Nathaniel Shead
trywrlock): Likewise. (__glibcxx_rwlock_unlock): Likewise. (__glibcxx_rwlock_destroy): Likewise. (__glibcxx_rwlock_init): Likewise. Signed-off-by: Nathaniel Shead --- libgcc/gthr-posix.h| 116 ++--- libgcc/gthr-single.h | 34 +---

[PATCH 11/10] c++/modules: Treat weakrefs as not TU-local [PR115126]

2024-09-24 Thread Nathaniel Shead
st x86_64-linux and aarch64-linux; we'll see what happens on other targets. PR c++/115126 gcc/cp/ChangeLog: * module.cc (depset::hash::is_tu_local_entity): Don't treat weak entities as TU-local. gcc/testsuite/ChangeLog: * g++.dg/modules/xtreme-header-8.C

Re: [PATCH 04/10] c++/modules: Fix linkage checks for exported using-decls

2024-09-23 Thread Nathaniel Shead
On Tue, Sep 24, 2024 at 09:44:48AM +1000, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > This fixes some inconsistencies with what kinds of linkage various > entities are assumed to have. This also fixes handlin

Re: [PATCH 06/10] c++/modules: Detect exposures of TU-local entities

2024-09-23 Thread Nathaniel Shead
On Tue, Sep 24, 2024 at 09:45:37AM +1000, Nathaniel Shead wrote: > I feel like there should be a way to make use of LAMBDA_TYPE_EXTRA_SCOPE to > avoid the need for the new TYPE_DEFINED_IN_INITIALIZER_P flag, perhaps once > something like my patch here[1] is accepted (but wit

[PATCH v2 0/6] c++/modules: Implement P1815 "Translation-unit-local entities"

2024-09-26 Thread Nathaniel Shead
approved patches - Use decl_maybe_constant_var_p intead of TREE_CONSTANT - Treat weakrefs as not TU-local - Check TU-local entities imported from header units - Don't treat class-scope statics always as definitions - Add testcase for standard-library exposures Nathaniel Shead (6): c++/mo

[PATCH v2 2/6] c++/modules: Implement ignored TU-local exposures

2024-09-26 Thread Nathaniel Shead
ument -Wignored-exposures. gcc/testsuite/ChangeLog: * g++.dg/modules/internal-5_a.C: New test. * g++.dg/modules/internal-5_b.C: New test. * g++.dg/modules/internal-6.C: New test. * g++.dg/modules/internal-7_a.C: New test. * g++.dg/modules/internal-7_b.C: New test. Si

[PATCH v2 3/6] c++/modules: Support anonymous namespaces in header units

2024-09-26 Thread Nathaniel Shead
g-directive handling to... (make_namespace_finish): ...here. gcc/testsuite/ChangeLog: * g++.dg/modules/internal-8_a.H: New test. * g++.dg/modules/internal-8_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc| 7

[PATCH v2 6/6] c++/modules: Add testcase for standard-library exposures [PR115126]

2024-09-26 Thread Nathaniel Shead
uite/ChangeLog: * g++.dg/modules/xtreme-header-8.C: New test. Signed-off-by: Nathaniel Shead --- gcc/testsuite/g++.dg/modules/xtreme-header-8.C | 8 1 file changed, 8 insertions(+) create mode 100644 gcc/testsuite/g++.dg/modules/xtreme-header-8.C diff --git a/gcc/testsuite/g++.dg

[PATCH v2 1/6] c++/modules: Detect exposures of TU-local entities

2024-09-26 Thread Nathaniel Shead
g++.dg/modules/block-decl-2.C: Adjust messages. * g++.dg/modules/internal-1.C: Adjust messages, remove XFAILs. * g++.dg/modules/linkage-2.C: Adjust messages, remove XFAILS. * g++.dg/modules/internal-3.C: New test. * g++.dg/modules/internal-4_a.H: New test. *

[PATCH v2 4/6] c++/modules: Check linkage for exported declarations

2024-09-26 Thread Nathaniel Shead
hangeLog: * g++.dg/modules/export-3.C: Adjust error message. * g++.dg/modules/export-6.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h| 1 + gcc/cp/decl2.cc | 1 + gcc/cp/module.cc

[PATCH v2 5/6] c++/modules: Validate external linkage definitions in header units [PR116401]

2024-09-26 Thread Nathaniel Shead
hdr-2.H: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl.cc| 1 + gcc/cp/module.cc | 18 +++ gcc/testsuite/g++.dg/modules/hdr-2.H | 172 ++ gcc/testsuite/g++.dg/modules/macro-4_c.H | 2 +- gcc/testsuite/g++.dg/m

Re: [PATCH 10/10] c++/modules: Validate external linkage definitions in header units [PR116401]

2024-09-26 Thread Nathaniel Shead
On Thu, Sep 26, 2024 at 05:27:23PM -0400, Jason Merrill wrote: > On 9/26/24 1:29 AM, Nathaniel Shead wrote: > > On Tue, Sep 24, 2024 at 09:47:17AM +1000, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > > >

[PATCH] c++/modules: Propagate purview/import for templates in duplicate_decls [PR116803]

2024-09-27 Thread Nathaniel Shead
* g++.dg/modules/merge-18_a.H: New test. * g++.dg/modules/merge-18_b.H: New test. * g++.dg/modules/merge-18_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl.cc| 10 ++ gcc/testsuite/g++.dg/modules/merge-18_a.H | 8 gc

Re: [PATCH v2] libgcc, libstdc++: Make TU-local declarations in headers external linkage [PR115126]

2024-09-27 Thread Nathaniel Shead
On Fri, Sep 27, 2024 at 03:55:14PM -0400, Jason Merrill wrote: > On 9/27/24 3:38 PM, Jonathan Wakely wrote: > > On Fri, 27 Sept 2024 at 19:46, Jason Merrill wrote: > > > > > > On 9/26/24 6:34 AM, Nathaniel Shead wrote: > > > > On Thu, Sep 26, 2024 at

Re: [PATCH 07/10] c++/modules: Implement ignored TU-local exposures

2024-09-27 Thread Nathaniel Shead
On Fri, Sep 27, 2024 at 11:56:27AM -0400, Jason Merrill wrote: > On 9/23/24 7:46 PM, Nathaniel Shead wrote: > > Currently I just stream DECL_NAME in TU_LOCAL_ENTITYs for use in > > diagnostics, > > but this feels perhaps insufficient. Are there any better approached here?

[PATCH 1/2] c++: Don't strip USING_DECLs when updating local bindings [PR116748]

2024-09-19 Thread Nathaniel Shead
date_binding): Maintain USING_DECLs in the binding slots. gcc/testsuite/ChangeLog: * g++.dg/lookup/using59.C: Update location. * g++.dg/lookup/using69.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/name-lookup.cc | 12 +++- gcc/testsuite/

[PATCH 2/2] c++: Implement resolution for DR 36 [PR116160]

2024-09-19 Thread Nathaniel Shead
ing-enum-3.C: No longer expect an error. * g++.dg/lookup/using53.C: Remove XFAIL. * g++.dg/cpp2a/using-enum-11.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/name-lookup.cc | 12 +++- gcc/testsuite/g++.dg/cpp0x/using-enum-3.C | 2 +-

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

2024-11-07 Thread Nathaniel Shead
ly. (maybe_unwrap_standard_trait): New function. (diagnose_atomic_constraint): Use it; pass in the location of the atomic constraint to diagnose_trait_expr. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-traits4.C: New test. Signed-off-by: Nathaniel Shead ---

[PATCH 1/2] c++/modules: Propagate some missing flags on type definitions

2024-10-24 Thread Nathaniel Shead
* tree.h (TYPE_WARN_IF_NOT_ALIGN_RAW): New accessor. (TYPE_WARN_IF_NOT_ALIGN): Use it. (SET_TYPE_WARN_IF_NOT_ALIGN): Likewise. gcc/testsuite/ChangeLog: * g++.dg/modules/class-10_a.H: New test. * g++.dg/modules/class-10_b.C: New test. Signed-off-by: Nathaniel Shead ---

[PATCH 2/2] c++/modules: Retrofit imported partial specs over existing implicit instantiations [PR113814]

2024-10-24 Thread Nathaniel Shead
New test. * g++.dg/modules/partial-6_a.H: New test. * g++.dg/modules/partial-6_b.H: New test. * g++.dg/modules/partial-6_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 1 + gcc/cp/module.cc

[PATCH] c++: Disallow decomposition of lambda bases [PR90321]

2024-11-07 Thread Nathaniel Shead
ins if needed. (cp_finish_decomp): Remove no-longer-needed check. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/decomp62.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/decl.cc| 20 ++-- gcc/testsuite/g++.dg/cpp1z/decomp62.C | 12 2 file

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

2024-11-26 Thread Nathaniel Shead
On Wed, Nov 27, 2024 at 12:03:23AM -0500, Jason Merrill wrote: > Tested x86_64-pc-linux-gnu. > > Does this approach make sense to you? Any other ideas? > > -- 8< -- > > We weren't representing 'using namespace' at all in modules, which broke > some of the literals tests. > > I experimented wi

Re: [PATCH v2 1/3] c++: Fix mangling of otherwise unattached class-scope lambdas [PR107741]

2024-11-27 Thread Nathaniel Shead
On Thu, Nov 21, 2024 at 07:51:55PM +0100, Jason Merrill wrote: > On 11/9/24 9:22 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? Given > > that this doesn't actually fix the modules PR c++/116568 anymore I've > > pulle

[PATCH v3 0/6] c++: Add some missing LAMBDA_EXPR_EXTRA_SCOPEs

2025-01-06 Thread Nathaniel Shead
d and regtested on x86_64-pc-linux-gnu. Nathaniel Shead (6): c++: Fix mangling of lambdas in static data member initializers [PR107741] c++: Fix mangling of otherwise unattached class-scope lambdas [PR118245] c++: Fix ABI for lambdas declared in alias templates [PR116568] c++: Update man

[PATCH v3 1/6] c++: Fix mangling of lambdas in static data member initializers [PR107741]

2025-01-06 Thread Nathaniel Shead
++.dg/abi/lambda-ctx2-19vs20.C: New test. * g++.dg/abi/lambda-ctx2-20.C: New test. * g++.dg/abi/lambda-ctx2.h: New test. * g++.dg/cpp0x/static-member-init-1.C: New test. Signed-off-by: Nathaniel Shead --- gcc/c-family/c-opts.cc| 2 +- gcc/common.opt

[PATCH v3 2/6] c++: Fix mangling of otherwise unattached class-scope lambdas [PR118245]

2025-01-06 Thread Nathaniel Shead
uite/ChangeLog: * g++.dg/abi/lambda-ctx3.C: New test. * g++.dg/abi/lambda-ctx4.C: New test. * g++.dg/cpp2a/lambda-uneval20.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 3 ++- gcc/cp/parser.cc |

[PATCH v3 3/6] c++: Fix ABI for lambdas declared in alias templates [PR116568]

2025-01-06 Thread Nathaniel Shead
for now). * g++.dg/modules/late-ret-3_a.H: Adjust cluster order. Signed-off-by: Nathaniel Shead --- gcc/cp/mangle.cc| 13 +++- gcc/cp/pt.cc| 23 + gcc/testsuite/g++.dg/abi/lambda-ctx4.C | 21 +

<    1   2   3   4   5   >