[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

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'

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

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

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

[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

[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

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

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

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

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

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

[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

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

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

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

[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] 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++: 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++: 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++/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? > > &

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 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 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] 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] c++/modules: Merge default arguments [PR99274]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[PATCH] c++: Add missing auto_diagnostic_groups

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[committed] c++: Simplify uses of LAMBDA_EXPR_EXTRA_SCOPE

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[PATCH] c++: Simplify uses of LAMBDA_EXPR_EXTRA_SCOPE

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

  1   2   3   4   >