Daily bump.
[gcc.git] / gcc / cp / ChangeLog
1 2020-07-31 Jakub Jelinek <jakub@redhat.com>
2
3 PR c++/96182
4 * decl.c (finish_function): In constexpr functions use for C++14 and
5 later error instead of warning if no return statement is present and
6 diagnose it regardless of warn_return_type. Move the warn_return_type
7 diagnostics earlier in the function.
8
9 2020-07-31 Martin Sebor <msebor@redhat.com>
10
11 PR c++/96003
12 * class.c (build_base_path): Set no-warning bit on the synthesized
13 conditional expression in static_cast.
14
15 2020-07-31 Richard Biener <rguenther@suse.de>
16
17 PR debug/96383
18 * cp-objcp-common.h (LANG_HOOKS_FINALIZE_EARLY_DEBUG):
19 Define to c_common_finalize_early_debug.
20
21 2020-07-31 Patrick Palka <ppalka@redhat.com>
22
23 PR c++/96197
24 * constexpr.c (cxx_eval_constant_expression) <case CONST_DECL>:
25 Pass false to decl_constant_value and decl_really_constant_value
26 so that they don't unshare their result.
27 * cp-tree.h (decl_constant_value): New declaration with an added
28 bool parameter.
29 (decl_really_constant_value): Add bool parameter defaulting to
30 true to existing declaration.
31 * init.c (constant_value_1): Add bool parameter which controls
32 whether to unshare the initializer before returning. Call
33 unshare_expr at most once.
34 (scalar_constant_value): Pass true to constant_value_1's new
35 bool parameter.
36 (decl_really_constant_value): Add bool parameter and forward it
37 to constant_value_1.
38 (decl_constant_value): Likewise, but instead define a new
39 overload with an added bool parameter.
40
41 2020-07-30 Patrick Palka <ppalka@redhat.com>
42
43 PR c++/64194
44 * pt.c (resolve_overloaded_unification): If the function
45 template specialization has a placeholder return type,
46 then instantiate it before attempting unification.
47
48 2020-07-30 Patrick Palka <ppalka@redhat.com>
49
50 PR c++/95486
51 * pt.c (alias_ctad_tweaks): Call remove_constraints before
52 calling set_constraints.
53
54 2020-07-30 Patrick Palka <ppalka@redhat.com>
55
56 PR c++/96106
57 * pt.c (reduce_template_parm_level): Propagate DECL_VIRTUAL_P
58 from the original TEMPLATE_PARM_DECL to the new lowered one.
59
60 2020-07-30 Patrick Palka <ppalka@redhat.com>
61
62 PR c++/96164
63 * constraint.cc (constraints_satisfied_p): Return true if
64 !flags_concepts.
65 * pt.c (do_type_instantiation): Update a paragraph taken from
66 [temp.explicit] to reflect the latest specification. Don't
67 instantiate a member with unsatisfied constraints.
68
69 2020-07-29 Jason Merrill <jason@redhat.com>
70
71 PR c++/91427
72 * cp-tree.h (IMPLICIT_RVALUE_P): New.
73 (enum cp_lvalue_kind_flags): Add clk_implicit_rval.
74 (implicit_rvalue_p, set_implicit_rvalue_p): New.
75 * call.c (reference_binding): Check clk_implicit_rval.
76 (build_over_call): Adjust C++20 implicit move.
77 * coroutines.cc (finish_co_return_stmt): Simplify implicit move.
78 * except.c (build_throw): Adjust C++20 implicit move.
79 * pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Propagate
80 IMPLICIT_RVALUE_P.
81 * tree.c (lvalue_kind): Set clk_implicit_rval.
82 * typeck.c (treat_lvalue_as_rvalue_p): Overhaul.
83 (maybe_warn_pessimizing_move): Adjust.
84 (check_return_expr): Adjust C++20 implicit move.
85
86 2020-07-29 Jason Merrill <jason@redhat.com>
87
88 PR c++/91212
89 * call.c (build_over_call): Don't call a const ref
90 overload for implicit move.
91
92 2020-07-28 Nathan Sidwell <nathan@acm.org>
93
94 * cp-gimplify.c (cp_genericize_r): Set IMPORTED_DECL's context.
95 * cp-objcp-common.c (cp_pushdecl): Set decl's context.
96 * decl.c (grokfndecl): Make DECL_CONTEXT setting clearer.
97
98 2020-07-28 Nathan Sidwell <nathan@acm.org>
99
100 * class.c (fixup_type_variants): Copy TYPE_SIZE and
101 TYPE_SIZE_UINIT.
102 (finish_struct): Call it.
103
104 2020-07-28 Nathan Sidwell <nathan@acm.org>
105
106 * ptree.c (cxx_print_decl): Better indentation.
107
108 2020-07-28 Jakub Jelinek <jakub@redhat.com>
109 Mark Wielaard <mark@klomp.org>
110
111 PR c++/96328
112 * parser.c (cp_lexer_safe_previous_token): Don't call
113 cp_lexer_previous_token, instead inline it by hand and return NULL
114 instead of failing assertion if all previous tokens until the first
115 one are purged.
116 (cp_parser_error_1): Optimize - only call cp_lexer_safe_previous_token
117 if token->type is CPP_NAME. Use cp_lexer_safe_previous_token instead
118 of cp_lexer_previous_token for the missing_token_desc != RT_NONE
119 case too.
120
121 2020-07-27 Nathan Sidwell <nathan@acm.org>
122
123 * cp-tree.h (enum cp_tree_index): Add CPTI_AS_BASE_IDENTIFIER.
124 (as_base_identifier): Define.
125 * decl.c (initialize_predifined_identifiers): Initialize as_base
126 identifier.
127 * class.c (layout_class_type): Name the as-base type. Zap
128 NSDMI its fields may have.
129
130 2020-07-22 Nathan Sidwell <nathan@acm.org>
131
132 * class.c (maybe_add_class_template_decl_list): Don't add CONST_DECLs.
133
134 2020-07-22 Nathan Sidwell <nathan@acm.org>
135
136 * typeck.c (structural_comptypes): [DECLTYPE_TYPE] break
137 apart complex if.
138 [UNDERLYING_TYPE]: Use an if.
139 [TYPEOF_TYPE]: New.
140
141 2020-07-22 Nathan Sidwell <nathan@acm.org>
142
143 * decl.c (decls_match): Move variables into scopes
144 they're needed in.
145 (duplicate_decls): Use STRIP_TEMPLATE.
146 (build_typename_type): Move var decls to their assignments.
147 (begin_function_body): Likewise.
148 * decl2.c (get_guard): Likewise.
149 (mark_used): Use true for truthiness.
150 * error.c (dump_aggr_type): Hold the decl in a var called
151 'decl', not 'name'.
152
153 2020-07-22 Nathan Sidwell <nathan@acm.org>
154
155 * cp-tree.h (struct tree_lambda_expr): Shrink
156 default_capture_mode & discriminator.
157
158 2020-07-22 Nathan Sidwell <nathan@acm.org>
159
160 * mangle.c (decl_is_template_id): Rename to ...
161 (maybe_template_info): ... here. Return the template info,
162 rather than use a pointer. Adjust all callers.
163 (find_substitution): Use template_args_equal, rather than
164 local check.
165
166 2020-07-22 Tobias Burnus <tobias@codesourcery.com>
167
168 * parser.c (cp_parser_omp_clause_hint): Require nonnegative hint.
169 (cp_parser_omp_critical): Permit hint(0) clause without named critical.
170 * pt.c (tsubst_expr): Re-check the latter for templates.
171
172 2020-07-21 Sunil K Pandey <skpgkp2@gmail.com>
173
174 PR target/95237
175 * decl.c (cp_finish_decl): Call target hook
176 lower_local_decl_alignment to lower local decl alignment.
177
178 2020-07-21 Nathan Sidwell <nathan@acm.org>
179
180 * parser.c (cp_lexer_consume_token): Drop PRAGMA_EOL assert.
181 (cp_parser_skip_to_closing_parenthesis_1): Only pass start token
182 to pragma skipper if recovering.
183 (cp_parser_skip_to_pragma_eol): Only purge and change pragma
184 state when recovering.
185
186 2020-07-20 Jason Merrill <jason@redhat.com>
187
188 * pt.c (type_dependent_expression_p): A pseudo-dtor can be
189 dependent.
190 * semantics.c (finish_call_expr): Use build_trivial_dtor_call for
191 pseudo-destructor.
192 (finish_pseudo_destructor_expr): Leave type NULL for dependent arg.
193
194 2020-07-20 Jason Merrill <jason@redhat.com>
195
196 * mangle.c (write_base_ref): New.
197 (write_expression): Use it for base field COMPONENT_REFs.
198 * pt.c (invalid_tparm_referent_p): Canonicalize the type
199 of array offsets. Allow subobjects.
200
201 2020-07-20 Jason Merrill <jason@redhat.com>
202
203 * pt.c (collect_ctor_idx_types): Add 'const' when deducing from
204 a string constant.
205
206 2020-07-17 Marek Polacek <polacek@redhat.com>
207
208 PR c++/79815
209 * decl.c (grokdeclarator): Detect cv-qual decltype(auto).
210 * pt.c (do_auto_deduction): Likewise.
211
212 2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
213
214 PR c++/95591
215 PR c++/95599
216 PR c++/95823
217 PR c++/95824
218 PR c++/95895
219 * coroutines.cc (struct coro_ret_data): Delete.
220 (coro_maybe_expand_co_return): Delete.
221 (co_return_expander): Delete.
222 (expand_co_returns): Delete.
223 (co_await_find_in_subtree): Remove unused name.
224 (build_actor_fn): Remove unused parm, remove handling
225 for co_return expansion.
226 (register_await_info): Demote duplicate info message to a
227 warning.
228 (coro_make_frame_entry): Move closer to use site.
229 (struct susp_frame_data): Add fields for final suspend label
230 and a flag to indicate await expressions with initializers.
231 (captures_temporary): Delete.
232 (register_awaits): Remove unused code, update comments.
233 (find_any_await): New.
234 (tmp_target_expr_p): New.
235 (struct interesting): New.
236 (find_interesting_subtree): New.
237 (struct var_nest_node): New.
238 (flatten_await_stmt): New.
239 (handle_nested_conditionals): New.
240 (process_conditional): New.
241 (replace_statement_captures): Rename to...
242 (maybe_promote_temps): ... this.
243 (maybe_promote_captured_temps): Delete.
244 (analyze_expression_awaits): Check for await expressions with
245 initializers. Simplify handling for truth-and/or-if.
246 (expand_one_truth_if): Simplify (map cases that need expansion
247 to COND_EXPR).
248 (await_statement_walker): Handle CO_RETURN_EXPR. Simplify the
249 handling for truth-and/or-if expressions.
250 (register_local_var_uses): Ensure that we create names in the
251 implementation namespace.
252 (morph_fn_to_coro): Add final suspend label to suspend frame
253 callback data and remove it from the build_actor_fn call.
254
255 2020-07-16 Marek Polacek <polacek@redhat.com>
256
257 * call.c (convert_like): Remove macro and introduce a new
258 wrapper instead.
259 (convert_like_with_context): Likewise.
260 (convert_like_real): Rename to convert_like.
261 (convert_like_real_1): Rename to convert_like_internal. Call
262 convert_like instead of convert_like_real therein.
263 (perform_direct_initialization_if_possible): Call convert_like
264 instead of convert_like_real.
265
266 2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
267
268 * coroutines.cc: Correct some spelling errors
269 in comments.
270
271 2020-07-15 Nathan Sidwell <nathan@acm.org>
272
273 * parser.c (cp_parser_declaration): Avoid copying tokens.
274 (cp_parser_block_declaration): RAII token pointer.
275
276 2020-07-15 Nathan Sidwell <nathan@acm.org>
277
278 * parser.c (cp_parser_skip_to_closing_parenthesis_1): Deal with
279 meeting a deferred pragma.
280 (cp_parser_skip_to_end_of_statement): Likewise.
281 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
282 (cp_parser_skip_to_pragma_eol): We should never meet EOF.
283 (cp_parser_omp_declare_simd): Likewise.
284 (cp_parser_omp_declare_reduction, cp_parser_oacc_routine)
285 (pragma_lex): Likewise.
286
287 2020-07-14 Marek Polacek <polacek@redhat.com>
288
289 PR c++/95789
290 PR c++/96104
291 PR c++/96179
292 * call.c (convert_like_real_1): Renamed from convert_like_real.
293 (convert_like_real): New wrapper for convert_like_real_1.
294
295 2020-07-14 Nathan Sidwell <nathan@acm.org>
296
297 * parser.c (cp_lexer_alloc): Do not deal with PCH here.
298 (cp_lexer_new_main): Deal with PCH here. Store the tokens directly
299 into the buffer.
300 (cp_lexer_new_from_tokens): Assert last token isn't purged either.
301 (cp_lexer_get_preprocessor_token): Change first arg to flags, adjust.
302 (cp_parser_new): Pass the lexer in, don't create it here.
303 (cp_parser_translation_unit): Initialize access checks here.
304 (cp_parser_initial_pragma): First token is provided by caller,
305 don't deal with PCH stopping here. Adjust error message.
306 (c_parse_file): Adjust, change error message to avoid C++20 module
307 confusion.
308
309 2020-07-14 Nathan Sidwell <nathan@acm.org>
310
311 * ptree.c (cxx_print_type): Add TYPEOF_TYPE and BASES.
312
313 2020-07-14 Nathan Sidwell <nathan@acm.org>
314
315 * class.c (build_base_field_1): Cache CLASSTYPE_AS_BASE.
316 (build_self_reference): Rename value -> decl.
317 (dump_class_hierarchy_1): Cache CLASSTYPE_AS_BASE.
318
319 2020-07-14 Marek Polacek <polacek@redhat.com>
320
321 PR c++/95820
322 * decl.c (grokdeclarator) <case cdk_function>: Check also
323 pointers/references/... to functions.
324
325 2020-07-14 Nathan Sidwell <nathan@acm.org>
326
327 * cp-tree.h: Correct some tree lang flag comments,
328 reformat some structure definitions. Note some structure
329 sizes. Clarify some comments.
330 (yyungetc): Delete. Not been a thing for some time.
331 * class.c (copy_fndecl_with_name): Comment.
332 (check_bases_and_members): Unnecessary {}.
333 (layout_class_type): Comment.
334 * cp-tree.def (UNBOUND_CLASS_TEMPLATE): Adjust comment.
335 * decl.c: Fix some formatting & whitespace issues.
336 (function_requirements_equivalent_p): Note why
337 substitutions are needed.
338 * decl2.c (no_linkage_error): Note that heroics about
339 'typedef struct { ... };' are no longer needed.
340 * method.c: Whitespace.
341 * name-lookup.c: Whitespace.
342 (add_decl_to_level): Reformat a line.
343 (print_binding_stack): Mark as DEBUG_FUNCTION.
344 (has_using_namespace_std_directive_p): Delete comment.
345 * pt.c: Whitespace
346 * ptree.c: Whitespace.
347 * rtti.c: Whitespace & comment.
348 * tree.c: Comment.
349 * typeck.c (structural_comptypes): Add comment.
350
351 2020-07-13 Nathan Sidwell <nathan@acm.org>
352
353 * Make-lang.in (c++.disclean): Likewise.
354
355 2020-07-13 Marek Polacek <polacek@redhat.com>
356
357 PR c++/96077
358 * parser.c (cp_parser_enum_specifier): Commit to tentative parse
359 after we've seen an opening brace.
360
361 2020-07-10 Jason Merrill <jason@redhat.com>
362
363 * tree.c (structural_type_p): Allow unions.
364 * mangle.c (write_expression): Express unions with a designator.
365
366 2020-07-10 Jason Merrill <jason@redhat.com>
367
368 * pt.c (convert_nontype_argument): Handle REAL_TYPE.
369 (invalid_nontype_parm_type_p): Allow all structural types.
370 * tree.c (structural_type_p): Use SCALAR_TYPE_P.
371
372 2020-07-10 Jason Merrill <jason@redhat.com>
373
374 PR c++/96105
375 PR c++/96052
376 PR c++/95976
377 * class.c (check_field_decls): An array of empty classes is not an
378 empty data member.
379 (layout_empty_base_or_field): Handle explicit alignment.
380 Fix union handling.
381
382 2020-07-09 Julian Brown <julian@codesourcery.com>
383 Thomas Schwinge <thomas@codesourcery.com>
384
385 PR middle-end/95270
386 * semantics.c (finish_omp_clauses): Likewise.
387
388 2020-07-09 Patrick Palka <ppalka@redhat.com>
389
390 PR c++/96132
391 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
392 Restore dependent_type_p check that guarded the call to
393 is_really_empty_class.
394
395 2020-07-08 Patrick Palka <ppalka@redhat.com>
396
397 PR c++/95497
398 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
399 When processing_template_decl, check COMPLETE_TYPE_P before
400 calling is_really_empty_class. Don't check dependent_type_p.
401
402 2020-07-08 Marek Polacek <polacek@redhat.com>
403
404 PR c++/96103
405 * parser.c (cp_parser_decltype): Print error about using decltype(auto)
406 in C++11. Check that the token following "auto" is ")".
407
408 2020-07-07 Patrick Palka <ppalka@redhat.com>
409
410 PR c++/95303
411 * cxx-pretty-print.c (pp_cxx_unqualified_id): Check
412 PRIMARY_TEMPLATE_P before printing the innermost template
413 arguments.
414
415 2020-07-07 Martin Sebor <msebor@redhat.com>
416
417 PR c++/96063
418 * parser.c (class_decl_loc_t::diag_mismatched_tags): Print notes only
419 if warning_at returns nonzero.
420
421 2020-07-06 Martin Sebor <msebor@redhat.com>
422
423 PR c++/95984
424 * call.c (build_over_call): Check calls only when tf_warning is set.
425
426 2020-07-06 Nathan Sidwell <nathan@acm.org>
427
428 * decl.c (push_library_fn): Return the decl pushdecl_toplevel returns.
429 * except.c (verify_library_fn): Replace with ...
430 (declare_library_fn_1): ... this fn. Always push the fn.
431 (declare_library_fn): Call it.
432 (build_throw): Call declare_library_fn_1.
433
434 2020-07-06 Jonathan Wakely <jwakely@redhat.com>
435
436 PR c++/96068
437 * parser.c (cp_parser_toplevel_declaration): Only do pedwarn for
438 empty-declaration in C++98.
439
440 2020-07-02 Jason Merrill <jason@redhat.com>
441 Jakub Jelinek <jakub@redhat.com>
442
443 * decl.c (grokfndecl): Allow consteval virtual.
444 * search.c (check_final_overrider): Check consteval mismatch.
445 * constexpr.c (cxx_eval_thunk_call): New.
446 (cxx_eval_call_expression): Call it.
447 * cvt.c (cp_get_fndecl_from_callee): Handle FDESC_EXPR.
448 * decl2.c (mark_vtable_entries): Track vtables with consteval.
449 (maybe_emit_vtables): Pass consteval_vtables through.
450 (clear_consteval_vfns): Replace consteval with nullptr.
451 (c_parse_final_cleanups): Call it.
452
453 2020-07-01 Nathan Sidwell <nathan@acm.org>
454
455 * class.c (copy_fndecl_with_name): Add additional predicate args, do
456 not deduce them locally.
457 (copy_operator_fn): Adjust copy_fndecl_with_name call.
458 (build_clone): Add vtt and inherited predicate args. Pass through
459 to copy_fndecl_with_name call.
460 (build_cdtor_clones): Likewise, pass through to build_clone as
461 needed.
462 (build_cdtor): Determine vtt and inherited here.
463 * cp-tree.h (DECL_NEEDS_CTT_PARM_P): Delete.
464
465 2020-06-30 Nathan Sidwell <nathan@acm.org>
466
467 * cp-tree.h (copy_fndecl_with_name): Rename to ...
468 (copy_operatorn_fn): ... this. Change arg type.
469 (clone_function_decl): Rename to ...
470 (clone_cdtor): ... this.
471 * class.c (copy_fndecl_with_name): Make static.
472 (copy_operator_fn): New wrapper.
473 (build_clones): Rename to ...
474 (build_cdtor_clones): ... this.
475 (clone_function_decl): Rename to ...
476 (clone_cdtor): ... this. Adjust build_clones calls.
477 (clone_constructors_and_destructors): Adjust clone_function_decl
478 calls.
479 * method.c (implicitly_declare_fn): Adjust copy_fndecl_with_name
480 call.
481 (lazily_declare_fn): Adjust clone_function_decl call.
482 * pt.c (tsubst_function_decl): Likewise.
483 (instantiate_template_1): Likewise.
484
485 2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
486
487 * coroutines.cc (morph_fn_to_coro): Remove trailing
488 space in a diagnostic.
489
490 2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
491
492 * coroutines.cc (expand_one_await_expression): Remove
493 code dealing with initial suspend.
494 (build_actor_fn): Remove code special-casing initial
495 and final suspend. Handle the final suspend and marking
496 of the coroutine as done.
497 (coro_rewrite_function_body): New.
498 (bind_expr_find_in_subtree): Remove.
499 (coro_body_contains_bind_expr_p): Remove.
500 (morph_fn_to_coro): Split the rewrite of the original
501 function into coro_rewrite_function_body and call it.
502
503 2020-06-29 Marek Polacek <polacek@redhat.com>
504
505 PR c++/94553
506 * decl.c (duplicate_decls): Make sure a concept or a variable
507 template is unique in its declarative region.
508
509 2020-06-29 Marek Polacek <polacek@redhat.com>
510
511 PR c++/95568
512 * pt.c (collect_ctor_idx_types): Use TREE_TYPE.
513
514 2020-06-28 Iain Sandoe <iain@sandoe.co.uk>
515
516 PR c++/95711
517 * coroutines.cc (register_local_var_uses): Skip past
518 namespace decls.
519
520 2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
521
522 PR c++/95736
523 * coroutines.cc (get_awaitable_var): New helper.
524 (build_co_await): Check more carefully before
525 copying an awaitable.
526 (expand_one_await_expression): No initializer
527 is required when the awaitable is not a temp.
528 (register_awaits): Remove handling that is now
529 completed when the await expression is built.
530
531 2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
532
533 * coroutines.cc (morph_fn_to_coro): Diagnose unavailable
534 get_return_object_on_allocation_failure.
535
536 2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
537
538 PR c++/95519
539 * coroutines.cc (struct coroutine_info):Add a field
540 to hold computed p.return_void expressions.
541 (coro_build_promise_expression): New.
542 (get_coroutine_return_void_expr): New.
543 (finish_co_yield_expr): Build the promise expression
544 using coro_build_promise_expression.
545 (finish_co_return_stmt): Likewise.
546 (build_init_or_final_await): Likewise.
547 (morph_fn_to_coro): Likewise, for several cases.
548
549 2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
550
551 * coroutines.cc (morph_fn_to_coro): Handle error
552 returns in building g-r-o-o-a-f expressions.
553
554 2020-06-24 Nicholas Krause <xerofoify@gmail.com>
555
556 PR c++/95672
557 * typeck2.c (cxx_incomplete_type_diagnostic): Add missing
558 TYPE_EXPANSION_PACK check for diagnosing incomplete types in
559 cxx_incomplete_type_diagnostic.
560
561 2020-06-24 Iain Sandoe <iain@sandoe.co.uk>
562
563 PR c++/95518
564 PR c++/95813
565 * coroutines.cc (act_des_fn): Copy function
566 attributes onto the outlined coroutine helpers.
567
568 2020-06-24 Jason Merrill <jason@redhat.com>
569
570 * call.c (build_over_call): Only call build_base_path once.
571
572 2020-06-24 Jason Merrill <jason@redhat.com>
573
574 PR c++/95719
575 * call.c (build_over_call): Look up the overrider in base_binfo.
576 * class.c (lookup_vfn_in_binfo): Look through BINFO_PRIMARY_P.
577
578 2020-06-23 Jason Merrill <jason@redhat.com>
579
580 PR c++/93976
581 Implement C++20 P2082R1, Fixing CTAD for aggregates.
582 * cp-tree.h (TPARMS_PRIMARY_TEMPLATE): Split out from...
583 (DECL_PRIMARY_TEMPLATE): ...here.
584 (builtin_guide_p): Declare.
585 * decl.c (reshape_init_class): Handle bases of a template.
586 (reshape_init_r): An array with dependent bound takes a single
587 initializer.
588 * pt.c (tsubst_default_argument): Shortcut {}.
589 (unify_pack_expansion): Allow omitted arguments to trailing pack.
590 (builtin_guide_p): New.
591 (collect_ctor_idx_types): Give a trailing pack a {} default
592 argument. Handle arrays better.
593
594 2020-06-23 Iain Sandoe <iain@sandoe.co.uk>
595
596 PR c++/95477
597 * coroutines.cc (morph_fn_to_coro): Apply a cleanup to
598 the get return object when the DTOR is non-trivial.
599
600 2020-06-20 Iain Sandoe <iain@sandoe.co.uk>
601
602 PR c++/95505
603 * coroutines.cc (morph_fn_to_coro): Update handling of
604 get-return-object-on-allocation-fail and diagnose missing
605 std::nothrow.
606
607 2020-06-20 Jason Merrill <jason@redhat.com>
608
609 * call.c (joust): Only compare constraints for non-template
610 candidates with matching parameters.
611 * pt.c (tsubst_pack_expansion): Fix getting a type parameter
612 pack.
613 (more_specialized_fn): Only compare constraints for candidates with
614 matching parameters.
615
616 2020-06-19 Jason Merrill <jason@redhat.com>
617
618 * method.c (early_check_defaulted_comparison): Allow defaulting
619 comparison outside class. Complain if non-member operator isn't a
620 friend.
621
622 2020-06-18 Jason Merrill <jason@redhat.com>
623
624 * method.c (early_check_defaulted_comparison): Check for &&.
625 (build_comparison_op): Allow empty union. Diagnose non-category
626 type.
627 (common_comparison_type): Remove handling for non-category type.
628
629 2020-06-18 Marek Polacek <polacek@redhat.com>
630
631 PR c++/95735
632 * pt.c (finish_template_variable): Return if
633 coerce_innermost_template_parms return error_mark_node.
634
635 2020-06-18 Marek Polacek <polacek@redhat.com>
636
637 PR c++/95728
638 * pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
639 if placement is erroneous.
640
641 2020-06-17 Jonathan Wakely <jwakely@redhat.com>
642
643 PR c++/66159
644 * parser.c (cp_parser_elaborated_type_specifier): Do not warn
645 unless in a declaration.
646
647 2020-06-17 Jason Merrill <jason@redhat.com>
648
649 * cp-tree.h (copy_fndecl_with_name): Declare.
650 * class.c (copy_fndecl_with_name): Split out from...
651 (build_clone): ...here.
652 (add_implicitly_declared_members): Add op== to TYPE_FIELDS.
653 * method.c (implicitly_declare_fn): Use copy_fndecl_with_name.
654
655 2020-06-17 Jason Merrill <jason@redhat.com>
656
657 * call.c (build_new_op_1): Don't look for a CALL_EXPR when
658 calling a consteval function.
659
660 2020-06-17 Jason Merrill <jason@redhat.com>
661
662 * decl2.c (grokfield): Pass SD_DEFAULTED and SD_DELETED.
663 * decl.c (duplicate_decls): Reduce error for delete
664 after earlier declaration to pedwarn.
665
666 2020-06-17 Marek Polacek <polacek@redhat.com>
667
668 PR c++/95508
669 * constexpr.c (maybe_fold_non_dependent_expr): New.
670 * cp-tree.h (maybe_fold_non_dependent_expr): Declare.
671 * typeck.c (cp_build_array_ref): Call maybe_fold_non_dependent_expr
672 instead of maybe_constant_value.
673
674 2020-06-16 Marek Polacek <polacek@redhat.com>
675
676 PR c++/95369
677 * call.c (add_list_candidates): Return if a designated initializer
678 is used with a non-aggregate.
679 (implicit_conversion_error): Give an error for the case above.
680
681 2020-06-16 Marek Polacek <polacek@redhat.com>
682
683 PR c++/95560
684 * name-lookup.c (check_local_shadow): Check if types are
685 non-null before calling same_type_p.
686
687 2020-06-16 Jakub Jelinek <jakub@redhat.com>
688
689 * semantics.c (handle_omp_for_class_iterator): Adjust
690 c_omp_check_loop_iv_exprs caller.
691 (finish_omp_for): Likewise. Don't call fold_build_cleanup_point_expr
692 before calling c_finish_omp_for and c_omp_check_loop_iv, move it
693 after those calls.
694 * pt.c (tsubst_omp_for_iterator): Handle non-rectangular loops.
695
696 2020-06-16 Jakub Jelinek <jakub@redhat.com>
697
698 * parser.c (cp_parser_omp_clause_schedule): Reject modifier separated
699 from kind by comma rather than colon.
700
701 2020-06-16 Patrick Palka <ppalka@redhat.com>
702
703 * pt.c (perform_instantiation_time_access_checks): No need to
704 tsubst into decl.
705 * semantics.c (enforce_access): Verify that decl is not
706 dependent.
707
708 2020-06-16 Patrick Palka <ppalka@redhat.com>
709
710 PR c++/41437
711 PR c++/47346
712 * cp-tree.h (qualified_typedef_usage_s): Delete.
713 (qualified_typedef_usage_t): Delete.
714 (deferred_access_check): Move up in file.
715 (tree_template_info::typedefs_needing_access_checking): Delete.
716 (tree_template_info::deferred_access_checks): New field.
717 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): Rename to ...
718 (TI_DEFERRED_ACCESS_CHECKS): ... this, and adjust accordingly.
719 * pt.c (perform_typedefs_access_check): Rename to ...
720 (perform_instantiation_time_access_checks): ... this, and adjust
721 accordingly. Remove unnecessary tree tests.
722 (instantiate_class_template_1): Adjust accordingly.
723 (instantiate_decl): Likewise.
724 * semantics.c (enforce_access): Likewise.
725
726 2020-06-16 Patrick Palka <ppalka@redhat.com>
727
728 PR c++/41437
729 PR c++/47346
730 * call.c (enforce_access): Move to semantics.c.
731 * cp-tree.h (enforce_access): Delete.
732 (get_types_needing_access_check): Delete.
733 (add_typedef_to_current_template_for_access_check): Delete.
734 * decl.c (make_typename_type): Adjust accordingly. Use
735 check_accessibility_of_qualified_id instead of directly using
736 perform_or_defer_access_check.
737 * parser.c (cp_parser_template_declaration_after_parameters):
738 Don't push a dk_no_check access state when parsing a template.
739 * pt.c (get_types_needing_access_check): Delete.
740 (append_type_to_template_for_access_check_1): Delete.
741 (perform_typedefs_access_check): Adjust. If type_decl is a
742 FIELD_DECL, also check its DECL_CONTEXT for dependence. Use
743 tsubst_copy instead of tsubst to substitute into type_decl so
744 that we substitute into the DECL_CONTEXT of a FIELD_DECL.
745 (append_type_to_template_for_access_check): Delete.
746 * search.c (accessible_p): Remove the processing_template_decl
747 early exit.
748 * semantics.c (enforce_access): Moved from call.c. If we're
749 parsing a template and the access check failed, add the check to
750 TI_TYPEDEFS_NEEDING_ACCESS_CHECKING.
751 (perform_or_defer_access_check): Adjust comment.
752 (add_typedef_to_current_template_for_access_check): Delete.
753 (check_accessibility_of_qualified_id): Adjust accordingly.
754 Exit early if the scope is dependent.
755
756 2020-06-11 Patrick Palka <ppalka@redhat.com>
757
758 PR c++/93467
759 * constraint.cc (associate_classtype_constraints): If there is a
760 discrepancy between the current template depth and the template
761 depth of the original declaration, then adjust the template
762 parameter depth within the current constraints appropriately.
763 * pt.c (tsubst_friend_class): Substitute into and set the
764 constraints on the injected declaration.
765
766 2020-06-11 Iain Sandoe <iain@sandoe.co.uk>
767
768 * coroutines.cc (instantiate_coro_traits): Pass a reference
769 to lambda closure objects to traits instantiation.
770 (morph_fn_to_coro): Likewise for promise parameter
771 preview and allocator lookup.
772
773 2020-06-10 Iain Sandoe <iain@sandoe.co.uk>
774
775 PR c++/95440
776 * call.c (add_candidates): Use vec_safe_length() for
777 testing the arguments list.
778 (build_new_method_call_1): Use vec_safe_is_empty() when
779 checking for an empty args list.
780
781 2020-06-10 Marek Polacek <polacek@redhat.com>
782
783 PR c++/95562
784 * parser.c (cp_parser_direct_declarator): Clear
785 CP_PARSER_FLAGS_DELAY_NOEXCEPT if the declarator kind is not
786 cdk_id.
787
788 2020-06-09 Iain Sandoe <iain@sandoe.co.uk>
789
790 PR c++/95137
791 * coroutines.cc (expand_one_await_expression): Build separate
792 DTOR trees for the awaitable object on the destroy and resume
793 paths.
794
795 2020-06-09 Jason Merrill <jason@redhat.com>
796
797 PR c++/95552
798 * cp-gimplify.c (predeclare_vla): Only predeclare a VLA if it's
799 wrapped in a pointer type.
800
801 2020-06-05 Marek Polacek <polacek@redhat.com>
802
803 PR c++/95369
804 * call.c (build_converted_constant_expr_internal): Allow
805 list-initialization.
806
807 2020-06-05 Iain Sandoe <iain@sandoe.co.uk>
808
809 * cp-tree.def (CO_RETURN_EXPR): Correct the class
810 to use tcc_statement.
811
812 2020-06-05 Jason Merrill <jason@redhat.com>
813
814 * error.c (dump_binary_op): Handle negative operand to
815 POINTER_PLUS_EXPR.
816
817 2020-06-04 Jason Merrill <jason@redhat.com>
818
819 PR c++/93310
820 * constexpr.c (cxx_eval_constant_expression) [OBJ_TYPE_REF]:
821 Evaluate OBJ_TYPE_REF_EXPR.
822
823 2020-06-04 Jason Merrill <jason@redhat.com>
824
825 PR c++/95158
826 * class.c (lookup_vfn_in_binfo): New.
827 * call.c (build_over_call): Use it.
828 * cp-tree.h (resolves_to_fixed_type_p): Add default argument.
829 (lookup_vfn_in_binfo): Declare.
830
831 2020-06-04 Iain Sandoe <iain@sandoe.co.uk>
832
833 PR c++/95346
834 * coroutines.cc (morph_fn_to_coro): Ensure that the get-
835 return-object is constructed correctly; When it is not the
836 final return value, pass it to the CTOR of the return type
837 as an rvalue, per the standard comment.
838
839 2020-06-04 Jakub Jelinek <jakub@redhat.com>
840
841 PR c++/82304
842 PR c++/95307
843 * constexpr.c (cxx_eval_constant_expression): Diagnose CONVERT_EXPR
844 conversions from pointer types to arithmetic types here...
845 (cxx_eval_outermost_constant_expr): ... instead of here.
846
847 2020-06-03 Mark Wielaard <mark@klomp.org>
848
849 * parser.c (cp_lexer_safe_previous_token): New function.
850 (cp_parser_error_1): Add name_hint if the previous token is
851 a string literal and next token is a CPP_NAME and we have a
852 missing header suggestion for the name.
853
854 2020-06-03 Patrick Palka <ppalka@redhat.com>
855
856 * pt.c (process_partial_specialization): Pass the full set of
857 generic template arguments to strictly_subsumes.
858
859 2020-06-03 Patrick Palka <ppalka@redhat.com>
860
861 PR c++/92103
862 * pt.c (most_specialized_partial_spec): Reorganize the loop over
863 DECL_TEMPLATE_SPECIALIZATIONS. Check constraints_satisfied_p on
864 the original template declaration, not on the tsubsted one.
865
866 2020-06-03 Iain Sandoe <iain@sandoe.co.uk>
867
868 PR c++/95345
869 * coroutines.cc (finish_co_await_expr): Revise to allow for
870 parameter packs.
871 (finish_co_yield_expr): Likewise.
872
873 2020-06-03 Jason Merrill <jason@redhat.com>
874
875 PR c++/95232
876 * cp-tree.h (predeclare_vla): Declare.
877 * cp-gimplify.c (predeclare_vla): Handle getting a decl.
878 * pt.c (tsubst_expr) [DECL_EXPR]: Use it.
879
880 2020-06-03 Tobias Burnus <tobias@codesourcery.com>
881
882 * cp-gimplify.c (cxx_omp_predetermined_mapping): New.
883 * cp-objcp-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redfine.
884 * cp-tree.h (cxx_omp_predetermined_mapping): Declare.
885
886 2020-06-02 Jason Merrill <jason@redhat.com>
887
888 PR c++/95193
889 * pt.c (tsubst_decl): Relax assert.
890
891 2020-06-02 Iain Sandoe <iain@sandoe.co.uk>
892
893 PR c++/95050
894 * coroutines.cc (build_co_await): Wrap the co_await expression
895 in a TARGET_EXPR, where needed.
896 (finish_co_yield_expr): Likewise.
897
898 2020-06-02 Patrick Palka <ppalka@redhat.com>
899
900 PR c++/92633
901 PR c++/92838
902 * pt.c (tsubst_function_decl): Don't do set_constraints when
903 regenerating a lambda.
904 (tsubst_lambda_expr): Substitute into the lambda's constraints
905 and do set_constraints here.
906
907 2020-06-01 Jason Merrill <jason@redhat.com>
908
909 PR c++/95466
910 PR c++/95311
911 PR c++/95221
912 * class.c (build_vfn_ref): Revert 95311 change.
913 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): Build a
914 COMPOUND_EXPR.
915
916 2020-06-01 Iain Sandoe <iain@sandoe.co.uk>
917
918 PR c++/95350
919 * coroutines.cc (struct param_info): Remove rv_ref field.
920 (build_actor_fn): Remove specifial rvalue ref handling.
921 (morph_fn_to_coro): Likewise.
922
923 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
924
925 PR c++/95087
926 * coroutines.cc (morph_fn_to_coro): If we see an
927 early fatal error, drop the erroneous function body.
928
929 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
930
931 * coroutines.cc (build_co_await): Remove unused
932 variable.
933 (finish_co_await_expr): Likewise.
934 (finish_co_yield_expr): Likewise; revise comment.
935
936 2020-05-30 Iain Sandoe <iain@sandoe.co.uk>
937
938 * coroutines.cc (morph_fn_to_coro): Revise initialization
939 of the frame pointer to avoid an unused value.
940
941 2020-05-30 Patrick Palka <ppalka@redhat.com>
942
943 PR c++/95386
944 * constraint.cc (satisfaction_value): Accept INTEGER_CST of any
945 boolean type.
946
947 2020-05-29 Patrick Palka <ppalka@redhat.com>
948 Jason Merrill <jason@redhat.com>
949
950 PR c++/95181
951 * class.c (add_method): Let special member function templates
952 coexist if they are not equivalently constrained, or in a class
953 template.
954
955 2020-05-29 Jason Merrill <jason@redhat.com>
956
957 PR c++/95371
958 * pt.c (process_template_parm): Set DECL_TEMPLATE_INFO
959 on the DECL_TEMPLATE_RESULT.
960
961 2020-05-29 Marek Polacek <polacek@redhat.com>
962
963 PR c++/95344
964 * cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set
965 TREE_THIS_VOLATILE here.
966 (cp_fold): Set it here along with TREE_NO_WARNING.
967
968 2020-05-29 Jason Merrill <jason@redhat.com>
969
970 PR c++/95311
971 PR c++/95221
972 * class.c (build_vfn_ref): Don't fold the INDIRECT_REF.
973
974 2020-05-29 Patrick Palka <ppalka@redhat.com>
975
976 PR c++/92652
977 PR c++/93698
978 PR c++/94128
979 * parser.c (cp_parser_requires_clause_expression): Temporarily
980 increment processing_template_decl only if it is 0.
981 (cp_parser_constraint_expression): Likewise.
982 (cp_parser_requires_expression): Likewise.
983
984 2020-05-29 Patrick Palka <ppalka@redhat.com>
985
986 PR c++/95241
987 * constexpr.c (get_or_insert_ctor_field): Add limited support
988 for RANGE_EXPR index lookups.
989
990 2020-05-28 Jakub Jelinek <jakub@redhat.com>
991
992 PR c++/95328
993 * decl.c (cp_finish_decomp): Call complete_type before checking
994 COMPLETE_TYPE_P.
995
996 2020-05-28 Jason Merrill <jason@redhat.com>
997
998 PR c++/94926
999 * decl.c (cp_finish_decl): Revert r9-297 change.
1000 (check_static_variable_definition): Likewise.
1001 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
1002 * pt.c (instantiate_decl): Return early on type error.
1003
1004 2020-05-27 Jason Merrill <jason@redhat.com>
1005
1006 PR c++/95319
1007 * decl.c (reshape_init_array_1): Don't reuse in overload context.
1008
1009 2020-05-27 Jason Merrill <jason@redhat.com>
1010
1011 PR c++/95242
1012 * call.c (build_new_op_1): Suppress
1013 warn_zero_as_null_pointer_constant across comparison of <=> result
1014 to 0.
1015
1016 2020-05-27 Jason Merrill <jason@redhat.com>
1017
1018 PR c++/95222
1019 * decl.c (grokdeclarator): Don't shift attributes in TYPENAME
1020 context.
1021
1022 2020-05-27 Nathan Sidwell <nathan@acm.org>
1023
1024 PR c++/95263
1025 * pt.c (lookup_template_class_1): Restore alias template mutation.
1026
1027 2020-05-26 Jakub Jelinek <jakub@redhat.com>
1028
1029 PR c++/95197
1030 * cp-gimplify.c: Include omp-general.h.
1031 (cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration
1032 variables in composite distribute parallel for, instantiate copy
1033 ctor of their types.
1034
1035 2020-05-23 Patrick Palka <ppalka@redhat.com>
1036
1037 PR c++/94038
1038 * constexpr.c (cxx_eval_constant_expression)
1039 <case TEMPLATE_ID_EXPR>: Don't evaluate the concept when
1040 constexpr evaluation is uid-sensitive.
1041
1042 2020-05-22 Jason Merrill <jason@redhat.com>
1043
1044 * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Don't preevaluate
1045 the function address if the call used operator syntax.
1046
1047 2020-05-21 Jason Merrill <jason@redhat.com>
1048
1049 PR c++/95221
1050 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): For a virtual
1051 call, instrument the OBJ_TYPE_REF.
1052
1053 * decl.c (compute_array_index_type_loc): Diagnose expressions
1054 in a template that can't be constant.
1055 * parser.c (cp_parser_direct_declarator): Don't check
1056 non-constant array bounds here.
1057
1058 * cp-tree.h (is_rvalue_constant_expression): Declare.
1059 * constexpr.c (is_rvalue_constant_expression): New.
1060 * parser.c (cp_parser_constant_expression): Use it.
1061 * decl.c (cp_finish_decl): Try to treat a constexpr initializer in a
1062 template as constant.
1063
1064 * typeck.c (build_x_modify_expr): Handle error_mark_node arguments.
1065
1066 * decl.c (grokparms): Return NULL_TREE if any parms were erroneous.
1067
1068 2020-05-21 Iain Sandoe <iain@sandoe.co.uk>
1069
1070 * coroutines.cc (finish_co_return_stmt): Revert change to use
1071 finish_expr_stmt.
1072
1073 2020-05-21 Patrick Palka <ppalka@redhat.com>
1074
1075 PR c++/94038
1076 * constexpr.c (constexpr_ctx::uid_sensitive): Remove field.
1077 (uid_sensitive_constexpr_evaluation_value): Define.
1078 (uid_sensitive_constexpr_evaluation_true_counter): Define.
1079 (uid_sensitive_constexpr_evaluation_p): Define.
1080 (uid_sensitive_constexpr_evaluation_sentinel): Define its
1081 constructor.
1082 (uid_sensitive_constexpr_evaluation_checker): Define its
1083 constructor and its evaluation_restricted_p method.
1084 (get_fundef_copy): Remove 'ctx' parameter. Use u_s_c_e_p
1085 instead of constexpr_ctx::uid_sensitive.
1086 (cxx_eval_call_expression): Use u_s_c_e_p instead, and test it
1087 last. Adjust call to get_fundef_copy.
1088 (instantiate_cx_fn_r): Test u_s_c_e_p so that we increment the
1089 counter if necessary.
1090 (cxx_eval_outermost_constant_expr): Remove 'uid_sensitive'
1091 parameter. Adjust function body accordingly.
1092 (maybe_constant_value): Remove 'uid_sensitive' parameter and
1093 adjust function body accordingly. Set up a
1094 uid_sensitive_constexpr_evaluation_checker, and use it to
1095 conditionally update the cv_cache.
1096 * cp-gimplify.c (cp_fold): Set up a
1097 uid_sensitive_constexpr_evaluation_checker, and use it to
1098 conditionally update the fold_cache.
1099 * cp-tree.h (maybe_constant_value): Update declaration.
1100 (struct uid_sensitive_constexpr_evaluation_sentinel): Define.
1101 (struct sensitive_constexpr_evaluation_checker): Define.
1102 * expr.c (fold_for_warn): Set up a
1103 uid_sensitive_constexpr_evaluation_sentinel before calling
1104 the folding subroutines. Drop all but the first argument to
1105 maybe_constant_value.
1106
1107 2020-05-20 Marek Polacek <polacek@redhat.com>
1108
1109 DR 2237
1110 * parser.c (cp_parser_unqualified_id): Reject simple-template-id as
1111 the declarator-id of a destructor.
1112 (cp_parser_constructor_declarator_p): Reject simple-template-id as
1113 the declarator-id of a constructor.
1114
1115 2020-05-20 Marek Polacek <polacek@redhat.com>
1116
1117 DR 2289
1118 PR c++/94553
1119 * cp-tree.h (SD_DECOMPOSITION): New flag.
1120 * decl.c (duplicate_decls): Make sure a structured binding is unique
1121 in its declarative region.
1122 (start_decl): If INITIALIZED is SD_DECOMPOSITION, call
1123 fit_decomposition_lang_decl.
1124 (grokdeclarator): Compare INITIALIZED directly to SD_* flags.
1125 * parser.c (cp_parser_decomposition_declaration): Pass SD_DECOMPOSITION
1126 to start_decl.
1127
1128 2020-05-20 Patrick Palka <ppalka@redhat.com>
1129
1130 PR c++/95223
1131 * typeck.c (structural_comptypes): Don't perform
1132 context-dependent resolution of TYPENAME_TYPEs when
1133 comparing_specializations.
1134
1135 2020-05-19 Nathan Sidwell <nathan@acm.org>
1136
1137 * pt.c (lookup_template_class_1): Do not reinit template_info of an
1138 alias here.
1139
1140 2020-05-18 Martin Sebor <msebor@redhat.com>
1141
1142 PR c++/94923
1143 * call.c ((maybe_warn_class_memaccess): Use is_byte_access_type.
1144 * cp-tree.h (is_dummy_object): Return bool.
1145 (is_byte_access_type): Declare new function.
1146 * tree.c (is_dummy_object): Return bool.
1147 (is_byte_access_type): Define new function.
1148
1149 2020-05-19 Patrick Palka <ppalka@redhat.com>
1150
1151 PR c++/87847
1152 * pt.c (init_template_processing): Enable sanitization for
1153 decl_specializations and type_specializations.
1154
1155 PR c++/66439
1156 * pt.c (fn_type_unification): Pass 'fn' instead of NULL_TREE as
1157 the 'in_decl' parameter to coerce_template_parms.
1158
1159 2020-05-18 Marek Polacek <polacek@redhat.com>
1160
1161 PR c++/94955
1162 * typeck.c (cp_build_binary_op): Use fold_for_warn instead of
1163 cp_fold_rvalue.
1164
1165 2020-05-18 Marek Polacek <polacek@redhat.com>
1166
1167 PR c++/94937
1168 * cvt.c (cp_get_fndecl_from_callee): Return NULL_TREE if the function
1169 type is not INDIRECT_TYPE_P.
1170 * decl.c (omp_declare_variant_finalize_one): Call
1171 cp_get_callee_fndecl_nofold instead of looking for the function decl
1172 manually.
1173
1174 2020-05-18 Marek Polacek <polacek@redhat.com>
1175
1176 PR c++/90915
1177 * parser.c (cp_parser_has_attribute_expression): Sorry on a
1178 type-dependent argument.
1179
1180 2020-05-18 Marek Polacek <polacek@redhat.com>
1181
1182 DR 1512
1183 PR c++/87699
1184 * call.c (add_builtin_candidate) <case EQ_EXPR>: Create candidate
1185 operator functions when type is std::nullptr_t for ==/!=.
1186 * typeck.c (composite_pointer_type_r): Add a bool * parameter. Use it
1187 to maybe add "const" to the pointer type.
1188 (composite_pointer_type): Update the call to composite_pointer_type_r.
1189 (cp_build_binary_op): Turn two warning_at into error_at. Print the
1190 types.
1191
1192 2020-05-18 Jason Merrill <jason@redhat.com>
1193
1194 * call.c (build_over_call): Remove unnecessary
1195 cp_stabilize_reference.
1196
1197 2020-05-18 Marek Polacek <polacek@redhat.com>
1198
1199 * call.c (add_builtin_candidate): Don't create a builtin overload
1200 candidate for ++ when type is bool in C++17.
1201
1202 2020-05-18 Marek Polacek <polacek@redhat.com>
1203
1204 * cfns.h: Regenerated.
1205
1206 2020-05-17 Iain Sandoe <iain@sandoe.co.uk>
1207
1208 * coroutines.cc (morph_fn_to_coro): Initialize the gro variable.
1209
1210 2020-05-16 Iain Sandoe <iain@sandoe.co.uk>
1211
1212 * coroutines.cc (finish_co_return_stmt): Implement rules
1213 from [class.copy.elision] /3.
1214
1215 2020-05-16 Patrick Palka <ppalka@redhat.com>
1216
1217 PR c++/57943
1218 * semantics.c (finish_decltype_type): Call
1219 instantiate_non_dependent_expr_sfinae on the expression.
1220
1221 2020-05-15 Patrick Palka <ppalka@redhat.com>
1222
1223 Revert:
1224
1225 2020-04-07 Patrick Palka <ppalka@redhat.com>
1226
1227 PR c++/90996
1228 * typeck2.c (process_init_constructor_array): Propagate
1229 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
1230 the array initializer.
1231
1232 2020-05-15 Jason Merrill <jason@redhat.com>
1233
1234 PR c++/93286 - ICE with __is_constructible and variadic template.
1235 * pt.c (tsubst_tree_list): New.
1236 (tsubst, tsubst_copy_and_build): Use it.
1237 * decl2.c (is_late_template_attribute): Handle error_mark_node args.
1238
1239 2020-05-15 Nathan Sidwell <nathan@acm.org>
1240
1241 * pt.c (template_args_equal): Fix thinkos in previous 'cleanup'.
1242
1243 2020-05-14 Jason Merrill <jason@redhat.com>
1244
1245 PR c++/93901
1246 * pt.c (maybe_instantiate_noexcept): Change clone handling.
1247
1248 2020-05-14 Patrick Palka <ppalka@redhat.com>
1249
1250 PR c++/78446
1251 * call.c (build_op_call): Pass complain to lookup_fnfields.
1252 (build_special_member_call): Likewise.
1253 * class.c (type_requires_array_cookie): Pass tf_warning_or_error
1254 to lookup_fnfields.
1255 * cp-tree.h (lookup_fnfields): Add tsubst_flags_t parameter.
1256 * except.c (build_throw): Pass tf_warning_or_error to
1257 lookup_fnfields.
1258 * init.c (build_new_1): Pass complain to lookup_fnfields.
1259 * method.c (locate_fn_flags): Likewise.
1260 * name-lookup.c (lookup_name_real_1): Pass tf_warning_or_error
1261 to lookup_fnfields.
1262 * pt.c (tsubst_baselink): Pass complain to lookup_fnfields.
1263 * search.c (lookup_fnfields): New 'complain' parameter. Pass it
1264 to lookup_member.
1265
1266 2020-05-14 Nathan Sidwell <nathan@acm.org>
1267
1268 * parser.c (cp_parser_diagnose_invalid_typename): Mention
1269 std=c++20 not 2a, reformat dependent binfo inform loops.
1270
1271 * pt.c (tsubst_template_decl): Reorder and commonize some control
1272 paths.
1273
1274 * pt.c (tsubst_friend_function): Simplify control flow.
1275
1276 * pt.c (lookup_template_class_1): Remove unnecessary else by
1277 simply grabbing TYPE_NAME earlier.
1278
1279 * pt.c (push_template_decl_real): Adjust friend pushing logic.
1280 Reinit template type.
1281
1282 * pt.c (build_template_decl): Init DECL_TEMPLATE_RESULT &
1283 TREE_TYPE here ...
1284 (process_partial_specialization): ... not here ...
1285 (push_template_decl_real, add_inherited_template_parms)
1286 (build_deduction_guide): ... or here.
1287
1288 2020-05-14 Jakub Jelinek <jakub@redhat.com>
1289
1290 * cp-gimplify.c (cp_genericize_r): Set cfun->has_omp_target.
1291
1292 2020-05-13 Patrick Palka <ppalka@redhat.com>
1293
1294 PR c++/79706
1295 * init.c (build_vec_delete_1): Just return error_mark_node if
1296 deallocate_expr is error_mark_node.
1297 (build_delete): Just return error_mark_node if do_delete is
1298 error_mark_node.
1299
1300 2020-05-13 Patrick Palka <ppalka@redhat.com>
1301
1302 PR c++/95020
1303 * constraint.cc (tsubst_requires_expr): Produce a new
1304 requires-expression when processing_template_decl, even if
1305 template arguments are not dependent.
1306
1307 2020-05-13 Marek Polacek <polacek@redhat.com>
1308
1309 PR c++/95066
1310 * decl.c (duplicate_decls): Set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
1311
1312 2020-05-13 Nathan Sidwell <nathan@acm.org>
1313
1314 * pt.c (template_args_equal): Reorder category checking for
1315 clarity.
1316
1317 * pt.c (perform_typedefs_access_check): Cache expensively
1318 calculated object references.
1319 (check_auto_in_tmpl_args): Just assert we do not get unexpected
1320 nodes, rather than silently do nothing.
1321 (append_type_to_template_for_access): Likewise, cache expensie
1322 object reference.
1323
1324 * pt.c (canonical_type_parameter): Simplify.
1325
1326 Formatting fixups & some simplifications.
1327 * pt.c (spec_hash_table): New typedef.
1328 (decl_specializations, type_specializations): Use it.
1329 (retrieve_specialization): Likewise.
1330 (register_specialization): Remove unnecessary casts.
1331 (push_template_decl_real): Reformat.
1332 (instantiate_class_template_1): Use more RAII.
1333 (make_argument_pack): Simplify.
1334 (instantiate_template_1): Use gcc_checking_assert for expensive
1335 asserts.
1336 (instantiate_decl): Likewise.
1337 (resolve_typename_type): Reformat comment.
1338 * semantics.c (struct deferred_access): Remove unnecessary GTY on
1339 member.
1340 (begin_class_definition): Fix formatting.
1341
1342 2020-05-13 Jason Merrill <jason@redhat.com>
1343
1344 * call.c, class.c, constexpr.c, constraint.cc, decl.c, init.c,
1345 lambda.c, lex.c, method.c, name-lookup.c, parser.c, pt.c, tree.c,
1346 typeck2.c: Change cxx2a to cxx20.
1347
1348 2020-05-12 Marek Polacek <polacek@redhat.com>
1349
1350 PR c++/95074
1351 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: When
1352 looking for a block-scope function declaration, look through the whole
1353 set, not just the first function in the overload set.
1354
1355 2020-05-12 Jakub Jelinek <jakub@redhat.com>
1356
1357 PR c++/95063
1358 * pt.c (tsubst_decl): Deal with DECL_OMP_PRIVATIZED_MEMBER for
1359 a bit-field.
1360
1361 2020-05-11 Jason Merrill <jason@redhat.com>
1362
1363 Resolve C++20 NB comment CA104
1364 * pt.c (determine_specialization): Compare constraints for
1365 specialization of member template of class instantiation.
1366
1367 2020-05-11 Jason Merrill <jason@redhat.com>
1368
1369 PR c++/92583
1370 PR c++/92654
1371 * tree.c (cp_walk_subtrees): Stop at typedefs.
1372 Handle TYPENAME_TYPE here.
1373 * pt.c (find_parameter_packs_r): Not here.
1374 (for_each_template_parm_r): Clear *walk_subtrees.
1375 * decl2.c (min_vis_r): Look through typedefs.
1376
1377 2020-05-11 Jason Merrill <jason@redhat.com>
1378
1379 * call.c (implicit_conversion_error): Split out from...
1380 (perform_implicit_conversion_flags): ...here.
1381 (build_converted_constant_expr_internal): Use it.
1382
1383 2020-05-11 Jason Merrill <jason@redhat.com>
1384
1385 PR c++/90748
1386 * parser.c (inject_parm_decls): Set current_class_ptr here.
1387 (cp_parser_direct_declarator): And here.
1388 (cp_parser_late_return_type_opt): Not here.
1389 (cp_parser_noexcept_specification_opt): Nor here.
1390 (cp_parser_exception_specification_opt)
1391 (cp_parser_late_noexcept_specifier): Remove unneeded parameters.
1392
1393 2020-05-11 Jason Merrill <jason@redhat.com>
1394
1395 * decl.c (cxx_init_decl_processing): Call declare_weak for
1396 __cxa_pure_virtual.
1397
1398 2020-05-11 Jason Merrill <jason@redhat.com>
1399
1400 * pt.c (instantiate_class_template_1): Call tsubst_expr for
1401 STATIC_ASSERT member.
1402 * ptree.c (cxx_print_xnode): Handle STATIC_ASSERT.
1403
1404 2020-05-11 Jason Merrill <jason@redhat.com>
1405
1406 * pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Remove redundant
1407 walking of capture list.
1408
1409 2020-05-11 Jason Merrill <jason@redhat.com>
1410
1411 * cp-tree.h (LOOKUP_EXPLICIT_TMPL_ARGS): Remove.
1412 * call.c (build_new_function_call): Don't set it.
1413 (build_new_method_call_1): Likewise.
1414 (build_over_call): Check cand->explicit_targs instead.
1415
1416 2020-05-11 Jason Merrill <jason@redhat.com>
1417
1418 * decl.c (compute_array_index_type_loc): Stabilize before building
1419 the MINUS_EXPR.
1420
1421 2020-05-11 Jason Merrill <jason@redhat.com>
1422
1423 * decl.c (grokdeclarator): Adjust deprecated_state here.
1424 (start_decl): Not here.
1425
1426 2020-05-08 Iain Sandoe <iain@sandoe.co.uk>
1427
1428 PR c++/95003
1429 * coroutines.cc (build_actor_fn): Ensure that bind scopes
1430 are marked as having side-effects where necessary.
1431 (replace_statement_captures): Likewise.
1432 (morph_fn_to_coro): Likewise.
1433
1434 2020-05-08 Nathan Sidwell <nathan@acm.org>
1435
1436 * NEWS: Delete, it is so stale.
1437
1438 * parser.c (cp_lexer_set_source_position_from_token): EOF has a
1439 location too.
1440
1441 2020-05-07 Iain Sandoe <iain@sandoe.co.uk>
1442
1443 PR c++/94817
1444 PR c++/94829
1445 * coroutines.cc (morph_fn_to_coro): Set unformed outline
1446 functions to error_mark_node. For early error returns suppress
1447 warnings about missing ramp return values. Fix reinstatement
1448 of the function body on pre-existing initial error.
1449 * decl.c (finish_function): Use the normal error path for fails
1450 in the ramp function, do not try to compile the helpers if the
1451 transform fails.
1452
1453 2020-05-07 Marek Polacek <polacek@redhat.com>
1454
1455 PR c++/94590 - Detect long double -> double narrowing.
1456 * typeck2.c (check_narrowing): Detect long double -> double
1457 narrowing even when double and long double have the same
1458 precision. Make it handle conversions to float too.
1459
1460 2020-05-07 Marek Polacek <polacek@redhat.com>
1461
1462 PR c++/94255
1463 * parser.c (cp_parser_class_specifier_1): Check that the scope is
1464 nested inside current scope before pushing it.
1465
1466 2020-05-07 Marek Polacek <polacek@redhat.com>
1467
1468 P1957R2
1469 * typeck2.c (check_narrowing): Consider T* to bool narrowing
1470 in C++11 and up.
1471
1472 2020-05-07 Marek Polacek <polacek@redhat.com>
1473
1474 * decl.c (grok_op_properties): Fix spelling of non-static.
1475 * typeck.c (build_class_member_access_expr): Likewise.
1476
1477 2020-05-07 Richard Biener <rguenther@suse.de>
1478
1479 PR middle-end/94703
1480 * optimize.c (update_cloned_parm): Copy DECL_NOT_GIMPLE_REG_P.
1481
1482 2020-05-06 Marek Polacek <polacek@redhat.com>
1483
1484 PR c++/94938
1485 * pt.c (tsubst_copy_and_build): Call type_dependent_expression_p_push
1486 instead of uses_template_parms. Move the warning_sentinels after the
1487 RECURs.
1488
1489 2020-05-06 Jakub Jelinek <jakub@redhat.com>
1490
1491 PR c++/94951
1492 * typeck.c (cp_strict_aliasing_warning): New function.
1493 (cp_build_indirect_ref_1, build_reinterpret_cast_1): Use
1494 it instead of strict_aliasing_warning.
1495
1496 PR c++/94907
1497 * method.c (defaulted_late_check): Don't call synthesize_method
1498 on constexpr sfk_comparison if it has been called on it already.
1499
1500 2020-05-06 Nathan Sidwell <nathan@acm.org>
1501
1502 PR c++/94946
1503 * decl.c (grokdeclarator): Don't splice template attributes in
1504 parm context -- they can apply to the parm.
1505
1506 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
1507
1508 * coroutines.cc: Remove references to n4849 throughout.
1509
1510 2020-05-05 Jason Merrill <jason@redhat.com>
1511
1512 CWG 2235
1513 * pt.c (more_specialized_fn): Do consider parms with no deducible
1514 template parameters.
1515
1516 2020-05-05 Jason Merrill <jason@redhat.com>
1517
1518 PR c++/90212
1519 * constexpr.c (potential_constant_expression_1): In a lambda
1520 function, consider a captured variable directly.
1521
1522 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
1523
1524 * coroutines.cc (transform_await_wrapper): Check that we have
1525 no unlowered co_yields.
1526 (captures_temporary): Likewise.
1527 (register_awaits): Likewise.
1528
1529 2020-05-05 Nathan Sidwell <nathan@acm.org>
1530
1531 PR c++/94807
1532 * coroutines.cc (morph_fn_to_coro): Just check for
1533 closure_identifier.
1534 * pt.c (tsubst_function_decl): Update lambda fn's this_ptr name.
1535
1536 2020-05-05 Marek Polacek <polacek@redhat.com>
1537 Jason Merrill <jason@redhat.com>
1538
1539 PR c++/94799
1540 * parser.c (cp_parser_postfix_dot_deref_expression): If we have
1541 a type-dependent object of class type, stash it to
1542 parser->context->object_type. If the postfix expression doesn't have
1543 a type, use typeof.
1544 (cp_parser_class_name): Consider object scope too.
1545 (cp_parser_lookup_name): Remove code dealing with the case when
1546 object_type is unknown_type_node.
1547
1548 2020-05-04 Patrick Palka <ppalka@redhat.com>
1549
1550 PR c++/94038
1551 * cp-gimplify.c (cp_fold) <case CALL_EXPR>: Move some variable
1552 declarations closer to their uses. Copy the CALL_EXPR only
1553 when one of its arguments has changed.
1554 <case TREE_VEC>: Instead of first collecting the folded
1555 arguments into a releasing_vec, just make a copy of the TREE_VEC
1556 as soon as folding changes one of its arguments.
1557
1558 2020-05-04 Iain Sandoe <iain@sandoe.co.uk>
1559
1560 * coroutines.cc (morph_fn_to_coro): Mark the coro.gro variable
1561 as artificial and ignored.
1562
1563 2020-05-04 Nathan Sidwell <nathan@acm.org>
1564
1565 pt.c (process_template_parm): Don't walk the template list twice,
1566 remember the final node instead.
1567 (end_template_parm_list): Refactor. Comment on why we do a pop
1568 and a push.
1569
1570 PR c++/94827 -- don't save parms in nested requirement
1571 * constraint.cc (tsubst_nested_requirement): TYPE directly holds
1572 notmalized requirement.
1573 (finish_nested_requirement): Don't stash current tpl parms into
1574 the requirement.
1575 (diagnose_nested_requirement): TYPE directly holds notmalized
1576 requirement.
1577
1578 2020-05-01 Patrick Palka <ppalka@redhat.com>
1579
1580 PR c++/90880
1581 * cp-tree.h (check_accessibility_of_qualified_id): Add
1582 tsubst_flags_t parameter and change return type to bool.
1583 * parser.c (cp_parser_lookup_name): Pass tf_warning_to_error to
1584 check_accessibility_of_qualified_id.
1585 * pt.c (tsubst_qualified_id): Return error_mark_node if
1586 check_accessibility_of_qualified_id returns false.
1587 * semantics.c (check_accessibility_of_qualified_id): Add
1588 complain parameter. Pass complain instead of
1589 tf_warning_or_error to perform_or_defer_access_check. Return
1590 true unless perform_or_defer_access_check returns false.
1591
1592 2020-05-01 Marek Polacek <polacek@redhat.com>
1593
1594 PR c++/94885
1595 * typeck2.c (process_init_constructor_record): Return PICFLAG_ERRONEOUS
1596 if an initializer element was erroneous.
1597
1598 2020-05-01 Jason Merrill <jason@redhat.com>
1599
1600 PR c++/90479
1601 * init.c (get_nsdmi): Don't push_to_top_level for a local class.
1602
1603 2020-05-01 Jason Merrill <jason@redhat.com>
1604
1605 PR c++/91529
1606 * decl.c (cp_finish_decl): Also clear TREE_READONLY if
1607 -fmerge-all-constants.
1608
1609 2020-05-01 Jason Merrill <jason@redhat.com>
1610
1611 PR c++/93822
1612 * pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have
1613 the same type as the variable.
1614
1615 2020-04-30 Jason Merrill <jason@redhat.com>
1616 Nathan Sidwell <nathan@acm.org>
1617
1618 PR c++/94827
1619 * constraint.cc (map_arguments): If ARGS is null, it's a
1620 self-mapping of parms.
1621 (finish_nested_requirement): Do not pass argified
1622 current_template_parms to normalization.
1623 (tsubst_nested_requirement): Don't assert no template parms.
1624
1625 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
1626
1627 PR c++/94886
1628 * coroutines.cc (transform_local_var_uses): Defer walking
1629 the DECL_INITIALs of BIND_EXPR vars until all the frame
1630 allocations have been made.
1631
1632 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
1633
1634 PR c++/94883
1635 * coroutines.cc (register_awaits): Update target
1636 expressions for awaitable and suspend handle
1637 initializers.
1638
1639 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
1640
1641 PR c++/94879
1642 * coroutines.cc (build_co_await): Account for variables
1643 with DECL_VALUE_EXPRs.
1644 (captures_temporary): Likewise.
1645 (register_awaits): Likewise.
1646
1647 2020-04-29 Patrick Palka <ppalka@redhat.com>
1648
1649 PR c++/94830
1650 * pt.c (find_template_parameter_info::parm_list): New field.
1651 (keep_template_parm): Use the new field to build up the
1652 parameter list here instead of ...
1653 (find_template_parameters): ... here. Return ftpi.parm_list.
1654
1655 2020-04-29 Jakub Jelinek <jakub@redhat.com>
1656
1657 PR target/94707
1658 * class.c (build_base_field): Set DECL_FIELD_ABI_IGNORED on C++17 empty
1659 base artificial FIELD_DECLs.
1660 (layout_class_type): Set DECL_FIELD_ABI_IGNORED on empty class
1661 field_poverlapping_p FIELD_DECLs.
1662
1663 2020-04-29 Patrick Palka <ppalka@redhat.com>
1664
1665 PR c++/94819
1666 * constraint.cc (satisfy_declaration_constraints): Use saved_t
1667 instead of t as the key to decl_satisfied_cache.
1668
1669 PR c++/94808
1670 * error.c (print_requires_expression_info): Print the dependent
1671 form of the parameter list with its template parameter mapping,
1672 rather than printing the substituted form.
1673
1674 2020-04-28 Jason Merrill <jason@redhat.com>
1675
1676 PR c++/94583
1677 * decl.c (use_eh_spec_block): Check nothrow type after
1678 DECL_DEFAULTED_FN.
1679 * pt.c (maybe_instantiate_noexcept): Call synthesize_method for
1680 DECL_MAYBE_DELETED fns here.
1681 * decl2.c (mark_used): Not here.
1682 * method.c (get_defaulted_eh_spec): Reject DECL_MAYBE_DELETED here.
1683
1684 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
1685
1686 PR c++/94760
1687 * coroutines.cc (instantiate_coro_traits): Pass a reference to
1688 object type rather than a pointer type for 'this', for method
1689 coroutines.
1690 (struct param_info): Add a field to hold that the parm is a lambda
1691 closure pointer.
1692 (morph_fn_to_coro): Check for lambda closure pointers in the
1693 args. Use a reference to *this when building the args list for the
1694 promise allocator lookup.
1695
1696 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
1697
1698 PR c++/94759
1699 * coroutines.cc (coro_promise_type_found_p): Do not
1700 exclude non-classes here (this needs to be handled in the
1701 coroutine header).
1702 (morph_fn_to_coro): Allow for the case where the coroutine
1703 returns void.
1704
1705 2020-04-27 Iain Sandoe <iain@sandoe.co.uk>
1706
1707 PR c++/94701
1708 * coroutines.cc (struct local_var_info): Add fields for static
1709 variables and those with DECL_VALUE_EXPR redirection.
1710 (transform_local_var_uses): Skip past typedefs and static vars
1711 and then account for redirected variables.
1712 (register_local_var_uses): Likewise.
1713
1714 2020-04-27 Jason Merrill <jason@redhat.com>
1715
1716 PR c++/90750
1717 PR c++/79585
1718 * decl.c (grokdeclarator): Move dependent attribute to decl.
1719 * decl2.c (splice_template_attributes): No longer static.
1720
1721 2020-04-27 Patrick Palka <ppalka@redhat.com>
1722
1723 PR c++/94772
1724 * constexpr.c (cxx_eval_call_expression): Don't set new_obj if we're
1725 evaluating the target constructor of a delegating constructor.
1726 (cxx_eval_store_expression): Don't set TREE_READONLY if the LHS of the
1727 INIT_EXPR is '*this'.
1728
1729 2020-04-26 Marek Polacek <polacek@redhat.com>
1730
1731 PR c++/90320
1732 * call.c (struct conversion): Add copy_init_p.
1733 (standard_conversion): Set copy_init_p in ck_base and ck_rvalue
1734 if FLAGS demands LOOKUP_ONLYCONVERTING.
1735 (convert_like_real) <case ck_base>: If copy_init_p is set, or
1736 LOOKUP_ONLYCONVERTING into FLAGS.
1737
1738 2020-04-26 Iain Sandoe <iain@sandoe.co.uk>
1739
1740 PR c++/94752
1741 * coroutines.cc (morph_fn_to_coro): Ensure that
1742 unnamed function params have a usable and distinct
1743 frame field name.
1744
1745 2020-04-24 Jason Merrill <jason@redhat.com>
1746
1747 PR c++/94583
1748 * decl.c (redeclaration_error_message): Reject defaulted comparison
1749 operator that has been previously declared.
1750
1751 2020-04-25 Patrick Palka <ppalka@redhat.com>
1752
1753 * parser.c (cp_parser_diagnose_invalid_type_name): Suggest enabling
1754 concepts if the invalid identifier is 'requires'.
1755
1756 2020-04-25 Jakub Jelinek <jakub@redhat.com>
1757
1758 PR c++/94742
1759 * semantics.c (finish_call_expr): When looking if all overloads
1760 are noreturn, use STRIP_TEMPLATE to look through TEMPLATE_DECLs.
1761
1762 2020-04-24 Martin Liska <mliska@suse.cz>
1763
1764 * coroutines.cc: Fix compilation error for release checking
1765 where we miss declaration of ‘coro_body_contains_bind_expr_p’.
1766
1767 2020-04-23 Patrick Palka <ppalka@redhat.com>
1768
1769 * tree.c (zero_init_expr_p): Use uses_template_parms instead of
1770 dependent_type_p.
1771
1772 PR c++/94645
1773 * pt.c (template_class_depth): Walk into the DECL_FRIEND_CONTEXT of a
1774 friend declaration rather than into its CP_DECL_CONTEXT.
1775
1776 2020-04-23 Iain Sandoe <iain@sandoe.co.uk>
1777
1778 PR c++/94288
1779 * coroutines.cc (await_statement_expander): Simplify cases.
1780 (struct susp_frame_data): Add fields for truth and/or if
1781 cases, rename one field.
1782 (analyze_expression_awaits): New.
1783 (expand_one_truth_if): New.
1784 (add_var_to_bind): New helper.
1785 (coro_build_add_if_not_cond_break): New helper.
1786 (await_statement_walker): Handle conditional expressions,
1787 handle expansion of truth-and/or-if cases.
1788 (bind_expr_find_in_subtree): New, checking-only.
1789 (coro_body_contains_bind_expr_p): New, checking-only.
1790 (morph_fn_to_coro): Ensure that we have a top level bind
1791 expression.
1792
1793 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
1794
1795 PR translation/94698
1796 * class.c (check_field_decls): Change "define" to "declare" in
1797 -Weffc++ diagnostics.
1798
1799 2020-04-22 Patrick Palka <ppalka@redhat.com>
1800
1801 PR c++/94719
1802 PR c++/94549
1803 * constraint.cc (satisfy_declaration_constraints): If the inherited
1804 constructor points to an instantiation of a constructor template,
1805 remember and use its attached template arguments.
1806
1807 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
1808
1809 PR translation/94698
1810 * class.c (check_field_decls): Change "override" to "define" in
1811 -Weffc++ diagnostics.
1812
1813 2020-04-22 Iain Sandoe <iain@sandoe.co.uk>
1814
1815 PR c++/94682
1816 * coroutines.cc (struct param_info): Add a field to note that
1817 the param is 'this'.
1818 (morph_fn_to_coro): Convert this to a reference before using it
1819 in the promise parameter preview.
1820
1821 2020-04-22 Jason Merrill <jason@redhat.com>
1822
1823 PR c++/94546
1824 * pt.c (register_parameter_specializations): If the instantiation is
1825 still a parameter pack, don't wrap it in a NONTYPE_ARGUMENT_PACK.
1826 (tsubst_pack_expansion, tsubst_expr): Adjust.
1827
1828 2020-04-22 Martin Sebor <msebor@redhat.com>
1829 Jason Merrill <jason@redhat.com>
1830
1831 PR c++/94510
1832 * decl.c (reshape_init_array_1): Avoid stripping redundant trailing
1833 zero initializers...
1834 * mangle.c (write_expression): ...and handle them here even for
1835 pointers to members by calling zero_init_expr_p.
1836 * cp-tree.h (zero_init_expr_p): Declare.
1837 * tree.c (zero_init_expr_p): Define.
1838 (type_initializer_zero_p): Remove.
1839 * pt.c (tparm_obj_values): New hash_map.
1840 (get_template_parm_object): Store to it.
1841 (tparm_object_argument): New.
1842
1843 2020-04-22 Patrick Palka <ppalka@redhat.com>
1844
1845 PR c++/67825
1846 * constraint.cc (diagnose_valid_expression): Check convert_to_void here
1847 as well as in tsubst_valid_expression_requirement.
1848
1849 2020-04-21 Patrick Palka <ppalka@redhat.com>
1850
1851 PR c++/94549
1852 * constraint.cc (satisfy_declaration_constraints): Don't strip the
1853 inherited constructor if it already has template information.
1854
1855 PR c++/94597
1856 * pt.c (any_template_parm_r) <case IDENTIFIER_NODE>: New case. If this
1857 is a conversion operator, visit its TREE_TYPE.
1858
1859 2020-04-21 Nathan Sidwell <nathan@acm.org>
1860
1861 * pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
1862 error_mark_node.
1863
1864 2020-04-21 Iain Sandoe <iain@sandoe.co.uk>
1865
1866 PR c++/94661
1867 * coroutines.cc (morph_fn_to_coro): Simplify return
1868 value computation.
1869
1870 2020-04-17 Marek Polacek <polacek@redhat.com>
1871
1872 PR c++/94592
1873 * constexpr.c (cxx_eval_outermost_constant_expr): Return when T is
1874 a BRACE_ENCLOSED_INITIALIZER_P.
1875 (is_nondependent_constant_expression): Don't check
1876 BRACE_ENCLOSED_INITIALIZER_P.
1877 (is_nondependent_static_init_expression): Likewise.
1878
1879 2020-04-20 Patrick Palka <ppalka@redhat.com>
1880
1881 PR c++/94628
1882 * cp-tree.h (lss_policy::lss_nop): New enumerator.
1883 * pt.c (local_specialization_stack::local_specialization_stack): Handle
1884 an lss_nop policy.
1885 (local_specialization_stack::~local_specialization_stack): Likewise.
1886 (tsubst_pack_expansion): Use a local_specialization_stack instead of
1887 manually saving and restoring local_specializations. Conditionally
1888 replace local_specializations sooner, before the handling of the
1889 unsubstituted_packs case.
1890
1891 2020-04-20 Marek Polacek <polacek@redhat.com>
1892
1893 PR c++/94505 - bogus -Wparentheses warning with fold-expression.
1894 * pt.c (fold_expression): Add warning_sentinel for -Wparentheses
1895 before calling build_x_binary_op.
1896
1897 2020-04-20 Marek Polacek <polacek@redhat.com>
1898
1899 * coroutines.cc (captures_temporary): Don't assign the result of
1900 STRIP_NOPS to the same variable.
1901
1902 2020-04-20 Nathan Sidwell <nathan@acm.org>
1903
1904 PR c++/94454 - tpl-tpl-parms are not canonicalizable types
1905 * pt.c (canonical_type_parameter): Assert not a tpl-tpl-parm.
1906 (process_template_parm): tpl-tpl-parms are structural.
1907 (rewrite_template_parm): Propagate structuralness.
1908
1909 PR c++/94454 - Expr pack expansion equality
1910 * tree.c (cp_tree_equal) [TEMPLATE_ID_EXPR, default]: Refactor.
1911 [EXPR_PACK_EXPANSION]: Add.
1912
1913 PR c++/94454 Template Argument Hashing
1914 * pt.c (iterative_hash_template_arg): Strip nodes as
1915 template_args_equal does.
1916 [ARGUMENT_PACK_SELECT, TREE_VEC, CONSTRUCTOR]: Refactor.
1917 [node_class:TEMPLATE_TEMPLATE_PARM]: Hash by level & index.
1918 [node_class:default]: Refactor.
1919
1920 2020-04-18 Patrick Palka <ppalka@redhat.com>
1921
1922 PR c++/94632
1923 * tree.c (cp_tree_equal) <case PARM_DECL>: Ignore
1924 comparing_specializations if the parameters' contexts are identical.
1925
1926 PR c++/92187
1927 * pt.c (splice_late_return_type): Propagate cv-qualifiers and
1928 PLACEHOLDER_TYPE_CONSTRAINTS from the original auto node to the new one.
1929
1930 2020-04-17 Patrick Palka <ppalka@redhat.com>
1931
1932 PR c++/94483
1933 * lambda.c (lambda_capture_field_type): Avoid doing auto deduction if
1934 the explicit initializer has parameter packs.
1935
1936 PR c++/88754
1937 * parser.c (cp_parser_check_template_parameters): Before issuing a hard
1938 error, first try simulating an error instead.
1939
1940 2020-04-17 Jakub Jelinek <jakub@redhat.com>
1941
1942 PR other/94629
1943 * call.c (build_conditional_expr_1): Remove redundant assignment to
1944 arg2.
1945
1946 2020-04-16 Patrick Palka <ppalka@redhat.com>
1947
1948 PR c++/94475
1949 * cvt.c (ocp_convert): If the result of scalar_constant_value is
1950 erroneous, ignore it and use the original expression.
1951
1952 2020-04-16 Jakub Jelinek <jakub@redhat.com>
1953
1954 PR c++/94571
1955 * parser.c (cp_parser_simple_declaration): Fix up a pasto in
1956 diagnostics.
1957
1958 2020-04-15 Jakub Jelinek <jakub@redhat.com>
1959
1960 PR c/94593
1961 * parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
1962 requires directive when not at file or namespace scope.
1963
1964 2020-04-14 Iain Sandoe <iain@sandoe.co.uk>
1965
1966 PR c++/94359
1967 * coroutines.cc (build_actor_fn): Check that the target can
1968 support the resume tailcall before mandating it.
1969
1970 2020-04-14 Patrick Palka <ppalka@redhat.com>
1971
1972 PR c++/85278
1973 * cxx-pretty-print.c (cxx_pretty_printer:simple_type_specifier)
1974 <case DECLTYPE_TYPE>: Handle DECLTYPE_TYPE here instead of ...
1975 (pp_cxx_type_specifier_seq) <case DECLTYPE_TYPE>: ... here.
1976 (cxx_pretty_printer::direct_abstract_declarator) <case DECLTYPE_TYPE>:
1977 New no-op case.
1978
1979 PR c++/94034
1980 * constexpr.c (replace_result_decl_data): New struct.
1981 (replace_result_decl_data_r): New function.
1982 (replace_result_decl): New function.
1983 (cxx_eval_call_expression): Use it.
1984 * tree.c (build_aggr_init_expr): Set the location of the AGGR_INIT_EXPR
1985 to that of its initializer.
1986
1987 2020-04-13 Marek Polacek <polacek@redhat.com>
1988
1989 PR c++/94588
1990 * name-lookup.c (check_local_shadow): Add an inform call.
1991
1992 2020-04-13 Patrick Palka <ppalka@redhat.com>
1993
1994 PR c++/94521
1995 * error.c (dump_scope): Pass TFF_NO_FUNCTION_ARGUMENTS to
1996 dump_function_decl when printing a function template instantiation as a
1997 scope.
1998
1999 PR c++/94470
2000 * constexpr.c (get_or_insert_ctor_field): Set default value of parameter
2001 'pos_hint' to -1.
2002 (cxx_eval_bare_aggregate): Use get_or_insert_ctor_field instead of
2003 assuming the the next index belongs at the end of the new CONSTRUCTOR.
2004 (cxx_eval_store_expression): Revert PR c++/78572 fix.
2005
2006 2020-04-13 Nathan Sidwell <nathan@acm.org>
2007
2008 PR c++/94426 lambdas with internal linkage are different to no-linkage
2009 * decl2.c (determine_visibility): A lambda's visibility is
2010 affected by its extra scope.
2011 * pt.c (instantiate_decl): Determine var's visibility before
2012 instantiating its initializer.
2013 * tree.c (no_linkage_check): Revert code looking at visibility of
2014 lambda's extra scope.
2015 `
2016 2020-04-10 Iain Sandoe <iain@sandoe.co.uk>
2017
2018 PR c++/94528
2019 * coroutines.cc (co_await_expander): Remove.
2020 (expand_one_await_expression): New.
2021 (process_one_statement): New.
2022 (await_statement_expander): New.
2023 (build_actor_fn): Revise to use per-statement expander.
2024 (struct susp_frame_data): Reorder and comment.
2025 (register_awaits): Factor code.
2026 (replace_statement_captures): New, factored from...
2027 (maybe_promote_captured_temps):.. here.
2028 (await_statement_walker): Revise to process per statement.
2029 (morph_fn_to_coro): Use revised susp_frame_data layout.
2030
2031 2020-04-10 Marek Polacek <polacek@redhat.com>
2032
2033 PR c++/94149
2034 * method.c (constructible_expr): In C++20, try using parenthesized
2035 initialization of aggregates to determine the result of
2036 __is_constructible.
2037
2038 2020-04-10 Bin Cheng <bin.cheng@linux.alibaba.com>
2039
2040 * coroutines.cc (co_await_expander): Simplify.
2041
2042 2020-04-09 Jason Merrill <jason@redhat.com>
2043
2044 PR c++/94523
2045 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]: Look at
2046 ctx->object and ctx->global->values first.
2047
2048 2020-04-09 Marek Polacek <polacek@redhat.com>
2049
2050 PR c++/93790
2051 * call.c (initialize_reference): If the reference binding failed, maybe
2052 try initializing from { }.
2053 * decl.c (grok_reference_init): For T& t(e), set
2054 LOOKUP_AGGREGATE_PAREN_INIT but don't build up a constructor yet.
2055
2056 2020-04-08 Iain Sandoe <iain@sandoe.co.uk>
2057 Jun Ma <JunMa@linux.alibaba.com>
2058
2059 * coroutines.cc (maybe_promote_captured_temps): Add a cleanup
2060 expression, if needed, to any call from which we promoted
2061 temporaries captured by reference.
2062
2063 2020-04-08 Marek Polacek <polacek@redhat.com>
2064
2065 PR c++/94507 - ICE-on-invalid with lambda template.
2066 * pt.c (tsubst_lambda_expr): Cope when tsubst_template_decl or
2067 tsubst_function_decl returns error_mark_node.
2068
2069 2020-04-08 Martin Liska <mliska@suse.cz>
2070
2071 PR c++/94314
2072 * decl.c (duplicate_decls): Duplicate also DECL_IS_REPLACEABLE_OPERATOR.
2073 (cxx_init_decl_processing): Mark replaceable all implicitly defined
2074 operators.
2075
2076 2020-04-08 Patrick Palka <ppalka@redhat.com>
2077
2078 Core issues 1001 and 1322
2079 PR c++/92010
2080 * pt.c (rebuild_function_or_method_type): Split function out from ...
2081 (tsubst_function_type): ... here.
2082 (maybe_rebuild_function_decl_type): New function.
2083 (tsubst_function_decl): Use it.
2084
2085 2020-04-08 Jakub Jelinek <jakub@redhat.com>
2086
2087 PR c++/94325
2088 * decl.c (begin_destructor_body): For CLASSTYPE_VBASECLASSES class
2089 dtors, if CLASSTYPE_PRIMARY_BINFO is non-NULL, but not BINFO_VIRTUAL_P,
2090 look at CLASSTYPE_PRIMARY_BINFO of its BINFO_TYPE if it is not
2091 BINFO_VIRTUAL_P, and so on.
2092
2093 2020-04-08 Marek Polacek <polacek@redhat.com>
2094
2095 PR c++/94478 - ICE with defaulted comparison operator
2096 * method.c (early_check_defaulted_comparison): Give an error when the
2097 context is null.
2098
2099 2020-04-08 Tobias Burnus <tobias@codesourcery.com>
2100
2101 PR middle-end/94120
2102 * paser.c (cp_parser_oacc_declare): Add check that variables
2103 are declared in the same scope as the directive.
2104
2105 2020-04-07 Jason Merrill <jason@redhat.com>
2106
2107 PR c++/94480
2108 * parser.c (cp_parser_requires_expression): Use tentative_firewall.
2109
2110 PR c++/94481
2111 * parser.c (cp_parser_placeholder_type_specifier): Use
2112 matching_parens.
2113
2114 2020-04-07 Iain Sandoe <iain@sandoe.co.uk>
2115
2116 * coroutines.cc (maybe_promote_captured_temps): Ensure that
2117 reference capture placeholder vars are properly declared.
2118
2119 2020-04-07 Patrick Palka <ppalka@redhat.com>
2120
2121 PR c++/90996
2122 * tree.c (replace_placeholders): Look through all handled components,
2123 not just COMPONENT_REFs.
2124 * typeck2.c (process_init_constructor_array): Propagate
2125 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
2126 the array initializer.
2127
2128 2020-04-07 Jakub Jelinek <jakub@redhat.com>
2129
2130 PR c++/94512
2131 * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
2132 if cp_parser_omp_master succeeded.
2133
2134 2020-04-06 Jason Merrill <jason@redhat.com>
2135
2136 PR c++/94462
2137 * decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.
2138
2139 2020-04-04 Marek Polacek <polacek@redhat.com>
2140 Jason Merrill <jason@redhat.com>
2141
2142 PR c++/94155 - crash in gimplifier with paren init of aggregates.
2143 * init.c (build_vec_init): Fill in indexes.
2144
2145 2020-04-04 Jason Merrill <jason@redhat.com>
2146
2147 PR c++/91377
2148 * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR.
2149
2150 2020-04-04 Patrick Palka <ppalka@redhat.com>
2151
2152 PR c++/94205
2153 PR c++/79937
2154 * constexpr.c (struct constexpr_ctx): New field 'parent'.
2155 (cxx_eval_bare_aggregate): Propagate CONSTRUCTOR_PLACEHOLDER_BOUNDARY
2156 flag from the original constructor to the reduced constructor.
2157 (lookup_placeholder): Prefer to return the outermost matching object
2158 by recursively calling lookup_placeholder on the 'parent' context,
2159 but don't cross CONSTRUCTOR_PLACEHOLDER_BOUNDARY constructors.
2160 (cxx_eval_constant_expression): Link the 'ctx' context to the 'new_ctx'
2161 context via 'new_ctx.parent' when being expanded without an explicit
2162 target. Don't call replace_placeholders.
2163 (cxx_eval_outermost_constant_expr): Initialize 'ctx.parent' to NULL.
2164
2165 PR c++/94219
2166 PR c++/94205
2167 * constexpr.c (get_or_insert_ctor_field): Split out (while adding
2168 support for VECTOR_TYPEs, and optimizations for the common case)
2169 from ...
2170 (cxx_eval_store_expression): ... here. Rename local variable
2171 'changed_active_union_member_p' to 'activated_union_member_p'. Record
2172 the sequence of indexes into 'indexes' that yields the subobject we're
2173 assigning to. Record the integer offsets of the constructor indexes
2174 we're assigning through into 'index_pos_hints'. After evaluating the
2175 initializer of the store expression, recompute 'valp' using 'indexes'
2176 and using 'index_pos_hints' as hints.
2177 (cxx_eval_bare_aggregate): Tweak comments. Use get_or_insert_ctor_field
2178 to recompute the constructor_elt pointer we're assigning through after
2179 evaluating each initializer.
2180
2181 2020-04-04 Jason Merrill <jason@redhat.com>
2182
2183 PR c++/67825
2184 * constraint.cc (tsubst_valid_expression_requirement): Call
2185 convert_to_void.
2186
2187 2020-04-04 Jason Merrill <jason@redhat.com>
2188
2189 PR c++/94453
2190 * constexpr.c (maybe_constant_value): Use break_out_target_exprs.
2191 * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in
2192 NON_LVALUE_EXPR.
2193
2194 2020-04-04 Jakub Jelinek <jakub@redhat.com>
2195
2196 PR debug/94441
2197 * parser.c (cp_parser_omp_for_loop): Use
2198 protected_set_expr_location_if_unset.
2199 * cp-gimplify.c (genericize_if_stmt, genericize_cp_loop): Likewise.
2200
2201 PR c++/94477
2202 * pt.c (tsubst_expr) <case OMP_MASTER>: Clear
2203 omp_parallel_combined_clauses.
2204
2205 2020-04-03 Jason Merrill <jason@redhat.com>
2206
2207 PR c++/91966
2208 * pt.c (complex_pack_expansion_r): New.
2209 (complex_alias_template_p): Use it.
2210
2211 2020-03-31 Jason Merrill <jason@redhat.com>
2212
2213 PR c++/94205
2214 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Call
2215 replace_placeholders.
2216 * typeck2.c (store_init_value): Fix arguments to
2217 fold_non_dependent_expr.
2218
2219 2020-03-31 Jason Merrill <jason@redhat.com>
2220
2221 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Use
2222 local variables.
2223
2224 2020-03-30 Jason Merrill <jason@redhat.com>
2225
2226 PR c++/90711
2227 * tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
2228 (called_fns_equal): Check DECL_CONTEXT.
2229
2230 2020-03-30 Jakub Jelinek <jakub@redhat.com>
2231
2232 PR c++/94385
2233 * semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with
2234 STATEMENT_CODE_P code.
2235
2236 2020-03-28 Patrick Palka <ppalka@redhat.com>
2237
2238 PR c++/94306
2239 * parser.c (cp_parser_requires_clause_opt): Diagnose and recover from
2240 "requires {" when "requires requires {" was probably intended.
2241
2242 PR c++/94252
2243 * constraint.cc (tsubst_compound_requirement): Always suppress errors
2244 from type_deducible_p and expression_convertible_p, as they're not
2245 substitution errors.
2246 (diagnose_atomic_constraint) <case INTEGER_CST>: Remove this case so
2247 that we diagnose INTEGER_CST expressions of non-bool type via the
2248 default case.
2249 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: New case.
2250 * parser.c (cp_parser_requires_expression): Always parse the requirement
2251 body as if we're processing a template, by temporarily incrementing
2252 processing_template_decl. Afterwards, if we're not actually in a
2253 template context, perform semantic processing to diagnose any invalid
2254 types and expressions.
2255 * pt.c (tsubst_copy_and_build) <case REQUIRES_EXPR>: Remove dead code.
2256 * semantics.c (finish_static_assert): Explain an assertion failure
2257 when the condition is a REQUIRES_EXPR like we do when it is a concept
2258 check.
2259
2260 * constraint.cc (diagnose_compound_requirement): When diagnosing a
2261 compound requirement, maybe replay the satisfaction failure, subject to
2262 the current diagnosis depth.
2263
2264 * constraint.cc (finish_constraint_binary_op): Set the location of EXPR
2265 as well as its range, because build_x_binary_op doesn't always do so.
2266 (current_constraint_diagnosis_depth): New.
2267 (concepts_diagnostics_max_depth_exceeded_p): New.
2268 (collect_operands_of_disjunction): New.
2269 (satisfy_disjunction): When diagnosing a satisfaction failure, maybe
2270 replay each branch of the disjunction, subject to the current diagnosis
2271 depth.
2272 (diagnose_valid_expression): When diagnosing a satisfaction failure,
2273 maybe replay the substitution error, subject to the current diagnosis
2274 recursion.
2275 (diagnose_valid_type): Likewise.
2276 (diagnose_nested_requiremnet): Likewise.
2277 (diagnosing_failed_constraint::diagnosing_failed_constraint): Increment
2278 current_constraint_diagnosis_depth when diagnosing.
2279 (diagnosing_failed_constraint::~diagnosing_failed_constraint): Decrement
2280 current_constraint_diagnosis_depth when diagnosing.
2281 (diagnosing_failed_constraint::replay_errors_p): New static member
2282 function.
2283 (diagnose_constraints): Don't diagnose if concepts_diagnostics_max_depth
2284 is 0. Emit a one-off note to increase -fconcepts-diagnostics-depth if
2285 the limit was exceeded.
2286 * cp-tree.h (diagnosing_failed_constraint::replay_errors_p): Declare.
2287
2288 2020-03-27 Nathan Sidwell <nathan@acm.org>
2289
2290 PR c++/84733
2291 * name-lookup.c (do_pushdecl): Look through cleanp levels.
2292
2293 2020-03-27 Martin Sebor <msebor@redhat.com>
2294
2295 PR c++/94078
2296 PR c++/93824
2297 PR c++/93810
2298 * cp-tree.h (most_specialized_partial_spec): Declare.
2299 * parser.c (cp_parser_elaborated_type_specifier): Distinguish alias
2300 from declarations.
2301 (specialization_of): New function.
2302 (cp_parser_check_class_key): Move code...
2303 (class_decl_loc_t::add): ...to here. Add parameters. Avoid issuing
2304 -Wredundant-tags on first-time declarations in other declarators.
2305 Correct handling of template specializations.
2306 (class_decl_loc_t::diag_mismatched_tags): Also expect to be called
2307 when -Wredundant-tags is enabled. Use primary template or partial
2308 specialization as the guide for uses of implicit instantiations.
2309 * pt.c (most_specialized_partial_spec): Declare extern.
2310
2311 2020-03-27 Nathan Sidwell <nathan@acm.org>
2312
2313 PR c++/94257
2314 * name-lookup.c (push_namespace): Triage ambiguous lookups that
2315 contain namespaces.
2316
2317 2020-03-27 Jakub Jelinek <jakub@redhat.com>
2318
2319 PR c++/94326
2320 * call.c (set_flags_from_callee): Don't update
2321 cp_function_chain->can_throw or current_function_returns_abnormally
2322 if cp_unevaluated_operand.
2323
2324 PR c++/94339
2325 * cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
2326 operand and creating a new COMPOUND_EXPR if anything changed.
2327
2328 2020-03-26 Marek Polacek <polacek@redhat.com>
2329
2330 PR c++/94336 - template keyword accepted before destructor names.
2331 * parser.c (cp_parser_unqualified_id): Give an error when 'template'
2332 is followed by a destructor name.
2333
2334 2020-03-27 Patrick Palka <ppalka@redhat.com>
2335
2336 * decl.c (compute_array_index_type_loc): Remove redundant
2337 type_dependent_expression_p check that is subsumed by
2338 value_dependent_expression_p.
2339 * decl2.c (is_late_template_attribute): Likewise.
2340 * pt.c (uses_template_parms): Likewise.
2341 (dependent_template_arg_p): Likewise.
2342
2343 2020-03-26 Marek Polacek <polacek@redhat.com>
2344
2345 DR 1710
2346 PR c++/94057 - template keyword in a typename-specifier.
2347 * parser.c (check_template_keyword_in_nested_name_spec): New.
2348 (cp_parser_nested_name_specifier_opt): Implement DR1710, optional
2349 'template'. Call check_template_keyword_in_nested_name_spec.
2350 (cp_parser_simple_type_specifier): Assume that a <
2351 following a qualified-id in a typename-specifier begins
2352 a template argument list.
2353
2354 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
2355
2356 * coroutines.cc (coro_init_identifiers): Initialize an identifier
2357 for the cororoutine handle 'address' method name.
2358 (struct coro_aw_data): Add fields to cover the continuations.
2359 (co_await_expander): Determine the kind of await_suspend in use.
2360 If we have the case that returns a continuation handle, then save
2361 this and make the target for 'scope exit without cleanup' be the
2362 continuation resume label.
2363 (expand_co_awaits): Remove.
2364 (struct suspend_point_info): Remove fields that kept the returned
2365 await_suspend handle type.
2366 (transform_await_expr): Remove code tracking continuation handles.
2367 (build_actor_fn): Add the continuation handle as an actor-function
2368 scope var. Build the symmetric transfer continuation point. Call
2369 the tree walk for co_await expansion directly, rather than via a
2370 trivial shim function.
2371 (register_await_info): Remove fields tracking continuation handles.
2372 (get_await_suspend_return_type): Remove.
2373 (register_awaits): Remove code tracking continuation handles.
2374 (morph_fn_to_coro): Remove code tracking continuation handles.
2375
2376 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
2377
2378 * coroutines.cc (co_await_expander): If we are expanding the
2379 initial await expression, set a boolean flag to show that we
2380 have now reached the initial await_resume() method call.
2381 (expand_co_awaits): Handle the 'initial await resume called' flag.
2382 (build_actor_fn): Insert the initial await expression into the
2383 start of the user-authored function-body. Handle the 'initial await
2384 resume called' flag.
2385 (morph_fn_to_coro): Initialise the 'initial await resume called'
2386 flag. Modify the unhandled exception catch clause to recognise
2387 exceptions that occur before the initial await_resume() and re-
2388 throw them.
2389
2390 2020-03-26 Jakub Jelinek <jakub@redhat.com>
2391
2392 PR c++/81349
2393 * class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
2394 true for all TEMPLATE_DECLs.
2395
2396 PR c++/94272
2397 * cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
2398
2399 2020-03-25 Patrick Palka <ppalka@redhat.com>
2400
2401 PR c++/94265
2402 * parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
2403 current condition chain when the if-statement has a non-empty
2404 init-statement.
2405
2406 2020-03-25 Iain Sandoe <iain@sandoe.co.uk>
2407
2408 PR c++/94319
2409 * coroutines.cc (captures_temporary): Fix a missing dereference.
2410
2411 2020-03-24 Marek Polacek <polacek@redhat.com>
2412
2413 PR c++/94190 - wrong no post-decrement operator error in template.
2414 * call.c (convert_like_real): Use convert_from_reference on the result.
2415
2416 2020-03-24 Jason Merrill <jason@redhat.com>
2417
2418 PR c++/94186
2419 * constraint.cc (constraint_satisfaction_value): Repeat noisily on
2420 error.
2421 (tsubst_nested_requirement): Likewise.
2422 (get_constraint_error_location): Allow missing context.
2423 (diagnose_atomic_constraint): Diagnose non-bool constraint here.
2424 (satisfy_atom): Not here. Only diagnose non-constant when noisy.
2425
2426 2020-03-24 Jason Merrill <jason@redhat.com>
2427
2428 * pt.c (any_template_parm_r): Look into the type of a non-type
2429 template parm.
2430
2431 2020-03-24 Jason Merrill <jason@redhat.com>
2432
2433 * cp-tree.h (cp_expr): When constructing from an expr and a
2434 location, call protected_set_expr_location.
2435
2436 2020-03-23 Patrick Palka <ppalka@redhat.com>
2437
2438 PR c++/93805
2439 * except.c (maybe_noexcept_warning): Add TODO.
2440 * method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
2441
2442 2020-03-23 nathans <nathan@acm.org>
2443
2444 PR c++/94044
2445 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
2446 operand.
2447
2448 2020-03-21 Patrick Palka <ppalka@redhat.com>
2449
2450 PR c++/94066
2451 * constexpr.c (reduced_constant_expression_p) [CONSTRUCTOR]: Properly
2452 handle unions without an initializer.
2453 (cxx_eval_component_reference): Emit a different diagnostic when the
2454 constructor element corresponding to a union member is NULL.
2455 (cxx_eval_bare_aggregate): When constructing a union, always set the
2456 active union member before evaluating the initializer. Relax assertion
2457 that verifies the index of the constructor element we're initializing
2458 hasn't been changed.
2459 (cxx_eval_store_expression): Diagnose changing the active union member
2460 while the union is in the process of being initialized. After setting
2461 an active union member, clear CONSTRUCTOR_NO_CLEARING on the underlying
2462 CONSTRUCTOR.
2463 (cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
2464 CONSTRUCTOR returned by lookup_placeholder.
2465
2466 2020-03-20 Patrick Palka <ppalka@redhat.com>
2467
2468 * cxx-pretty-print.c (pp_cxx_parameter_mapping): Make extern. Move
2469 the "[with ]" bits to here from ...
2470 (pp_cxx_atomic_constraint): ... here.
2471 * cxx-pretty-print.h (pp_cxx_parameter_mapping): Declare.
2472 * error.c (rebuild_concept_check): Delete.
2473 (print_concept_check_info): Print the dependent form of the constraint and the
2474 preferably substituted parameter mapping alongside it.
2475
2476 2020-03-19 Jason Merrill <jason@redhat.com>
2477
2478 PR c++/94175
2479 * cp-gimplify.c (simple_empty_class_p): Look through
2480 SIMPLE_TARGET_EXPR_P.
2481 (cp_gimplify_expr) [MODIFY_EXPR]: Likewise.
2482 [RETURN_EXPR]: Avoid producing 'return *retval;'.
2483 * call.c (build_call_a): Strip TARGET_EXPR from empty class arg.
2484 * cp-tree.h (SIMPLE_TARGET_EXPR_P): Check that TARGET_EXPR_INITIAL
2485 is non-null.
2486
2487 2020-03-19 Jakub Jelinek <jakub@redhat.com>
2488
2489 PR c++/93931
2490 * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
2491 on outer_automatic_var_p decls.
2492 * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
2493 capture proxy decls.
2494
2495 2020-03-18 Nathan Sidwell <nathan@acm.org>
2496
2497 PR c++/94147 - mangling of lambdas assigned to globals
2498 * parser.c (cp_parser_init_declarator): Namespace-scope variables
2499 provide a lambda scope.
2500 * tree.c (no_linkage_check): Lambdas with a variable for extra
2501 scope have a linkage from the variable.
2502
2503 2020-03-18 Jakub Jelinek <jakub@redhat.com>
2504
2505 * constraint.cc (resolve_function_concept_check, subsumes_constraints,
2506 strictly_subsumes): Fix up duplicated word issue in a comment.
2507 * coroutines.cc (build_init_or_final_await, captures_temporary):
2508 Likewise.
2509 * logic.cc (dnf_size_r, cnf_size_r): Likewise.
2510 * pt.c (append_type_to_template_for_access_check): Likewise.
2511
2512 PR c++/91759
2513 * decl.c (grokfndecl): Restore old diagnostics about deduction
2514 guide declared in different scope if in_namespace is NULL_TREE.
2515
2516 2020-03-17 Jakub Jelinek <jakub@redhat.com>
2517
2518 PR c++/90995
2519 * parser.c (cp_parser_enum_specifier): Use temp_override for
2520 parser->colon_corrects_to_scope_p, replace goto out with return.
2521 If scoped enum or enum with underlying type is not followed by
2522 { or ;, call cp_parser_commit_to_tentative_parse before calling
2523 cp_parser_error and make sure to return error_mark_node instead of
2524 NULL_TREE. Formatting fixes.
2525
2526 2020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
2527
2528 PR c++/94197
2529 * method.c (assignable_expr): Use cp_unevaluated.
2530 (is_xible_helper): Push a non-deferred access check for
2531 the stub objects created by assignable_expr and constructible_expr.
2532
2533 2020-03-17 Jakub Jelinek <jakub@redhat.com>
2534
2535 * pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
2536 (lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
2537 in a comment.
2538 * parser.c (cp_parser_statement, cp_parser_linkage_specification,
2539 cp_parser_placeholder_type_specifier,
2540 cp_parser_constraint_requires_parens): Likewise.
2541 * name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
2542
2543 2020-03-15 Iain Sandoe <iain@sandoe.co.uk>
2544
2545 * coroutines.cc (co_await_expander): Fix indentation.
2546
2547 2020-03-14 Jason Merrill <jason@redhat.com>
2548
2549 PR c++/92068
2550 * pt.c (process_partial_specialization): Error rather than crash on
2551 extra pack expansion.
2552
2553 2020-03-14 Jason Merrill <jason@redhat.com>
2554
2555 PR c++/92909
2556 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
2557 DECL_ORIGINAL_TYPE of a typedef.
2558
2559 2020-03-14 Jason Merrill <jason@redhat.com>
2560
2561 PR c++/93248
2562 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
2563 substituting DECL_ARGUMENTS.
2564
2565 2020-03-14 Jakub Jelinek <jakub@redhat.com>
2566
2567 * logic.cc (formula::formula): Change "a an" to "an" in a comment.
2568 * parser.c (cp_debug_parser): Change "a an" to "an" in a string
2569 literal.
2570
2571 2020-03-13 Patrick Palka <ppalka@redhat.com>
2572
2573 PR c++/67960
2574 * call.c (build_over_call): Use a warning_sentinel to disable
2575 warn_deprecated_decl before calling build_addr_func.
2576
2577 2020-03-12 Jakub Jelinek <jakub@redhat.com>
2578
2579 PR c++/94124
2580 * decl.c (reshape_init_array_1): Don't unshare constructor if there
2581 aren't any trailing zero elts, otherwise only unshare the first
2582 nelts.
2583
2584 2020-03-11 Jason Merrill <jason@redhat.com>
2585
2586 PR c++/93907
2587 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
2588 argument.
2589
2590 2020-03-11 Marek Polacek <polacek@redhat.com>
2591 Jason Merrill <jason@redhat.com>
2592
2593 PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
2594 * constexpr.c (cref_has_const_field): New function.
2595 (modifying_const_object_p): Consider a COMPONENT_REF
2596 const only if any of its fields are const.
2597 (cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
2598 as readonly after its initialization has been done.
2599
2600 2020-03-10 Marek Polacek <polacek@redhat.com>
2601
2602 PR c++/94124 - wrong conversion error with non-viable overload.
2603 * decl.c (reshape_init_array_1): Unshare a constructor if we
2604 stripped trailing zero-initializers.
2605
2606 2020-03-10 Jason Merrill <jason@redhat.com>
2607
2608 PR c++/93901
2609 * pt.c (maybe_instantiate_noexcept): Always update clones.
2610
2611 2020-03-10 Jason Merrill <jason@redhat.com>
2612
2613 PR c++/93596
2614 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
2615
2616 2020-03-10 Jason Merrill <jason@redhat.com>
2617
2618 PR c++/93922
2619 PR c++/94041
2620 PR c++/52320
2621 PR c++/66139
2622 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
2623 66139: Don't split_nonconstant_init. Remove pre_p parameter.
2624
2625 2020-03-09 Marek Polacek <polacek@redhat.com>
2626
2627 PR c++/92031 - bogus taking address of rvalue error.
2628 PR c++/91465 - ICE with template codes in check_narrowing.
2629 PR c++/93870 - wrong error when converting template non-type arg.
2630 PR c++/94068 - ICE with template codes in check_narrowing.
2631 * call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
2632 in a template when not ck_identity and we're dealing with a class.
2633 (convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
2634 in a template if we need a temporary.
2635 * decl.c (compute_array_index_type_loc): Remove
2636 instantiate_non_dependent_expr_sfinae call. Call
2637 fold_non_dependent_expr instead of maybe_constant_value.
2638 (build_explicit_specifier): Don't instantiate or create a sentinel
2639 before converting the expression.
2640 * except.c (build_noexcept_spec): Likewise.
2641 * pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
2642 Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
2643 build_converted_constant_expr returned.
2644 * typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
2645 of maybe_constant_value.
2646
2647 2020-03-09 Jakub Jelinek <jakub@redhat.com>
2648
2649 PR c++/94067
2650 Revert
2651 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
2652
2653 * constexpr.c (cxx_eval_constant_expression): Do not handle
2654 RROTATE_EXPR and LROTATE_EXPR.
2655
2656 2020-03-09 Marek Polacek <polacek@redhat.com>
2657
2658 PR c++/94050 - ABI issue with alignas on armv7hl.
2659 * class.c (layout_class_type): Don't replace a class's
2660 CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
2661
2662 2020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
2663
2664 * coroutines.cc (build_actor_fn): Factor out code inserting the
2665 default return_void call to...
2666 (morph_fn_to_coro): ...here, also hoist local var declarations.
2667
2668 2020-03-08 Patrick Palka <ppalka@redhat.com>
2669
2670 PR c++/93729
2671 * call.c (convert_like_real): Check complain before emitting an error
2672 about binding a bit-field to a reference.
2673
2674 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
2675 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
2676 TYPE_NAME.
2677
2678 2020-03-06 Nathan Sidwell <nathan@acm.org>
2679
2680 PR c++/94027
2681 * mangle.c (find_substitution): Don't call same_type_p on template
2682 args that cannot match.
2683
2684 2020-03-04 Martin Sebor <msebor@redhat.com>
2685
2686 PR c++/90938
2687 * tree.c (type_initializer_zero_p): Fail for structs initialized
2688 with non-structs.
2689
2690 2020-03-04 Jason Merrill <jason@redhat.com>
2691
2692 PR c++/90432
2693 * init.c (perform_member_init): Don't do aggregate initialization of
2694 empty field.
2695 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
2696 initialization of empty field.
2697
2698 2020-03-04 Martin Liska <mliska@suse.cz>
2699
2700 * method.c: Wrap array in ctor with braces in order
2701 to silent clang warnings.
2702
2703 2020-03-03 Jason Merrill <jason@redhat.com>
2704 Marek Polacek <polacek@redhat.com>
2705
2706 PR c++/90505 - mismatch in template argument deduction.
2707 * pt.c (tsubst): Don't reduce the template level of template
2708 parameters when tf_partial.
2709
2710 2020-03-03 Jakub Jelinek <jakub@redhat.com>
2711
2712 PR c++/93998
2713 * constexpr.c (cxx_eval_constant_expression)
2714 <case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
2715 *non_constant_p is true.
2716
2717 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
2718
2719 * coroutines.cc (captures_temporary): Strip component_ref
2720 to its base object.
2721
2722 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
2723
2724 * coroutines.cc (finish_co_await_expr): Build co_await_expr
2725 with unknown_type_node.
2726 (finish_co_yield_expr): Ditto.
2727 *pt.c (type_dependent_expression_p): Set co_await/yield_expr
2728 with unknown type as dependent.
2729
2730 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
2731
2732 * coroutines.cc (struct local_var_info): Adjust to remove the
2733 reference to the captured var, and just to note that this is a
2734 lambda capture proxy.
2735 (transform_local_var_uses): Handle lambda captures specially.
2736 (struct param_frame_data): Add a visited set.
2737 (register_param_uses): Also check for param uses in lambda
2738 capture proxies.
2739 (struct local_vars_frame_data): Remove captures list.
2740 (register_local_var_uses): Handle lambda capture proxies by
2741 noting and bypassing them.
2742 (morph_fn_to_coro): Update to remove lifetime extension of
2743 lambda capture-by-copy vars.
2744
2745 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
2746
2747 * coroutines.cc (build_co_await): Do not build frame
2748 awaitable proxy vars when the co_await expression is
2749 a function parameter or local var.
2750 (co_await_expander): Do not initialise a frame var with
2751 itself.
2752 (transform_await_expr): Only substitute the awaitable
2753 frame var if it's needed.
2754 (register_awaits): Do not make frame copies for param
2755 or local vars that are awaitables.
2756
2757 2020-02-28 Jason Merrill <jason@redhat.com>
2758
2759 Implement P2092R0, Disambiguating Nested-Requirements
2760 * parser.c (cp_parser_requirement_parameter_list): Pass
2761 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
2762
2763 * call.c (build_user_type_conversion_1): Don't look at the second
2764 conversion of a non-viable candidate.
2765
2766 2020-02-28 Jakub Jelinek <jakub@redhat.com>
2767
2768 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
2769 * typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
2770 functions in unevaluated contexts.
2771
2772 2020-02-27 Nathan Sidwell <nathan@acm.org>
2773
2774 PR c++/93933
2775 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
2776 cp_tree_equal.
2777 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
2778 * typeck.c (comptypes): Assert we don't get any argument packs.
2779
2780 * class.c (adjust_clone_args): Correct arg-checking assert.
2781 * typeck.c (comptypes): Assert not nulls.
2782
2783 2020-02-26 Marek Polacek <polacek@redhat.com>
2784
2785 PR c++/93789 - ICE with invalid array bounds.
2786 * decl.c (compute_array_index_type_loc): Don't use the folded
2787 size when folding cleared TREE_CONSTANT.
2788
2789 2020-02-26 Iain Sandoe <iain@sandoe.co.uk>
2790
2791 * class.c (classtype_has_non_deleted_copy_ctor): New.
2792 * coroutines.cc (struct param_info): Keep track of params
2793 that are references, and cache the original type and whether
2794 the DTOR is trivial.
2795 (build_actor_fn): Handle param copies always, and adjust the
2796 handling for references.
2797 (register_param_uses): Only handle uses here.
2798 (classtype_has_non_deleted_copy_ctor): New.
2799 (morph_fn_to_coro): Adjust param copy handling to match n4849
2800 by reordering ahead of the promise CTOR and always making a
2801 frame copy, even if the param is unused in the coroutine body.
2802 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
2803
2804 2020-02-26 Patrick Palka <ppalka@redhat.com>
2805
2806 * constraint.cc (finish_constraint_binary_op): Set expr's location range
2807 to the range of its operands.
2808 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
2809 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
2810 instead of the corresponding template arguments ARGS and adjust body
2811 accordingly.
2812 (diagnose_requires_expr): Likewise.
2813 (diagnose_atomic_constraint): Likewise. When printing an atomic
2814 constraint expression, print the instantiated parameter mapping
2815 alongside it.
2816 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
2817 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
2818 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
2819
2820 2020-02-26 Marek Polacek <polacek@redhat.com>
2821
2822 PR c++/93676 - value-init crash in template.
2823 * init.c (build_new_1): Don't call build_vec_init in a template.
2824
2825 2020-02-26 Marek Polacek <polacek@redhat.com>
2826
2827 PR c++/93862 - ICE with static_cast when converting from int[].
2828 * call.c (reference_compatible_p): No longer static.
2829 * cp-tree.h (reference_compatible_p): Declare.
2830 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
2831 of reference_related_p.
2832
2833 2020-02-26 Marek Polacek <polacek@redhat.com>
2834
2835 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
2836 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
2837 field.
2838
2839 2020-02-24 Martin Sebor <msebor@redhat.com>
2840
2841 PR c++/93804
2842 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
2843 in shared C/C++ code in headers.
2844 Remove a duplicate hunk of code.
2845
2846 2020-02-24 Marek Polacek <polacek@redhat.com>
2847
2848 PR c++/93869 - ICE with -Wmismatched-tags.
2849 * parser.c (cp_parser_check_class_key): Check class_key earlier.
2850
2851 2020-02-24 Marek Polacek <polacek@redhat.com>
2852
2853 PR c++/93712 - ICE with ill-formed array list-initialization.
2854 * call.c (next_conversion): Return NULL for ck_aggr.
2855 (build_aggr_conv): Set u.expr instead of u.next.
2856 (build_array_conv): Likewise.
2857 (build_complex_conv): Likewise.
2858 (conv_get_original_expr): Handle ck_aggr.
2859
2860 2020-02-24 Jakub Jelinek <jakub@redhat.com>
2861
2862 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
2863 * call.c (build_over_call): Don't evaluate immediate functions in
2864 unevaluated operands.
2865
2866 2020-02-24 Jason Merrill <jason@redhat.com>
2867
2868 P0780R2: Resolve lambda init-capture pack grammar.
2869 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
2870 ...&x=y.
2871
2872 2020-02-22 Marek Polacek <polacek@redhat.com>
2873
2874 PR c++/93882
2875 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
2876
2877 2020-02-21 Martin Sebor <msebor@redhat.com>
2878
2879 PR gcov-profile/93753
2880 * class.c (check_flexarrays): Tighten up a test for potential members
2881 of anonymous structs or unions.
2882
2883 2020-02-20 Martin Sebor <msebor@redhat.com>
2884
2885 PR c++/93801
2886 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
2887
2888 2020-02-20 Martin Liska <mliska@suse.cz>
2889
2890 PR translation/93841
2891 * config/or1k/or1k.opt: Remove superfluous word.
2892 * doc/invoke.texi: Likewise.
2893
2894 2020-02-20 Martin Liska <mliska@suse.cz>
2895
2896 PR translation/93838
2897 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
2898
2899 2020-02-19 Marek Polacek <polacek@redhat.com>
2900
2901 PR c++/93169 - wrong-code with a non-constexpr constructor.
2902 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
2903 on constant CONSTRUCTORs.
2904
2905 2020-02-15 Marek Polacek <polacek@redhat.com>
2906
2907 PR c++/93710 - poor diagnostic for array initializer.
2908 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
2909 for an error call.
2910
2911 2020-02-15 Jason Merrill <jason@redhat.com>
2912
2913 PR c++/92556
2914 * pt.c (any_template_parm_r): Look into lambda body.
2915
2916 PR c++/92583
2917 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
2918
2919 2020-02-14 Jakub Jelinek <jakub@redhat.com>
2920
2921 PR c++/61414
2922 * class.c (enum_min_precision): Change prec type from int to int &.
2923
2924 PR libstdc++/92906
2925 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
2926 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
2927 (fallback_dfloat32_type, fallback_dfloat64_type,
2928 fallback_dfloat128_type): Define.
2929 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
2930 dfloat*_type_node.
2931 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
2932 is disabled for compatibility.
2933
2934 2020-02-13 Jason Merrill <jason@redhat.com>
2935
2936 PR c++/93713
2937 * name-lookup.c (matching_fn_p): A function does not match a
2938 template.
2939
2940 PR c++/93643
2941 PR c++/91476
2942 * tree.c (decl_linkage): Always lk_none for locals.
2943
2944 2020-02-12 Jason Merrill <jason@redhat.com>
2945
2946 PR c++/92583
2947 PR c++/92654
2948 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
2949 * pt.c (find_parameter_packs_r): Not here.
2950
2951 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
2952
2953 * coroutines.cc (build_actor_fn): Implement deallocation function
2954 selection per n4849, dcl.fct.def.coroutine bullet 12.
2955 (morph_fn_to_coro): Implement allocation function selection per
2956 n4849, dcl.fct.def.coroutine bullets 9 and 10.
2957
2958 2020-02-12 Marek Polacek <polacek@redhat.com>
2959
2960 PR c++/93684 - ICE-on-invalid with broken attribute.
2961 * parser.c (cp_parser_std_attribute): Peek a token first before
2962 consuming it.
2963
2964 2020-02-11 Jason Merrill <jason@redhat.com>
2965
2966 PR c++/93675
2967 * class.c (add_implicitly_declared_members): Use do_friend.
2968 * method.c (implicitly_declare_fn): Fix friend handling.
2969 (decl_remember_implicit_trigger_p): New.
2970 (synthesize_method): Use it.
2971 * decl2.c (mark_used): Use it.
2972
2973 2020-02-11 Jason Merrill <jason@redhat.com>
2974
2975 PR c++/93650
2976 PR c++/90691
2977 * constexpr.c (maybe_constant_value): Correct earlier change.
2978 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
2979 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
2980
2981 2020-02-12 Patrick Palka <ppalka@redhat.com>
2982
2983 PR c++/69448
2984 PR c++/80471
2985 * type-utils.h (find_type_usage): Refactor to take a tree * and to
2986 return a tree *, and update documentation accordingly.
2987 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
2988 decltype(auto) node.
2989 (make_constrained_decltype_auto): No need to explicitly set
2990 AUTO_IS_DECLTYPE anymore.
2991 (splice_late_return_type): Use find_type_usage to find and
2992 replace a possibly nested auto node instead of using is_auto.
2993 Check test for is_auto into an assert when deciding whether
2994 to late_return_type.
2995 (type_uses_auto): Adjust the call to find_type_usage.
2996 * parser.c (cp_parser_decltype): No need to explicitly set
2997 AUTO_IS_DECLTYPE anymore.
2998
2999 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
3000 (dump_simple_decl): Handle standard concept definitions as well as
3001 variable concept definitions.
3002
3003 2020-02-10 Jakub Jelinek <jakub@redhat.com>
3004
3005 PR other/93641
3006 * error.c (dump_decl_name): Fix up last argument to strncmp.
3007
3008 2020-02-10 Jason Merrill <jason@redhat.com>
3009
3010 PR c++/93618
3011 * tree.c (array_of_unknown_bound_p): New.
3012 * init.c (perform_member_init): Do nothing for flexible arrays.
3013
3014 2020-02-09 Jakub Jelinek <jakub@redhat.com>
3015
3016 PR c++/93633
3017 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
3018 ARRAY_TYPE, use the element type. Punt if objtype after that is not
3019 a class type.
3020
3021 2020-02-08 Jason Merrill <jason@redhat.com>
3022
3023 PR c++/90691
3024 * expr.c (fold_for_warn): Call maybe_constant_value.
3025 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
3026 (maybe_constant_value): Add uid_sensitive parm.
3027 (get_fundef_copy): Don't copy if it's true.
3028 (cxx_eval_call_expression): Don't instantiate if it's true.
3029 (cxx_eval_outermost_constant_expr): Likewise.
3030
3031 PR c++/92852
3032 * constexpr.c (maybe_constant_value): Don't unshare if the cached
3033 value is the same as the argument.
3034
3035 * typeck.c (maybe_warn_about_returning_address_of_local): Add
3036 location parameter.
3037
3038 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
3039 if appropriate.
3040
3041 2020-02-08 Jakub Jelinek <jakub@redhat.com>
3042
3043 PR c++/93549
3044 * constexpr.c (find_array_ctor_elt): If last element has no index,
3045 for flag_checking verify all elts have no index. If i is within the
3046 elts, return it directly, if it is right after the last elt, append
3047 if NULL index, otherwise force indexes on all elts.
3048 (cxx_eval_store_expression): Allow cep->index to be NULL.
3049
3050 2020-02-07 Marek Polacek <polacek@redhat.com>
3051
3052 PR c++/92947 - Paren init of aggregates in unevaluated context.
3053 * call.c (build_new_method_call_1): Don't check
3054 cp_unevaluated_operand. Check the return value of digest_init.
3055
3056 2020-02-06 Jason Merrill <jason@redhat.com>
3057
3058 PR c++/92654
3059 * tree.c (cp_walk_subtrees): Walk into type template arguments.
3060 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
3061 instead of TYPE_ALIAS_P.
3062 * pt.c (push_template_decl_real): Likewise.
3063 (find_parameter_packs_r): Likewise. Remove dead code.
3064 * error.c (find_typenames_r): Remove dead code.
3065
3066 2020-02-06 Jason Merrill <jason@redhat.com>
3067
3068 PR c++/92517
3069 * parser.c (cp_parser_constraint_primary_expression): Do the main
3070 parse non-tentatively.
3071
3072 2020-02-06 Marek Polacek <polacek@redhat.com>
3073
3074 PR c++/93597 - ICE with lambda in operator function.
3075 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
3076
3077 2020-02-05 Jason Merrill <jason@redhat.com>
3078
3079 PR c++/93140
3080 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
3081 handling of TREE_CHAIN for empty pack.
3082
3083 2020-02-05 Jakub Jelinek <jakub@redhat.com>
3084
3085 PR c++/93557
3086 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
3087 prior to passing it to c_build_vec_convert.
3088
3089 2020-02-05 Marek Polacek <polacek@redhat.com>
3090
3091 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
3092 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
3093 TREE_SIDE_EFFECTS.
3094
3095 2020-02-05 Jason Merrill <jason@redhat.com>
3096
3097 PR c++/92593
3098 * decl.c (grokdeclarator): Reject field of current class type even
3099 in a template.
3100
3101 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
3102
3103 * coroutines.cc (maybe_promote_captured_temps): Increase the index
3104 number for temporary variables' name.
3105
3106 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
3107
3108 * coroutines.cc (build_co_await): Call convert_from_reference
3109 to wrap co_await_expr with indirect_ref which avoid
3110 reference/non-reference type confusion.
3111
3112 (co_await_expander): Sink to call_expr if await_resume
3113 is wrapped by indirect_ref.
3114
3115 2020-02-04 Jason Merrill <jason@redhat.com>
3116
3117 PR c++/93551
3118 * constraint.cc (satisfy_declaration_constraints): Check return
3119 value of push_tinst_level.
3120
3121 PR c++/90951
3122 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
3123 elements instead of value-initializing them.
3124
3125 PR c++/86917
3126 * init.c (perform_member_init): Simplify.
3127 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
3128 flexarray.
3129 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
3130
3131 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
3132
3133 * coroutines.cc (find_promise_type): Delete unused forward
3134 declaration.
3135 (struct coroutine_info): Add a bool for no promise type error.
3136 (coro_promise_type_found_p): Only emit the error for a missing
3137 promise once in each affected coroutine.
3138
3139 2020-02-03 Jason Merrill <jason@redhat.com>
3140
3141 PR c++/66477
3142 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
3143 defer loading the value of a reference.
3144
3145 2020-02-03 Jason Merrill <jason@redhat.com>
3146
3147 PR c++/91953
3148 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
3149 empty class type.
3150 [COMPONENT_REF]: A member function reference doesn't use the object
3151 as an rvalue.
3152
3153 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
3154
3155 PR c++/93458
3156 * coroutines.cc (struct coroutine_info): Add a bool flag to note
3157 that we emitted an error for a bad function return type.
3158 (get_coroutine_info): Tolerate an unset info table in case of
3159 missing traits.
3160 (find_coro_traits_template_decl): In case of error or if we didn't
3161 find a type template, note we emitted the error and suppress
3162 duplicates.
3163 (find_coro_handle_template_decl): Likewise.
3164 (instantiate_coro_traits): Only check for error_mark_node in the
3165 return from lookup_qualified_name.
3166 (coro_promise_type_found_p): Reorder initialization so that we check
3167 for the traits and their usability before allocation of the info
3168 table. Check for a suitable return type and emit a diagnostic for
3169 here instead of relying on the lookup machinery. This allows the
3170 error to have a better location, and means we can suppress multiple
3171 copies.
3172 (coro_function_valid_p): Re-check for a valid promise (and thus the
3173 traits) before proceeding. Tolerate missing info as a fatal error.
3174
3175 2020-02-03 Jason Merrill <jason@redhat.com>
3176
3177 PR c++/88256
3178 * cp-gimplify.c (predeclare_vla): New.
3179 (cp_genericize_r) [NOP_EXPR]: Call it.
3180
3181 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
3182
3183 * coroutines.cc (transform_await_wrapper): Set actor funcion as
3184 new context of label_decl.
3185 (build_actor_fn): Fill new field of await_xform_data.
3186
3187 2020-02-02 Marek Polacek <polacek@redhat.com>
3188
3189 PR c++/93530 - ICE on invalid alignas in a template.
3190 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
3191 decl_attributes.
3192
3193 2020-01-31 Jason Merrill <jason@redhat.com>
3194
3195 PR c++/86216
3196 * semantics.c (process_outer_var_ref): Capture VLAs even in
3197 unevaluated context.
3198
3199 PR c++/14179
3200 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
3201 non-aggregate elements.
3202 (reshape_init_array): Add first_initializer_p parm.
3203 (reshape_init_r): Change first_initializer_p from bool to tree.
3204 (reshape_init): Pass init to it.
3205
3206 PR c++/14179
3207 * parser.c (cp_parser_initializer_list): Suppress location wrappers
3208 after 256 elements.
3209
3210 2020-01-29 Jason Merrill <jason@redhat.com>
3211
3212 PR c++/82521
3213 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
3214 the expression was dependent before substitution.
3215
3216 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
3217
3218 * coroutines.cc (act_des_fn): New.
3219 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
3220 Access promise via actor function's frame pointer argument.
3221 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
3222
3223 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
3224
3225 * coroutines.cc (co_await_expander): Handle type conversion case.
3226
3227 2020-01-29 Jason Merrill <jason@redhat.com>
3228
3229 PR c++/90333
3230 PR c++/89640
3231 PR c++/60503
3232 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
3233 a trailing return type.
3234 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
3235 parens.
3236
3237 2020-01-29 Marek Polacek <polacek@redhat.com>
3238
3239 PR c++/91754 - Fix template arguments comparison with class NTTP.
3240 * pt.c (class_nttp_const_wrapper_p): New.
3241 (template_args_equal): See through class_nttp_const_wrapper_p
3242 arguments.
3243
3244 2020-01-29 Marek Polacek <polacek@redhat.com>
3245
3246 PR c++/92948 - Fix class NTTP with template arguments.
3247 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
3248 converting a value-dependent expression to a class type.
3249 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
3250 as the result of the tsubst_copy call.
3251
3252 2020-01-29 Jakub Jelinek <jakub@redhat.com>
3253
3254 PR c++/91118
3255 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
3256 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
3257
3258 2020-01-28 Jason Merrill <jason@redhat.com>
3259
3260 PR c++/93442
3261 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
3262
3263 PR c++/93477
3264 PR c++/91476
3265 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
3266
3267 PR c++/90546
3268 * call.c (build_user_type_conversion_1): Allow a template conversion
3269 returning an rvalue reference to bind directly to an lvalue.
3270
3271 PR c++/90731
3272 * decl.c (grokdeclarator): Propagate eh spec from typedef.
3273
3274 2020-01-28 Martin Liska <mliska@suse.cz>
3275
3276 PR c++/92440
3277 * pt.c (redeclare_class_template): Group couple of
3278 errors and inform messages with auto_diagnostic_group.
3279
3280 2020-01-28 Martin Liska <mliska@suse.cz>
3281
3282 PR c++/92440
3283 * pt.c (redeclare_class_template): Use inform
3284 for the second location.
3285
3286 2020-01-27 Jason Merrill <jason@redhat.com>
3287
3288 PR c++/90966
3289 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
3290
3291 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
3292
3293 PR c++/93443
3294 * coroutines.cc (morph_fn_to_coro): Check the ramp return
3295 value when it is constructed from the 'get return object'.
3296
3297 2020-01-27 Nathan Sidwell <nathan@acm.org>
3298
3299 PR c++/91826
3300 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
3301
3302 2020-01-26 Jason Merrill <jason@redhat.com>
3303
3304 PR c++/90992
3305 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
3306 temporarily enable -Wsystem-headers. Change second warning to
3307 conditional inform.
3308
3309 PR c++/90997
3310 * semantics.c (finish_call_expr): Don't call
3311 instantiate_non_dependent_expr before warn_for_memset.
3312
3313 2020-01-25 Marek Polacek <polacek@redhat.com>
3314
3315 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
3316 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
3317 dynamic_cast diagnostic.
3318
3319 2020-01-24 Jason Merrill <jason@redhat.com>
3320
3321 PR c++/93400 - ICE with constrained friend.
3322 * constraint.cc (maybe_substitute_reqs_for): New.
3323 * decl.c (function_requirements_equivalent_p): Call it.
3324 * pt.c (tsubst_friend_function): Only substitute
3325 TEMPLATE_PARMS_CONSTRAINTS.
3326 (tsubst_template_parms): Copy constraints.
3327
3328 2020-01-24 Jason Merrill <jason@redhat.com>
3329
3330 PR c++/93279 - ICE with lambda in member operator.
3331 * name-lookup.c (maybe_save_operator_binding): Don't remember
3332 class-scope bindings.
3333
3334 2020-01-24 Jason Merrill <jason@redhat.com>
3335
3336 PR c++/93377 - ICE with member alias in constraint.
3337 * pt.c (any_template_parm_r): Look at template arguments for all
3338 aliases, not only alias templates.
3339
3340 2020-01-24 Marek Polacek <polacek@redhat.com>
3341
3342 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
3343 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
3344
3345 2020-01-24 Jason Merrill <jason@redhat.com>
3346
3347 PR c++/92852 - ICE with generic lambda and reference var.
3348 * constexpr.c (maybe_constant_value): Likewise.
3349
3350 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
3351
3352 PR c++/92804
3353 * parser.c (cp_parser_nested_name_specifier_opt): Properly
3354 diagnose concept-ids.
3355
3356 2020-01-23 Jason Merrill <jason@redhat.com>
3357
3358 PR c++/93331 - ICE with __builtin_strchr.
3359 * constexpr.c (cxx_eval_builtin_function_call): Use the original
3360 argument if we didn't manage to extract a STRING_CST.
3361
3362 PR c++/93345 - ICE with defaulted dtor and template.
3363 PR c++/33799
3364 * decl.c (cxx_maybe_build_cleanup): Don't try to set
3365 throwing_cleanup in a template.
3366
3367 2020-01-22 Marek Polacek <polacek@redhat.com>
3368
3369 PR c++/92907 - noexcept does not consider "const" in member functions.
3370 * g++.dg/cpp0x/noexcept56.C: New test.
3371
3372 2020-01-22 Marek Polacek <polacek@redhat.com>
3373
3374 PR c++/93324 - ICE with -Wall on constexpr if.
3375 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
3376
3377 2020-01-22 Patrick Palka <ppalka@redhat.com>
3378
3379 * constraint.cc (get_mapped_args): Avoid using auto_vec
3380 as a vector element. Release the vectors inside the lists
3381 vector.
3382 * parser.c (cp_literal_operator_id): Free the buffer.
3383
3384 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
3385
3386 * coroutines.cc (finish_co_await_expr): Add error check on return
3387 value of build_co_await.
3388 (finish_co_yield_expr,): Ditto.
3389
3390 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
3391
3392 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
3393 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
3394 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
3395
3396 2020-01-21 Jason Merrill <jason@redhat.com>
3397
3398 PR c++/60855 - ICE with sizeof VLA capture.
3399 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
3400
3401 PR c++/90732 - ICE with VLA capture and generic lambda.
3402 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
3403
3404 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
3405 Bin Cheng <bin.cheng@linux.alibaba.com>
3406
3407 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
3408 from complete_type_or_else.
3409 (register_param_uses): Likewise.
3410 (build_co_await): Do not try to use complete_type_or_else for void
3411 types, otherwise for incomplete types, check for NULL return from
3412 complete_type_or_else.
3413
3414 2020-01-21 Jason Merrill <jason@redhat.com>
3415
3416 PR c++/91476 - anon-namespace reference temp clash between TUs.
3417 * decl2.c (copy_linkage): Factor out of get_guard.
3418 * call.c (make_temporary_var_for_ref_to_temp): Use it.
3419 * decl.c (cp_finish_decomp): Use it.
3420 (cp_finish_decl): determine_visibility sooner.
3421
3422 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
3423
3424 * coroutines.cc (finish_co_await_expr): Set return value flag.
3425 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
3426
3427 2020-01-19 Jason Merrill <jason@redhat.com>
3428
3429 PR c++/33799 - destroy return value, take 2.
3430 * cp-tree.h (current_retval_sentinel): New macro.
3431 (struct language_function): Add throwing_cleanup bitfield.
3432 * decl.c (cxx_maybe_build_cleanup): Set it.
3433 * except.c (maybe_set_retval_sentinel)
3434 (maybe_splice_retval_cleanup): New functions.
3435 * parser.c (cp_parser_compound_statement): Call
3436 maybe_splice_retval_cleanup.
3437 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
3438
3439 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
3440
3441 2020-01-18 Jakub Jelinek <jakub@redhat.com>
3442
3443 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
3444 but non-NO_DOLLAR_IN_LABEL case build.
3445
3446 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
3447
3448 * Make-lang.in: Add coroutines.o.
3449 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
3450 (DECL_COROUTINE_P): New.
3451 * lex.c (init_reswords): Enable keywords when the coroutine flag
3452 is set,
3453 * operators.def (co_await): New operator.
3454 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
3455 (op_error): Likewise.
3456 (build_new_op_1): Likewise.
3457 (build_new_function_call): Validate coroutine builtin arguments.
3458 * constexpr.c (potential_constant_expression_1): Handle
3459 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
3460 * coroutines.cc: New file.
3461 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
3462 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
3463 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
3464 * cp-tree.h (coro_validate_builtin_call): New.
3465 * decl.c (emit_coro_helper): New.
3466 (finish_function): Handle the case when a function is found to
3467 be a coroutine, perform the outlining and emit the outlined
3468 functions. Set a bit to signal that this is a coroutine component.
3469 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
3470 (cp_parser_unary_expression): Handle co_await.
3471 (cp_parser_assignment_expression): Handle co_yield.
3472 (cp_parser_statement): Handle RID_CO_RETURN.
3473 (cp_parser_jump_statement): Handle co_return.
3474 (cp_parser_operator): Handle co_await operator.
3475 (cp_parser_yield_expression): New.
3476 (cp_parser_required_error): Handle RT_CO_YIELD.
3477 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
3478 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
3479 CO_RETURN_EXPRs.
3480 * tree.c (cp_walk_subtrees): Likewise.
3481
3482 2020-01-17 Jason Merrill <jason@redhat.com>
3483
3484 PR c++/92531 - ICE with noexcept(lambda).
3485 * pt.c (uses_template_parms): Don't try to enumerate all the
3486 expression cases.
3487
3488 2020-01-17 Jakub Jelinek <jakub@redhat.com>
3489
3490 PR c++/93228
3491 * parser.c (cp_parser_template_name): Look up deprecated attribute
3492 in DECL_TEMPLATE_RESULT or its type's attributes.
3493
3494 2020-01-16 Jason Merrill <jason@redhat.com>
3495
3496 PR c++/93286 - ICE with __is_constructible and variadic template.
3497 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
3498 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
3499
3500 PR c++/93280 - ICE with aggregate assignment and DMI.
3501 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
3502 * typeck2.c (digest_nsdmi_init): Not here.
3503
3504 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
3505
3506 PR c++/91073
3507 * cp-tree.h (is_constrained_auto): New.
3508 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
3509 handle concept-check expressions; take a cp_decl_specifier_seq*
3510 instead of a bool.
3511 (cp_parser_condition): Update call.
3512 (cp_parser_simple_declaration): Likewise.
3513 (cp_parser_placeholder_type_specifier): Correctly handle
3514 concept-check expressions.
3515
3516 2020-01-15 Jason Merrill <jason@redhat.com>
3517
3518 Revert
3519 PR c++/33799 - destroy return value if local cleanup throws.
3520 * cp-tree.h (current_retval_sentinel): New macro.
3521 * decl.c (start_preparsed_function): Set up cleanup for retval.
3522 * typeck.c (check_return_expr): Set current_retval_sentinel.
3523
3524 PR c++/93257 - consteval void function.
3525 * constexpr.c (verify_constant): Allow void_node.
3526
3527 PR c++/92871 - bad code with xvalue and GNU ?: extension.
3528 * call.c (prevent_lifetime_extension): New.
3529 (build_conditional_expr_1): Use it.
3530
3531 2020-01-14 Nathan Sidwell <nathan@acm.org>
3532
3533 PR c++/90916
3534 * pt.c (retrieve_specialization): Use get_template_info, not open
3535 coding access.
3536
3537 PR c++/90916
3538 * pt.c (retrieve_specialization): Get the TI from the decl or the
3539 classtype as appropriate.
3540
3541 2020-01-14 David Malcolm <dmalcolm@redhat.com>
3542
3543 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
3544 New static constant.
3545 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
3546 (struct named_label_hash::empty_zero_p): Likewise.
3547 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
3548
3549 2020-01-14 Jason Merrill <jason@redhat.com>
3550
3551 PR c++/92590 - wrong handling of inherited default ctor.
3552 * class.c (add_method): A constrained inherited ctor doesn't hide an
3553 implicit derived ctor.
3554 Revert:
3555 PR c++/92552 - ICE with inherited constrained default ctor.
3556 * pt.c (instantiate_class_template_1): Copy
3557 TYPE_HAS_USER_CONSTRUCTOR.
3558 PR c++/91930 - ICE with constrained inherited default ctor.
3559 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
3560 for inherited constructor.
3561 PR c++/92594 - ICE with inherited trivial default ctor.
3562 * method.c (trivial_fn_p): Treat an inherited default constructor
3563 like a normal default constructor.
3564
3565 PR c++/92594 - ICE with inherited trivial default ctor.
3566 * method.c (trivial_fn_p): Treat an inherited default constructor
3567 like a normal default constructor.
3568
3569 PR c++/92009 - ICE with punning of typeid.
3570 * rtti.c (get_tinfo_desc): Call xref_basetypes.
3571 * constexpr.c (cxx_fold_indirect_ref): Don't strip
3572 REINTERPRET_CAST_P.
3573
3574 2020-01-13 Jason Merrill <jason@redhat.com>
3575
3576 PR c++/92746 - ICE with noexcept of function concept check.
3577 * except.c (check_noexcept_r): Handle concept-check.
3578
3579 PR c++/92582 - ICE with member template as requirement.
3580 * pt.c (struct find_template_parameter_info): Add ctx_parms.
3581 (any_template_parm_r): Handle TEMPLATE_DECL.
3582 (find_template_parameters): Take parms instead of their depth.
3583 * constraint.cc (build_parameter_mapping): Pass them.
3584
3585 PR c++/33799 - destroy return value if local cleanup throws.
3586 * cp-tree.h (current_retval_sentinel): New macro.
3587 * decl.c (start_preparsed_function): Set up cleanup for retval.
3588 * typeck.c (check_return_expr): Set current_retval_sentinel.
3589
3590 PR c++/93238 - short right-shift with enum.
3591 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
3592
3593 2020-01-10 Jason Merrill <jason@redhat.com>
3594
3595 * typeck.c (cp_build_binary_op): Restore short_shift code.
3596
3597 PR c++/93143 - incorrect tree sharing with constexpr.
3598 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
3599 CONSTRUCTORs are already unshared.
3600
3601 PR c++/93173 - incorrect tree sharing.
3602 PR c++/93033
3603 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
3604 copy_if_shared after cp_genericize_tree.
3605 * typeck2.c (split_nonconstant_init): Don't unshare here.
3606
3607 2020-01-08 Jason Merrill <jason@redhat.com>
3608
3609 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
3610 TARGET_EXPR_DIRECT_INIT_P.
3611 * constexpr.c (cxx_eval_constant_expression): Likewise.
3612
3613 2020-01-08 Jason Merrill <jason@redhat.com>
3614
3615 PR c++/91369 - constexpr destructor and member initializer.
3616 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
3617 when not preevaluating.
3618
3619 2020-01-08 Jason Merrill <jason@redhat.com>
3620
3621 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
3622 support.
3623
3624 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
3625
3626 * init.c (build_new): Add location_t parameter and use it throughout.
3627 (build_raw_new_expr): Likewise.
3628 * parser.c (cp_parser_new_expression): Pass the combined_loc.
3629 * pt.c (tsubst_copy_and_build): Adjust call.
3630 * cp-tree.h: Update declarations.
3631
3632 2020-01-07 Jason Merrill <jason@redhat.com>
3633
3634 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
3635 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
3636 explicit class visibility for a template.
3637
3638 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
3639
3640 * mangle.c (mangle_type_attribute_p): New function, split out from...
3641 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
3642 that contain a space.
3643
3644 2020-01-07 Jakub Jelinek <jakub@redhat.com>
3645
3646 PR c++/91369
3647 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
3648 member, initialize it to zero in ctor.
3649 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
3650 a heap object. Don't cache calls to functions which allocate some
3651 heap objects and don't deallocate them or deallocate some heap
3652 objects they didn't allocate.
3653
3654 2020-01-06 Jason Merrill <jason@redhat.com>
3655
3656 PR c++/92552 - ICE with inherited constrained default ctor.
3657 * pt.c (instantiate_class_template_1): Copy
3658 TYPE_HAS_USER_CONSTRUCTOR.
3659 * class.c (one_inherited_ctor): Don't set it here.
3660
3661 2020-01-06 Andrew Sutton <asutton@lock3software.com>
3662
3663 PR c++/92739 - parsing requires clause with attributes.
3664 * parser.c (cp_parser_constraint_requires_parens): Exclude
3665 attributes as postfix expressions.
3666
3667 2020-01-05 Jakub Jelinek <jakub@redhat.com>
3668
3669 PR c++/93138
3670 * parser.c (cp_parser_check_class_key): Disable access checks for the
3671 simple name lookup.
3672 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
3673 !warn_redundant_tags.
3674
3675 2010-01-05 Jakub Jelinek <jakub@redhat.com>
3676
3677 PR c++/93046
3678 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
3679 TARGET_EXPR if it has been gimplified already.
3680
3681 2020-01-03 Jason Merrill <jason@redhat.com>
3682
3683 PR c++/93033 - incorrect tree node sharing with array init.
3684 * typeck2.c (split_nonconstant_init): Unshare non-decl.
3685 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
3686
3687 2020-01-02 Jason Merrill <jason@redhat.com>
3688
3689 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
3690 C++17.
3691
3692 2020-01-02 Jakub Jelinek <jakub@redhat.com>
3693
3694 PR c/90677
3695 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
3696 has not been found, rather than error_mark_node.
3697
3698 2020-01-01 Jakub Jelinek <jakub@redhat.com>
3699
3700 Update copyright years.
3701 \f
3702 Copyright (C) 2020 Free Software Foundation, Inc.
3703
3704 Copying and distribution of this file, with or without modification,
3705 are permitted in any medium without royalty provided the copyright
3706 notice and this notice are preserved.