c++: omp reduction cleanups

2020-09-09 Thread Nathan Sidwell
context to global_namespace before pushing. (tsubst_omp_udr): Assert current_function_decl, add comment about decl context. pushing to trunk nathan -- Nathan Sidwell diff --git c/gcc/cp/parser.c w/gcc/cp/parser.c index 9849e59d5aa..0da383937c2 100644 --- c/gcc/cp/parser.c +++ w/gcc/c

c++: DECL_LOCAL_FUNCTION_P -> DECL_LOCAL_DECL_P

2020-09-10 Thread Nathan Sidwell
local. (type_dependent_expression_p): Use DECL_LOCAL_DECL_P. * semantics.c (finish_call_expr): Likewise. libcc1/ * licp1plugin.cc (plugin_build_call_expr): Use DECL_LOCAL_DECL_P. pushed to trunk nathan -- Nathan Sidwell diff --git c/gcc/cp/call.c w/gcc/cp/call.c index 61bbb3

gcc git hook

2020-09-10 Thread Nathan Sidwell
Is it possible for the git hooks to reject pushes with overly-long subject lines? I occasionally see pushes that forgot to add a separate title line, and so the whole of the commit description gets used. nathan -- Nathan Sidwell

c++: TINFO_VAR_DECLARED_CONSTINIT -> DECL_DECLARED_CONSTINIT_P

2020-09-10 Thread Nathan Sidwell
* decl.c (start_decl): No need to retrofit_lang_decl for constinit flag. (cp_finish_decl): Use DECL_DECLARED_CONSTINIT_P. * pt.c (tsubst_decl): No need to handle constinit flag propagation. (tsubst_expr): Or here. pushed to trunk, nathan -- Nathan Sidw

Re: gcc git hook

2020-09-10 Thread Nathan Sidwell
On 9/10/20 1:21 PM, Joseph Myers wrote: On Thu, 10 Sep 2020, Nathan Sidwell wrote: Is it possible for the git hooks to reject pushes with overly-long subject lines? I occasionally see pushes that forgot to add a separate title line, and so the whole of the commit description gets used. Is

Re: c++: TINFO_VAR_DECLARED_CONSTINIT -> DECL_DECLARED_CONSTINIT_P

2020-09-10 Thread Nathan Sidwell
On 9/10/20 12:58 PM, Marek Polacek via Gcc-patches wrote: On Thu, Sep 10, 2020 at 12:39:36PM -0400, Nathan Sidwell wrote: We need to record whether template function-scope static decls are constinit. That's currently held on the var's TEMPLATE_INFO data. But I want to get rid of s

Re: [PATCH] c++: Remove LOOKUP_CONSTINIT.

