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

2024-01-06 Thread Nathan Sidwell
+ +int main() { + const int& x = A::x; + if (x != -1) + __builtin_abort(); +} -- Nathan Sidwell

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

2024-01-06 Thread Nathan Sidwell
--- /dev/null +++ b/gcc/testsuite/g++.dg/modules/merge-16_b.C @@ -0,0 +1,5 @@ +// PR c++/112588 +// { dg-additional-options "-fmodules-ts" } + +#include "merge-16.h" +import merge16; -- Nathan Sidwell

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

2024-01-06 Thread Nathan Sidwell
nal linkage" } + } +} + +namespace m { + enum e3 { x3 }; // { dg-message "declared here with module linkage" } + enum class e4 { x4 }; // { dg-message "declared here with module linkage" } +} + +export using enum s::e1; // { dg-error "does not have external linkage" } +export using enum s::e2; // { dg-error "does not have external linkage" } +export using enum m::e3; // { dg-error "does not have external linkage" } +export using enum m::e4; // { dg-error "does not have external linkage" } + +// { dg-prune-output "not writing module" } -- Nathan Sidwell

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

2024-01-06 Thread Nathan Sidwell
blic declarations in module interface files, whether used or not".) I'd like to hear Nathan's thoughts on the matter first, since he's the modules implementation designer. Jason -- Nathan Sidwell

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

2024-01-06 Thread Nathan Sidwell
stsuite/g++.dg/modules/using-11_b.C new file mode 100644 index 000..736a48c98f2 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/using-11_b.C @@ -0,0 +1,8 @@ +// PR c++/109679 +// { dg-module-do link } +// { dg-additional-options "-fmodules-ts" } + +import M; +int main() { + return foo(); +} -- Nathan Sidwell

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

2024-01-06 Thread Nathan Sidwell
/testsuite/g++.dg/modules/part-mac-1_c.C b/gcc/testsuite/g++.dg/modules/part-mac-1_c.C index 78a53d2fda3..db57adcef44 100644 --- a/gcc/testsuite/g++.dg/modules/part-mac-1_c.C +++ b/gcc/testsuite/g++.dg/modules/part-mac-1_c.C @@ -2,4 +2,4 @@ // { dg-module-cmi {mod} } export module mod; -import mod:impl; +import :impl; -- 2.42.0 -- Nathan Sidwell

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

2024-01-06 Thread Nathan Sidwell
e mode 100644 index 000..0508c0d6193 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr106363_b.C @@ -0,0 +1,10 @@ +// PR c++/106363 +// { dg-additional-options "-fmodules-ts" } +// { dg-module-cmi pr106363.b } + +export module pr106363.b; +import pr106363.a; + +namespace ns { + export using ns::x; +} -- Nathan Sidwell

Re: [PATCH RFC] c++/modules: __class_type_info and modules

2023-12-23 Thread Nathan Sidwell
On 12/18/23 17:10, Jason Merrill wrote: On 12/18/23 16:57, Nathan Sidwell wrote: On 12/18/23 16:31, Jason Merrill wrote: Tested x86_64-pc-linux-gnu.  Does this make sense?  Did you have another theory about how to merge these? Why isn't push_abi_namespace doing the right setup here? (and I

Re: [PATCH RFC] c++/modules: __class_type_info and modules

2023-12-18 Thread Nathan Sidwell
atch-id: 66735c0c7beb22586ed4b632d10ec9094bb9920c -- Nathan Sidwell

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

2023-12-16 Thread Nathan Sidwell
-module-cmi pr106363.b } + +export module pr106363.b; +import pr106363.a; + +namespace ns { + export using ns::x; +} -- 2.42.0 -- Nathan Sidwell

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

2023-11-24 Thread Nathan Sidwell
th internal linkage" } + } +} + +namespace m { + enum e3 { x3 }; // { dg-message "declared here with module linkage" } + enum class e4 { x4 }; // { dg-message "declared here with module linkage" } +} + +export using enum s::e1; // { dg-error "does not have external linkage" } +export using enum s::e2; // { dg-error "does not have external linkage" } +export using enum m::e3; // { dg-error "does not have external linkage" } +export using enum m::e4; // { dg-error "does not have external linkage" } + +// { dg-prune-output "not writing module" } -- Nathan Sidwell

Re: [PATCH] c++: Allow exporting a typedef redeclaration [PR102341]

2023-11-24 Thread Nathan Sidwell
On 11/23/23 21:10, Nathaniel Shead wrote: On Thu, Nov 23, 2023 at 11:45:31AM -0500, Nathan Sidwell wrote: On 11/13/23 01:09, Nathaniel Shead wrote: I happened to be browsing the standard a bit later and noticed that we incorrectly reject the example given below. Bootstrapped on x86_64-pc

Re: [PATCH] c++: Check module attachment instead of purview when necessary [PR112631]

2023-11-23 Thread Nathan Sidwell
--- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr112631.C @@ -0,0 +1,8 @@ +// { dg-additional-options "-fmodules-ts" } +// { dg-module-cmi bla } + +export module bla; + +extern "C++" inline void fun() { + void oops(); // { dg-bogus "block-scope extern declaration" } +} -- Nathan Sidwell

