Re: [PATCH] coroutines: Handle lambda capture objects in the way as clang.

2020-04-22 Thread Nathan Sidwell
m.lambda_cobj = is_this_parameter (arg) +|| (DECL_NAME (arg) +&& DECL_NAME (arg) == closure_identifier); and here. Otherwise ok nathan -- Nathan Sidwell

Re: [PATCH] c++: Fix misuse of "override" in -Weffc++ warnings (PR 94698)

2020-04-22 Thread Nathan Sidwell
eck_field_decls): Change "override" to "define" in -Weffc++ diagnostics. Tested powerpc64le-linux, OK for master? ok, thanks -- Nathan Sidwell

Re: [PATCH] coroutines: Fix handling of conditional statements [PR94288]

2020-04-23 Thread Nathan Sidwell
, checking-only. (coro_body_contains_bind_expr_p): New, checking-only. (morph_fn_to_coro): Ensure that we have a top level bind expression. ok. -- Nathan Sidwell

Re: [PATCH] c-family: Fix ICE on __builtin_speculation_safe_value () [PR94755]

2020-04-26 Thread Nathan Sidwell
, params)) + if (!speculation_safe_value_resolve_params (loc, function, params)) return error_mark_node; first_param isn't used in that conditional, can't you just move its assinment afterwards? -- Nathan Sidwell

Re: [PATCH] coroutines: Do not assume parms are named [PR94752].

2020-04-26 Thread Nathan Sidwell
/ChangeLog: 2020-04-25 Iain Sandoe * coroutines.cc (morph_fn_to_coro): Ensure that unnamed function params have a usable and distinct frame field name. ok -- Nathan Sidwell

Re: [PATCH] c-family: Fix ICE on __builtin_speculation_safe_value () [PR94755]

2020-04-27 Thread Nathan Sidwell
On 4/26/20 10:59 AM, Jakub Jelinek wrote: On Sun, Apr 26, 2020 at 09:58:16AM -0400, Nathan Sidwell wrote: first_param = (*params)[0]; - if (fncode == BUILT_IN_NONE - || !speculation_safe_value_resolve_params (loc, function, params)) + if

Re: [PATCH] coroutines: Fix handling of non-class coroutine returns [PR94759]

2020-04-27 Thread Nathan Sidwell
); /* The GRO is the return value. */ + else r = NULL_TREE; ^^ missing line break I see Jonathan approved the library bit, with a nit too. nathan -- Nathan Sidwell

Re: [PATCH] coroutines: Pass class ref to traits lookup and promise allocator [PR94760]

2020-04-27 Thread Nathan Sidwell
vec_safe_push (args, arg); + { + param_info *parm_i = param_uses->get (arg); + gcc_checking_assert (parm_i); + if (parm_i->lambda_cobj) + vec_safe_push (args, arg); + else if (0 && parm_i->this_ptr) ^^ looks like now-disabled experimental code? -- Nathan Sidwell

Re: [PATCH] wwdocs: Update coroutines status.

2020-04-27 Thread Nathan Sidwell
as applied to http://wg21.link/n4861";>n4861 + 10 + (requires -fcoroutines) + __cpp_impl_coroutine >= 201902 Parenthesized initialization of aggregates -- Nathan Sidwell

Re: [PATCH] coroutines: Fix for uses of structured binding [PR94701]

2020-04-27 Thread Nathan Sidwell
variables. (register_local_var_uses): Likewise. ok -- Nathan Sidwell

Re: [PATCH v2] wwdocs: Update coroutines status.

2020-04-27 Thread Nathan Sidwell
On 4/27/20 11:04 AM, Iain Sandoe wrote: Nathan Sidwell wrote: On 4/27/20 3:56 AM, Iain Sandoe wrote: hi, This makes minor adjustments to the coroutines status reflecting the changes in n4861, the C++20 standard DIS. OK to apply? thanks Iain — htdocs/gcc-10/changes.html | 1 + htdocs

Re: [PATCH] coroutines: Pass class ref to traits lookup and promise allocator [PR94760]

2020-04-27 Thread Nathan Sidwell
On 4/27/20 2:41 PM, Iain Sandoe wrote: Nathan Sidwell wrote: On 4/25/20 11:08 AM, Iain Sandoe wrote: + tree arg = DECL_ARGUMENTS (fndecl); + bool lambda_p = LAMBDA_TYPE_P (DECL_CONTEXT (fndecl)); I think LAMBDA_FUNCTION_P (fndecl) expresses intent better. done in both places

Re: gcc.dg testsuite glitches

2020-04-28 Thread Nathan Sidwell
il stage 1. nathan -- Nathan Sidwell

Re: [PATCH] c++: Parameter pack in requires parameter list [PR94808]

2020-04-28 Thread Nathan Sidwell
/ChangeLog: PR c++/94808 * error.c (print_requires_expression_info): Substitute into and collect all parameters in a vector first before printing them. Handle zero or multiple parameters of an expanded parameter pack. ok, thanks -- Nathan Sidwell

[PR c+ 94827]: template parm with default requires

2020-04-29 Thread Nathan Sidwell
Jason, this is the patch you suggested, as I understood it. I kept finish_nested_require's saving of the (converted) current_template_parms, becase of the comment about use in diagnostics. Is this what you meant? boostrapped on x86_64-linux. nathan -- Nathan Sidwell 2020-04-27

Re: [PATCH] coroutines: Fix cases where proxy variables are used [PR94879]

2020-04-30 Thread Nathan Sidwell
std::g initial_suspend(); + l final_suspend(); +}; +class m : public j { +public: + void get_return_object(); + void unhandled_exception(); +}; +class n { +public: + using promise_type = m; +}; +std::d k; +void a() { + auto am = k; + [&]() -> n { co_await std::b(am.e); }; +} -- Nathan Sidwell

