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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[PATCH] testsuite: Fix g++.dg/modules/adl-5

2025-02-07 Thread Nathaniel Shead
ChangeLog: * g++.dg/modules/adl-5_a.c: Move to... * g++.dg/modules/adl-5_a.C: ...here. * g++.dg/modules/adl-5_d.C: Add errors. Signed-off-by: Nathaniel Shead --- gcc/testsuite/g++.dg/modules/{adl-5_a.c => adl-5_a.C} | 0 gcc/testsuite/g++.dg/modules/adl-5_d.C

Re: [PATCH] c++: Improve contracts support in modules [PR108205]

2025-02-03 Thread Nathaniel Shead
On Mon, Feb 03, 2025 at 06:57:14PM -0500, Jason Merrill wrote: > On 2/1/25 7:03 AM, Nathaniel Shead wrote: > > Regtested on x86_64-pc-linux-gnu (so far just "dg.exp=contract* > > modules.exp=contract*"), OK for trunk if full bootstrap+regtest passes? > > > >

[PATCH] c++: Improve contracts support in modules [PR108205]

2025-02-01 Thread Nathaniel Shead
ew test. Signed-off-by: Nathaniel Shead --- gcc/cp/contracts.cc | 27 +--- gcc/testsuite/g++.dg/modules/contracts-5_a.C | 8 ++ gcc/testsuite/g++.dg/modules/contracts-5_b.C | 20 +++ 3 files changed, 46 insertions(+), 9 deletions(-)

[PATCH] c++: Modularise start_cleanup_fn [PR98893]

2025-02-01 Thread Nathaniel Shead
c++/98893 gcc/cp/ChangeLog: * decl.cc (start_cleanup_fn): Make name from the mangled name of the passed-in decl. (register_dtor_fn): Pass decl to start_cleanup_fn. gcc/testsuite/ChangeLog: * g++.dg/modules/pr98893_a.H: New test. * g++.dg/modules/pr98893_b.C: New test. Si

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

2025-01-31 Thread Nathaniel Shead
ocal_entity): Handle unnamed template types, treat lambdas specially. (is_exposure_of_member_type): New function. (depset::hash::add_dependency): Use it. (depset::hash::finalize_dependencies): Likewise. gcc/testsuite/ChangeLog: * g++.dg/modules/internal-10

[PATCH 2/3] c++: Clear lambda scope for unattached member template lambdas

2025-01-31 Thread Nathaniel Shead
cal. Signed-off-by: Nathaniel Shead --- gcc/cp/lambda.cc | 11 +++ gcc/testsuite/g++.dg/cpp2a/lambda-uneval22.C | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/cp/lambda.cc b/gcc/cp/lambda.cc index 5593636eaf8..73cf816b6e1 100644 --

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

2025-01-31 Thread Nathaniel Shead
dg/cpp0x/static-member-init-1.C: Likewise. Signed-off-by: Nathaniel Shead --- gcc/cp/decl2.cc | 15 -- gcc/cp/parser.cc | 30 +++ gcc/testsuite/g++.dg/abi/lambda-ctx2-19.C | 3 ++ gcc/testsuite/g++.dg/abi/lambda-ctx

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

2025-01-31 Thread Nathaniel Shead
On Mon, Jan 27, 2025 at 10:20:05AM -0500, Patrick Palka wrote: > On Sat, 12 Oct 2024, Nathaniel Shead wrote: > > > This version rewords all "ignored exposures" language. > > > > I haven't fixed up the issue with DECL_TEMPLATE_INSTANTIATIONS for this &

Re: [PATCH v3 6/6] c++/modules: Diagnose TU-local lambdas, give mangling scope to lambdas in concepts

2025-01-23 Thread Nathaniel Shead
On Thu, Jan 23, 2025 at 04:47:32PM -0500, Jason Merrill wrote: > On 1/6/25 7:24 AM, Nathaniel Shead wrote: > > Happy to defer this till GCC16 if preferred. > > > > -- >8 -- > > > > This fills in a hole left in r15-6378-g9016c5ac94c557 with regards to > >

[PATCH 3/3] c++/modules: Treat unattached lambdas as TU-local

2025-01-23 Thread Nathaniel Shead
est. * g++.dg/modules/lambda-8_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 29 +-- gcc/testsuite/g++.dg/modules/lambda-8.h | 8 +++ gcc/testsuite/g++.dg/modules/lambda-8_a.H | 5 gcc/testsuite/g++.dg/modules/lam

[PATCH 2/3] c++/modules: Diagnose TU-local lambdas, give mangling scope to lambdas in concepts

2025-01-23 Thread Nathaniel Shead
new XFAIL for lambda alias. * g++.dg/modules/lambda-9.h: New test. * g++.dg/modules/lambda-9_a.H: New test. * g++.dg/modules/lambda-9_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h| 3 ++- gcc/cp/module

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