Re: [PATCH] c++/modules: Allow exporting const-qualified namespace-scope variables [PR99232]

2023-11-23 Thread Nathan Sidwell
s/pr99232_b.C @@ -0,0 +1,7 @@ +// PR c++/99232 +// { dg-additional-options "-fmodules-ts" } + +import pr99232; + +double foo() { return lambda * 2.0; } +static_assert(a == 42); -- Nathan Sidwell

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

2023-11-23 Thread Nathan Sidwell
-1_c.C b/gcc/testsuite/g++.dg/modules/part-mac-1_c.C index 78a53d2fda3..db57adcef44 100644 --- a/gcc/testsuite/g++.dg/modules/part-mac-1_c.C +++ b/gcc/testsuite/g++.dg/modules/part-mac-1_c.C @@ -2,4 +2,4 @@ // { dg-module-cmi {mod} } export module mod; -import mod:impl; +import :impl; -- Nathan Sidwell

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

2023-11-23 Thread Nathan Sidwell
00..ab0c4ab4805 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/lambda-6_b.C @@ -0,0 +1,9 @@ +// PR c++/107398 +// { dg-additional-options "-fmodules-ts" } + +import Lambda6; + +int main() { + if (foo() != 1) +__builtin_abort(); +} -- Nathan Sidwell

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

2023-11-23 Thread Nathan Sidwell
ting for declaration" } +export typedef int z; // { dg-bogus "conflicting exporting for declaration" } + +template using w = T; +export template using w = T; // { dg-error "conflicting exporting for declaration" } template int f (T); export template int f (T); // { dg-error "conflicting exporting for declaration" } -- Nathan Sidwell

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

2023-11-23 Thread Nathan Sidwell
cls so we miss this for now class A; -export class A; // { dg-error "conflicting exporting declaration" "" { xfail *-*-* } } +export class A; // { dg-error "conflicting exporting for declaration" } -// { dg-warning "due to errors" "" { target *-*-* } 0 } +template struct B; +export template struct B {}; // { dg-error "conflicting exporting for declaration" } + +// { dg-warning "due to errors" "" { target *-*-* } 0 } -- Nathan Sidwell

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

2023-11-19 Thread Nathan Sidwell
off-by: Nathaniel Shead thanks, I've committed it for you. nathan -- Nathan Sidwell

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

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

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

2023-11-09 Thread Nathan Sidwell
ot; } +// { dg-module-cmi !lib } + +export module lib; + +namespace outer { + template void any_of(T) { } // { dg-note "declared here" } +} + +export using outer::any_of; // { dg-error "does not have external linkage" } + +// { dg-prune-output "not writing module" } -- Nathan Sidwell

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

2023-11-09 Thread Nathan Sidwell
ew file mode 100644 index 000..b7468562ba9 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr103499_b.C @@ -0,0 +1,8 @@ +// PR c++/103499 +// { dg-additional-options "-fmodules-ts" } + +import pr103499; + +void test(derived* p) { + delete p; +} -- Nathan Sidwell

Re: [PATCH] c++/modules: fix up recent testcases

2023-10-25 Thread Nathan Sidwell
65c..37d0e77b1e1 100644 --- a/gcc/testsuite/g++.dg/modules/lambda-5_a.C +++ b/gcc/testsuite/g++.dg/modules/lambda-5_a.C @@ -1,5 +1,5 @@ // PR c++/105322 -// { dg-module-do link +// { dg-module-do link } // { dg-additional-options -fmodules-ts } // { dg-module-cmi pr105322.Lambda } -- Nat

Re: [PATCH] c++/modules: ICE with lambda initializing local var [PR105322]

2023-10-20 Thread Nathan Sidwell
PR c++/105322 +// { dg-additional-options -fmodules-ts } + +import pr105322; + +int main() { + f1(); + f2(); + g3(); +} -- Nathan Sidwell From fb65e961231943ecc68988f38a9ec78b0c93e5df Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 20 Oct 2023 12:20:37 -0400 Subject: [PATCH] c++: Cons

Re: [PATCH v5 4/5] c++modules: report imported CMI files as dependencies