Re: [PATCH] coroutines: Fix handling of target cleanup exprs [PR94883]

2020-04-30 Thread Nathan Sidwell
overly complex. ok -- Nathan Sidwell

Re: [PATCH] coroutines: Fix handling of artificial vars [PR94886]

2020-04-30 Thread Nathan Sidwell
ll +++ b/gcc/testsuite/g++.dg/coroutines/pr94886-folly-3.C @@ -0,0 +1,15 @@ + +#include "coro.h" +#include "coro1-ret-int-yield-int.h" + +#include + +coro1 +my_coro () +{ + const std::array expectedValues = {{0, 3, 1, 4, 2}}; + + for (int expectedValue : expectedValues) { +co_yield expectedValue; + } +} -- Nathan Sidwell

Re: [PR c+ 94827]: template parm with default requires

2020-04-30 Thread Nathan Sidwell
On 4/29/20 2:50 PM, Nathan Sidwell wrote: Jason, this is the patch you suggested, as I understood it.  I kept finish_nested_require's saving of the (converted) current_template_parms, becase of the comment about use in diagnostics. this extended test that tries to call the function

Re: [PR c+ 94827]: template parm with default requires

2020-04-30 Thread Nathan Sidwell
On 4/30/20 10:18 AM, Jason Merrill wrote: On 4/29/20 2:50 PM, Nathan Sidwell wrote: Jason, this is the patch you suggested, as I understood it.  I kept finish_nested_require's saving of the (converted) current_template_parms, becase of the comment about use in diagnostics. Is this wha

Re: [PR c+ 94827]: template parm with default requires

2020-04-30 Thread Nathan Sidwell
On 4/30/20 10:35 AM, Nathan Sidwell wrote: On 4/30/20 10:18 AM, Jason Merrill wrote: On 4/29/20 2:50 PM, Nathan Sidwell wrote: Jason, this is the patch you suggested, as I understood it.  I kept finish_nested_require's saving of the (converted) current_template_parms, becase of the co

[PR 94827] Don't save tmpl parms in nested requirement

2020-05-04 Thread Nathan Sidwell
This patch removes the stashing of template parms that Jason noticed was unused when we fixed the 94827 ICE. pushed to trunk. nathan -- Nathan Sidwell 2020-05-04 Nathan Sidwell PR c++/94827 -- don't save parms in nested requirement * constraint.cc (tsubst_nested_requirement):

[C++] template parm cleanup

2020-05-04 Thread Nathan Sidwell
y header, and then a push of the real one -- why not just modify the dummy in place? Added a comment about that. pushed to trunk. nathan -- Nathan Sidwell 2020-05-04 Nathan Sidwell pt.c (process_template_parm): Don't walk the template list twice, remember the final node instead. (end

[PR libstdc++/94747] negating a size_t does not show intent

2020-05-04 Thread Nathan Sidwell
Pushed this patch to dynamic_cast. We negate an offsetof value, which although well formed, it doesn't show intent well. The reason checkers trigger on this is that it is a cause of real bugs. So, negate a ptrdiff_t instead. nathan -- Nathan Sidwell 2020-05-04 Nathan Sidwell

[PR 94807] Consistently name lambda fn's this pointer

2020-05-05 Thread Nathan Sidwell
smaller change seemed to be telling tsubst_function_decl to zap the name too. (tsubst_function_decl has to treat a lambda;s this pointer specially, it can't just send it to tsubst with the rest of the parms, as that tickles an assert inside class instantiation.) pushed to trunk natha

[libitm] testsuite tweak

2020-05-05 Thread Nathan Sidwell
I had reason to wander into libitm's testsuite, and discovered gcc emitting colorized diagnostics. Those are hard to read in a log file. This patch disables colorizing. pushed as obvious -- Nathan Sidwell 2020-05-05 Nathan Sidwell * testsuite/lib/libitm.exp (libitm_init)

[libitm] eh specifications are lax

2020-05-05 Thread Nathan Sidwell
o I make use of a new _ITM_NOTHROW macro, suitably defined. Because of the lax checking in the compiler, and old compiler with a patched libitm.h will be ok... Until I change the compiler :) booted & tested on x86_64-linux, ok? nathan [*] modules make it harder to have ODR violations, that