2020-09-11 Thread Nathan Sidwell
flags) /* [dcl.constinit]/2 "If a variable declared with the constinit specifier has dynamic initialization, the program is ill-formed." */ - if (flags & LOOKUP_CONSTINIT) + if (DECL_DECLARED_CONSTINIT_P (decl)) { error_at (location_of (decl), "% variable %qD does not have a constant " base-commit: b7028f060c6760b336b416897412e327ded12ab5 -- Nathan Sidwell

objc++: Always pop scope with method definitions [PR97015]

2020-09-11 Thread Nathan Sidwell
djust expected errors. pushed -- Nathan Sidwell diff --git c/gcc/cp/parser.c w/gcc/cp/parser.c index fed16895b42..fba3fcc0c4c 100644 --- c/gcc/cp/parser.c +++ w/gcc/cp/parser.c @@ -32980,44 +32980,42 @@ cp_parser_objc_method_prototype_list (cp_parser* parser) static void cp_parser_objc_method_definition

c++: Concepts and local externs

2020-09-11 Thread Nathan Sidwell
I discovered that we'd accept constraints on block-scope function decls inside templates. This fixes that. gcc/cp/ * decl.c (grokfndecl): Don't attach to local extern. gcc/testsuite/ * concepts/local-extern.C: New. pushed to trunk nathan -- Nathan Si

structurally compare type_arg_packs [93933]

2020-02-25 Thread Nathan Sidwell
where I need to merge global module entities. nathan -- Nathan Sidwell 2020-02-25 Nathan Sidwell PR c++/93933 * pt.c (template_parm_to_arg): TYPE_ARGUMENT_PACKS are structural. (coerce_template_parameter_pack, make_argument_pack) (tsubst_argument_pack, tsubst, type_unification_real) (unify

Re: [PATCH] coroutines: Amend parameter handling to match n4849.

2020-02-26 Thread Nathan Sidwell
(CLASSTYPE_CONSTRUCTORS (t)); iter; ++iter) +if (copy_fn_p (*iter) && !DECL_DELETED_FN (*iter)) + return true; + return false; +} Please put this in class.c next to the non deleted move ctor variant. Needs a comment. Ok with those changes, no need to re-review. nathan -- Nathan Sidwell

Re: [PATCH Coroutines]Insert the default return_void call at correct position

2020-02-27 Thread Nathan Sidwell
-return_void.C: New. ok, thanks! nathan -- Nathan Sidwell

Re: [PATCH, v3] wwwdocs: e-mail subject lines for contributions

2020-02-27 Thread Nathan Sidwell
e brief summary. Also, use the shortened form, as the topic part is more usefully conveyed in the proper topic field (see above). I've not seen any follow-up to this version.  Should we go ahead and adopt this? do it! do it! do it! do it! nathan -- Nathan Sidwell

[PATCH] Fix broken assert

2020-02-27 Thread Nathan Sidwell
lying this this to fix the original assert, and assert nulls never make it to comptypes. nathan -- Nathan Sidwell 2020-02-27 Nathan Sidwell * class.c (adjust_clone_args): Correct arg-checking assert. * typeck.c (comptypes): Assert not nulls. diff --git i/gcc/cp/class.c w/gcc/cp/class.c

Re: structurally compare type_arg_packs [93933]

2020-02-27 Thread Nathan Sidwell
On 2/26/20 5:00 PM, Jason Merrill wrote: On 2/25/20 4:09 PM, Nathan Sidwell wrote: We consider all TYPE_ARGUMENT_PACKS distinct types, leading to problems with redeclarations. I'd think that the bug is that we're treating them as types in the first place; they aren't types, so

Re: [PATCH] coroutines: Don't make duplicate frame copies of awaitables.

2020-03-02 Thread Nathan Sidwell
ise a frame var with itself. (transform_await_expr): Only substitute the awaitable frame var if it's needed. (register_awaits): Do not make frame copies for param or local vars that are awaitables. ok -- Nathan Sidwell

Re: [PATCH, v3] wwwdocs: e-mail subject lines for contributions

2020-03-02 Thread Nathan Sidwell
On 3/2/20 8:01 AM, Richard Earnshaw (lists) wrote: On 27/02/2020 13:37, Nathan Sidwell wrote: On 2/3/20 6:41 AM, Richard Earnshaw (lists) wrote: On 22/01/2020 17:45, Richard Earnshaw (lists) wrote: [updated based on v2 discussions] This patch proposes some new (additional) rules for email

Re: [PATCH] coroutines: Update lambda capture handling to n4849.

2020-03-02 Thread Nathan Sidwell
ifetime extension of lambda capture-by-copy vars. ok -- Nathan Sidwell

Re: [PATCH Coroutines]Pickup more CO_AWAIT_EXPR expanding cases

2020-03-02 Thread Nathan Sidwell
-02-10 Bin Cheng * coroutines.cc (co_await_expander): Simplify. ok -- Nathan Sidwell

Re: [PATCH coroutines v1] Build co_await/yield_expr with unknown_type in processing_template_decl phase

2020-03-02 Thread Nathan Sidwell
*pt.c (type_dependent_expression_p): Set co_await/yield_expr     with unknown type as dependent. gcc/testsuite 2020-02-05  Jun Ma     * g++.dg/coroutines/torture/co-await-14-template-traits.C: New test. ok -- Nathan Sidwell

Re: [PATCH coroutines] Handle component_ref in captures_temporary

2020-03-02 Thread Nathan Sidwell
inue; Either a separate if, or merging both ifs (my preference) would be better. nathan -- Nathan Sidwell

Re: [PATCH coroutines] Handle component_ref in captures_temporary

2020-03-03 Thread Nathan Sidwell
On 3/3/20 12:42 AM, JunMa wrote: 在 2020/3/2 下午10:49, Nathan Sidwell 写道: On 2/12/20 2:23 AM, JunMa wrote: Hi nathan Here is the updated patch This is ok, with a correction in a comment: + /* This isn't a temporary or argument. */ /* This isn't a temporary. */ is

[PR94027] ICE in mangling

2020-03-06 Thread Nathan Sidwell
Now same_type_p rejects argument packs, we need to be more careful calling it with template argument vector contents. The mangler needs to do some comparisons to find the special substitutions. While that code looks a little ugly, this seems the smallest fix. nathan -- Nathan Sidwell 2020

ODR violation in ranges

2020-03-11 Thread Nathan Sidwell
t the same! As you can guess, I can't turn this into a header unit (well, I can, but merging duplicates complains at you) nathan -- Nathan Sidwell

Re: ODR violation in ranges

2020-03-11 Thread Nathan Sidwell
#x27;_ZNKUliE_clEi' sigh, nathan From: Libstdc++ on behalf of Jonathan Wakely via Libstdc++ Sent: Wednesday, March 11, 2020 10:26 To: Nathan Sidwell Cc: libstd...@gcc.gnu.org; GCC Patches Subject: Re: ODR violation in ranges On 11/03/20 06:

Re: ODR violation in ranges

2020-03-11 Thread Nathan Sidwell
On 3/11/20 11:23 AM, Jason Merrill wrote: On Wed, Mar 11, 2020 at 11:05 AM Nathan Sidwell <mailto:nat...@acm.org>> wrote: On 3/11/20 6:56 AM, Tam S. B. wrote: > IIUC using lambda in inline variable initializer is not ODR violation. This is covered in CWG 2300 ( htt

[PR c++/94147] Lamdas attached to global variables

2020-03-12 Thread Nathan Sidwell
ommit in a few days if there are no comments. nathan -- Nathan Sidwell 2020-03-12 Nathan Sidwell PR c++/94147 - mangling of lambdas assigned to globals * parser.c (cp_parser_init_declarator): Namespace-scope variables provide a lambda scope. * tree.c (no_linkage_check): Lambdas with a varia

[PR 94044] ICE with sizeof & argument pack

2020-03-20 Thread Nathan Sidwell
tion. nathan -- Nathan Sidwell 2020-03-20 Nathan Sidwell PR c++/94044 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack operand. diff --git i/gcc/cp/tree.c w/gcc/cp/tree.c index da2e7fdcca3..b85967e1bfa 100644 --- i/gcc/cp/tree.c +++ w/gcc/cp/tree.c @@ -3802,9 +3802,13 @@ cp_tree_e

Re: [PR 94044] ICE with sizeof & argument pack

2020-03-23 Thread Nathan Sidwell
introduced. On Mon, Mar 23, 2020 at 2:27 AM Jim Wilson wrote: On Fri, Mar 20, 2020 at 8:41 AM Nathan Sidwell wrote: If it could be tested on arm &| riscv, that'd be additional verification. I did riscv testing, both cross and native, and didn't see any new problems with the patch.

Re: [PATCH] coroutines: Implement n4849 recommended symmetric transfer.

2020-03-24 Thread Nathan Sidwell
cleanup_point_expr_void (r); Shouldn't there be no cleanups? Perhaps assert it didn't add any? + add_stmt (r); + /* We need the resume index to work with. */ tree res_idx_m = lookup_member (coro_frame_type, resume_idx_name, nathan -- Nathan Sidwell

Re: [PATCH] coroutines: Implement n4849 recommended symmetric transfer.

2020-03-24 Thread Nathan Sidwell
correctly? OK for master now? thanks Iain Nathan Sidwell wrote: On 3/20/20 11:40 AM, Iain Sandoe via Gcc-patches wrote: tree suspend = TREE_VEC_ELT (awaiter_calls, 1); /* await_suspend(). */ + tree susp_type; + if (TREE_CODE (suspend) == CALL_EXPR) +{ + susp_type = CALL_EXPR_FN

Re: [PATCH] coroutines: Implement n4849 recommended symmetric transfer.

2020-03-25 Thread Nathan Sidwell
perhaps adding is ok anyway? nathan -- Nathan Sidwell

Re: [PATCH] coroutines: Implement n4849 changes to exception handling.

2020-03-25 Thread Nathan Sidwell
'idx'. Also, why is it a runtime variable? you're setting it from a compile time constant -- just propagate the constant? I'm finding this name too confusing to review properly. nathan -- Nathan Sidwell

preprocessor: Better line info for &

2020-07-07 Thread Nathan Sidwell
* c-c++-common/cpp/line-3.c: New. * c-c++-common/cpp/line-4.c: New. * c-c++-common/cpp/line-4.h: New. -- Nathan Sidwell diff --git c/ChangeLog w/ChangeLog index 8c254769017..481f54a856e 100644 --- c/ChangeLog +++ w/ChangeLog @@ -1,3 +1,28 @@ +2020-07-07 Nat

testsuite: missed testcase

2020-07-07 Thread Nathan Sidwell
I discovered I'd missed applying a testcase when fixing up the EOF token location a while back. gcc/testsuite/ * c-c++-common/cpp/pragma-eof.c: New -- Nathan Sidwell diff --git c/gcc/testsuite/c-c++-common/cpp/pragma-eof.c w/gcc/testsuite/c-c++-common/cpp/pragma-eof.c new

Re: testsuite: missed testcase

2020-07-10 Thread Nathan Sidwell
On 7/10/20 10:28 AM, Christophe Lyon wrote: Hi, On Tue, 7 Jul 2020 at 20:47, Nathan Sidwell wrote: I discovered I'd missed applying a testcase when fixing up the EOF token location a while back. gcc/testsuite/ * c-c++-common/cpp/pragma-eof.c: New The new tes

Re: [PATCH] c++: Fix tentative parsing of enum-specifier [PR96077]

2020-07-13 Thread Nathan Sidwell
(with the typo Jakub noticed fixed :) does this also fix 95288? gcc/cp/ChangeLog: PR c++/96077 * parser.c (cp_parser_enum_specifier): Commit to tentative parse after we've seen an opening brace. gcc/testsuite/ChangeLog: PR c++/96077 * g++.dg/parse/e

testsuite: Fix scan-lang-dump-not

2020-07-13 Thread Nathan Sidwell
pushed as obvious turned out scan-lang-dump-not was broken in the 3 argument case -- I'd missed a necessary empty arg. Fixed thusly. gcc/testsuite/ * lib/scanlang.exp (scan-lang-dump-not): Fix 3-arg case. -- Nathan Sidwell diff --git c/gcc/testsuite/lib/scanlan

Re: [PATCH] c++: Fix tentative parsing of enum-specifier [PR96077]

2020-07-13 Thread Nathan Sidwell
On 7/13/20 11:15 AM, Marek Polacek wrote: On Mon, Jul 13, 2020 at 10:08:52AM -0400, Nathan Sidwell wrote: On 7/10/20 11:43 AM, Marek Polacek via Gcc-patches wrote: Here's an interesting issue: in this code a ) is missing: enum { E = (2 } e; but we compile the code anyway, and E is s

makefile cleanup

2020-07-13 Thread Nathan Sidwell
I discovered we were deleting cxxmain.c, which we generated at some point in time. Not anymore. nathan -- Nathan Sidwell diff --git c/gcc/Makefile.in w/gcc/Makefile.in index d5dcc03d59b..2ba76656dbf 100644 --- c/gcc/Makefile.in +++ w/gcc/Makefile.in @@ -3501,7 +3501,6 @@ distclean: clean

testsuite: scan-lang-dump-times & scan-lang-dump-not

2020-07-13 Thread Nathan Sidwell
ang-dump-times, scan-lang-dump-not): New. nathan -- Nathan Sidwell diff --git c/gcc/testsuite/lib/scanlang.exp w/gcc/testsuite/lib/scanlang.exp index d9f8c1e6e83..b85ec681666 100644 --- c/gcc/testsuite/lib/scanlang.exp +++ w/gcc/testsuite/lib/scanlang.exp @@ -35,6 +35,56 @@ proc scan-lang-dump { ar

doc: fix a couple of typos

2020-07-14 Thread Nathan Sidwell
. pushing to trunk -- Nathan Sidwell diff --git i/gcc/doc/gty.texi w/gcc/doc/gty.texi index 9414d3cc48c..f5c310414dc 100644 --- i/gcc/doc/gty.texi +++ w/gcc/doc/gty.texi @@ -250,7 +250,7 @@ for more information. @findex cache @item cache -When the @code{cache} option is applied to a global variable

core: tree-node comments and robustify

2020-07-14 Thread Nathan Sidwell
ng on 64-bits * tree.c (cache_integer_cst): Note why no caching of enum literals. (get_tree_code_name): Robustify error case. pushing to trunk -- Nathan Sidwell diff --git i/gcc/tree-core.h w/gcc/tree-core.h index 8c5a2e3c404..ba7f9ceb205 100644 --- i/gcc/tree-core.h +++

core: comment & formatting

2020-07-14 Thread Nathan Sidwell
ng to trunk -- Nathan Sidwell diff --git i/gcc/hash-map.h w/gcc/hash-map.h index 5b8fd184e32..6bf3dc64816 100644 --- i/gcc/hash-map.h +++ w/gcc/hash-map.h @@ -177,7 +177,8 @@ public: return !ins; } - /* if the passed in key is in the map return its value otherwise NULL. */ + /* I

c++: comments & formatting

2020-07-14 Thread Nathan Sidwell
al_comptypes): Add comment. pushing to trunk -- Nathan Sidwell diff --git i/gcc/cp/class.c w/gcc/cp/class.c index 14380c7a08c..c49055d384e 100644 --- i/gcc/cp/class.c +++ w/gcc/cp/class.c @@ -4708,6 +4708,10 @@ check_methods (tree t) } } +/* FN is constructor, destructor or operator fu

c++: refactor a few class.c fns

2020-07-14 Thread Nathan Sidwell
PE_AS_BASE. (build_self_reference): Rename value -> decl. (dump_class_hierarchy_1): Cache CLASSTYPE_AS_BASE. pushed -- Nathan Sidwell diff --git i/gcc/cp/class.c w/gcc/cp/class.c index c49055d384e..803b33bf346 100644 --- i/gcc/cp/class.c +++ w/gcc/cp/class.c @@ -4456,9 +4456,10 @@ build_base_fi

c++: tree dumper

2020-07-14 Thread Nathan Sidwell
A couple of C++ nodes were unknown to the tree dumper. gcc/cp/ * ptree.c (cxx_print_type): Add TYPEOF_TYPE and BASES. pushed -- Nathan Sidwell diff --git i/gcc/cp/ptree.c w/gcc/cp/ptree.c index 7d329049549..224cf14edb5 100644 --- i/gcc/cp/ptree.c +++ w/gcc/cp/ptree.c

c++: Parser initialization cleanup

2020-07-14 Thread Nathan Sidwell
, change error message to avoid C++20 module confusion. pushed -- Nathan Sidwell diff --git i/gcc/cp/parser.c w/gcc/cp/parser.c index 9e32a3c7772..08cfd23d8c4 100644 --- i/gcc/cp/parser.c +++ w/gcc/cp/parser.c @@ -212,7 +212,7 @@ static int cp_lexer_saving_tokens static cp_token *cp_le

Re: [PATCH v3] c++: Make convert_like complain about bad ck_ref_bind again [PR95789]

2020-07-14 Thread Nathan Sidwell
d.a=1; +} + +template void Templated_Function(){ +vector A; +A.push_back(Modify_Dummy(dummy{0})); // { dg-error "cannot bind non-const lvalue reference" } +} + +int main(){ +Templated_Function(); +} base-commit: 9cba898481368ce16c6a2d30ef781a82dce27c55 -- Nathan Sidwell

c++: error recovery & pragmas

2020-07-15 Thread Nathan Sidwell
p_declare_simd): Likewise. (cp_parser_omp_declare_reduction, cp_parser_oacc_routine) (pragma_lex): Likewise. gcc/testsuite/ * g++.dg/parse/pragma-recovery.C: New. pushed -- Nathan Sidwell diff --git c/gcc/cp/parser.c w/gcc/cp/parser.c index 08cfd23d8c4..153

c++: refactor some parser code

2020-07-15 Thread Nathan Sidwell
that case. gcc/cp/ * parser.c (cp_parser_declaration): Avoid copying tokens. (cp_parser_block_declaration): RAII token pointer. pushed -- Nathan Sidwell diff --git i/gcc/cp/parser.c w/gcc/cp/parser.c index 1532431378e..11db02418bc 100644 --- i/gcc/cp/parser.c ++

Re: [PATCH] analyzer: Fix -Wanalyzer-possible-null-argument warning

2020-07-16 Thread Nathan Sidwell
st for warnings, line 26) PASS: g++.dg/analyzer/pr94028.C  -std=c++98  (test for warnings, line 33) PASS: g++.dg/analyzer/pr94028.C  -std=c++98 (test for excess errors) -- Nathan Sidwell

Re: [PATCH] c++: Get rid of convert_like* macros.

2020-07-16 Thread Nathan Sidwell
On 7/15/20 6:59 PM, Marek Polacek wrote: The convert_like* macros were introduced in 2000-03-05 Nathan Sidwell * call.c (convert_like): Macrofy. (convert_like_with_context): New macro. but now we can use overloading so we can do away with the macros. I've also taken

Re: [PATCH] coroutines: Correct frame capture of compiler temps [PR95591+4].

2020-07-16 Thread Nathan Sidwell
mespace, it has external linkage, and hence ripe for ODR breakage, if some other TU is interested about something else :) Is there a more specific name it could have? + else if ((tmp_target_expr_p (expr) + && !p->temps_used->contains (expr))) too many parens here. nathan -- Nathan Sidwell

Re: [PATCH] coroutines: Correct frame capture of compiler temps [PR95591+4].

2020-07-17 Thread Nathan Sidwell
On 7/17/20 3:37 AM, Richard Biener wrote: On Thu, Jul 16, 2020 at 7:39 PM Nathan Sidwell wrote: On 7/16/20 11:56 AM, Iain Sandoe wrote: Hello folks, It's unfortunate the original plan of handling lifetime issues in a gimple pass didn't work out. OK for master? OK for 10.x?

preprocessor: line-map tidying

2020-07-20 Thread Nathan Sidwell
rflow calculation. Add comment about range and column bit init. (linemap_ordinary_map_lookup): Refactor for RAII (linemap_macro_map_lookup): Likewise. pushed -- Nathan Sidwell diff --git i/libcpp/line-map.c w/libcpp/line-map.c index 8a390d0857b..a8d52861dee 100644

Re: pragma-eof.c

2020-07-20 Thread Nathan Sidwell
directive had line number of the last line in the file (without EOL) and the added line changed that. I've committed following, tested on x86_64-linux, committed to trunk as obvious. thanks jakub! -- Nathan Sidwell

c++: Fix scan forward over pragma [PR96257]

2020-07-21 Thread Nathan Sidwell
EOL assert. (cp_parser_skip_to_closing_parenthesis_1): Only pass start token to pragma skipper if recovering. (cp_parser_skip_to_pragma_eol): Only purge and change pragma state when recovering. gcc/testsuite/ * g++.dg/parse/pr96257.C: New. pushed -- Nath

c++: mangler simplifications

2020-07-22 Thread Nathan Sidwell
ocal check. -- Nathan Sidwell diff --git i/gcc/cp/mangle.c w/gcc/cp/mangle.c index 43ff2e84db5..9fd30011288 100644 --- i/gcc/cp/mangle.c +++ w/gcc/cp/mangle.c @@ -170,7 +170,7 @@ integer_type_codes[itk_none] = '\0', '\0', '\0', '\0', '\0', '\0

preprocessor: add_path simplification

2020-07-22 Thread Nathan Sidwell
I noticed add_path was calling strlen more than once on the same string. Let's not do that. gcc/ * incpath.c (add_path): Avoid multiple strlen calls. -- Nathan Sidwell diff --git i/gcc/incpath.c w/gcc/incpath.c index 8a2bda00f80..8437939bf1e 100644 --- i/gcc/incp

c++: Shrink lambda-expr

2020-07-22 Thread Nathan Sidwell
s per function. I know, users are strange :) On a 64 bit system this saves 64 bits, because we also had 32 bits of padding added. gcc/cp/ * cp-tree.h (struct tree_lambda_expr): Shrink default_capture_mode & discriminator. -- Nathan Sidwell diff --git i/gcc/cp/

c++: More modern C++ variable decls

2020-07-22 Thread Nathan Sidwell
e true for truthiness. * error.c (dump_aggr_type): Hold the decl in a var called 'decl', not 'name'. nathan -- Nathan Sidwell diff --git i/gcc/cp/decl.c w/gcc/cp/decl.c index db91b50a4f0..24cfb8e4b27 100644 --- i/gcc/cp/decl.c +++ w/gcc/cp/decl.c @@ -974,

c++: structural_comptypes addition

2020-07-22 Thread Nathan Sidwell
cc/cp/ * typeck.c (structural_comptypes): [DECLTYPE_TYPE] break apart complex if. [UNDERLYING_TYPE]: Use an if. [TYPEOF_TYPE]: New. nathan -- Nathan Sidwell diff --git i/gcc/cp/typeck.c w/gcc/cp/typeck.c index 589e014f855..adc088ce1d7 100644 --- i/gcc/cp/typ

dumpfile: filenames containing -

2020-07-22 Thread Nathan Sidwell
I discovered the dump machinery would get confused by filenames containing '-'. Fixed thusly as obvious. gcc/ * dumpfile.c (parse_dump_option): Deal with filenames containing '-' nathan -- Nathan Sidwell diff --git i/gcc/dumpfile.c w/

c++: Don't add enums to class's decl_list

2020-07-22 Thread Nathan Sidwell
We don't need to add CONST_DECLs to a template decl's decl list. Also made the code flow a bit clearer. gcc/cp/ * class.c (maybe_add_class_template_decl_list): Don't add CONST_DECLs. nathan -- Nathan Sidwell diff --git i/gcc/cp/class.c w/gcc/c

c++: Name as_base type

2020-07-22 Thread Nathan Sidwell
BASE_IDENTIFIER. (as_base_identifier): Define. * decl.c (initialize_predifined_identifiers): Initialize as_base identifier. * class.c (layout_class_type): Name the as-base type. Zap NSDMI its fields may have. -- Nathan Sidwell diff --git i/gcc/cp/c

c-family: Use strcmp to compare location file names

2020-07-27 Thread Nathan Sidwell
.dg/lookup/missing-std-include-11.C: New. pushing ... -- Nathan Sidwell diff --git c/gcc/c-family/c-common.c w/gcc/c-family/c-common.c index 51ecde69f2d..98b80d56cae 100644 --- c/gcc/c-family/c-common.c +++ w/gcc/c-family/c-common.c @@ -8764,8 +8764,7 @@ c_family_tests (void) #endif /* #if

Re: [PATCH] c++: Fix up cp_lexer_safe_previous_token [PR96328]

2020-07-28 Thread Nathan Sidwell
though we don't have a testcase that would ICE. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? ok, thanks! nathan -- Nathan Sidwell

Re: [PATCH] libcpp: Fix up raw string literal parsing error-recovery [PR96323]

2020-07-28 Thread Nathan Sidwell
x and i686-linux, ok for trunk? ok, thanks! It's hard to think of all the wrong ways code can be written! nathan -- Nathan Sidwell

preprocessor: simplify read_main

2020-07-28 Thread Nathan Sidwell
We can always use the final map to get the return value, rather than conditionally only when there was an immediate line directive. libcpp/ * init.c (cpp_read_main_file): Always use the last map for the return value. pushed -- Nathan Sidwell diff --git i

testsuite: Fix spello

2020-07-28 Thread Nathan Sidwell
'Patterns' has one 'r'. gcc/testsuite/ * lib/options.exp: Fix spello pushing as obvious. -- Nathan Sidwell diff --git i/gcc/testsuite/lib/options.exp w/gcc/testsuite/lib/options.exp index 44ea51075bc..c7f7316943e 100644 --- i/gcc/testsuite/lib/o

c++: tree dump indentation

2020-07-28 Thread Nathan Sidwell
We were always forcing an indent, even if there was nothing to indent. Fixed thusly. gcc/cp/ * ptree.c (cxx_print_decl): Better indentation. pushing -- Nathan Sidwell diff --git i/gcc/cp/ptree.c w/gcc/cp/ptree.c index 224cf14edb5..dfc244fdceb 100644 --- i/gcc/cp

c++: better fixup_type_variants

2020-07-28 Thread Nathan Sidwell
. (finish_struct): Call it. nathan -- Nathan Sidwell diff --git i/gcc/cp/class.c w/gcc/cp/class.c index ba96113bc88..7a25d8fc76c 100644 --- i/gcc/cp/class.c +++ w/gcc/cp/class.c @@ -1967,6 +1967,9 @@ fixup_type_variants (tree t) /* Copy whatever these are holding today. */ TYPE_VFIELD

c++: Set more DECL_CONTEXTs

2020-07-28 Thread Nathan Sidwell
.c (cp_pushdecl): Set decl's context. * decl.c (grokfndecl): Make DECL_CONTEXT setting clearer. -- Nathan Sidwell diff --git i/gcc/cp/cp-gimplify.c w/gcc/cp/cp-gimplify.c index 0e949e29c5c..f8695835684 100644 --- i/gcc/cp/cp-gimplify.c +++ w/gcc/cp/cp-gimplify.c @@ -1495,6 +1495,

Re: [PATCH 0/2] cpp: fix __has_include in traditional mode

2020-07-29 Thread Nathan Sidwell
reate mode 100644 gcc/testsuite/c-c++-common/cpp/has-include-1-traditional.c -- Nathan Sidwell

docs: refer to c++20

2020-08-03 Thread Nathan Sidwell
I noticed a bunch of references to c++2a. fixed thusly gcc/ * doc/invoke.texi: Refer to c++20 nathan -- Nathan Sidwell diff --git i/gcc/doc/invoke.texi w/gcc/doc/invoke.texi index eb73f306051..4aa492452ae 100644 --- i/gcc/doc/invoke.texi +++ w/gcc/doc/invoke.texi

c++: fix template parm count leak

2020-08-04 Thread Nathan Sidwell
* g++.dg/template/pr39425.C: Adjust errors, (unbounded template recursion). * g++.old-deja/g++.pt/spec20.C: Remove fallout diagnostics. pushed, nathan -- Nathan Sidwell diff --git i/gcc/cp/parser.c w/gcc/cp/parser.c index ab088874ba7..9946acdb42f 100644 --- i/gcc/cp/parser.c +++

Re: [PATCH] c++: Template keyword following :: [PR96082]

2020-08-04 Thread Nathan Sidwell
the error. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/10/9? Why would anyone write that? Users are more ... imaginative than you or me! The patch is OK. nathan -- Nathan Sidwell

Re: RFC: Monitoring old PRs, new dg directives

2020-08-05 Thread Nathan Sidwell
, I don't care). I don't want to see the ICEs of tests that are expected to ICE. I think that means there has to be a positive marker on the unexpected ICEs, rather than lack of an expected marker on them. nathan -- Nathan Sidwell

Re: RFC: Monitoring old PRs, new dg directives

2020-08-06 Thread Nathan Sidwell
On 8/5/20 7:29 PM, Marek Polacek wrote: On Wed, Aug 05, 2020 at 11:03:08AM -0400, Nathan Sidwell wrote: On 8/4/20 8:54 PM, Marek Polacek via Gcc-patches wrote: On Tue, Aug 04, 2020 at 03:33:23PM -0700, Mike Stump wrote: I think the read of the room is that people think it would be generally

Re: RFC: Monitoring old PRs, new dg directives

2020-08-07 Thread Nathan Sidwell
On 8/6/20 8:01 PM, Mike Stump wrote: On Aug 6, 2020, at 7:01 AM, Nathan Sidwell wrote: XFAIL: g++.dg/foo.C -std=c++17 (internal compiler error) PASS: g++.dg/foo.C -std=c++17 (test for excess errors) Which one of these would you not like to see? Neither of these is solving the issue. How

Re: RFC: Monitoring old PRs, new dg directives

2020-08-07 Thread Nathan Sidwell
On 8/6/20 6:55 PM, Marek Polacek wrote: On Thu, Aug 06, 2020 at 10:01:37AM -0400, Nathan Sidwell wrote: On 8/5/20 7:29 PM, Marek Polacek wrote: On Wed, Aug 05, 2020 at 11:03:08AM -0400, Nathan Sidwell wrote: On 8/4/20 8:54 PM, Marek Polacek via Gcc-patches wrote: On Tue, Aug 04, 2020 at 03

Re: [PATCH v2] coroutines: Implement n4849 changes to exception handling.

2020-03-26 Thread Nathan Sidwell
ction body. This (channelling Sandra) user-authored, I think? only need to exercise the initial Otherwise fine -- no cognative dissonance on variable name vs meaning :) ok, thanks nathan -- Nathan Sidwell

Re: [PATCH v3] coroutines: Implement n4849 recommended symmetric transfer.

2020-03-26 Thread Nathan Sidwell
On 3/25/20 5:40 PM, Iain Sandoe wrote: Nathan Sidwell wrote: On 3/24/20 2:08 PM, Iain Sandoe wrote: tree suspend = TREE_VEC_ELT (awaiter_calls, 1); /* await_suspend(). */ + tree susp_type; + if (tree fndecl = cp_get_callee_fndecl_nofold (suspend)) +susp_type = TREE_TYPE

[PR c++/94257] Fix ICE with ambiguous inline namespaces

2020-03-27 Thread Nathan Sidwell
r. nathan -- Nathan Sidwell 2020-03-27 Nathan Sidwell PR c++/94257 * name-lookup.c (push_namespace): Triage ambiguous lookups that contain namespaces. diff --git c/gcc/cp/name-lookup.c w/gcc/cp/name-lookup.c index d00bb5fbfa6..e6dfb9cc723 100644 --- c/gcc/cp/name-lookup.c +++ w/gcc/cp/name-

[C++ PR/84733] ICE popping local binding

2020-03-27 Thread Nathan Sidwell
inding in both cases. nathan -- Nathan Sidwell 2020-03-27 Nathan Sidwell PR c++/84733 * name-lookup.c (do_pushdecl): Look through cleanp levels. diff --git c/gcc/cp/name-lookup.c w/gcc/cp/name-lookup.c index e6dfb9cc723..8dd0b0d723e 100644 --- c/gcc/cp/name-lookup.c +++ w/gcc/cp/name

linkage of lambda types

2020-04-01 Thread Nathan Sidwell
se we might want the above to have a pseudo-external linkage -- IIRC we don't correctly give templates instantiated from non-external types internal linkage, so we have to either guarantee unique mangling or guarantee same typeness. What am I missing? nathan -- Nathan Sidwell

Re: [PATCH] Check DECL_CONTEXT of new/delete operators.

2020-04-06 Thread Nathan Sidwell
perator new/deletes. The rules are pretty much as you can guess -- one lifetime must be entirely within the other. If inner one's ctor throws, the exception path must destroy the outer. does that help? nathan -- Nathan Sidwell

Re: [PATCH] Check DECL_CONTEXT of new/delete operators.

2020-04-07 Thread Nathan Sidwell
On 4/7/20 7:29 AM, Jonathan Wakely wrote: On Mon, 6 Apr 2020 at 13:45, Nathan Sidwell wrote: The both operator new and operator delete are looked up in the same manner. The std does not require a 'matching pair' be found. but it is extremely poor form for a class to declare exac

Re: [PING PATCH coroutines] Do not strip cleanup_point when promote temporaries out of current stmt

2020-04-08 Thread Nathan Sidwell
_statement_current); BIND_EXPR_BODY (aw_bind) = pop_stmt_list (aw_bind_body); awpts->captured_temps.empty (); ok -- Nathan Sidwell

[PR C++ 94426] Lambda linkage

2020-04-10 Thread Nathan Sidwell
nkage), the variable will have internal linkage, regardless of the linkage of the template it is instantiated from. We need to know that before instantiating the lambda, so we can restrict its linkage correctly. I'll commit this in a few days. nathan -- Nathan Sidwell 2020-04-10 Nathan Sidw

