[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

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

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

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

2024-05-26 Thread Nathaniel Shead
ration. PR c++/114867 gcc/cp/ChangeLog: * name-lookup.cc (do_nonmember_using_decl): Don't remove the existing overload. gcc/testsuite/ChangeLog: * g++.dg/modules/using-17_a.C: New test. * g++.dg/modules/using-17_b.C: New test. Signed-off-by: Nathaniel Shead

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

2024-05-24 Thread Nathaniel Shead
On Fri, May 24, 2024 at 11:24:38AM -0400, Jason Merrill wrote: > On 5/24/24 11:20, Nathaniel Shead wrote: > > This is just a small improvement to a diagnostic. I thought about also > > adding an inform to suggest something like "standard library headers > > should

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

2024-05-24 Thread Nathaniel Shead
s with builtin" error. This patch updates the message to include "in module", to help guide the user towards the likely cause. gcc/cp/ChangeLog: * module.cc (module_may_redeclare): Update error message. gcc/testsuite/ChangeLog: * g++.dg/modules/enum-12.C: Test f

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

2024-05-24 Thread Nathaniel Shead
On Fri, May 24, 2024 at 09:54:31AM -0400, Jason Merrill wrote: > On 5/24/24 04:06, Nathaniel Shead wrote: > > On Thu, May 23, 2024 at 06:41:06PM -0400, Jason Merrill wrote: > > > On 5/13/24 07:56, Nathaniel Shead wrote: > > > > > > @@ -11751,9 +11767,16 @@ t

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

2024-05-24 Thread Nathaniel Shead
On Thu, May 23, 2024 at 06:41:06PM -0400, Jason Merrill wrote: > On 5/13/24 07:56, Nathaniel Shead wrote: > > > > @@ -11751,9 +11767,16 @@ tsubst_friend_class (tree friend_tmpl, tree > > > > args) > > > > if (tmpl != error_mark_node) > > >

Re: [PATCH 1/2] c++/modules: Fix treatment of unnamed types

2024-05-23 Thread Nathaniel Shead
On Thu, May 23, 2024 at 03:36:48PM -0400, Jason Merrill wrote: > On 5/23/24 09:27, Nathaniel Shead wrote: > > On Mon, May 20, 2024 at 06:00:09PM -0400, Jason Merrill wrote: > > > On 5/17/24 02:14, Nathaniel Shead wrote: > > > > On Tue, May 14, 2024 at 06:21:4

[PATCH v2] c++/modules: Improve errors for bad module-directives [PR115200]

2024-05-23 Thread Nathaniel Shead
On Thu, May 23, 2024 at 05:11:39PM -0400, Jason Merrill wrote: > On 5/23/24 10:54, Nathaniel Shead wrote: > > Bootstrapped and regtested (so far just modules.exp and dg.exp) on > > x86_64-pc-linux-gnu, OK for trunk if full regtest succeeds? > > > > -- >8 -- >

[PATCH] c++/modules: Improve errors for bad module-directives [PR115200]

2024-05-23 Thread Nathaniel Shead
ges. * g++.dg/modules/mod-decl-6.C: New test. * g++.dg/modules/mod-decl-7.C: New test. * g++.dg/modules/mod-decl-8.C: New test. * g++.dg/modules/mod-decl-8.h: New test. Signed-off-by: Nathaniel Shead --- gcc/cp/parser.cc |

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

2024-05-23 Thread Nathaniel Shead
On Sun, May 12, 2024 at 11:29:39PM +1000, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > Constrained partial specialisations aren't all necessarily tracked on > the instantiation table. The mo

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

2024-05-23 Thread Nathaniel Shead
ybe_has_cmi_p): Update comment. * module.cc (set_defining_module): Only need to track declarations for later exporting if the module may have a CMI. * name-lookup.cc (pushdecl): Likewise. Signed-off-by: Nathaniel Shead --- gcc/cp/cp-tree.h | 7 +++ gcc/cp/modul

[PATCH 1/2] c++/modules: Fix treatment of unnamed types

2024-05-23 Thread Nathaniel Shead
On Mon, May 20, 2024 at 06:00:09PM -0400, Jason Merrill wrote: > On 5/17/24 02:14, Nathaniel Shead wrote: > > On Tue, May 14, 2024 at 06:21:48PM -0400, Jason Merrill wrote: > > > On 5/12/24 22:58, Nathaniel Shead wrote: > > > > Bootstrapped and regtested on x86

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

2024-05-17 Thread Nathaniel Shead
On Fri, May 17, 2024 at 04:14:31PM +1000, Nathaniel Shead wrote: > On Tue, May 14, 2024 at 06:21:48PM -0400, Jason Merrill wrote: > > On 5/12/24 22:58, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > OK. > &g

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

2024-05-16 Thread Nathaniel Shead
On Tue, May 14, 2024 at 06:25:29PM -0400, Jason Merrill wrote: > On 5/11/24 08:32, Nathaniel Shead wrote: > > I wasn't entirely sure what to do with the 'abi/main.C' testcase here; > > is this OK, or should I e.g. lower the linkage error to a pedwarn for > > the

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

2024-05-16 Thread Nathaniel Shead
On Tue, May 14, 2024 at 06:21:48PM -0400, Jason Merrill wrote: > On 5/12/24 22:58, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > OK. > I realised as I was looking over this again that I might have spoken too soon with the h

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

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

  1   2   3   4   >