Re: [PATCH] Fix PR91606

2019-10-02 Thread Nathan Sidwell
ter-to-member fat pointer structure members as DECL_NONADDRESSABLE_P. ok, thanks nathan -- Nathan Sidwell

[preprocessor/91991] column location overflow

2019-10-04 Thread Nathan Sidwell
ll failure paths go through a common exit block. With this patch I can compile the sqlite package in the PR. committing to trunk. nathan -- Nathan Sidwell 2019-10-04 Nathan Sidwell PR preprocessor/91991 * line-map.c (linemap_line_start): Clear max_column_hint if we run out of locatio

PR 91770 - emit a warning in a system header

2019-10-10 Thread Nathan Sidwell
;, I could clear the map's in-system-header flag around the warning emission. But that's, well, urgh:( Is there a neater way? nathan [1] The user may have included the system header inside an extern "C" region, but this is also so the glibc maintainers can locate where gli

[PATCH] teach gengtype about 'mutable'

2019-10-13 Thread Nathan Sidwell
In constifying some more of line-map I discovered gengtype didn't know mutable. Added thusly. nathan -- Nathan Sidwell 2019-10-13 Nathan Sidwell * gengtype-lex.l (CXX_KEYWORD): Add 'mutable'. Index: gcc

Re: [PATCH] teach gengtype about 'mutable'

2019-10-14 Thread Nathan Sidwell
On 10/14/19 7:16 AM, Richard Biener wrote: On Sun, Oct 13, 2019 at 4:45 PM Nathan Sidwell wrote: In constifying some more of line-map I discovered gengtype didn't know mutable. Added thusly. mutable is bad. Why do you want to use it? the line map info has a caching field. mutab

Re: [PATCH] teach gengtype about 'mutable'

2019-10-14 Thread Nathan Sidwell
On 10/14/19 3:46 PM, Jeff Law wrote: On 10/14/19 6:09 AM, Nathan Sidwell wrote: On 10/14/19 7:16 AM, Richard Biener wrote: On Sun, Oct 13, 2019 at 4:45 PM Nathan Sidwell wrote: In constifying some more of line-map I discovered gengtype didn't know mutable. Added thusly. mutable i

[C++ PATCH] build_clone cleanup

2019-10-15 Thread Nathan Sidwell
build_clone is recursive when applied to a template, but I found the control flow confusing. this makes it clearer and moves some decls to their initializers. Applying to trunk. nathan -- Nathan Sidwell 2019-10-15 Nathan Sidwell * class.c (build_clone): Refactor to clarify

[linemap PATCH] Constify lookup

2019-10-15 Thread Nathan Sidwell
a rathole cleaning up the C-era accessors and like. I punted. committing to trunk nathan -- Nathan Sidwell 2019-10-15 Nathan Sidwell * include/line-map.h (struct maps_info_ordinary): Make cache mutable. (struct maps_info_macro): Likewise. (LINEMAPS_CACHE): Remove non-ref accessor

[C++ PATCH] clone_function_decl breakup

2019-10-15 Thread Nathan Sidwell
added. I suppose this could have used FOR_EVERY_CLONE, but I went with the counting scheme. On the module branch, build_clones is not static and has a few more parameters, but that's a different patch. installing on trunk. nathan -- Nathan Sidwell 2019-10-15 Nathan Sidwell * cl

[C++ PATCH] builtin fn creation

2019-10-17 Thread Nathan Sidwell
* applies the transforms to the incoming decl before cloning it * uses copy_decl, a c++ decl-specific copy_node, which correctly duplicates the lang-specific data * uses IDENTIFIER_LENGTH rather than strlen * set DECL_CONTEXT to FROB_CONTEXT (current_namespace). applying to trunk. nathan -- Nathan S

[C++ PATCH] anon type names

2019-10-18 Thread Nathan Sidwell
tting this to trunk. nathan -- Nathan Sidwell 2019-10-18 Nathan Sidwell * cp-tree.h (struct lang_type): Remove was_anonymous. (TYPE_WAS_UNNAMED): Implement by checking TYPE_DECL & TYPE_STUB_DECL. * decl.c (name_unnamed_type): Don't set TYPE_WAS_UNNAMED. Index: gc

[PR C++/94946] ambiguous overload regression

2020-05-06 Thread Nathan Sidwell
This appears to fix 94946 -- regular testsuite passes, bootstrapping now. I'll commit if the bootstrap is good. Jakub, ok for gcc-10 too? nathan -- Nathan Sidwell 2020-05-06 Nathan Sidwell PR c++/94946 * decl.c (grokdeclarator): Don't splice template attributes in parm conte

Re: [PATCH] coroutines: Improve error recovery [PR94817, PR94829].

2020-05-06 Thread Nathan Sidwell
initial error. * decl.c (finish_function): Use the normal error path for fails in the ramp function, do not try to compile the helpers if the transform fails. ok -- Nathan Sidwell

Re: [PATCH] testsuite: Improve g++.dg/ext/attr-parm-1.C testcase [PR94946]

2020-05-07 Thread Nathan Sidwell
On 5/7/20 4:03 AM, Jakub Jelinek wrote: Hi! On Wed, May 06, 2020 at 02:14:03PM -0400, Nathan Sidwell wrote: --- /dev/null +++ w/gcc/testsuite/g++.dg/ext/attr-parm-1.C @@ -0,0 +1,7 @@ +// { dg-do compile { target { i?86-*-* x86_64-*-* } } } +// { dg-options -m32 } +// PR 94946 +class a

Re: gcc.dg testsuite glitches

2020-05-07 Thread Nathan Sidwell
On 5/7/20 1:34 PM, Jeff Law wrote: On Tue, 2020-04-28 at 10:36 -0400, Nathan Sidwell wrote: On 4/28/20 5:12 AM, Manfred Schwarb wrote: Hi, first, I do not have commit rights, so please somebody check and commit, I guess this goes under the obvious and trivial rules. There are several

Re: [PATCH] coroutines: Update TREE_SIDE_EFFECTS on inserted bind exprs.

2020-05-08 Thread Nathan Sidwell
, where a loop body is dropped in gimplification because it is not marked. tested so far on x86-64-darwin16, OK if it passes on Linux too, for master, 10.2? thanks ok for both -- Nathan Sidwell

[C++] EOF has a location

2020-05-08 Thread Nathan Sidwell
There's no need to special-case EOF's location. For the complete file we give it a legitimate location. And for deferred parses we now zap a temporary EOF onto the next token, so we can just use its location anyway. pushed to master. nathan -- Nathan Sidwell 2020-05-08 Nath

[preprocessor] Reimplement directives-only, add raw literal support

2020-05-08 Thread Nathan Sidwell
th in forward scanning. It may have different failure mode than forward scanning on bad tokenization. Finally, Moved some cpp tests from the c-specific dg.gcc/cpp directory to the c-c++-common/cpp shared directory, pushed to master. nathan -- Nathan Sidwell 2020-05-08 Nathan Sidwell l

[C++] Delete the news

2020-05-08 Thread Nathan Sidwell
the last time the NEWS file was updated was GCC 3.4. It is no longer news-worthy. We've moved to documenting this stuff on the web. pushed. nathan -- Nathan Sidwell 2020-05-08 Nathan Sidwell * NEWS: Delete, it is so stale. diff --git c/gcc/cp/NEWS w/gcc/cp/NEWS deleted file mode 1

Re: [libitm] eh specifications are lax

2020-05-11 Thread Nathan Sidwell
ping? On 5/5/20 4:08 PM, Nathan Sidwell wrote: I discovered that libitm: (a) declares __cxa_allocate_exception and friends directly, (b) doesn't mark them as 'throw()' (c) doesn't mark the replacment fns _ITM_$foo as nothrow either We happen to get away with it because of

Re: [PATCH] c++: Function found via ADL when it should not [PR95074]

2020-05-12 Thread Nathan Sidwell
function declaration, look through the whole set, not just the first function in the overload set. ok, thanks! -- Nathan Sidwell

[PR 95013] EOF location is at end of file

2020-05-12 Thread Nathan Sidwell
;s not a position on a line, it's a non-existant line. The testsuite churn is just correcting the EOF location diagnostics. This time I've made sure to check all testsuites, sorry obj-c++ folks. pushed to master. nathan -- Nathan Sidwell 2020-05-12 Nathan Sidwell libcpp/ E

Re: [PR 95013] EOF location is at end of file

2020-05-13 Thread Nathan Sidwell
beating me to it. nathan -- Nathan Sidwell

Re: [PATCH] coroutines: Implicitly movable objects should use move CTORs for co_return.

2020-05-13 Thread Nathan Sidwell
only parm is the coro frame pointer. Either way you'll need to teach TLAR a new trick, or clone it locally (probably the better choice). in place of TLAR's (parm_ok && ...) I think you want (code == COMPONENT_REF && OPERAND (0) == coro_frame) and of course move it outside the (irrelavant) context check does that help? nathan -- Nathan Sidwell

Re: [PATCH] coroutines: Implicitly movable objects should use move CTORs for co_return.

2020-05-13 Thread Nathan Sidwell
On 5/13/20 9:26 AM, Iain Sandoe wrote: Nathan Sidwell wrote: On 5/13/20 6:59 AM, Iain Sandoe wrote: @@ -1045,25 +1044,50 @@ finish_co_return_stmt (location_t kw, tree expr)    if (!crv_meth || crv_meth == error_mark_node) return error_mark_node;  -  vec *args

[C++] some cleanup patches

2020-05-13 Thread Nathan Sidwell
I've committed this set of minor cleanups from the modules branch. nathan -- Nathan Sidwell 2020-05-13 Nathan Sidwell Formatting fixups & some simplifications. * pt.c (spec_hash_table): New typedef. (decl_specializations, type_specializations): Use it. (retrieve_specialization):

[C++] canonical_type_parameter

2020-05-13 Thread Nathan Sidwell
Canonical_type_parameter shows C-like thinking. This modernizes it, which I found simpler to understand. pushed to master nathan -- Nathan Sidwell 2020-05-13 Nathan Sidwell * pt.c (canonical_type_parameter): Simplify. diff --git i/gcc/cp/pt.c w/gcc/cp/pt.c index a732ced2d8d..a36f603761c

[C++] simplify typedef access checking

2020-05-13 Thread Nathan Sidwell
I discovered template typedef access checking was more expensive than it need be. The call of get_types_needed_access_check in the FOR_EACH_VEC_SAFE_ELT is the moral equivalent of for (size_t pos = 0; pos != strlen (string); pos++)' Let's not do that. nathan -- Nathan Sidwell

[C++] template arg comparison

2020-05-13 Thread Nathan Sidwell
When fixing up the template specialization hasher I was confused by the control flow through template_args_equal. This reorders the category checking, so it is clearer as to what kind of node can reach which point. nathan -- Nathan Sidwell 2020-05-13 Nathan Sidwell * pt.c

[C++] improve build_template_decl

2020-05-14 Thread Nathan Sidwell
I discovered all the users of build_template_decl were explicitly setting the RESULT and TYPE fields of the built decl. Let's just have build_template_decl do that in the first place. pushed to master. nathan -- Nathan Sidwell 2020-05-14 Nathan Sidwell * pt.c (build_template

[C++] more pt.c simplifications

2020-05-14 Thread Nathan Sidwell
.diff We were checking TYPE_NAME and then copying it if not null. Just copy it, and then see if we got null. push-tpl.diff Push_template_decl_real's friend-pushing logic was confusing me. This is more understandable. Fix a latent type bug I disovered. nathan -- Nathan Sidwell diff -

[C++] a missed c++2a->c++20

2020-05-14 Thread Nathan Sidwell
Jason missed a c++2a mention. I couldn't resist changing the loop following to place the initializers inside the fors. pushed to master nathan -- Nathan Sidwell 2020-05-14 Nathan Sidwell * parser.c (cp_parser_diagnose_invalid_typename): Mention std=c++20 not 2a, reformat dependent

Re: [PATCH v2] coroutines: Implicitly movable objects should use move CTORs for co_return.

2020-05-14 Thread Nathan Sidwell
On 5/14/20 9:04 AM, Iain Sandoe wrote: Hi thanks for the review and pointers ... Nathan Sidwell wrote: On 5/13/20 9:26 AM, Iain Sandoe wrote: Nathan Sidwell wrote: On 5/13/20 6:59 AM, Iain Sandoe wrote: This is the equivalent of finish_return_stmt () in the parser, it knows nothing

[C++] simplify tsubst_template_decl

2020-05-14 Thread Nathan Sidwell
the final (for now) templatet simplification is this one. The control flow through tsubst_template_decl was also confusing. This flattens the conditionals and reorders things to make it simpler. pushed to trunk. nathan -- Nathan Sidwell 2020-05-14 Nathan Sidwell * pt.c

Re: [C++] template arg comparison

2020-05-15 Thread Nathan Sidwell
here: else if (TYPE_P (ot) || TYPE_P (nt)) Whoops, I flubbed that. Fixed thusly. In other news, someone's reading my patches! Seriously, thanks! nathan -- Nathan Sidwell 2020-05-15 Nathan Sidwell * pt.c (template_args_equal): Fix thinkos in previous 'cleanup'. diff --git i/

[PR 95182] ICE with EOF in macro args

2020-05-19 Thread Nathan Sidwell
. pushed to trunk nathan -- Nathan Sidwell 2020-05-18 Nathan Sidwell PR preprocessor/95182 libcpp/ * macro.c (collect_args): Preserve EOFif we fell out of the main file. (cpp_get_token_1): Reformat a couple of short lines. diff --git c/libcpp/macro.c w/libcpp/macro.c index dc4366ffefd

[PR 95149] reimplement raw literal lexing

2020-05-19 Thread Nathan Sidwell
ending '"'. pushed to master -- Nathan Sidwell 2020-05-18 Nathan Sidwell PR preprocessor/95149 libcpp/ * lex.c (struct lit_accum): New. (bufring_append): Replace by lit_accum::append. (lex_raw_string): Reimplement, using fragments of the old version. (lex_string): Adjust

[preprocessor] Some cleanups

2020-05-19 Thread Nathan Sidwell
athan -- Nathan Sidwell 2020-05-18 Nathan Sidwell * include/cpplib.h (cpp_get_otions, cpp_get_callbacks) (cpp_get_deps): Mark as PURE. * include/line-map.h (get_combined_adhoc_loc) (get_location_from_adhoc_loc, get_pure_location): Reformat decls. * internal.h (struct lexer_state): Clarify co

[c++] alias template instantiation

2020-05-19 Thread Nathan Sidwell
Here's a small cleanup discovered by modules. The alias instantiation machinery would setup template_info, and then sometime later overwrite that with equivalent info. The template info, once set, is logically immutable. Let's just not do that. pushed to master nathan -- Nath

Re: [PATCH] c++: spec_hasher and TYPENAME_TYPE resolution [PR95223]

2020-05-20 Thread Nathan Sidwell
/cp/ChangeLog: PR c++/95223 * gcc/cp/typeck.c (structural_comptypes): Don't perform context-dependent resolution of TYPENAME_TYPEs when comparing_specializations. ok. nathan -- Nathan Sidwell

[preprocessor] Replace flags with an enum

2020-05-20 Thread Nathan Sidwell
_cpp_find_file has 3 bool arguments, at most one of which is ever set. Ripe for replacing with a 4-state enum. Also, this is C++, so 'typedef struct Foo Foo' is unnecessary. pushed to master. nathan -- Nathan Sidwell 2020-05-20 Nathan Sidwell * internal.h (typedef _cpp_fil

[preprocessor] a few cleanups in c-family

2020-05-20 Thread Nathan Sidwell
iling horribly. I do not add a pointer comparison on the, possibly rash, assumption strcmp does that already. The other two are merely moving local var decls to their point of initialization, and using the c++ idiom of allowing that as an if condition. pushed to master nathan -- Nathan Sidwell 20

Re: [preprocessor] a few cleanups in c-family

2020-05-20 Thread Nathan Sidwell
On 5/20/20 2:22 PM, Nathan Sidwell wrote: Here are some small cleanups. The one bug fix is try_to_locate_new_include_insertion_point was using pointer comparison to compare strings.  This usually works, because the line table doesn't duplicate file names.  Except when reading preproc

Re: [preprocessor] a few cleanups in c-family

2020-05-21 Thread Nathan Sidwell
On 5/21/20 4:02 AM, Andreas Schwab wrote: On Mai 20 2020, Nathan Sidwell wrote: I'm reverting that change. It is not ready. The first map has a different string for the main file name, and we were relying on that not equalling the later ones via pointer comparison. I must have b

[PR c++/95263] Revert alias template change

2020-05-27 Thread Nathan Sidwell
Sadly my attempt to make some aliast template construction immutable doesn't always apply. Reverting that patch and I guess more work needed on modules :( nathan -- Nathan Sidwell 2020-05-27 Nathan Sidwell PR c++/95263, revert 74744bb1f2847b5b9ce3e97e0fec9c23bb0e499f *

Re: [PATCH] coroutines: Correct handling of references in parm copies [PR95350].

2020-06-01 Thread Nathan Sidwell
  int y = x.handle.promise().get_value(); -  if (y != 14) +  if (y != 10) {   PRINTF ("main: wrong result (%d).", y);   abort (); } -  if (regular != 3 || copy != 1 || move != 1) +  if (regular != 3 || copy != 0 || move != 1) {   PRINTF ("main: unexpected ctor use (R:%d, C:%d, M:%d)\n",  regular, copy, move); -- 2.24.1 -- Nathan Sidwell

Re: [PATCH] coroutines: Wrap co_await in a target expr where needed [PR95050]

2020-06-01 Thread Nathan Sidwell
r3 (std::move(r2)); +} + +int main() +{ + auto x = my_coro (); + return 0; +} -- Nathan Sidwell

Re: [PATCH] coroutines: Correct handling of references in parm copies [PR95350].

2020-06-01 Thread Nathan Sidwell
int y = x.handle.promise().get_value(); - if (y != 14) + if (y != 10) { PRINTF ("main: wrong result (%d).", y); abort (); } - if (regular != 3 || copy != 1 || move != 1) + if (regular != 3 || copy != 0 || move != 1) { PRINTF ("main: unexpected ctor use (R:%d, C:%d, M:%d)\n", regular, copy, move); -- Nathan Sidwell

Re: [PATCH] coroutines: Allow parameter packs in co_await/yield expressions [PR95345]

2020-06-01 Thread Nathan Sidwell
nd() { return {}; } + dummy_coro final_suspend() { return {}; } + void return_void() { } + void unhandled_exception() { } +}; + +template +dummy_coro +foo() +{ + ((co_await [](int){ return std::suspend_never{}; }(I)), ...); + co_return; +} + +void bar() { + foo<1>(); +} -- Nathan Sidwell

Re: [PATCH] coroutines: Fix missed ramp function return copy elision [PR95346].

2020-06-01 Thread Nathan Sidwell
n_return_type, LOOKUP_NORMAL, +tf_warning_or_error); + r = build_cplus_new (fn_return_type, r, tf_warning_or_error); missing release_tree_vector (arg) call here? -- Nathan Sidwell

Re: [PATCH] coroutines: co_returns are statements, not expressions.

2020-06-01 Thread Nathan Sidwell
he promise return_ call for Op0. */ + Op1 is the promise return_ call for for the expression given. */ -DEFTREECODE (CO_RETURN_EXPR, "co_return", tcc_expression, 2) +DEFTREECODE (CO_RETURN_EXPR, "co_return", tcc_statement, 2) /* Local variables: -- Nathan Sidwell

c++: name-lookup refactoring

2020-12-10 Thread Nathan Sidwell
ove assert. (make_namespace, make_namespace_finish): New, broken out of ... (push_namespace): ... here. Call them. Add namespace to level here. pushing to trunk nathan -- Nathan Sidwell diff --git i/gcc/cp/name-lookup.c w/gcc/cp/name-lookup.c index fa372810349..051ef0b36b1 100644

c++: modularize spelling suggestions

2020-12-10 Thread Nathan Sidwell
. (maybe_add_fuzzy_binding): Return bool true if found. (consider_binding_level): Add module support. * module.cc (get_import_bitmap): Stub. pushing to trunk -- Nathan Sidwell diff --git i/gcc/cp/module.cc w/gcc/cp/module.cc index 176286cdd91..dc4fa41bbc4 100644 --- i/gcc/cp

c++: Name lookup for modules

2020-12-10 Thread Nathan Sidwell
shing to trunk -- Nathan Sidwell diff --git i/gcc/cp/cp-tree.h w/gcc/cp/cp-tree.h index 6270fadfe2b..5304f6b86a2 100644 --- i/gcc/cp/cp-tree.h +++ w/gcc/cp/cp-tree.h @@ -6993,7 +6993,7 @@ extern void maybe_check_all_macros (cpp_reader *); extern void finish_module_processing (cpp_reader *); ext

c++: modules & using-decls

2020-12-10 Thread Nathan Sidwell
ignificant (rather than be an obscure nop). gcc/cp/ * name-lookup.c (do_nonmember_using_decl): Add INSERT_P parm. Deal with exporting using decls. (finish_nonmember_using_decl): Examine BINDING_VECTOR. pushing to trunk -- Nathan Sidwell diff --git i/gcc/cp/name-look

c++: name lookup API for modules

2020-12-10 Thread Nathan Sidwell
lookup_class_binding) (walk_module_binding, import_module_binding, set_module_binding) (note_pending_specializations, load_pending_specializations) (add_module_decl, add_imported_namespace): New. (get_cxx_dialect_name): Make extern. pushing to trunk -- Nathan Sidwell diff --git i/gcc/c

Re: [PATCH] aix: Fixinclude updates [PR98208]

2020-12-11 Thread Nathan Sidwell
{ +#endif /* AIX_PHYSADR_T_CHECK */ + I'm pretty sure this is wrong. I think the test_text in inclhack.def should be a pre-fixed string that the testsuite presumably checks is converted. -- Nathan Sidwell

c++: Module lang hook overriding

2020-12-11 Thread Nathan Sidwell
, handle_module_option) (module_preproces_options): Stubs. pushing to trunk -- Nathan Sidwell diff --git i/gcc/cp/cp-lang.c w/gcc/cp/cp-lang.c index 9e980bc6de9..5d2aef45a7d 100644 --- i/gcc/cp/cp-lang.c +++ w/gcc/cp/cp-lang.c @@ -77,6 +77,12 @@ static tree cxx_enum_underlying_base_type (const_tree

c++: cp_tree_equal tweaks

2020-12-11 Thread Nathan Sidwell
trunk -- Nathan Sidwell diff --git i/gcc/cp/cp-tree.h w/gcc/cp/cp-tree.h index 63170fc013d..f2a01d25d0c 100644 --- i/gcc/cp/cp-tree.h +++ w/gcc/cp/cp-tree.h @@ -5454,6 +5454,10 @@ extern int function_depth; in structrual_comptypes. */ extern int comparing_specializations; +/* When comp

c++: module test harness

2020-12-11 Thread Nathan Sidwell
Here is the module test harness -- but no tests. gcc/testsuite/ * g++.dg/modules/modules.exp: New. -- Nathan Sidwell diff --git c/gcc/testsuite/g++.dg/modules/modules.exp w/gcc/testsuite/g++.dg/modules/modules.exp new file mode 100644 index 000..e2fd2a7fdd0 --- /dev

c++: Refactor final cleanup

2020-12-11 Thread Nathan Sidwell
This is a small refactor of the end of decl processing, into which dropping module support will be simpler. gcc/cp/ * decl2.c (c_parse_final_cleanups): Refactor loop. pushing to trunk -- Nathan Sidwell diff --git i/gcc/cp/decl2.c w/gcc/cp/decl2.c index c122017c2fa..b13c9d9f73d

c++: Final module preparations

2020-12-11 Thread Nathan Sidwell
Call maybe_attach_decl. * module.cc (maybe_attach_decl, lazy_load_specializations): Stubs. (finish_module_procesing): Stub. * pt.c (lookup_template_class_1): Lazy load specializations. (instantiate_template_1): Likewise. pushing to trunk -- Nathan Sidwell diff --git i/gcc/cp/c

Re: C++ Module Binding Vector

2020-12-14 Thread Nathan Sidwell
On 12/11/20 3:39 PM, Jason Merrill wrote: On 12/2/20 9:19 AM, Nathan Sidwell wrote: This is modified from the original patch.  firstly it contains a few more necessary bits.  But mainly I renamed the entities from +extern tree make_binding_vec    (tree, unsigned clusters

Re: [PATCH v2] aix: Fixinclude updates [PR98208]

2020-12-14 Thread Nathan Sidwell
On 12/14/20 7:19 AM, Ilya Leoshkevich wrote: On Fri, 2020-12-11 at 07:51 -0500, Nathan Sidwell wrote: I'm pretty sure this is wrong. I think the test_text in inclhack.def should be a pre-fixed string that the testsuite presumably checks is converted. You're right; I've ad

preprocessor: Deferred macro support

2020-12-14 Thread Nathan Sidwell
field. (struct cpp_hashnode): Tweak deferred field documentation. * macro.c (_cpp_new_macro): Clear new field. (cpp_get_deferred_macro, get_deferred_or_lazy_macro): Assert more. pushing to trunk -- Nathan Sidwell diff --git i/libcpp/include/cpplib.h w/libcpp/include/cpp

c++: module-related tweak

2020-12-14 Thread Nathan Sidwell
In manually applying a name-lookup patch, I managed to transpose two calls. That caused a test failure. Fixed thusly. gcc/cp/ * name-lookup.c (do_namespace_alias): Set originating module before pushing. pushing to trunk -- Nathan Sidwell diff --git a/gcc

commit checker

2020-12-15 Thread Nathan Sidwell
Add toplevel dirs contrib/ * gcc-changelog/git_commit.py (changelog_locations): Add libcody, c++tools. pushed to trunk -- Nathan Sidwell diff --git c/contrib/gcc-changelog/git_commit.py w/contrib/gcc-changelog/git_commit.py index 0c438165516..01f49874652

c++: module mapper

2020-12-15 Thread Nathan Sidwell
. gcc/cp/ * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add mapper-client & mapper-resolver. * mapper-client.h: New. * mapper-client.cc: New. * mapper-resolver.cc: New. pushing to trunk -- Nathan Sidwell diff --git c/gcc/cp/Make-lang.in w

doc: Document C++ 20 modules

2020-12-15 Thread Nathan Sidwell
And here is the user-facing documentation. gcc/ * doc/cppopts.texi: Document new cpp opt. * doc/invoke.texi: Add C++20 module option & documentation. -- Nathan Sidwell diff --git c/gcc/doc/cppopts.texi w/gcc/doc/cppopts.texi index 7f1849d841f..e5ece92

C++ 20 modules

2020-12-15 Thread Nathan Sidwell
lease file issues in bugzilla. There are some known omissions listed in the documentation (go read it). Finally, thanks to the early testers, those that supported me in implementing such an exciting feature, and those who listened to my comments and suggestions in many WG21 meetings. nathan -- Nathan Sidwell

libcody: Fix for dash

2020-12-15 Thread Nathan Sidwell
Apparently 'var+=...' is not a dash thing. Fixed thusly. * config.m4: Avoid non-dash idiom * configure: Rebuilt. pushed (2 patches, because I didn't look carefully enough the first time) -- Nathan Sidwell diff --git i/libcody/config.m4 w/libcody/config.m4 in

libcody: Work with older gccs

2020-12-15 Thread Nathan Sidwell
Older GCCs don't have all the exciting options we have now. let's just turn them off. Makefile.in: Disable some flags -- Nathan Sidwell >From 98b960b40ba4934bdbd8d87d9432475e148d1022 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Tue, 15 Dec 2020 13:34:26

gcc_update update

2020-12-15 Thread Nathan Sidwell
I missed adding these two configure files. gcc_update: Add c++tools & libcody thanks David for pointing at the fix. nathan -- Nathan Sidwell >From c6d406f5039072938d308fe3a7fc4cd2a0bac952 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Tue, 15 Dec 2020 13:42:23 -0800

<    4   5   6   7   8   9   10   11   12   13   >