Re: [PATCH] coroutines: Fix compile error with symmetric transfers [PR94359]

2020-04-13 Thread Nathan Sidwell
calls (or equivalent) to take place - but that will be deferred until next stage 1. This is fine from my PoV for gcc 10. nathan -- Nathan Sidwell

Re: [PR C++ 94426] Lambda linkage

2020-04-16 Thread Nathan Sidwell
On 4/16/20 6:50 AM, Iain Sandoe wrote: Hi Nathan, Iain Sandoe wrote: Nathan Sidwell wrote: My fix for 94147 was confusing no-linkage with internal linkage, at the language level. That's wrong. (the std is confusing here, because it describes linkage of names (which is wrong)

Re: [PATCH] coroutines: Backout mandate for tailcalls at O < 2 [PR94359]

2020-04-16 Thread Nathan Sidwell
ed on x86_64-linux/darwin, powerpc64-linux, sparc-solaris11) OK for master? thanks Iain OK. will you leave 94359 open, or is there a separate bug for the lack of generalized symmetric xfer? nathan -- Nathan Sidwell

[PR94454] specialization hashtable inconsistencies

2020-04-16 Thread Nathan Sidwell
ttp.diff applied bug pack.diff not. I did get several fails in the g++ and libstdc++ testsuites with shim.diff applied, and none of the fixes. nathan -- Nathan Sidwell 2020-04-16 Nathan Sidwell PR 94454 - specialization hash inconsistencies * pt.c (iterative_hash_template_arg): Strip nod

