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