2025-01-23 Thread Nathaniel Shead
mbers instead. * pt.cc (instantiate_class_template): Add lambda scoping. gcc/testsuite/ChangeLog: * g++.dg/abi/lambda-ctx3.C: New test. * g++.dg/cpp2a/lambda-uneval21.C: New test. * g++.dg/cpp2a/lambda-uneval22.C: New test. Signed-off-by: Nathaniel Shead --- gcc

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

2025-01-23 Thread Nathaniel Shead
On Wed, Jan 22, 2025 at 10:03:40PM -0500, Jason Merrill wrote: > On 1/6/25 7:21 AM, Nathaniel Shead wrote: > > Something like this should probably be backported to GCC 14 too, since > > my change in r14-9232-g3685fae23bb008 inadvertantly caused ICEs that > > this fixes. But

[PATCH] c++/modules: Fix exporting temploid friends in header units [PR118582]

2025-01-22 Thread Nathaniel Shead
te/ChangeLog: * g++.dg/modules/pr118582_a.H: New test. * g++.dg/modules/pr118582_b.H: New test. * g++.dg/modules/pr118582_c.H: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 47 +++ gcc/testsuite/g++.dg/modules/

[PATCH] c++/modules: Handle mismatching TYPE_CANONICAL when deduping partial specs [PR118101]

2025-01-20 Thread Nathaniel Shead
a.C: New test. * g++.dg/modules/partial-7_b.C: New test. * g++.dg/modules/partial-7_c.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc | 11 ++- gcc/testsuite/g++.dg/modules/partial-7.h | 5 + gcc/testsuite/g++.dg/modules

[PATCH] c++/modules: Check linkage of structured binding decls

2025-01-19 Thread Nathaniel Shead
gcc/testsuite/ChangeLog: * g++.dg/modules/export-6.C: Add structured binding tests. * g++.dg/modules/hdr-2.H: Likewise. Signed-off-by: Nathaniel Shead --- gcc/cp/parser.cc| 1 + gcc/cp/tree.cc | 2 ++ gcc/testsuite/g++.dg/modules/e

Re: [PATCH] c++/modules: Propagate FNDECL_USED_AUTO alongside deduced return types [PR118049]

2025-01-18 Thread Nathaniel Shead
On Fri, Jan 17, 2025 at 11:35:19AM -0500, Patrick Palka wrote: > On Fri, 17 Jan 2025, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > In the linked testcase, we're erroring

Re: [PATCH] c++: Allow pragmas in NSDMIs [PR118147]

2025-01-17 Thread Nathaniel Shead
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2024-December/672098.html. On Fri, Dec 20, 2024 at 10:17:43PM +1100, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk and > maybe release branches? > > -- >8 -- > > This patch rem

[PATCH] c++/modules: Propagate FNDECL_USED_AUTO alongside deduced return types [PR118049]

2025-01-17 Thread Nathaniel Shead
t. * g++.dg/modules/auto-5_b.C: New test. * g++.dg/modules/auto-5_c.C: New test. * g++.dg/modules/auto-6_a.H: New test. * g++.dg/modules/auto-6_b.C: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/module.cc| 5 + gcc/testsuite/g++.dg/modules/

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

2025-01-16 Thread Nathaniel Shead
On Thu, Jan 16, 2025 at 07:09:33PM -0500, Jason Merrill wrote: > On 1/6/25 7:22 AM, Nathaniel Shead wrote: > > I'm not 100% sure I've handled this properly, any feedback welcome. > > In particular, maybe should I use `DECL_IMPLICIT_TYPEDEF_P` in the >

Re: [PATCH v2] c++/modules: Don't emit imported deduction guides [PR117397]

2025-01-14 Thread Nathaniel Shead
On Mon, Jan 13, 2025 at 07:00:18PM -0500, Jason Merrill wrote: > On 1/12/25 7:03 AM, Nathaniel Shead wrote: > > On Sun, Jan 12, 2025 at 04:14:41AM +1100, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > > >

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

2025-01-12 Thread Nathaniel Shead
On Fri, Jan 03, 2025 at 05:18:55PM +, xxx wrote: > From: yxj-github-437 <2457369...@qq.com> > > This patch attempts to fix an error when build module std. The reason for the > error is __builrin_va_list (aka struct __va_list) is an internal linkage. so > attempt to handle this builtin type by

[PATCH v2] c++/modules: Don't emit imported deduction guides [PR117397]

2025-01-12 Thread Nathaniel Shead
On Sun, Jan 12, 2025 at 04:14:41AM +1100, 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 name lookup finds duplicate > copies of the deduction guides, causing a ch

[committed] testsuite: Fix flag used for modules test

2025-01-11 Thread Nathaniel Shead
tead of -fmodules in testcase. * g++.dg/modules/pr114630_b.C: Likewise. * g++.dg/modules/pr114630_c.C: Likewise. Signed-off-by: Nathaniel Shead --- gcc/testsuite/g++.dg/modules/pr114630_a.C | 2 +- gcc/testsuite/g++.dg/modules/pr114630_b.C | 2 +- gcc/testsuite/g++.dg/modules/

  1   2   3   4   5   >