2023-07-21 Thread Nathan Sidwell via Gcc-patches
On 7/21/23 10:57, Ben Boeckel wrote: On Thu, Jul 20, 2023 at 17:00:32 -0400, Nathan Sidwell wrote: On 7/19/23 20:47, Ben Boeckel wrote: But it is inhibiting distributed builds because the distributing tool would need to know: - what CMIs are actually imported (here, "read the module m

Re: [PATCH v5 4/5] c++modules: report imported CMI files as dependencies

2023-07-20 Thread Nathan Sidwell via Gcc-patches
On 7/19/23 20:47, Ben Boeckel wrote: On Wed, Jul 19, 2023 at 17:11:08 -0400, Nathan Sidwell wrote: GCC is neither of these descriptions. a CMI does not contain the transitive closure of its imports. It contains an import table. That table lists the transitive closure of its imports (it needs

Re: [PATCH v5 4/5] c++modules: report imported CMI files as dependencies

2023-07-19 Thread Nathan Sidwell via Gcc-patches
On 7/18/23 20:01, Ben Boeckel wrote: On Tue, Jul 18, 2023 at 16:52:44 -0400, Jason Merrill wrote: On 6/25/23 12:36, Ben Boeckel wrote: On Fri, Jun 23, 2023 at 08:12:41 -0400, Nathan Sidwell wrote: On 6/22/23 22:45, Ben Boeckel wrote: On Thu, Jun 22, 2023 at 17:21:42 -0400, Jason Merrill

Re: [PATCH v5 4/5] c++modules: report imported CMI files as dependencies

2023-07-18 Thread Nathan Sidwell via Gcc-patches
On 7/18/23 16:52, Jason Merrill wrote: On 6/25/23 12:36, Ben Boeckel wrote: On Fri, Jun 23, 2023 at 08:12:41 -0400, Nathan Sidwell wrote: On 6/22/23 22:45, Ben Boeckel wrote: On Thu, Jun 22, 2023 at 17:21:42 -0400, Jason Merrill wrote: On 1/25/23 16:06, Ben Boeckel wrote: They affect

Re: [PATCH v3] Introduce attribute reverse_alias

2023-07-15 Thread Nathan Sidwell via Gcc-patches
Not commenting on the semantics, but the name seems unfortunate (hello bikeshed). The documentation starts with 'attribute causes @var{name} to be emitted as an alias to the definition'. So not emitting a 'reverse alias', whatever that might be. It doesn;t seem to mention how reverse alias

Re: [WIP RFC] Add support for keyword-based attributes

2023-07-14 Thread Nathan Sidwell via Gcc-patches
appear, but without the same minimum language requirements. + The link is intended to be automatic: there should be no exceptions. + + - The attribute appertains to whatever a standard attribute in the + same location would appertain to. There is no "sliding" from decls +

Re: [PATCH v5 4/5] c++modules: report imported CMI files as dependencies

2023-06-23 Thread Nathan Sidwell via Gcc-patches
it is neutered in patch 3 where `write_make_modules_deps` is used in `make_write` (or will use that name Why do you want to record the transitive modules? I would expect just noting the ones with imports directly in the TU would suffice (i.e check the 'outermost' arg) nathan -- Nathan Sidwell

Fix templated conversion operator demangling

2023-06-13 Thread Nathan Sidwell via Gcc-patches
eing the template inst of X. That code appears to be completely unnecessary. Added a bunch of conversion operator demangling tests. nathan -- Nathan SidwellFrom 5a897036187468d4ded330b90b2abdaff5061ed6 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 12 Jun 2023 19:37:04 -0400 Subject: [PATC

[c++] Implement DR 976

2023-06-10 Thread Nathan Sidwell via Gcc-patches
rray- or function-producing conversions, which I suspect is rarer. pushed to trunk nathan -- Nathan SidwellFrom 80f075b410125bddb31459428760645baba1a69f Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Sat, 10 Jun 2023 12:42:17 -0400 Subject: [PATCH] c++: Adjust conversion deduction [PR61663][D

[patch] Allow plugin-specific dumps

2023-05-17 Thread Nathan Sidwell via Gcc-patches
2001 From: Nathan Sidwell Date: Wed, 17 May 2023 19:27:13 -0400 Subject: [PATCH] Allow plugin dumps Defer dump option parsing until plugins are initialized. This allows one to use plugin names for dumps. PR other/99451 gcc/ * opts.h (handle_deferred_dump_options): Declare. * opts-global.cc

Re: Ping: [PATCH] testsuite/C++: suppress filename canonicalization in module tests

2023-04-27 Thread Nathan Sidwell via Gcc-patches
#define nop(X) X --- a/gcc/testsuite/g++.dg/modules/dir-only-2_b.C +++ b/gcc/testsuite/g++.dg/modules/dir-only-2_b.C @@ -1,5 +1,5 @@ // { dg-do preprocess } -// { dg-additional-options "-fmodules-ts -fdirectives-only -isystem [srcdir]" } +// { dg-additional-options "-fmodules-ts -fdirectives-only -isystem [srcdir] -fno-canonical-system-headers" } // a comment module; // line frob -- Nathan Sidwell

Re: [PATCH v2] testsuite/C++: cope with IPv6 being unavailable

2023-04-27 Thread Nathan Sidwell via Gcc-patches
rror {failed (socket|connecting|disabled) mapper 'localhost:172477262'} "" { target *-*-* } 0 } // { dg-prune-output "fatal error:" } // { dg-prune-output "failed to read" } // { dg-prune-output "compilation terminated" } -- Nathan Sidwell

Re: [PATCH] c++: Fix Solaris bootstraps across midnight

2023-04-11 Thread Nathan Sidwell via Gcc-patches
Jakub, for avoidance of doubt, your version is fine. nathan On 4/11/23 18:06, Nathan Sidwell wrote: On 4/11/23 04:12, Jakub Jelinek wrote: Hi! When working on the PR109040 fix, I wanted to test it on some WORD_REGISTER_OPERATIONS target and tried sparc-solaris on GCC Farm. My bootstrap

Re: [PATCH] c++: Fix Solaris bootstraps across midnight

2023-04-11 Thread Nathan Sidwell via Gcc-patches
$@ -nt \ $(srcdir)/cp/module.cc; then \ cp ../prev-gcc/$@ $@; \ else \ date '+%y%m%dU' 2>/dev/null >$@; \ fi`; \ nathan -- Nathan Sidwell

Re: C++ modules and AAPCS/ARM EABI clash on inline key methods

2023-02-21 Thread Nathan Sidwell via Gcc-patches
*-*-* } } } -- Nathan Sidwell

Re: [PATCH] c++ modules: uninstantiated template friend class [PR104234]

2023-02-02 Thread Nathan Sidwell via Gcc-patches
i pr104234 } +export module pr104234; + +template struct A { + template friend struct B; +}; +A a; +template struct B { }; -- Nathan Sidwell

Re: [PATCH] c++tools: Fix compilation of server.cc on hpux

2023-01-09 Thread Nathan Sidwell via Gcc-patches
ock_fd >= 0 && FD_ISSET (sock_fd, )) active = -1; +#endif } if (active >= 0) -- Nathan Sidwell

Re: [PATCH] c++: modules and std::source_location::current() def arg [PR100881]

2022-12-08 Thread Nathan Sidwell via Gcc-patches
. That's a clever approach! LGTM nathan -- Nathan Sidwell

Re: PING [PATCH v3] c++: Allow module name to be a single letter on Windows

2022-11-28 Thread Nathan Sidwell via Gcc-patches
&& IS_DIR_SEPARATOR (ptr[2])) // A:/FOO +#endif +  || false)   /* A header name.  */   return get_module (build_string (strlen (ptr), ptr)); -- Nathan Sidwell

demangler: Templated lambda demangling

2022-11-10 Thread Nathan Sidwell via Gcc-patches
osed as indicating the number of explicit template parameters (1-based). I'll commit in a few days. nathan -- Nathan SidwellFrom b7f0ba90011b8c9cae7b7278463f609ba21cd44b Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 7 Nov 2022 11:24:14 -0500 Subject: [PATCH] demangler: Templated lambda demang

Re: [PATCH] c++: Allow module name to be a single letter on Windows

2022-11-08 Thread Nathan Sidwell via Gcc-patches
On 11/8/22 05:18, Torbjorn SVENSSON wrote: Hi Nathan, On 2022-11-08 00:03, Nathan Sidwell wrote: Yes, something like the above, but I think you're missing "/bob' in the DOS_BASED case?  shouldn't that also be a pathname? if (IS_DIR_SEPARATOR (ptr[ptr[0] == '.']) // ./FOO or

Re: [PATCH] c++: Allow module name to be a single letter on Windows

2022-11-07 Thread Nathan Sidwell via Gcc-patches
On 11/3/22 11:06, Torbjorn SVENSSON wrote: On 2022-11-03 15:17, Nathan Sidwell wrote: On 10/28/22 05:15, Torbjörn SVENSSON wrote: On Windows, the ':' character is special and when the module name is a single character, like 'A', then the flatname would be (for example) 'A:Foo'. On Windows

C++: Template lambda mangling testcases

2022-11-07 Thread Nathan Sidwell via Gcc-patches
I found some additional cases when working on the demangler. May as well check their mangling. Since I managed to confuse myself. nathan -- Nathan SidwellFrom 51d567d4d15e78b42d2ca83f229c98fff2aec9fa Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 7 Nov 2022 11:08:21 -0500 Subject

Re: [PATCH] c++: Allow module name to be a single letter on Windows

2022-11-03 Thread Nathan Sidwell via Gcc-patches
(f)[0] && (f)[1] == ':' && ((f)[2] == '/' || (f)[2] == '\\')) #define HAS_DOS_DRIVE_SPEC(f) HAS_DRIVE_SPEC_1 (1, f) #define IS_UNIX_DIR_SEPARATOR(c) IS_DIR_SEPARATOR_1 (0, c) -- Nathan Sidwell

Re: [PATCH v2] c++: Use in-process client when networking is disabled

2022-11-03 Thread Nathan Sidwell via Gcc-patches
On 11/3/22 09:48, Torbjorn SVENSSON wrote: Hello Nathan, On 2022-11-03 14:13, Nathan Sidwell wrote: On 11/3/22 05:37, Torbjörn SVENSSON wrote: v1 -> v2: Updated expression in bad-mapper-3.C Ok for trunk? --- Without the patch, the output for bad-mapper-3.C would be: /src/gcc/gcc/testsu

Re: [PATCH v2] c++: Use in-process client when networking is disabled

2022-11-03 Thread Nathan Sidwell via Gcc-patches
ING disabled) mapper 'localhost:172477262'} "" { target *-*-* } 0 } // { dg-prune-output "fatal error:" } // { dg-prune-output "failed to read" } // { dg-prune-output "compilation terminated" } -- Nathan Sidwell

c++: per-scope, per-signature lambda discriminators

2022-11-01 Thread Nathan Sidwell via Gcc-patches
2b0e81d5cc2f7e1d773f6c502bd65b097f392675 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 31 Oct 2022 06:11:28 -0400 Subject: [PATCH] c++: per-scope, per-signature lambda discriminators This implements ABI-compliant lambda discriminators. Not only do we have per-scope counters, but we also

c++: Reorganize per-scope lambda discriminators

2022-11-01 Thread Nathan Sidwell via Gcc-patches
recorder (nearly) always consecutively, it's clearer to handle it as two separate operations. That also allows us to remove the instantiation special-case for a null extra-scope. nathan -- Nathan SidwellFrom 0122faae30fe1ad1dfa8c69f3d3f0428b996b600 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell

c++: Templated lambda mangling

2022-10-27 Thread Nathan Sidwell via Gcc-patches
From bf6e972b65c56c615682f712f785d0f0541ac77b Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 24 Oct 2022 17:39:55 -0400 Subject: [PATCH] c++: Templated lambda mangling (Explicitly) Templated lambdas have a different signature to implicitly templated lambdas -- '[] (T) {}' is not the same as '[](auto) {}'. This sh

Re: [PATCH] c++: Fix ICE on g++.dg/modules/adl-3_c.C [PR107379]

2022-10-27 Thread Nathan Sidwell via Gcc-patches
owing patch fixes it by calling find_namespace_slot again even if it was non-NULL, just doesn't assert it is *slot == ns in that case (because it often is not). Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? ok. thanks nathan -- Nathan Sidwell

c++: Adjust synthetic template parm creation

2022-10-25 Thread Nathan Sidwell via Gcc-patches
43e654afeba484d75fbee080262a038c1da00ad5 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Tue, 25 Oct 2022 09:39:00 -0400 Subject: [PATCH] c++: Adjust synthetic template parm creation We intend to mark synthetic template parameters (coming from use of auto parms), as DECL_VIRTUAL_P. The API of process_template_parm

Re: [PATCH] c++ modules: verify_type failure with typedef enum [PR106848]

2022-10-24 Thread Nathan Sidwell via Gcc-patches
On 10/21/22 09:11, Patrick Palka wrote: On Fri, 21 Oct 2022, Nathan Sidwell wrote: Thanks for the explanation, it's a situation I didn;t anticipate and your fix is good. Could you add a comment about why you need to propagate the values though? Thanks a lot, will do. Just to make sure

Re: [PATCH] c++ modules: verify_type failure with typedef enum [PR106848]

2022-10-21 Thread Nathan Sidwell via Gcc-patches
0,0 +1,6 @@ +// PR c++/106848 +// { dg-additional-options "-fmodules-ts -g" } + +import "enum-9_a.H"; + +memory_order x = memory_order_seq_cst; -- 2.38.0.68.ge85701b4af -- Nathan Sidwell

Re: [PATCH] c++ modules: handle CONCEPT_DECL in node_template_info [PR102963]

2022-10-20 Thread Nathan Sidwell via Gcc-patches
; + +static_assert(C); +static_assert(C); // { dg-error "static assert" } -- Nathan Sidwell

Re: [PATCH] c++ modules: stream non-trailing default targs [PR105045]

2022-10-18 Thread Nathan Sidwell via Gcc-patches
/testsuite/g++.dg/modules/pr105045_b.C @@ -0,0 +1,6 @@ +// PR c++/105045 +// { dg-additional-options -fmodules-ts } + +import pr105045; + +int main() { f(0); } -- Nathan Sidwell

Re: [PATCH] c++ modules: streaming constexpr_fundef [PR101449]

2022-10-15 Thread Nathan Sidwell via Gcc-patches
@ +// PR c++/101449 +// { dg-additional-options -fmodules-ts } + +import pr101449; + +static_assert(f().b); +static_assert(g(f())); -- Nathan Sidwell

Re: [PATCH] c++ modules: ICE with templated friend and std namespace [PR100134]

2022-10-14 Thread Nathan Sidwell via Gcc-patches
On 10/13/22 11:27, Jason Merrill wrote: On 10/11/22 13:40, Nathan Sidwell wrote: On 10/11/22 11:35, Patrick Palka wrote: IIUC the function depset::hash::add_binding_entity has an assert verifying that if a namespace contains an exported entity, then the namespace must have been opened

Re: [PATCH] c++ modules: ICE with dynamic_cast [PR106304]

2022-10-14 Thread Nathan Sidwell via Gcc-patches
gcc/testsuite/g++.dg/modules/pr106304_b.C new file mode 100644 index 000..e8333909c8d --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/pr106304_b.C @@ -0,0 +1,8 @@ +// PR c++/106304 +// { dg-additional-options -fmodules-ts } + +module pr106304; + +void f(A& a) { + as_b(a); +} -- Nathan Sidwell

Re: [PATCH] c++ modules: ICE with templated friend and std namespace [PR100134]

2022-10-11 Thread Nathan Sidwell via Gcc-patches
pr100134; + +import "tpl-friend-8_a.H"; + +export std::A a; -- Nathan Sidwell

Re: [PATCH] c++ modules: lazy loading from within template [PR99377]

2022-10-11 Thread Nathan Sidwell via Gcc-patches
On 10/11/22 10:58, Patrick Palka wrote: On Mon, 10 Oct 2022, Nathan Sidwell wrote: On 10/4/22 13:36, Patrick Palka wrote: Here when lazily loading the binding for f at parse time from the template g, processing_template_decl is set and thus the call to note_vague_linkage_fn from module_state

libiberty: Demangling 'M' prefixes

2022-10-11 Thread Nathan Sidwell via Gcc-patches
, so we do not need to check for that case (although we could if we wanted to be more lenient). nathan -- Nathan SidwellFrom 0fa35c7e2974a22b2107fa378895c3069fe07ff3 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 30 Sep 2022 09:43:30 -0700 Subject: [PATCH] libiberty: Demangling 'M

Re: [PATCH] c++ modules: lazy loading from within template [PR99377]

2022-10-10 Thread Nathan Sidwell via Gcc-patches
/null +++ b/gcc/testsuite/g++.dg/modules/pr99377-2_b.C @@ -0,0 +1,6 @@ +// PR c++/99377 +// { dg-additional-options -fmodules-ts } +// { dg-do link } +import pr99377; +template void g() { f(); } +int main() { g(); } -- Nathan Sidwell

Re: [PATCH] c++ modules: ICE with bitfield member in class template

2022-10-07 Thread Nathan Sidwell via Gcc-patches
ld-3.H new file mode 100644 index 000..4fd4db7116a --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/bfield-3.H @@ -0,0 +1,8 @@ +// { dg-additional-options -fmodule-header } +// { dg-module-cmi {} } + +template +struct A { + int x : 1; + int y : N; +}; -- Nathan Sidwell

libiberty: Demangle variadic template lambdas

2022-10-07 Thread Nathan Sidwell via Gcc-patches
the argument of the pack. That's an orthogonal problem, for which the solution is to have better knowledge of operator precedence. nathan -- Nathan SidwellFrom 55bd808527e8c1947cf2d2b42769528087b687ef Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 30 Sep 2022 12:11:42 -0700 Subject: [PATCH

c++: Lambda context mangling

2022-10-07 Thread Nathan Sidwell via Gcc-patches
0:00 2001 From: Nathan Sidwell Date: Fri, 30 Sep 2022 08:43:10 -0700 Subject: [PATCH 1/3] c++: Lambda context mangling VAR and FIELD decls can become part of a lambda context, when the lambda is 'attached' to that entity (It's a C++20 ODR thing that was discovered with modules, but is actually sepa

Re: [PATCH] c++ modules: static var in inline function [PR104433]

2022-10-07 Thread Nathan Sidwell via Gcc-patches
+ +import "static-2_a.H"; + +int main() { + f(); +} -- Nathan Sidwell

Re: C++ ABI

2022-09-30 Thread Nathan Sidwell via Gcc-patches
On 9/30/22 09:43, Nathan Sidwell wrote: Hi, I've discovered some mangling problems with lambdas.  (a) divergence from clang and (b) manglings that incorrectly demangle.  With #a I'm not yet sure who is correct.  for #b g++ is definitely wrong. From the docs, it doesn't appear to have been

C++ ABI

2022-09-30 Thread Nathan Sidwell via Gcc-patches
should bump it to 18? nathan -- Nathan Sidwell

Re: [PATCH] testsuite: Colon is reserved on Windows

2022-09-30 Thread Nathan Sidwell via Gcc-patches
0; -- Nathan Sidwell

c++: import/export NTTP objects

2022-09-29 Thread Nathan Sidwell via Gcc-patches
. nathan -- Nathan SidwellFrom a1f7f9541c2b20eb44750b9c15cd831c62d67f21 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 28 Sep 2022 09:21:14 -0700 Subject: [PATCH] c++: import/export NTTP objects This adds smarts to the module machinery to handle NTTP object VAR_DECLs. Like typeinfo objects

Re: [PATCH] c++ modules: ICE with class NTTP argument [PR100616]

2022-09-28 Thread Nathan Sidwell via Gcc-patches
On 9/28/22 10:42, Patrick Palka wrote: On Tue, 27 Sep 2022, Nathan Sidwell wrote: On 9/26/22 15:05, Patrick Palka wrote: On Mon, 26 Sep 2022, Patrick Palka wrote: On Mon, 26 Sep 2022, Nathan Sidwell wrote: return decl; @@ -29150,9 +29151,10 @@ finish_concept_definition (cp_expr

c++: Add DECL_NTTP_OBJECT_P lang flag

2022-09-28 Thread Nathan Sidwell via Gcc-patches
-- anyway a bit flag on the node is better, IMHO). We break apart the creation routine, so there's now an entry point the module machinery can use directly. nathan -- Nathan SidwellFrom 50888e70c984da9cd9676d3986f68222581884b3 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 28 Sep 2022 09:20

Re: [PATCH] c++ modules: ICE with class NTTP argument [PR100616]

2022-09-27 Thread Nathan Sidwell via Gcc-patches
On 9/26/22 15:05, Patrick Palka wrote: On Mon, 26 Sep 2022, Patrick Palka wrote: On Mon, 26 Sep 2022, Nathan Sidwell wrote: On 9/26/22 10:08, Nathan Sidwell wrote: On 9/23/22 09:32, Patrick Palka wrote: Judging by the two commits that introduced/modified this part

Re: [PATCH] c++ modules: variable template partial spec fixes [PR107033]

2022-09-26 Thread Nathan Sidwell via Gcc-patches
tional-options -fmodule-header } +// { dg-module-cmi {} } + +#include "partial-2.h" diff --git a/gcc/testsuite/g++.dg/modules/partial-2_d.C b/gcc/testsuite/g++.dg/modules/partial-2_d.C new file mode 100644 index 000..ed54d3c2884 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/partial-2_d.C @@ -0,0 +1,8 @@ +// PR c++/107033 +// { dg-additional-options -fmodules-ts } +// { dg-module-cmi pr107033 } +export module pr107033; + +import "partial-2_c.H"; + +#include "partial-2.cc" -- Nathan Sidwell

Re: [PATCH] c++ modules: ICE with class NTTP argument [PR100616]

2022-09-26 Thread Nathan Sidwell via Gcc-patches
On 9/26/22 10:08, Nathan Sidwell wrote: On 9/23/22 09:32, Patrick Palka wrote: Judging by the two commits that introduced/modified this part of maybe_register_incomplete_var, r196852 and r214333, ISTM the code is really only concerned with constexpr static data members (whose initializer may

Re: [PATCH] c++ modules: ICE with class NTTP argument [PR100616]

2022-09-26 Thread Nathan Sidwell via Gcc-patches
paramete object for A{}'. I see that's a special mangler 'mangle_template_parm_object', called from get_template_parm_object. Perhaps these VAR_DECLs need an additional in-tree flag that the streamer can check for? nathan -- Nathan Sidwell

Re: [PATCH] c++ modules: ICE with class NTTP argument [PR100616]

2022-09-22 Thread Nathan Sidwell via Gcc-patches
. not sure how to approach this. nathan -- Nathan Sidwell

Re: [PATCH] c++ modules: partial variable template specializations [PR106826]

2022-09-22 Thread Nathan Sidwell via Gcc-patches
__cpp_concepts +static_assert(concepts::is_reference_v); +static_assert(concepts::is_reference_v); +static_assert(!concepts::is_reference_v); + +static_assert(concepts::A::is_reference_v); +static_assert(concepts::A::is_reference_v); +static_assert(!concepts::A::is_reference_v); +#endif -- Nathan Sidwell

Re: [PATCH 2/2] c++: xtreme-header modules tests cleanups

2022-09-20 Thread Nathan Sidwell via Gcc-patches
-#include -#include -#include -#include #endif #endif #endif + +// C++23 +#if __cplusplus > 202002L +#include +#include +#include +#if 0 +// Unimplemented +#include +#include +#include +#include +#include +#endif +#endif + -- Nathan Sidwell

Re: [PATCH 1/2] c++: modules and non-dependent auto deduction

2022-09-20 Thread Nathan Sidwell via Gcc-patches
++.dg/modules/auto-3_b.C @@ -0,0 +1,4 @@ +// { dg-additional-options "-fmodules-ts -fno-module-lazy" } + +#include "auto-3.h" +import "auto-3_a.H"; -- Nathan Sidwell

Re: [PATCH] c++: stream PACK_EXPANSION_EXTRA_ARGS [PR106761]

2022-09-20 Thread Nathan Sidwell via Gcc-patches
On 9/20/22 10:08, Patrick Palka wrote: On Tue, 20 Sep 2022, Nathan Sidwell wrote: On 9/19/22 09:52, Patrick Palka wrote: It looks like some xtreme-header-* tests are failing after the libstdc++ change r13-2158-g02f6b405f0e9dc ultimately because we're neglecting to stream

Re: [PATCH] c++: stream PACK_EXPANSION_EXTRA_ARGS [PR106761]

2022-09-20 Thread Nathan Sidwell via Gcc-patches
; res = expn; } -- Nathan Sidwell

Re: [PATCH] c++: modules ICE with typename friend declaration

2022-09-17 Thread Nathan Sidwell via Gcc-patches
On 9/16/22 11:54, Patrick Palka wrote: On Fri, 16 Sep 2022, Nathan Sidwell wrote: Thanks, this looks right. Sigh templates can mess up ones mental invariants! The test case should really be a foo_[ab].C kind, to test both sides of the streaming. Bonus points for using the template after

Re: [PATCH] c++: modules ICE with typename friend declaration

2022-09-16 Thread Nathan Sidwell via Gcc-patches
Thanks, this looks right. Sigh templates can mess up ones mental invariants! The test case should really be a foo_[ab].C kind, to test both sides of the streaming. Bonus points for using the template after importing. And you need the dg-module-cmi annotation to check /and then delete/ the gcm

Re: Ping [PATCH V2] libcpp: Optimize #pragma once with a hash table [PR58770]

2022-08-23 Thread Nathan Sidwell via Gcc-patches
On 8/22/22 13:39, Paul Hollinsky wrote: On Mon, Aug 22, 2022 at 09:19:29AM -0400, Nathan Sidwell wrote: On 8/19/22 16:27, Paul Hollinsky wrote: Hi all, Would love some feedback on this patch! Thanks, Paul On Mon, Aug 01, 2022 at 05:18:40AM +, Paul Hollinsky wrote: Rather than

Re: Ping [PATCH V2] libcpp: Optimize #pragma once with a hash table [PR58770]

2022-08-22 Thread Nathan Sidwell via Gcc-patches
485,9 @@ struct cpp_reader been used. */ bool seen_once_only; + /* Optimization for #pragma once. */ + struct htab *pragma_once_files; + /* Multiple include optimization. */ const cpp_hashnode *mi_cmacro; const cpp_hashnode *mi_ind_cmacro; -- 2.34.1 -- Nathan Sidwell

Re: Where in C++ module streaming to handle a new bitfield added in "tree_decl_common"

2022-08-16 Thread Nathan Sidwell via Gcc-patches
On 8/15/22 10:03, Richard Biener wrote: On Mon, Aug 15, 2022 at 3:29 PM Nathan Sidwell via Gcc-patches wrote: On 8/2/22 10:44, Qing Zhao wrote: Hi, Nathan, I am adding a new bitfield “decl_not_flexarray” in “tree_decl_common” (gcc/tree-core.h) for the new gcc feature -fstrict-flex-arrays

c++: Fix module line no testcase

2022-08-15 Thread Nathan Sidwell via Gcc-patches
Not all systems have the same injected headers, leading to line location table differences that are immaterial to the test. Fix the regexp more robustly. nathan -- Nathan SidwellFrom af088b32def1c56538f0f3aaea16f013e9292d64 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 15 Aug 2022

Re: Where in C++ module streaming to handle a new bitfield added in "tree_decl_common"

2022-08-15 Thread Nathan Sidwell via Gcc-patches
odule streaming, could you please help me on this? add it in to trees_{in,out}::core_bools. You could elide streaming for non-FIELD_DECL decls. Hope that helps. nathan Thanks a lot for your help. Qing -- Nathan Sidwell

C++: add -std={c,gnu}++{current,future}

2022-07-13 Thread Nathan Sidwell via Gcc-patches
9671f4d5e7efa130280b6d50fb4e9e8492d5b587 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 13 Jul 2022 12:11:40 -0700 Subject: [PATCH] C++: add -std={c,gnu}++{current,future} Since C++ is such a moving target, Microsoft have /std:c++latest (AFAICT clang does not), to select the currently

c++: Prune ordinary locations

2022-07-05 Thread Nathan Sidwell via Gcc-patches
47794da8d8ea61ea8f6a0e21d3c1731a56d0cff3 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 24 Jun 2022 05:57:42 -0700 Subject: [PATCH] c++: Prune ordinary locations Like macro locations, we only need to emit ordinary location information for locations emitted into the CMI. This adds a hash table noting

c++: Note macro locations

2022-06-30 Thread Nathan Sidwell via Gcc-patches
From 47e36785cd2ba35a577b0678a2ac185288eb9e52 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 27 Jun 2022 07:51:12 -0700 Subject: [PATCH] c++: Note macro locations In order to prune ordinary locations, we need to note the locations of macros we'll be writing out. This rearanges the macro processing to ach

c++: Rename macro location structs

2022-06-29 Thread Nathan Sidwell via Gcc-patches
The macro location tables should really mention they are about locations. So rename them. Also, add a missing free of the remapping table, and remove some now-unneeded macro checking. nathan -- Nathan SidwellFrom b0f25e1fdc6199725e69023a3dc49021f311ba66 Mon Sep 17 00:00:00 2001 From: Nathan

c++: Prune unneeded macro locations

2022-06-23 Thread Nathan Sidwell via Gcc-patches
% and 60% respectively. Ordinary locations are still transformed en-mass. They are somewhat more complicated to apply a similar optimization to. nathan -- Nathan SidwellFrom 445cc1266ff8b9b8f96eceafa3c1116da54de967 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 22 Jun 2022 05:54:30 -0700

c++: Remove ifdefed code

2022-06-22 Thread Nathan Sidwell via Gcc-patches
d844478ab47a16c8ae65f253fd1cdc685c7951fc Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 22 Jun 2022 07:51:44 -0700 Subject: [PATCH] c++: Remove ifdefed code The only reason I chose to use DECL_UID on this hash table was to make it stable against ASLR and perturbations due to other allocations. It's not required

doc: Document module language-linkage supported

2022-06-21 Thread Nathan Sidwell via Gcc-patches
I missed we documented this as unimplemented, when I implemented it. -- Nathan SidwellFrom f1fcd6e3ad911945bc3c24a3a5c7ea99b910121e Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Tue, 21 Jun 2022 06:23:11 -0700 Subject: [PATCH] doc: Document module language-linkage supported I missed we

  1   2   3   4   5   6   7   8   9   10   >