c++: avoid testcase warning on arm

2020-04-17 Thread Nathan Sidwell
I've pushed this patch to avoid a warning introduced by 94426's change to linkage of lambda. The arm eabi wants to emit the vtable, other abis don't. nathan -- Nathan Sidwell diff --git i/gcc/testsuite/ChangeLog w/gcc/testsuite/ChangeLog index dd2cb04916f..b98c72cdd2a 1

Re: [PATCH] coroutines: Fix handling of ramp return value [PR94661]

2020-04-20 Thread Nathan Sidwell
omputation. ok, thanks -- Nathan Sidwell

Re: [PATCH] coroutines: Fix STRIP_NOPS usage.

2020-04-20 Thread Nathan Sidwell
thanks for catching it. -- Nathan Sidwell

Re: [PATCH] coroutines: Pass class reference to promise param preview [PR94682]

2020-04-21 Thread Nathan Sidwell
estsuite/g++.dg/coroutines/promise-parm-preview-this.C + future foo(int param) { co_return 0; } +}; \ No newline at end of file ^ needs a new line nathan -- Nathan Sidwell

C++: ICE tsubsting ptr_plus

2020-04-21 Thread Nathan Sidwell
A colleague hit an ICE when build_pointer_plus exploded. tsubsting the pointer operand produced error_mark_node, and b_p_p is unprepared for that. pushed to trunk nathan -- Nathan Sidwell 2020-04-21 Nathan Sidwell * pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for

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