1 2021-10-06 Jakub Jelinek <jakub@redhat.com>
4 * parser.c (cp_parser_jump_statement): Implement C++23 P2242R3.
5 Allow goto expressions in constexpr function bodies for C++23.
6 Adjust error message for older standards to mention it.
7 * decl.c (start_decl): Allow static and thread_local declarations
8 in constexpr function bodies for C++23. Adjust error message for
9 older standards to mention it.
10 * constexpr.c (ensure_literal_type_for_constexpr_object): Allow
11 declarations of variables with non-literal type in constexpr function
12 bodies for C++23. Adjust error message for older standards to mention
14 (cxx_eval_constant_expression) <case DECL_EXPR>: Diagnose declarations
15 of initialization of static or thread_local vars.
16 (cxx_eval_constant_expression) <case GOTO_EXPR>: Diagnose goto
18 (potential_constant_expression_1) <case DECL_EXPR>: Swap the
19 CP_DECL_THREAD_LOCAL_P and TREE_STATIC checks.
20 (potential_constant_expression_1) <case LABEL_EXPR>: Allow labels for
21 C++23. Adjust error message for older standards to mention it.
23 2021-10-06 Jakub Jelinek <jakub@redhat.com>
24 Jason Merrill <jason@redhat.com>
28 * cp-tree.h (maybe_synthesize_method): Declare.
29 * method.c (genericize_spaceship): Use
30 LOOKUP_NORMAL | LOOKUP_NONVIRTUAL | LOOKUP_DEFAULTED instead of
31 LOOKUP_NORMAL for flags.
32 (comp_info): Remove defining member. Add complain, code, retcat.
33 (comp_info::comp_info): Adjust.
34 (do_one_comp): Split out from build_comparison_op. Use
35 LOOKUP_NORMAL | LOOKUP_NONVIRTUAL | LOOKUP_DEFAULTED instead of
36 LOOKUP_NORMAL for flags.
37 (build_comparison_op): Add defining argument. Adjust comp_info
38 construction. Use defining instead of info.defining. Assert that
39 if defining, ctype is a complete type. Walk base binfos.
40 (synthesize_method, maybe_explain_implicit_delete,
41 explain_implicit_non_constexpr): Adjust build_comparison_op callers.
42 (maybe_synthesize_method): New function.
43 * class.c (check_bases_and_members): Don't call defaulted_late_check
45 (finish_struct_1): Call it here instead after class has been
47 * pt.c (maybe_instantiate_noexcept): Call maybe_synthesize_method
48 instead of synthesize_method.
50 2021-10-05 Jakub Jelinek <jakub@redhat.com>
53 * tree.c (apply_identity_attributes): Fix handling of the
54 case where an attribute in the list doesn't affect type
55 identity but some attribute before it does.
57 2021-10-05 Patrick Palka <ppalka@redhat.com>
60 * constexpr.c (potential_constant_expression_1): Handle
61 NONTYPE_ARGUMENT_PACK.
63 2021-10-05 Patrick Palka <ppalka@redhat.com>
66 * pt.c (has_value_dependent_address): Return true for a static
67 local variable from a function template.
69 2021-10-04 Marek Polacek <polacek@redhat.com>
72 * typeck.c (cp_build_binary_op): Call do_warn_array_compare.
74 2021-10-03 Iain Sandoe <iain@sandoe.co.uk>
77 * coroutines.cc (register_local_var_uses): Emit a sorry if
78 we encounter a VLA in the coroutine local variables.
80 2021-10-03 Iain Sandoe <iain@sandoe.co.uk>
83 * coroutines.cc (await_statement_walker): Report an error if
84 an await expression is found in a handler body.
86 2021-10-03 John Eivind Helset <jehelset@gmail.com>
89 * coroutines.cc (build_co_await): Guard against NULL
92 2021-10-03 Iain Sandoe <iain@sandoe.co.uk>
95 * coroutines.cc (build_co_await): Mark co_await_expr trees
96 with TREE_SIDE_EFFECTS, also mark any containing expression.
97 (finish_co_await_expr): Mark type-dependent co_await_expr
98 trees with TREE_SIDE_EFFECTS.
100 2021-10-03 Iain Sandoe <iain@sandoe.co.uk>
103 * coroutines.cc (build_co_await): Strip NOPs from
104 candidate awaiter expressions before testing to see
105 if they need a temporary.
107 2021-10-01 Martin Sebor <msebor@redhat.com>
110 * typeck.c (warn_for_null_address): Enhance.
111 (cp_build_binary_op): Call it also for member pointers.
113 2021-10-01 qingzhe huang <nickhuang99@hotmail.com>
116 * tree.c (cp_build_qualified_type_real): Exclude typedef from
119 2021-10-01 Jakub Jelinek <jakub@redhat.com>
120 Richard Biener <rguenther@suse.de>
123 * typeck.c (cp_build_binary_op): Call ubsan_instrument_division
124 for division even for SANITIZE_SI_OVERFLOW.
126 2021-10-01 Jakub Jelinek <jakub@redhat.com>
128 * parser.c (cp_parser_omp_clause_order): Set
129 OMP_CLAUSE_ORDER_REPRODUCIBLE for explicit reproducible: modifier.
131 2021-10-01 Jakub Jelinek <jakub@redhat.com>
134 * name-lookup.c (push_local_extern_decl_alias): Return early even for
135 tls vars with non-dependent type when processing_template_decl. For
136 CP_DECL_THREAD_LOCAL_P vars call set_decl_tls_model on alias.
138 2021-09-30 Patrick Palka <ppalka@redhat.com>
141 * method.c (is_xible_helper): Don't exit early for multi-arg
144 2021-09-30 Patrick Palka <ppalka@redhat.com>
146 * parser.c (cp_parser_trait_expr): Call nreverse on the reversed
147 list of trailing arguments.
149 2021-09-30 Patrick Palka <ppalka@redhat.com>
152 * method.c (build_comparison_op): Skip DECL_VIRTUAL_P fields.
154 2021-09-28 Patrick Palka <ppalka@redhat.com>
157 * pt.c (coerce_template_template_parms): Keep
158 processing_template_decl set around the call to unify as well.
160 2021-09-28 Iain Sandoe <iain@sandoe.co.uk>
163 * coroutines.cc (analyze_fn_parms): Clean up synthetic names for
164 unnamed function params.
165 (morph_fn_to_coro): Do not try to set a guard variable for param
166 DTORs in the ramp, unless we have exceptions active.
168 2021-09-27 Patrick Palka <ppalka@redhat.com>
171 * pt.c (rewrite_template_parm): Handle single-level tsubst_args.
172 Avoid a tree cycle when assigning the DECL_TEMPLATE_PARMS for a
174 (alias_ctad_tweaks): Set current_template_parms accordingly.
176 2021-09-23 Michel Morin <mimomorin@gmail.com>
178 * parser.c (cp_keyword_starts_decl_specifier_p): Do not
179 handle RID_ATTRIBUTE.
180 (cp_parser_constructor_declarator_p): Remove now-redundant
182 (cp_parser_lambda_declarator_opt): Likewise.
184 2021-09-23 Michel Morin <mimomorin@gmail.com>
187 * parser.c (cp_keyword_starts_decl_specifier_p): Handle more
188 decl-specifiers (typedef/inline/cv/explicit/virtual/friend).
190 2021-09-23 Patrick Palka <ppalka@redhat.com>
192 * ptree.c (cxx_print_decl): Dump the DECL_TEMPLATE_RESULT of
193 a TEMPLATE_DECL. Dump the DECL_TEMPLATE_INFO rather than just
194 printing its pointer value.
196 2021-09-23 Jakub Jelinek <jakub@redhat.com>
199 * parser.c (cp_parser_omp_directive_args): Diagnose if omp::directive
200 is not followed by a balanced token sequence starting with open paren.
202 2021-09-22 Patrick Palka <ppalka@redhat.com>
206 * constexpr.c (cxx_eval_constant_expression)
207 <case TEMPLATE_ID_EXPR>: Check value_dependent_expression_p
208 instead of processing_template_decl.
209 * pt.c (value_dependent_expression_p) <case TEMPLATE_ID_EXPR>:
210 Return true only if any_dependent_template_arguments_p.
211 (instantiation_dependent_r) <case CALL_EXPR>: Remove this case.
212 <case TEMPLATE_ID_EXPR>: Likewise.
214 2021-09-22 Jakub Jelinek <jakub@redhat.com>
216 * parser.c (cp_parser_omp_clause_allocate): Parse allocate clause
218 * semantics.c (finish_omp_clauses) <OMP_CLAUSE_ALLOCATE>: Perform
219 semantic analysis of OMP_CLAUSE_ALLOCATE_ALIGN.
220 * pt.c (tsubst_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
221 also OMP_CLAUSE_ALLOCATE_ALIGN.
223 2021-09-22 Barrett Adair <barrettellisadair@gmail.com>
225 * pt.c (find_parm_usage_r): New walk_tree callback to find func
227 (any_template_arguments_need_structural_equality_p): New special
230 2021-09-21 wangpc <pc.wang@linux.alibaba.com>
232 * decl.c (start_decl_1): Move verify_type_context to ...
233 (cp_finish_decl): ... to here.
235 2021-09-18 Jakub Jelinek <jakub@redhat.com>
237 * parser.c (cp_parser_omp_clause_order): Parse unconstrained
238 and reproducible modifiers.
239 (OMP_DISTRIBUTE_CLAUSE_MASK): Add order clause.
241 2021-09-18 Jakub Jelinek <jakub@redhat.com>
243 * parser.c (cp_parser_omp_clause_default): Handle private and
244 firstprivate arguments, adjust diagnostics on unknown argument.
245 * cp-gimplify.c (cxx_omp_finish_clause): Handle OMP_CLAUSE_PRIVATE.
247 2021-09-18 Jason Merrill <jason@redhat.com>
249 * cp-tree.h (dependentish_scope_p): Declare.
250 * pt.c (dependentish_scope_p): New.
251 * parser.c (cp_parser_lookup_name): Return a TYPENAME_TYPE
252 for lookup of a type in a dependent object.
253 (cp_parser_template_id): Handle TYPENAME_TYPE.
254 (cp_parser_template_name): If we're looking for a type,
255 a name followed by < names a template.
257 2021-09-18 Jason Merrill <jason@redhat.com>
259 * cp-tree.h: Fix typo in LANG_FLAG list.
261 2021-09-17 Jakub Jelinek <jakub@redhat.com>
263 * cp-tree.h (finish_omp_atomic): Add r and weak arguments.
264 * parser.c (cp_parser_omp_atomic): Update function comment for
265 OpenMP 5.1 atomics, parse OpenMP 5.1 atomics and fail, compare and
267 * semantics.c (finish_omp_atomic): Add r and weak arguments, handle
268 them, handle COND_EXPRs.
269 * pt.c (tsubst_expr): Adjust for COND_EXPR forms that
270 finish_omp_atomic can now produce.
272 2021-09-16 Patrick Palka <ppalka@redhat.com>
275 * constraint.cc (get_normalized_constraints_from_decl): Always
276 look up constraints using the most general template.
277 * decl.c (grokdeclarator): Set constraints on a static data
279 * pt.c (determine_specialization): Check constraints on a
282 2021-09-16 Iain Sandoe <iain@sandoe.co.uk>
284 * coroutines.cc (await_statement_walker): Code cleanups.
286 2021-09-16 Jason Merrill <jason@redhat.com>
288 * constexpr.c (cxx_eval_outermost_constant_expr): Use
289 protected_set_expr_location.
291 2021-09-15 Patrick Palka <ppalka@redhat.com>
294 * call.c (build_user_type_conversion_1): Add tf_conv to complain.
295 (add_candidates): When in a SFINAE context, instead of adding a
296 candidate to bad_fns just mark it unviable.
298 2021-09-15 Jason Merrill <jason@redhat.com>
300 * cp-tree.h (parsing_function_declarator): Declare.
301 * name-lookup.c (set_decl_context_in_fn): Use it.
302 * parser.c (cp_parser_direct_declarator): Use it.
303 (parsing_function_declarator): New.
305 2021-09-15 Jakub Jelinek <jakub@redhat.com>
309 * typeck2.c (split_nonconstant_init_1): Don't throw away empty
310 initializers of flexible array members if they have non-zero type
313 2021-09-15 Patrick Palka <ppalka@redhat.com>
316 * decl.c (grok_special_member_properties): Set
317 TYPE_HAS_COPY_CTOR, TYPE_HAS_DEFAULT_CONSTRUCTOR
318 and TYPE_HAS_LIST_CTOR independently from each other.
320 2021-09-15 Jason Merrill <jason@redhat.com>
322 * decl.c (cxx_init_decl_processing): Only warn about odd
323 interference sizes if they were specified with --param.
325 2021-09-15 Jason Merrill <jason@redhat.com>
328 * cp-tree.h (enum cp_tree_index): Remove CPTI_TYPE_INFO_PTR_TYPE.
329 (type_info_ptr_type): Remove.
330 * rtti.c (init_rtti_processing): Don't predeclare std::type_info.
331 (typeid_ok_p): Check for null const_type_info_type_node.
332 (type_info_ptr_type, get_void_tinfo_ptr): New fns.
333 (get_tinfo_decl_dynamic, get_tinfo_ptr): Use them.
334 (ptr_initializer, ptm_initializer, get_pseudo_ti_init): Use them.
335 (get_tinfo_desc): Use const_ptr_type_node.
337 2021-09-15 Jason Merrill <jason@redhat.com>
339 * parser.c (cp_parser_template_name): Move object type.
340 (cp_parser_pre_parsed_nested_name_specifier): Likewise.
342 2021-09-15 Jason Merrill <jason@redhat.com>
344 * parser.c (cp_parser_unqualified_id): Only complain about ~A<T> in
347 2021-09-14 Iain Sandoe <iain@sandoe.co.uk>
349 * coroutines.cc (struct param_info): Add copy_var.
350 (build_actor_fn): Use simplified param references.
351 (register_param_uses): Likewise.
352 (rewrite_param_uses): Likewise.
353 (analyze_fn_parms): New function.
354 (coro_rewrite_function_body): Add proxies for the fn
355 parameters to the outer bind scope of the rewritten code.
356 (morph_fn_to_coro): Use simplified version of param ref.
358 2021-09-14 Iain Sandoe <iain@sandoe.co.uk>
360 * coroutines.cc (coro_resume_fn_id, coro_destroy_fn_id,
361 coro_promise_id, coro_frame_needs_free_id, coro_resume_index_id,
362 coro_self_handle_id, coro_actor_continue_id,
363 coro_frame_i_a_r_c_id): New.
364 (coro_init_identifiers): Initialize new name identifiers.
365 (coro_promise_type_found_p): Use pre-built identifiers.
366 (struct await_xform_data): Remove unused fields.
367 (transform_await_expr): Delete code that is now unused.
368 (build_actor_fn): Simplify interface, use pre-built identifiers and
369 remove transforms that are no longer needed.
370 (build_destroy_fn): Use revised field names.
371 (register_local_var_uses): Use pre-built identifiers.
372 (coro_rewrite_function_body): Simplify interface, use pre-built
373 identifiers. Generate proxy vars in the outer bind expr scope for the
374 implementation state that we wish to expose.
375 (morph_fn_to_coro): Adjust comments for new variable names, use pre-
376 built identifiers. Remove unused code to generate frame entries for
377 the implementation state. Adjust call for build_actor_fn.
379 2021-09-14 Patrick Palka <ppalka@redhat.com>
382 * constexpr.c (cxx_eval_call_expression): After evaluating a
383 subobject constructor call for an empty union member, produce a
384 side effect that makes sure the member gets activated.
386 2021-09-14 Jakub Jelinek <jakub@redhat.com>
389 * decl.c (layout_var_decl): For aggregates ending with a flexible
390 array member, add the size of the initializer for that member to
391 DECL_SIZE and DECL_SIZE_UNIT.
393 2021-09-14 Jakub Jelinek <jakub@redhat.com>
396 * method.c (is_xible_helper): Call complete_type on to.
398 2021-09-14 Jason Merrill <jason@redhat.com>
400 * decl.c (cxx_init_decl_processing): Don't warn if L1 cache line
401 size is smaller than maxalign.
403 2021-09-13 Jason Merrill <jason@redhat.com>
405 * constexpr.c (maybe_warn_about_constant_value):
406 Complain about std::hardware_destructive_interference_size.
407 (cxx_eval_constant_expression): Call it.
408 * decl.c (cxx_init_decl_processing): Check
409 --param *-interference-size values.
411 2021-09-13 Patrick Palka <ppalka@redhat.com>
414 * cp-tree.h (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): New accessor
416 * pt.c (has_extra_args_mechanism_p): New function.
417 (find_parameter_pack_data::found_extra_args_tree_p): New data
419 (find_parameter_packs_r): Set ppd->found_extra_args_tree_p
421 (make_pack_expansion): Set PACK_EXPANSION_FORCE_EXTRA_ARGS_P if
422 ppd.found_extra_args_tree_p.
423 (use_pack_expansion_extra_args_p): Return true if there were
424 unsubstituted packs and PACK_EXPANSION_FORCE_EXTRA_ARGS_P.
425 (tsubst_pack_expansion): Pass the pack expansion to
426 use_pack_expansion_extra_args_p.
428 2021-09-10 Jakub Jelinek <jakub@redhat.com>
430 * parser.c (cp_parser_omp_atomic): Allow acq_rel on atomic read/write
431 and acq_rel/acquire clauses on update.
432 * semantics.c (finish_omp_atomic): Adjust c_finish_omp_atomic caller.
434 2021-09-08 Richard Biener <rguenther@suse.de>
437 * cp-tree.h (ANON_AGGR_TYPE_FIELD): New define.
438 * decl.c (fixup_anonymous_aggr): Wipe RTTI info put in
439 place on invalid code.
440 * decl2.c (reset_type_linkage): Guard CLASSTYPE_TYPEINFO_VAR
442 * module.cc (trees_in::read_class_def): Likewise. Reconstruct
443 ANON_AGGR_TYPE_FIELD.
444 * semantics.c (finish_member_declaration): Populate
445 ANON_AGGR_TYPE_FIELD for anon aggregate typed members.
446 * typeck.c (lookup_anon_field): Remove DFS search and return
447 ANON_AGGR_TYPE_FIELD directly.
449 2021-09-07 Jakub Jelinek <jakub@redhat.com>
452 * constexpr.c (maybe_save_constexpr_fundef): Save body even for
453 constexpr deleting dtors.
454 (cxx_eval_call_expression): Don't use DECL_CLONED_FUNCTION for
457 2021-09-07 Marcel Vollweiler <marcel@codesourcery.com>
459 * parser.c (cp_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
461 * semantics.c (finish_omp_flush): Handle MEMMODEL_SEQ_CST.
463 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
465 * coroutines.cc (register_local_var_uses): Do not mangle
466 frame entries for the outermost scope. Record the outer
467 scope as nesting depth 0.
469 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
471 * coroutines.cc (coro_build_artificial_var): New.
472 (build_actor_fn): Use var builder, rename vars to use
473 implementation namespace.
474 (coro_rewrite_function_body): Likewise.
475 (morph_fn_to_coro): Likewise.
477 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
479 * coroutines.cc (transform_local_var_uses): Record
480 frame offset expressions as DECL_VALUE_EXPRs instead of
483 2021-09-03 Patrick Palka <ppalka@redhat.com>
486 * call.c (build_this_conversion): New function, split out from
487 add_function_candidate.
488 (add_function_candidate): New parameter shortcut_bad_convs.
489 Document it. Use build_this_conversion. Stop at the first bad
490 argument conversion when shortcut_bad_convs is true.
491 (add_template_candidate_real): New parameter shortcut_bad_convs.
492 Use build_this_conversion to check the 'this' conversion before
493 attempting deduction. When the rejection reason code is
494 rr_bad_arg_conversion, pass -1 instead of 0 as the viable
495 parameter to add_candidate. Pass 'convs' to add_candidate.
496 (add_template_candidate): New parameter shortcut_bad_convs.
497 (add_template_conv_candidate): Pass false as shortcut_bad_convs
498 to add_template_candidate_real.
499 (add_candidates): Prefer to shortcut bad conversions during
500 overload resolution under the assumption that we'll eventually
501 see a strictly viable candidate. If this assumption turns out
502 to be false, re-process the non-strictly viable candidates
503 without shortcutting those bad conversions.
505 2021-09-03 Jason Merrill <jason@redhat.com>
507 * pt.c (limit_bad_template_recursion): Suppress -Wunused for decls
508 we decide not to instantiate.
510 2021-09-03 Jakub Jelinek <jakub@redhat.com>
513 * class.c (build_base_field): Use SET_DECL_FIELD_ABI_IGNORED
514 instead of writing to DECL_FIELD_ABI_IGNORED.
515 (layout_class_type): Likewise. In the place where zero-width
516 bitfields used to be removed, use
517 SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD on those fields instead.
519 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
521 * call.c (build_over_call): Handle unavailable state in addition to
523 * class.c (type_build_ctor_call): Likewise.
524 (type_build_dtor_call): Likewise.
525 * cp-tree.h: Rename cp_warn_deprecated_use to
526 cp_handle_deprecated_or_unavailable.
527 * decl.c (duplicate_decls): Merge unavailability.
528 (grokdeclarator): Handle unavailability in addition to deprecation.
529 (type_is_unavailable): New.
530 (grokparms): Handle unavailability in addition to deprecation.
531 * decl.h (enum deprecated_states): Add
532 UNAVAILABLE_DEPRECATED_SUPPRESS.
533 * decl2.c (cplus_decl_attributes): Propagate unavailability to
535 (cp_warn_deprecated_use): Rename to ...
536 (cp_handle_deprecated_or_unavailable): ... this and amend to handle
537 the unavailable case. It remains a warning in the case of deprecation
538 but becomes an error in the case of unavailability.
539 (cp_warn_deprecated_use_scopes): Handle unavailability.
540 (mark_used): Likewise.
541 * parser.c (cp_parser_template_name): Likewise.
542 (cp_parser_template_argument): Likewise.
543 (cp_parser_parameter_declaration_list): Likewise.
544 * typeck.c (build_class_member_access_expr): Likewise.
545 (finish_class_member_access_expr): Likewise.
546 * typeck2.c (build_functional_cast_1): Likewise.
548 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
550 * coroutines.cc (build_actor_fn): Add begin/finish clauses
551 to the initial test in the actor function.
553 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
555 * coroutines.cc (await_statement_walker): Use build_stmt and
556 add_stmt instead of build1 and finish_expr_stmt.
558 2021-08-31 Jason Merrill <jason@redhat.com>
560 * coroutines.cc (flatten_await_stmt): Fix copyo.
561 * decl.c (reshape_init_class): Simplify.
562 * module.cc (module_state::read_language): Add null check.
563 * parser.c (build_range_temp): Avoid type_uses_auto.
564 (cp_parser_class_specifier_1): Add null check.
566 2021-08-31 Patrick Palka <ppalka@redhat.com>
569 * call.c (rejection_reason::call_varargs_p): Rename this
570 previously unused member to ...
571 (rejection_reason::least_p): ... this.
572 (arity_rejection): Add least_p parameter.
573 (add_template_candidate_real): When there are explicit
574 template arguments, check that the arity of the call agrees with
575 the arity of the function before attempting deduction.
576 (print_arity_information): Add least_p parameter.
577 (print_z_candidate): Adjust call to print_arity_information.
579 2021-08-31 Martin Sebor <msebor@redhat.com>
581 * parser.c (cp_parser_selection_statement): Use direct initialization
584 2021-08-31 Jason Merrill <jason@redhat.com>
586 * constexpr.c (explain_invalid_constexpr_fn): Use iloc_sentinel.
588 2021-08-31 Jason Merrill <jason@redhat.com>
591 * cp-tree.h (FNDECL_MANIFESTLY_CONST_EVALUATED): New.
592 * constexpr.c (cxx_eval_call_expression): Set it.
593 * pt.c (neglectable_inst_p): Check it.
595 2021-08-31 Marcel Vollweiler <marcel@codesourcery.com>
597 * parser.c (cp_parser_omp_clause_device): Parse device-modifiers 'device_num'
598 and 'ancestor' in 'target device' clauses.
599 * semantics.c (finish_omp_clauses): Error handling. Constant device ids must
600 evaluate to '1' if 'ancestor' is used.
602 2021-08-30 Jason Merrill <jason@redhat.com>
605 * cp-tree.h (struct lang_type): Add erroneous bit-field.
606 (CLASSTYPE_ERRONEOUS): New.
607 * pt.c (limit_bad_template_recursion): Check it.
608 (instantiate_class_template_1): Set it.
610 2021-08-30 Jason Merrill <jason@redhat.com>
612 * constexpr.c (cxx_eval_outermost_constant_expr): Copy
613 expr location to result.
615 2021-08-30 Jason Merrill <jason@redhat.com>
618 * cp-tree.h (cxx_constant_value_sfinae): Declare.
619 * constexpr.c (cxx_constant_value_sfinae): New.
620 * pt.c (fold_targs_r, maybe_fold_fn_template_args): New.
621 (tsubst_copy_and_build) [CALL_EXPR]: Call
622 maybe_fold_fn_template_args.
624 2021-08-30 Jason Merrill <jason@redhat.com>
626 * parser.c (cp_parser_simple_requirement): Warn about missing
629 2021-08-27 Jason Merrill <jason@redhat.com>
631 * typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
634 2021-08-25 Andrew Pinski <apinski@marvell.com>
637 * cp-objcp-common.c (cxx_block_may_fallthru): Handle
638 CLEANUP_STMT for the case which will be try/finally.
640 2021-08-25 Jakub Jelinek <jakub@redhat.com>
643 * init.c (build_value_init_noctor): Ignore unnamed zero-width
646 2021-08-23 Jakub Jelinek <jakub@redhat.com>
648 * parser.c (cp_parser_omp_clause_num_tasks,
649 cp_parser_omp_clause_grainsize): Parse the optional strict: modifier.
651 2021-08-20 Jakub Jelinek <jakub@redhat.com>
653 * parser.c (cp_parser_handle_statement_omp_attributes): Determine if
654 PRAGMA_OMP_ERROR directive is C_OMP_DIR_STANDALONE.
655 (cp_parser_omp_error): New function.
656 (cp_parser_pragma): Handle PRAGMA_OMP_ERROR.
658 2021-08-20 Jakub Jelinek <jakub@redhat.com>
660 * parser.c (cp_parser_omp_clause_depend_sink): Reject spurious
661 comma at the end of list. Don't parse closing paren here...
662 (cp_parser_omp_clause_depend): ... but here instead.
664 2021-08-19 Patrick Palka <ppalka@redhat.com>
667 * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT): Clarify comment.
669 2021-08-19 Jakub Jelinek <jakub@redhat.com>
671 * parser.c (cp_parser_omp_requires): Don't call cp_lexer_nth_token_is
672 and optionally consume token if current token is CPP_EOF,
673 CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
675 2021-08-19 Jakub Jelinek <jakub@redhat.com>
677 * parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
678 instead of cp_parser_skip_to_pragma_eol.
680 2021-08-18 Patrick Palka <ppalka@redhat.com>
684 * cp-tree.h (CONSTRUCTOR_BRACES_ELIDED_P): Define.
685 * decl.c (reshape_init_r): Set it.
686 * pt.c (collect_ctor_idx_types): Recurse into a sub-CONSTRUCTOR
687 iff CONSTRUCTOR_BRACES_ELIDED_P.
689 2021-08-18 Patrick Palka <ppalka@redhat.com>
692 * pt.c (convert_template_argument): Pass LOOKUP_IMPLICIT to
695 2021-08-18 Jakub Jelinek <jakub@redhat.com>
697 * parser.c (cp_parser_omp_nothing): New function.
698 (cp_parser_pragma): Handle PRAGMA_OMP_NOTHING.
700 2021-08-18 Jakub Jelinek <jakub@redhat.com>
702 * parser.c (cp_parser_omp_ordered): Return true instead of
703 false after emitting errors that the directive is not allowed in
705 (cp_parser_omp_target_update): Likewise.
706 (cp_parser_omp_cancellation_point): Change return type from void to
707 bool, return false if the directive should be ignored in pragma_stmt
709 (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data):
710 Change return type from tree to bool, return false if the
711 directive should be ignored in pragma_stmt contexts.
712 (cp_parser_omp_target): Adjust callers of cp_parser_omp_target_*_data,
713 return their result directly.
714 (cp_parser_pragma): For PRAGMA_OMP_CANCELLATION_POINT return what
715 cp_parser_omp_cancellation_point returned. Return true instead of
716 false after emitting errors that the directive is not allowed in
719 2021-08-17 Jakub Jelinek <jakub@redhat.com>
722 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_LAYOUT_COMPATIBLE.
723 (enum cp_built_in_function): Add CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
724 (fold_builtin_is_corresponding_member, next_common_initial_seqence,
725 layout_compatible_type_p): Declare.
726 * parser.c (cp_parser_primary_expression): Handle
727 RID_IS_LAYOUT_COMPATIBLE.
728 (cp_parser_trait_expr): Likewise.
729 * cp-objcp-common.c (names_builtin_p): Likewise.
730 * constraint.cc (diagnose_trait_expr): Handle
731 CPTK_IS_LAYOUT_COMPATIBLE.
732 * decl.c (cxx_init_decl_processing): Register
733 __builtin_is_corresponding_member builtin.
734 * constexpr.c (cxx_eval_builtin_function_call): Handle
735 CP_BUILT_IN_IS_CORRESPONDING_MEMBER builtin.
736 * semantics.c (is_corresponding_member_union,
737 is_corresponding_member_aggr, fold_builtin_is_corresponding_member):
739 (trait_expr_value): Handle CPTK_IS_LAYOUT_COMPATIBLE.
740 (finish_trait_expr): Likewise.
741 * typeck.c (next_common_initial_seqence, layout_compatible_type_p):
743 * cp-gimplify.c (cp_gimplify_expr): Fold
744 CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
746 * tree.c (builtin_valid_in_constant_expr_p): Handle
747 CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
748 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
749 CPTK_IS_LAYOUT_COMPATIBLE.
750 * class.c (remove_zero_width_bit_fields): Remove.
751 (layout_class_type): Don't call it.
753 2021-08-17 Jakub Jelinek <jakub@redhat.com>
755 * parser.c (OMP_SCOPE_CLAUSE_MASK): Define.
756 (cp_parser_omp_scope): New function.
757 (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_SCOPE.
758 * pt.c (tsubst_expr): Handle OMP_SCOPE.
760 2021-08-12 Jakub Jelinek <jakub@redhat.com>
762 * parser.c (cp_parser_omp_clause_name): Parse filter clause name.
763 (cp_parser_omp_clause_filter): New function.
764 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FILTER.
765 (OMP_MASKED_CLAUSE_MASK): Define.
766 (cp_parser_omp_masked): New function.
767 (cp_parser_omp_parallel): Handle parallel masked.
768 (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_MASKED.
769 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_FILTER.
770 * pt.c (tsubst_omp_clauses): Likewise.
771 (tsubst_expr): Handle OMP_MASKED.
773 2021-08-12 Sergei Trofimovich <siarheit@google.com>
776 * pt.c (tsubst_copy_and_build): Use build_ptrmemfunc_access_expr
777 to construct ptrmemfunc expression instantiation.
779 2021-08-12 Tobias Burnus <tobias@codesourcery.com>
781 * parser.c (cp_parser_omp_clause_proc_bind): Accept
782 'primary' as alias for 'master'.
784 2021-08-12 Jakub Jelinek <jakub@redhat.com>
786 * cp-tree.h (omp_declare_target_attr): New type.
787 (struct saved_scope): Change type of omp_declare_target_attribute
788 from int to vec<omp_declare_target_attr, va_gc> * and move it.
789 * parser.c (cp_parser_omp_declare_target): Instead of
790 incrementing scope_chain->omp_declare_target_attribute, push
791 a struct containing parser->lexer->in_omp_attribute_pragma to
793 (cp_parser_omp_end_declare_target): Instead of decrementing
794 scope_chain->omp_declare_target_attribute, pop a structure
795 from it. Diagnose mismatching declare target vs.
796 end declare target syntax.
797 * semantics.c (finish_translation_unit): Use vec_safe_length
798 and vec_safe_truncate on scope_chain->omp_declare_target_attributes.
799 * decl2.c (cplus_decl_attributes): Use vec_safe_length
800 on scope_chain->omp_declare_target_attributes.
802 2021-08-12 Jakub Jelinek <jakub@redhat.com>
804 * parser.c (cp_parser_lambda_body): Add temp overrides
805 for parser->{omp_declare_simd,oacc_routine,omp_attrs_forbidden_p}.
806 (cp_parser_statement): Restore parser->omp_attrs_forbidden_p for
807 cp_parser_declaration_statement.
808 (cp_parser_default_argument): Add temp override for
809 parser->omp_attrs_forbidden_p.
810 (cp_parser_late_parsing_omp_declare_simd): Diagnose declare simd
811 or declare variant in attribute syntax on a declaration immediately
812 following an OpenMP construct in pragma syntax.
814 2021-08-12 Jakub Jelinek <jakub@redhat.com>
817 * method.c (cat_tag_for): Return cc_last for !CLASS_TYPE_P
818 or for classes not in std namespace.
820 2021-08-12 Jakub Jelinek <jakub@redhat.com>
822 * name-lookup.c (finish_using_directive): Diagnose omp::directive
823 or omp::sequence attributes on using-directive.
825 2021-08-12 Jakub Jelinek <jakub@redhat.com>
827 * parser.c (cp_parser_block_declaration): Call
828 cp_parser_using_directive for C++11 attributes followed by
829 using namespace tokens.
830 (cp_parser_using_directive): Parse C++11 attributes at the start
831 of the directive rather than at the end, only parse GNU attributes
834 2021-08-12 Patrick Palka <ppalka@redhat.com>
837 * constexpr.c (cxx_eval_store_expression): Handle the lval=true
838 case in the early exit code path for empty stores with mismatched
841 2021-08-11 Patrick Palka <ppalka@redhat.com>
845 * cp-tree.h (unevaluated_p): Return true for REQUIRES_EXPR.
846 * decl.c (local_variable_p_walkfn): Don't walk into unevaluated
848 * parser.c (cp_parser_primary_expression) <case CPP_NAME>: Never
849 reject uses of local variables in unevaluated contexts.
850 * tree.c (cp_walk_subtrees) <case REQUIRES_EXPR>: Increment
851 cp_unevaluated_operand. Use cp_walk_tree directly instead of
852 WALK_SUBTREE to avoid the goto. Use REQUIRES_EXPR_REQS instead
853 of TREE_OPERAND directly.
855 2021-08-11 Jakub Jelinek <jakub@redhat.com>
858 * decl2.c (var_defined_without_dynamic_init): Return true for
859 DECL_DECLARED_CONSTINIT_P with complete type and trivial destructor.
861 2021-08-11 Patrick Palka <ppalka@redhat.com>
864 * parser.c (maybe_adjust_declarator_for_dguide): New, split
866 (cp_parser_init_declarator): ... here.
867 (cp_parser_member_declaration): Use it.
869 2021-08-11 Patrick Palka <ppalka@redhat.com>
872 * parser.c (cp_parser_parameter_declaration_list): Don't call
873 grokdeclarator if cp_parser_error_occurred.
874 (cp_parser_parameter_declaration): Simulate an error if we see
875 the beginning of a CTAD form, i.e. if we see an opening brace
876 after the decl-specifier-seq and the type is a CTAD placeholder.
878 2021-08-10 Jakub Jelinek <jakub@redhat.com>
880 * parser.c (cp_parser_member_declaration): Move odsd declaration
881 before cp_parser_using_declaration call to avoid errors with
884 2021-08-10 Jakub Jelinek <jakub@redhat.com>
886 * parser.h (struct cp_omp_declare_simd_data): Remove
887 in_omp_attribute_pragma and clauses members, add loc and attribs.
888 (struct cp_oacc_routine_data): Remove loc member, add clauses
890 * parser.c (cp_finalize_omp_declare_simd): New function.
891 (cp_parser_handle_statement_omp_attributes): Mention in
892 function comment the function is used also for
893 attribute-declaration.
894 (cp_parser_handle_directive_omp_attributes): New function.
895 (cp_parser_statement): Don't call
896 cp_parser_handle_statement_omp_attributes if statement doesn't
897 have attribute-specifier-seq at the beginning at all or if
898 if those attributes don't appertain to the statement.
899 (cp_parser_simple_declaration): Call
900 cp_parser_handle_directive_omp_attributes and
901 cp_finalize_omp_declare_simd.
902 (cp_parser_explicit_instantiation): Likewise.
903 (cp_parser_init_declarator): Initialize prefix_attributes
904 only after parsing declarators.
905 (cp_parser_direct_declarator): Call
906 cp_parser_handle_directive_omp_attributes and
907 cp_finalize_omp_declare_simd.
908 (cp_parser_member_declaration): Likewise.
909 (cp_parser_single_declaration): Likewise.
910 (cp_parser_omp_declare_simd): Don't initialize
911 data.in_omp_attribute_pragma, instead initialize
912 data.attribs[0] and data.attribs[1].
913 (cp_finish_omp_declare_variant): Remove
914 in_omp_attribute_pragma argument, instead use
915 parser->lexer->in_omp_attribute_pragma.
916 (cp_parser_late_parsing_omp_declare_simd): Adjust
917 cp_finish_omp_declare_variant caller. Handle attribute-syntax
918 declare simd/variant.
920 2021-08-06 Tamar Christina <tamar.christina@arm.com>
922 * cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
923 * decl.c (cxx_simulate_enum_decl): Likewise.
925 2021-08-04 Jakub Jelinek <jakub@redhat.com>
928 * parser.c (cp_parser_default_argument): Temporarily override
929 parser->omp_declare_simd and parser->oacc_routine to NULL.
931 2021-08-02 Patrick Palka <ppalka@redhat.com>
934 * logic.cc (formula::formula): Use emplace_back instead of
936 (formula::branch): Insert a copy of m_current directly after
937 m_current instead of at the end of the list.
938 (formula::erase): Define.
939 (decompose_formula): Remove.
940 (decompose_antecedents): Remove.
941 (decompose_consequents): Remove.
942 (derive_proofs): Remove.
943 (max_problem_size): Remove.
944 (diagnose_constraint_size): Remove.
945 (subsumes_constraints_nonnull): Rewrite directly in terms of
946 decompose_clause and derive_proof, interleaving decomposition
947 with implication checking. Remove limit on constraint complexity.
948 Use formula::erase to free the current clause before moving on to
951 2021-07-31 Jason Merrill <jason@redhat.com>
954 * decl.c (fixup_anonymous_aggr): Clear TYPE_NEEDS_CONSTRUCTING
957 2021-07-31 Jason Merrill <jason@redhat.com>
959 * ptree.c (cxx_print_type) [TYPE_PACK_EXPANSION]: Also print
960 PACK_EXPANSION_PATTERN.
962 2021-07-31 Jakub Jelinek <jakub@redhat.com>
964 * parser.c (cp_parser_declaration): Handle OpenMP directives
965 in attribute-declaration.
967 2021-07-30 Jakub Jelinek <jakub@redhat.com>
970 * cp-tree.h (enum cp_trait_kind): Add
971 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
972 (enum cp_built_in_function): Add
973 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.
974 (fold_builtin_is_pointer_inverconvertible_with_class): Declare.
975 * parser.c (cp_parser_primary_expression): Handle
976 RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
977 (cp_parser_trait_expr): Likewise.
978 * cp-objcp-common.c (names_builtin_p): Likewise.
979 * constraint.cc (diagnose_trait_expr): Handle
980 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
981 * decl.c (cxx_init_decl_processing): Register
982 __builtin_is_pointer_interconvertible_with_class builtin.
983 * constexpr.c (cxx_eval_builtin_function_call): Handle
984 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS builtin.
985 * semantics.c (pointer_interconvertible_base_of_p,
986 first_nonstatic_data_member_p,
987 fold_builtin_is_pointer_inverconvertible_with_class): New functions.
988 (trait_expr_value): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
989 (finish_trait_expr): Likewise. Formatting fix.
990 * cp-gimplify.c (cp_gimplify_expr): Fold
991 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. Call
992 fndecl_built_in_p just once.
994 * tree.c (builtin_valid_in_constant_expr_p): Handle
995 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. Call
996 fndecl_built_in_p just once.
997 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
998 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1000 2021-07-30 Jason Merrill <jason@redhat.com>
1002 * class.c (finish_struct_anon): Improve comment.
1003 * decl.c (fixup_anonymous_aggr): Reject anonymous struct
1006 2021-07-30 Jakub Jelinek <jakub@redhat.com>
1008 * parser.c (cp_parser_statement): Rollback attributes not just
1009 when std_attrs is non-NULL, but whenever
1010 cp_parser_std_attribute_spec_seq parsed any tokens.
1012 2021-07-30 Jakub Jelinek <jakub@redhat.com>
1015 * parser.c (cp_parser_skip_std_attribute_spec_seq): Add a forward
1017 (cp_parser_declaration): Parse empty-declaration and
1018 attribute-declaration.
1019 (cp_parser_toplevel_declaration): Don't parse empty-declaration here.
1021 2021-07-28 Martin Sebor <msebor@redhat.com>
1023 * init.c: Include new header.
1025 2021-07-27 Marek Polacek <polacek@redhat.com>
1029 * cp-gimplify.c (cp_fold): Remove {LE,LT,GE,GT_EXPR} from
1031 * typeck.c (cp_build_binary_op): Reject ordered comparison
1032 of two null pointers.
1034 2021-07-26 Jakub Jelinek <jakub@redhat.com>
1036 * parser.h (struct cp_lexer): Add orphan_p member.
1037 * parser.c (cp_parser_statement): Don't change in_omp_attribute_pragma
1038 upon restart from CPP_PRAGMA handling. Fix up condition when a lexer
1039 should be destroyed and adjust saved_tokens if it records tokens from
1040 the to be destroyed lexer.
1041 (cp_parser_omp_section_scan): New function.
1042 (cp_parser_omp_scan_loop_body): Use it. If
1043 parser->lexer->in_omp_attribute_pragma, allow optional comma
1045 (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
1047 2021-07-23 Jakub Jelinek <jakub@redhat.com>
1049 * parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
1050 * parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
1051 mixing of attribute and pragma syntax directives when seeing
1052 omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
1053 directives are followed by OpenMP pragma.
1054 (cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
1055 the cp_parser_handle_statement_omp_attributes call.
1056 (cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
1057 if true, set parser->omp_attrs_forbidden_p.
1058 (cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
1059 false as disallow_omp_attrs to cp_parser_omp_structured_block.
1060 (cp_parser_omp_parallel, cp_parser_omp_task): Set
1061 parser->omp_attrs_forbidden_p.
1063 2021-07-21 Thomas Schwinge <thomas@codesourcery.com>
1064 Joseph Myers <joseph@codesourcery.com>
1065 Cesar Philippidis <cesar@codesourcery.com>
1067 * parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
1068 (cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
1069 (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
1070 * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
1071 * semantics.c (finish_omp_clauses): Likewise.
1073 2021-07-21 Jakub Jelinek <jakub@redhat.com>
1076 * semantics.c (finish_omp_reduction_clause): Also call
1077 complete_type_or_else and return true if it fails.
1079 2021-07-19 Iain Sandoe <iain@sandoe.co.uk>
1082 * coroutines.cc (struct coroutine_info): Add fields for
1083 actor and destroy function decls.
1085 (coro_get_ramp_function): New.
1086 (coro_get_actor_function): New.
1087 (coro_get_destroy_function): New.
1088 (act_des_fn): Set up mapping between ramp, actor and
1090 (morph_fn_to_coro): Adjust interface to the builder for
1091 helper function decls.
1092 * cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
1094 * mangle.c (write_encoding): Handle coroutine helpers.
1095 (write_unqualified_name): Handle lambda coroutine helpers.
1097 2021-07-16 Patrick Palka <ppalka@redhat.com>
1100 * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
1101 substituting DECL_ARGUMENTS.
1103 2021-07-16 Patrick Palka <ppalka@redhat.com>
1107 * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
1108 when the return types are references.
1110 2021-07-16 Marek Polacek <polacek@redhat.com>
1112 * typeck2.c (check_narrowing): Don't suppress the pedantic error
1115 2021-07-15 Jakub Jelinek <jakub@redhat.com>
1118 * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
1119 operands, fold them right away to true or false.
1121 2021-07-15 Jason Merrill <jason@redhat.com>
1124 * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
1125 (cp_tree_size): Remove redundant entries.
1127 2021-07-14 Patrick Palka <ppalka@redhat.com>
1130 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
1131 * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
1133 (redeclare_class_template): Likewise.
1134 (forwarding_reference_p): Define.
1135 (maybe_adjust_types_for_deduction): Use it instead. Add 'tparms'
1137 (unify_one_argument): Pass tparms to
1138 maybe_adjust_types_for_deduction.
1139 (try_one_overload): Likewise.
1141 (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
1144 2021-07-14 Jason Merrill <jason@redhat.com>
1146 * class.c (struct find_final_overrider_data): Use auto_vec.
1147 (find_final_overrider): Remove explicit release.
1148 * coroutines.cc (process_conditional): Use auto_vec.
1149 * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
1150 (cp_genericize_tree): Remove explicit release.
1151 * parser.c (cp_parser_objc_at_property_declaration): Use
1153 * semantics.c (omp_reduction_lookup): Use auto_vec.
1155 2021-07-14 Marek Polacek <polacek@redhat.com>
1158 * constexpr.c (cxx_eval_array_reference): Create a new .object
1159 and .ctor for the non-aggregate non-scalar case too when
1162 2021-07-12 Patrick Palka <ppalka@redhat.com>
1166 * decl.c (grokfndecl): Don't require that deduction guides are
1167 declared at namespace scope. Check that class-scope deduction
1168 guides have the same access as the member class template.
1169 (grokdeclarator): Pretend class-scope deduction guides are static.
1170 * search.c (lookup_member): Don't use a BASELINK for (class-scope)
1173 2021-07-10 Patrick Palka <ppalka@redhat.com>
1176 * init.c (build_aggr_init): Return error_mark_node if
1177 expand_aggr_init_1 returns false.
1178 (expand_default_init): Change return type to bool. Return false
1179 on error, true on success.
1180 (expand_aggr_init_1): Likewise.
1182 2021-07-09 Jason Merrill <jason@redhat.com>
1185 * decl.c (function_requirements_equivalent_p): Only compare
1186 trailing requirements on a specialization.
1188 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
1190 * coroutines.cc (build_actor_fn): Move common code to
1192 (build_destroy_fn): Likewise.
1193 (act_des_fn): Build the void return here. Ensure that the
1194 source location matches the original function.
1196 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
1199 (coro_rewrite_function_body): Connect the replacement
1200 function block to the block nest correctly.
1202 2021-07-09 Patrick Palka <ppalka@redhat.com>
1205 * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
1207 * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
1208 * pt.c (build_extra_args): Make a copy of args.
1209 (add_extra_args): Add complain/in_decl parameters. Enable the
1210 code for handling the case where the extra arguments are
1212 (tsubst_pack_expansion): Pass complain/in_decl to
1214 (tsubst_template_args): Handle missing template arguments.
1215 (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
1218 2021-07-09 Patrick Palka <ppalka@redhat.com>
1221 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
1224 2021-07-08 Martin Sebor <msebor@redhat.com>
1227 * module.cc (identifier): Suppress warning.
1228 (module_state::read_macro_maps): Remove warning suppression.
1229 (module_state::install_macros): Ditto.
1231 2021-07-08 Marek Polacek <polacek@redhat.com>
1234 * cp-tree.h (unevaluated_p): New.
1235 * except.c (check_noexcept_r): Use it. Don't walk into
1236 unevaluated operands.
1238 2021-07-08 Martin Sebor <msebor@redhat.com>
1241 * module.cc (module_state::read_macro_maps): Temporarily disable
1243 (module_state::install_macros): Same.
1245 2021-07-06 Martin Sebor <msebor@redhat.com>
1247 * error.c (cp_printer): Remove support for %G and %K.
1249 2021-07-02 Jakub Jelinek <jakub@redhat.com>
1251 * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
1252 (struct cp_omp_declare_simd_data): Likewise.
1253 * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
1254 (omp_identifier): Define.
1255 * parser.c (cp_parser_skip_to_pragma_eol): Handle
1256 in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
1257 (cp_parser_require_pragma_eol): Likewise.
1258 (struct cp_omp_attribute_data): New type.
1259 (cp_parser_handle_statement_omp_attributes): New function.
1260 (cp_parser_statement): Handle OpenMP directives in statement's
1261 attribute-specifier-seq.
1262 (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
1264 (cp_parser_std_attribute): Handle omp::directive and omp::sequence
1266 (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
1267 a comma also before the first clause.
1268 (cp_parser_omp_allocate): Likewise.
1269 (cp_parser_omp_atomic): Likewise.
1270 (cp_parser_omp_depobj): Likewise.
1271 (cp_parser_omp_flush): Likewise.
1272 (cp_parser_omp_ordered): Likewise.
1273 (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
1274 into struct cp_omp_declare_simd_data.
1275 (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
1276 argument. If set, allow a comma also before match clause.
1277 (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
1278 allow a comma also before the first clause. Adjust
1279 cp_finish_omp_declare_variant caller.
1280 (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
1281 a comma also before the first clause.
1282 (cp_parser_omp_declare_reduction_exprs): Likewise.
1283 (cp_parser_omp_requires): Likewise.
1284 * decl.c (initialize_predefined_identifiers): Initialize
1286 * decl2.c (cplus_decl_attributes): Reject omp::directive and
1287 omp::sequence attributes.
1289 2021-07-02 Jakub Jelinek <jakub@redhat.com>
1292 * parser.c (cp_parser_omp_atomic): Consume comma only if it
1293 appears before a CPP_NAME.
1295 2021-07-02 Patrick Palka <ppalka@redhat.com>
1298 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
1299 use common_enclosing_class and to not depend on the TREE_TYPE
1300 of outer levels pointing to the corresponding primary template.
1302 2021-07-01 Patrick Palka <ppalka@redhat.com>
1305 * constexpr.c (cxx_eval_array_reference): When the element type
1306 is an empty type and the corresponding element is omitted, just
1307 return an empty CONSTRUCTOR instead of attempting value
1310 2021-07-01 Patrick Palka <ppalka@redhat.com>
1313 * pt.c (finish_template_variable): Pass the partially
1314 instantiated template and its args to instantiate_template.
1315 (instantiate_class_template_1): No need to call
1316 push_nested_class and pop_nested_class around the call to
1317 most_specialized_partial_spec.
1318 (instantiate_template_1): Pass the partially instantiated
1319 template to lookup_template_variable.
1320 (most_specialized_partial_spec): Use push_access_scope_guard
1321 to set the access scope appropriately. Use
1322 deferring_access_check_sentinel to force access to get checked
1324 (instantiate_decl): Just pass the VAR_DECL to
1325 most_specialized_partial_spec.
1327 2021-06-30 Patrick Palka <ppalka@redhat.com>
1329 * constraint.cc (get_normalized_constraints_from_decl): Use
1330 push_access_scope_guard instead of push_nested_class_guard.
1331 * cp-tree.h (struct push_nested_class_guard): Replace with ...
1332 (struct push_access_scope_guard): ... this.
1333 * pt.c (push_access_scope): When the argument corresponds to
1334 a class type, push the class instead of its context.
1335 (pop_access_scope): Adjust accordingly.
1337 2021-06-30 Marek Polacek <polacek@redhat.com>
1341 * decl.c (create_array_type_for_decl): Allow array of auto.
1343 2021-06-29 Jason Merrill <jason@redhat.com>
1345 * pt.c (instantiate_decl): Only consider partial specializations of
1346 actual variable templates.
1348 2021-06-26 Patrick Palka <ppalka@redhat.com>
1351 * pt.c (instantiate_class_template_1): Enter the scope of the
1352 type when calling most_specialized_partial_spec.
1354 2021-06-26 Jason Merrill <jason@redhat.com>
1358 * class.c (is_empty_field): Handle null argument.
1359 * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
1362 2021-06-26 Marek Polacek <polacek@redhat.com>
1365 * parser.c (cp_parser_declarator): Pass flags down to
1366 cp_parser_declarator. Also pass static_p/member_p.
1368 2021-06-25 Martin Sebor <msebor@redhat.com>
1370 * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
1371 with warning_suppressed_p, suppress_warning, and copy_no_warning, or
1372 nothing if not necessary.
1373 (set_up_extended_ref_temp): Same.
1374 * class.c (layout_class_type): Same.
1375 * constraint.cc (constraint_satisfaction_value): Same.
1376 * coroutines.cc (finish_co_await_expr): Same.
1377 (finish_co_yield_expr): Same.
1378 (finish_co_return_stmt): Same.
1379 (build_actor_fn): Same.
1380 (coro_rewrite_function_body): Same.
1381 (morph_fn_to_coro): Same.
1382 * cp-gimplify.c (genericize_eh_spec_block): Same.
1383 (gimplify_expr_stmt): Same.
1384 (cp_genericize_r): Same.
1386 * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
1387 * cvt.c (cp_fold_convert): Same.
1388 (convert_to_void): Same.
1389 * decl.c (wrapup_namespace_globals): Same.
1390 (grokdeclarator): Same.
1391 (finish_function): Same.
1392 (require_deduced_type): Same.
1393 * decl2.c (no_linkage_error): Same.
1394 (c_parse_final_cleanups): Same.
1395 * except.c (expand_end_catch_block): Same.
1396 * init.c (build_new_1): Same.
1398 (build_vec_delete_1): Same.
1399 (build_vec_init): Same.
1400 (build_delete): Same.
1401 * method.c (defaultable_fn_check): Same.
1402 * parser.c (cp_parser_fold_expression): Same.
1403 (cp_parser_primary_expression): Same.
1404 * pt.c (push_tinst_level_loc): Same.
1405 (tsubst_copy): Same.
1406 (tsubst_omp_udr): Same.
1407 (tsubst_copy_and_build): Same.
1408 * rtti.c (build_if_nonnull): Same.
1409 * semantics.c (maybe_convert_cond): Same.
1410 (finish_return_stmt): Same.
1411 (finish_parenthesized_expr): Same.
1412 (cp_check_omp_declare_reduction): Same.
1413 * tree.c (build_cplus_array_type): Same.
1414 * typeck.c (build_ptrmemfunc_access_expr): Same.
1415 (cp_build_indirect_ref_1): Same.
1416 (cp_build_function_call_vec): Same.
1417 (warn_for_null_address): Same.
1418 (cp_build_binary_op): Same.
1419 (unary_complex_lvalue): Same.
1420 (cp_build_modify_expr): Same.
1421 (build_x_modify_expr): Same.
1422 (convert_for_assignment): Same.
1424 2021-06-24 Patrick Palka <ppalka@redhat.com>
1427 * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
1429 2021-06-24 Patrick Palka <ppalka@redhat.com>
1432 * constraint.cc (evaluate_requires_expr): Adjust function comment.
1433 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
1434 (cp_fold) <case REQUIRES_EXPR>: ... here.
1436 2021-06-24 Jakub Jelinek <jakub@redhat.com>
1438 * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
1439 C_ORT_OMP for clauses on target construct.
1440 (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
1441 (cp_parser_omp_target): For non-combined target add
1442 map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION. Pass
1443 C_ORT_OMP_TARGET to finish_omp_clauses.
1444 * semantics.c (handle_omp_array_sections_1): Adjust ort handling
1445 for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
1446 never present on C_ORT_*DECLARE_SIMD.
1447 (handle_omp_array_sections): Likewise.
1448 (finish_omp_clauses): Likewise. Handle OMP_CLAUSE_IN_REDUCTION
1449 on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
1450 corresponding map clauses.
1451 * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
1452 clauses on target construct.
1454 2021-06-23 Patrick Palka <ppalka@redhat.com>
1457 * pt.c (push_access_scope): For artificial deduction guides,
1458 set the access scope to that of the constructor.
1459 (pop_access_scope): Likewise.
1460 (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
1462 2021-06-23 Patrick Palka <ppalka@redhat.com>
1465 * call.c (print_error_for_call_failure): Constify 'args' parameter.
1466 (perform_dguide_overload_resolution): Define.
1467 * cp-tree.h: (perform_dguide_overload_resolution): Declare.
1468 * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
1469 instead of build_new_function_call. Don't use tf_decltype or
1470 set cp_unevaluated_operand. Remove unnecessary NULL_TREE tests.
1472 2021-06-21 Patrick Palka <ppalka@redhat.com>
1475 * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
1476 sooner, before the NRVO handling.
1478 2021-06-21 Patrick Palka <ppalka@redhat.com>
1481 * tree.c (bot_replace): Use convert_to_base to build the
1482 conversion to the (morally) virtual base.
1484 2021-06-21 Jakub Jelinek <jakub@redhat.com>
1486 PR inline-asm/100785
1487 * typeck.c (cxx_mark_addressable): Diagnose trying to make
1488 bit-fields addressable.
1490 2021-06-17 Jason Merrill <jason@redhat.com>
1493 * decl.c (duplicate_decls): Make 'deleted after first declaration'
1494 pedwarn on by default.
1496 2021-06-17 Jason Merrill <jason@redhat.com>
1499 * init.c (build_vec_init): Preserve the type of base.
1501 2021-06-16 Jason Merrill <jason@redhat.com>
1505 * pt.c (tsubst_baselink): Update binfos in non-dependent case.
1507 2021-06-15 Robin Dapp <rdapp@linux.ibm.com>
1509 * decl.c (duplicate_decls): Likewise.
1511 2021-06-14 Tobias Burnus <tobias@codesourcery.com>
1514 * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
1515 var in the error case.
1517 2021-06-13 Trevor Saunders <tbsaunde@tbsaunde.org>
1519 * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
1520 with range based for.
1521 (cxx_eval_store_expression): Likewise.
1522 (cxx_eval_loop_expr): Likewise.
1523 * decl.c (wrapup_namespace_globals): Likewise.
1524 (cp_finish_decl): Likewise.
1525 (cxx_simulate_enum_decl): Likewise.
1526 * parser.c (cp_parser_postfix_expression): Likewise.
1528 2021-06-12 Jason Merrill <jason@redhat.com>
1531 * init.c (build_vec_init): Shortcut [0] case.
1533 2021-06-12 Jason Merrill <jason@redhat.com>
1535 * pt.c (lookup_template_class_1): Shortcut current_class_type.
1537 2021-06-11 Patrick Palka <ppalka@redhat.com>
1541 * pt.c (tsubst_arg_types): Rearrange so that we substitute into
1542 TYPE_ARG_TYPES in forward order while short circuiting
1543 appropriately. Adjust formatting.
1545 2021-06-11 Jakub Jelinek <jakub@redhat.com>
1548 * cp-tree.h (struct saved_scope): Add consteval_if_p
1549 member. Formatting fix for the discarded_stmt comment.
1550 (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
1551 * parser.c (cp_parser_lambda_expression): Temporarily disable
1552 in_consteval_if_p when parsing lambda body.
1553 (cp_parser_selection_statement): Parse consteval if.
1554 * decl.c (struct named_label_entry): Add in_consteval_if member.
1555 (level_for_consteval_if): New function.
1556 (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
1558 * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
1559 why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
1560 for !ctx->manifestly_const_eval.
1561 (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
1562 condition as if it was __builtin_is_constant_evaluated call.
1563 (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
1564 recurse on both branches.
1565 * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
1567 * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
1568 Temporarily set in_consteval_if_p when recursing on
1569 IF_STMT_CONSTEVAL_P then branch.
1570 (tsubst_lambda_expr): Temporarily disable
1571 in_consteval_if_p when instantiating lambda body.
1572 * call.c (immediate_invocation_p): Return false when
1575 2021-06-11 Marek Polacek <polacek@redhat.com>
1578 * constexpr.c (maybe_constexpr_fn): New.
1579 * cp-tree.h (maybe_constexpr_fn): Declare.
1580 * semantics.c (find_std_constant_evaluated_r): New.
1581 (maybe_warn_for_constant_evaluated): New.
1582 (finish_if_stmt_cond): Call it.
1584 2021-06-10 Patrick Palka <ppalka@redhat.com>
1587 * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
1588 the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
1589 a template template parameter, adjust to the
1590 TEMPLATE_TEMPLATE_PARAMETER before falling through.
1592 2021-06-10 Patrick Palka <ppalka@redhat.com>
1595 * constraint.cc (normalize_placeholder_type_constraints): When
1596 normalizing a non-templated return-type-requirement, add a dummy
1597 level to initial_parms.
1599 2021-06-08 Marek Polacek <polacek@redhat.com>
1602 * decl.c (grokdeclarator): Store a value-dependent
1603 explicit-specifier even for deduction guides.
1605 2021-06-08 Jason Merrill <jason@redhat.com>
1607 * parser.c (cp_parser_string_literal): Adjust diagnostic.
1609 2021-06-08 Jason Merrill <jason@redhat.com>
1612 * call.c (perfect_conversion_p): Check check_narrowing.
1614 2021-06-08 Jason Merrill <jason@redhat.com>
1617 * name-lookup.c (get_class_binding): Keep a BASELINK.
1618 (set_inherited_value_binding_p): Adjust.
1619 * lambda.c (is_lambda_ignored_entity): Adjust.
1620 * pt.c (lookup_template_function): Copy a BASELINK before
1623 2021-06-08 Jason Merrill <jason@redhat.com>
1626 * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
1628 2021-06-08 Jason Merrill <jason@redhat.com>
1630 * module.cc (duplicate_hash::hash): Comment out.
1631 (trees_in::tree_value): Adjust loop counter.
1633 2021-06-08 Jason Merrill <jason@redhat.com>
1636 * init.c (build_offset_ref): Return the BASELINK for a static
1639 2021-06-07 Patrick Palka <ppalka@redhat.com>
1642 * parser.c (cp_parser_lookup_name): Check access of the lookup
1643 result before we potentially adjust an injected-class-name to
1646 2021-06-06 Jakub Jelinek <jakub@redhat.com>
1649 * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
1650 even when target is combined with other constructs.
1652 2021-06-04 Patrick Palka <ppalka@redhat.com>
1655 * pt.c (convert_template_argument): Strip top-level cv-quals
1656 on the substituted type of a non-type template parameter.
1658 2021-06-04 Patrick Palka <ppalka@redhat.com>
1661 * pt.c (tsubst_function_decl): Remove old code for reducing
1662 args when it has excess levels.
1664 2021-06-04 Jakub Jelinek <jakub@redhat.com>
1667 * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
1668 ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
1671 2021-06-03 Patrick Palka <ppalka@redhat.com>
1674 * decl.c (make_typename_type): After calling
1675 lookup_template_class, adjust the result to its TYPE_NAME and
1676 then consider the tf_keep_type_decl flag.
1678 2021-06-03 Patrick Palka <ppalka@redhat.com>
1681 * pt.c (set_current_access_from_decl): Move to ...
1682 * class.c (set_current_access_from_decl): ... here.
1683 (handle_using_decl): Use it to propagate the access of the
1684 using-enum decl to the copy of the imported enumerator.
1685 * cp-tree.h (set_current_access_from_decl): Declare.
1686 * decl.c (build_enumerator): Simplify using make_temp_override
1687 and set_current_access_from_decl.
1689 2021-06-03 Jakub Jelinek <jakub@redhat.com>
1692 * semantics.c (handle_omp_array_sections_1): For
1693 OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
1694 finish_non_static_data_member and allow this as base.
1695 (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
1696 after depend only cases. Let this be diagnosed by !lvalue_p
1697 case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
1699 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
1701 2021-06-02 Jason Merrill <jason@redhat.com>
1704 * call.c (convert_like_internal): Clear tf_no_cleanup when
1706 (build_user_type_conversion_1): Only add ck_rvalue if
1707 LOOKUP_ONLYCONVERTING.
1709 2021-06-01 Patrick Palka <ppalka@redhat.com>
1712 * init.c (expand_aggr_init_1): Check
1713 type_has_non_user_provided_default_constructor instead of
1714 type_has_user_provided_constructor.
1716 2021-06-01 Jason Merrill <jason@redhat.com>
1719 * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
1720 for destroying delete.
1721 * init.c (build_delete): Don't clobber before destroying delete.
1723 2021-06-01 Jason Merrill <jason@redhat.com>
1726 * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
1728 2021-05-31 Richard Biener <rguenther@suse.de>
1731 * cp-objcp-common.c (names_builtin_p): Handle
1732 RID_BUILTIN_SHUFFLEVECTOR.
1733 * cp-tree.h (build_x_shufflevector): Declare.
1734 * parser.c (cp_parser_postfix_expression): Handle
1735 RID_BUILTIN_SHUFFLEVECTOR.
1736 * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
1737 * typeck.c (build_x_shufflevector): Build either a lowered
1738 VEC_PERM_EXPR or an unlowered shufflevector via a temporary
1739 internal function IFN_SHUFFLEVECTOR.
1741 2021-05-28 Jason Merrill <jason@redhat.com>
1743 * constexpr.c (build_data_member_initialization): Use tsi_range.
1744 (build_constexpr_constructor_member_initializers): Likewise.
1745 (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
1746 (potential_constant_expression_1): Likewise.
1747 * coroutines.cc (await_statement_expander): Likewise.
1748 (await_statement_walker): Likewise.
1749 * module.cc (trees_out::core_vals): Likewise.
1750 * pt.c (tsubst_expr): Likewise.
1751 * semantics.c (set_cleanup_locs): Likewise.
1753 2021-05-28 Jason Merrill <jason@redhat.com>
1757 * call.c (build_over_call): Adjust base_binfo in
1758 resolves_to_fixed_type_p case.
1760 2021-05-28 Jakub Jelinek <jakub@redhat.com>
1763 * semantics.c (handle_omp_array_sections): Copy
1764 OMP_CLAUSE_MAP_IMPLICIT.
1765 (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
1766 marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT. Add
1767 map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
1768 maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
1769 present too. For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
1770 if present in map_head, map_field_head or map_firstprivate_head
1773 2021-05-28 Tobias Burnus <tobias@codesourcery.com>
1775 * parser.c (cp_parser_omp_clause_affinity): New.
1776 (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
1777 cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
1779 * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
1780 finish_omp_clauses): Likewise.
1782 2021-05-27 Matthias Kretz <kretz@kde.org>
1785 * error.c (dump_template_bindings): Include code to print
1786 "[with" and ']', conditional on whether anything is printed at
1787 all. This is tied to whether a semicolon is needed to separate
1788 multiple template parameters. If the template argument repeats
1789 the template parameter (T = T), then skip the parameter.
1790 (dump_substitution): Moved code to print "[with" and ']' to
1791 dump_template_bindings.
1792 (dump_function_decl): Partial revert of PR50828, which masked
1793 TFF_TEMPLATE_NAME for all of dump_function_decl. Now
1794 TFF_TEMPLATE_NAME is masked for the scope of the function and
1795 only carries through to dump_function_name.
1796 (dump_function_name): Avoid calling dump_template_parms if
1797 TFF_TEMPLATE_NAME is set.
1799 2021-05-27 Matthias Kretz <kretz@kde.org>
1802 * error.c: Call dump_scope when printing a typedef.
1804 2021-05-27 Patrick Palka <ppalka@redhat.com>
1807 * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
1809 2021-05-27 Jason Merrill <jason@redhat.com>
1812 * pt.c (use_pack_expansion_extra_args_p): Don't compare
1813 args from the same argument pack.
1815 2021-05-27 Patrick Palka <ppalka@redhat.com>
1820 * pt.c (process_partial_specialization): Don't error on a
1821 non-simple non-type template argument that involves template
1823 (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
1824 MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
1826 2021-05-26 Patrick Palka <ppalka@redhat.com>
1829 * typeck.c (finish_class_member_access_expr): Disable ahead
1830 of time access checking during the member lookup.
1832 2021-05-26 Patrick Palka <ppalka@redhat.com>
1835 * tree.c (build_target_expr_with_type): Don't call force_rvalue
1836 on CALL_EXPR initializer. Simplify now that bot_manip is no
1838 (bot_manip): Use force_target_expr instead of
1839 build_target_expr_with_type.
1841 2021-05-26 Patrick Palka <ppalka@redhat.com>
1844 * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
1845 (fnptr_conv_p): Don't call non_reference. Use INDIRECT_TYPE_P
1846 instead of TYPE_PTR_P.
1847 * pt.c (convert_nontype_argument_function): Look through
1848 implicit INDIRECT_REFs before calling strip_fnptr_conv.
1850 2021-05-25 Jakub Jelinek <jakub@redhat.com>
1853 * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
1854 and side-effects, temporarily disable -Wunused-result warning when
1855 building COMPOUND_EXPR.
1857 2021-05-21 Jakub Jelinek <jakub@redhat.com>
1860 * semantics.c (finish_omp_clauses): Move firstprivate clauses with
1861 OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain. Don't error
1862 if a decl is mentioned both in map clause and in such firstprivate
1863 clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
1865 2021-05-20 Jason Merrill <jason@redhat.com>
1867 * call.c (reference_binding): Check for designator.
1868 (implicit_conversion_1, build_special_member_call): Likewise.
1869 * decl.c (reshape_init_r): Likewise.
1870 * pt.c (do_class_deduction): Likewise.
1871 * typeck2.c (digest_init_r): Likewise.
1873 2021-05-20 Jason Merrill <jason@redhat.com>
1876 * decl.c (reshape_init_class): Handle designator for
1877 member of anonymous aggregate here.
1878 * typeck2.c (process_init_constructor_record): Not here.
1880 2021-05-20 Jonathan Wakely <jwakely@redhat.com>
1882 * call.c (maybe_warn_array_conv): Use new warning option.
1883 * decl.c (mark_inline_variable, grokdeclarator): Likewise.
1884 * error.c (maybe_warn_cpp0x): Likewise.
1885 * parser.c (cp_parser_primary_expression)
1886 (cp_parser_unqualified_id)
1887 (cp_parser_pseudo_destructor_name)
1888 (cp_parser_lambda_introducer)
1889 (cp_parser_lambda_declarator_opt)
1890 (cp_parser_selection_statement)
1891 (cp_parser_init_statement)
1892 (cp_parser_decomposition_declaration)
1893 (cp_parser_function_specifier_opt)
1894 (cp_parser_static_assert)
1895 (cp_parser_namespace_definition)
1896 (cp_parser_using_declaration)
1897 (cp_parser_asm_definition)
1898 (cp_parser_ctor_initializer_opt_and_function_body)
1899 (cp_parser_initializer_list)
1900 (cp_parser_type_parameter_key)
1901 (cp_parser_member_declaration)
1902 (cp_parser_try_block)
1903 (cp_parser_std_attribute_spec): Likewise.
1904 * pt.c (check_template_variable): Likewise.
1906 2021-05-20 Jason Merrill <jason@redhat.com>
1909 * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
1911 2021-05-20 Jason Merrill <jason@redhat.com>
1914 * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
1916 2021-05-19 Jason Merrill <jason@redhat.com>
1920 * method.c (genericize_spaceship): Use fold_build2 for scalar
1923 2021-05-19 Jason Merrill <jason@redhat.com>
1925 * pt.c (build_deduction_guide): Treat the implicit deduction guide
1926 as a member of the class.
1928 2021-05-19 Marek Polacek <polacek@redhat.com>
1931 * cp-tree.h (any_non_type_attribute_p): Remove.
1932 * decl.c (grokdeclarator): Turn an error into a warning and only
1933 warn for standard attributes.
1934 * decl2.c (any_non_type_attribute_p): Remove.
1935 * parser.c (cp_parser_elaborated_type_specifier): Turn an error
1936 into a warning and only warn for standard attributes.
1937 (cp_parser_member_declaration): Likewise.
1939 2021-05-19 Martin Liska <mliska@suse.cz>
1942 * mangle.c (write_encoding): Fix typos.
1944 2021-05-19 Jakub Jelinek <jakub@redhat.com>
1947 * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
1948 master when combined with taskloop.
1949 (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
1950 parallel master when not combined with taskloop.
1952 2021-05-19 Jason Merrill <jason@redhat.com>
1955 * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
1957 2021-05-19 Jason Merrill <jason@redhat.com>
1960 * tree.c (strip_typedefs): Only look at the pattern of a
1961 TYPE_PACK_EXPANSION if it's a type.
1963 2021-05-18 Marek Polacek <polacek@redhat.com>
1965 * class.c (classtype_has_non_deleted_copy_ctor): Remove.
1966 * constraint.cc (contains_wildcard_p): Likewise.
1967 (get_template_head_requirements): Likewise.
1968 (check_constrained_friend): Likewise.
1969 (subsumes_constraints): Likewise.
1970 * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
1971 (push_void_library_fn): Likewise.
1972 (get_pattern_parm): Likewise.
1973 (get_template_parms_at_level): Likewise.
1974 (lambda_return_type): Likewise.
1975 (get_template_head_requirements): Likewise.
1976 (check_constrained_friend): Likewise.
1977 (subsumes_constraints): Likewise.
1978 * decl.c (push_void_library_fn): Likewise.
1979 * lambda.c (lambda_return_type): Likewise.
1980 * pt.c (get_template_parms_at_level): Likewise.
1981 (get_pattern_parm): Likewise.
1983 2021-05-18 Jason Merrill <jason@redhat.com>
1986 * call.c (perfect_candidate_p): An implicitly deleted move
1989 2021-05-18 Andreas Krebbel <krebbel@linux.ibm.com>
1992 * cvt.c (cp_convert_to_pointer): Use the size of the target
1994 * tree.c (cp_build_reference_type): Call
1995 cp_build_reference_type_for_mode with VOIDmode.
1996 (cp_build_reference_type_for_mode): Rename from
1997 cp_build_reference_type. Add MODE argument and invoke
1998 build_reference_type_for_mode.
1999 (strip_typedefs): Use build_pointer_type_for_mode and
2000 cp_build_reference_type_for_mode for pointers and references.
2002 2021-05-17 Jonathan Wakely <jwakely@redhat.com>
2005 * call.c (convert_like_internal): Print different diagnostic if
2006 the lvalue reference is const.
2008 2021-05-14 Jason Merrill <jason@redhat.com>
2011 * pt.c (enclosing_instantiation_of): Just compare
2012 DECL_SOURCE_LOCATION.
2013 (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
2015 2021-05-14 Marek Polacek <polacek@redhat.com>
2016 Jason Merrill <jason@redhat.com>
2019 * cp-tree.h (any_non_type_attribute_p): Declare.
2020 * decl.c (grokdeclarator): Diagnose when an attribute appertains to
2021 a friend declaration that is not a definition.
2022 * decl2.c (any_non_type_attribute_p): New.
2023 * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
2024 in the middle of decl-specifiers.
2025 (cp_parser_elaborated_type_specifier): Diagnose when an attribute
2026 appertains to a friend declaration that is not a definition.
2027 (cp_parser_member_declaration): Likewise.
2029 2021-05-12 Marek Polacek <polacek@redhat.com>
2031 * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
2034 2021-05-12 Marcel Vollweiler <marcel@codesourcery.com>
2036 * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
2039 2021-05-11 Jason Merrill <jason@redhat.com>
2042 * typeck.c (build_reinterpret_cast_1): Check intype on
2045 2021-05-11 Patrick Palka <ppalka@redhat.com>
2048 * name-lookup.c (maybe_save_operator_binding): Unconditionally
2049 enable for all function templates, not just generic lambdas.
2050 Handle compound-assignment operator expressions.
2051 * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
2052 in the type-dependent case.
2053 (build_x_modify_expr): Likewise. Move declaration of 'op' closer
2056 2021-05-11 Patrick Palka <ppalka@redhat.com>
2059 * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
2060 (satisfy_atom): Set up iloc_sentinel before calling
2062 * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
2063 expansion, carry over PACK_EXPANSION_LOCAL_P and
2064 PACK_EXPANSION_SIZEOF_P from the original pack expansion.
2066 2021-05-10 Richard Biener <rguenther@suse.de>
2068 PR middle-end/100464
2070 * call.c (set_up_extended_ref_temp): Mark the temporary
2071 addressable if the TARGET_EXPR was.
2073 2021-05-10 Martin Liska <mliska@suse.cz>
2075 * decl.c (duplicate_decls): Use startswith
2076 function instead of strncmp.
2077 (cxx_builtin_function): Likewise.
2078 (omp_declare_variant_finalize_one): Likewise.
2079 (grokfndecl): Likewise.
2080 * error.c (dump_decl_name): Likewise.
2081 * mangle.c (find_decomp_unqualified_name): Likewise.
2082 (write_guarded_var_name): Likewise.
2083 (decl_tls_wrapper_p): Likewise.
2084 * parser.c (cp_parser_simple_type_specifier): Likewise.
2085 (cp_parser_tx_qualifier_opt): Likewise.
2086 * pt.c (template_parm_object_p): Likewise.
2087 (dguide_name_p): Likewise.
2089 2021-05-10 Martin Liska <mliska@suse.cz>
2092 * decl.c (grokdeclarator): Remove redundant NULL check.
2094 2021-05-07 Jason Merrill <jason@redhat.com>
2096 * tree.c (rvalue): Assert expr is not a class lvalue.
2098 2021-05-07 Jason Merrill <jason@redhat.com>
2100 * cp-tree.h (build_stub_object): Declare.
2101 * method.c (build_stub_object): No longer static.
2102 * call.c (can_convert): Use it.
2103 * tree.c (build_dummy_object): Adjust comment.
2104 * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
2107 2021-05-07 Jason Merrill <jason@redhat.com>
2109 * coroutines.cc (build_co_await): Don't call 'rvalue'.
2110 (flatten_await_stmt): Simplify initialization.
2111 (morph_fn_to_coro): Change 'rvalue' to 'move'. Simplify.
2113 2021-05-04 Tobias Burnus <tobias@codesourcery.com>
2115 * semantics.c (finish_omp_reduction_clause): Accept float + complex
2116 for || and && reductions.
2118 2021-05-03 Patrick Palka <ppalka@redhat.com>
2121 * parser.c (cp_parser_class_head): Reinstate calls to pushclass
2122 and popclass when parsing the base-clause that were removed in
2125 2021-05-03 Patrick Palka <ppalka@redhat.com>
2129 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
2130 only when the callee is a FUNCTION_DECL.
2132 2021-05-03 Marek Polacek <polacek@redhat.com>
2135 * decl.c (grokfndecl): Check current_template_parms.
2137 2021-05-03 Marek Polacek <polacek@redhat.com>
2140 * constexpr.c (cxx_eval_constant_expression): Don't check
2143 2021-05-01 Jason Merrill <jason@redhat.com>
2145 * cp-tree.h (class ovl_iterator): Allow copying. Add op==.
2146 (class ovl_range, class lkp_range): New.
2147 * call.c (build_op_call_1, add_candidates): Use them.
2148 (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
2149 (has_trivial_copy_p): Likewise.
2150 * class.c (handle_using_decl, get_basefndecls): Likewise.
2151 (maybe_warn_about_overly_private_class): Likewise.
2152 (warn_hidden, add_implicitly_declared_members): Likewise.
2153 (check_methods, clone_constructors_and_destructors): Likewise.
2154 (type_has_user_nondefault_constructor): Likewise.
2156 2021-04-29 Jason Merrill <jason@redhat.com>
2158 * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
2161 2021-04-29 Jason Merrill <jason@redhat.com>
2164 * decl2.c (grokfield): Call cplus_decl_attributes for friend.
2165 (save_template_attributes): Use chainon.
2166 * friend.c (do_friend): Remove attrlist parm.
2167 * cp-tree.h (do_friend): Adjust.
2168 * class.c (add_implicitly_declared_members): Adjust.
2169 * decl.c (grokdeclarator): Adjust.
2170 * pt.c (apply_late_template_attributes): Optimize.
2172 2021-04-29 Jason Merrill <jason@redhat.com>
2175 * class.c (finish_struct_anon_r): Drop complain parm.
2176 Remove non-field diagnostic.
2177 (finish_struct_anon): Adjust.
2178 * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
2180 2021-04-29 Jason Merrill <jason@redhat.com>
2182 * cp-tree.h (cp_evaluated): Add reset parm to constructor.
2183 * parser.c (cp_parser_constant_expression): Change
2184 allow_non_constant_p to int. Use cp_evaluated.
2185 (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
2186 * semantics.c (finish_id_expression_1): Don't mess with
2187 cp_unevaluated_operand here.
2189 2021-04-29 Jason Merrill <jason@redhat.com>
2191 * cp-tree.h: Clarify comments.
2192 * pt.c (get_template_parm_object): Add assert.
2193 * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
2194 * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
2195 * typeck2.c (store_init_value): Likewise.
2197 2021-04-29 Patrick Palka <ppalka@redhat.com>
2200 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
2201 set tf_conv during the initial substitution into the function.
2203 2021-04-29 Jakub Jelinek <jakub@redhat.com>
2206 * semantics.c (finish_omp_clauses): Fix up check that variable
2207 mentioned in detach clause doesn't appear in data-sharing clauses.
2209 2021-04-28 Jakub Jelinek <jakub@redhat.com>
2211 * module.cc: Remove #error that triggers if DEV-PHASE is empty.
2213 2021-04-27 Jason Merrill <jason@redhat.com>
2216 * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
2219 2021-04-27 Patrick Palka <ppalka@redhat.com>
2222 * pt.c (tsubst_initializer_list): Correctly handle the case
2223 where an argument inside a base initializer pack expansion is
2224 itself a pack expansion.
2226 2021-04-26 Patrick Palka <ppalka@redhat.com>
2229 * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
2230 object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
2231 with a negative offset into one whose offset is nonnegative
2232 before calling cxx_fold_indirect_ref_1.
2234 2021-04-24 Patrick Palka <ppalka@redhat.com>
2241 * pt.c (do_class_deduction): Punt if the initializer is
2244 2021-04-24 Patrick Palka <ppalka@redhat.com>
2247 * parser.c (cp_parser_type_id_1): If we see a template
2248 placeholder, first try simulating an error before issuing
2251 2021-04-23 Patrick Palka <ppalka@redhat.com>
2254 * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
2255 Adjust parameter list loop to iterate over 'types' instead of
2256 'args'. Output the trailing '...' for a variadic function.
2257 Remove PARM_DECL support.
2258 (pp_cxx_requires_expr): Pretty print the parameter list directly
2259 instead of going through pp_cxx_parameter_declaration_clause.
2261 2021-04-23 Patrick Palka <ppalka@redhat.com>
2264 * decl.c (is_direct_enum_init): Check the implicit
2265 convertibility requirement added by CWG 2374.
2267 2021-04-23 Martin Liska <mliska@suse.cz>
2269 * cp-tree.h (STATIC_ASSERT): Prefer static assert.
2270 * lex.c (init_operators): Remove run-time check.
2272 2021-04-22 Marek Polacek <polacek@redhat.com>
2275 * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
2276 op1 separately for value- or type-dependence.
2278 2021-04-21 Marek Polacek <polacek@redhat.com>
2281 * parser.c (cp_parser_enum_specifier): Don't allow defining
2284 2021-04-21 Martin Liska <mliska@suse.cz>
2287 2021-04-21 Martin Liska <mliska@suse.cz>
2289 * error.c (dump_decl): Use flags in dump_generic_node call.
2291 2021-04-21 Martin Liska <mliska@suse.cz>
2293 * error.c (dump_decl): Use flags in dump_generic_node call.
2295 2021-04-21 Martin Liska <mliska@suse.cz>
2297 * error.c (dump_decl): Support anonymous labels.
2299 2021-04-20 Jason Merrill <jason@redhat.com>
2302 * pt.c (find_parameter_packs_r): Look into enum initializers.
2304 2021-04-19 Marek Polacek <polacek@redhat.com>
2307 * decl.c (grokvardecl): Given an error when a concept is not defined
2310 2021-04-16 Jakub Jelinek <jakub@redhat.com>
2313 * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
2314 for empty classes into *valp when types don't match even when *valp
2317 2021-04-16 Marek Polacek <polacek@redhat.com>
2320 * decl.c (make_typename_type): Give an error and return when
2321 name is is_overloaded_fn.
2322 * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
2323 before calling make_typename_type.
2325 2021-04-16 Patrick Palka <ppalka@redhat.com>
2328 * constexpr.c (reduced_constant_expression_p): For array
2329 CONSTRUCTORs, use a dedicated loop that additionally verifies
2330 the CONSTRUCTOR spans the entire array.
2332 2021-04-16 Jakub Jelinek <jakub@redhat.com>
2335 * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
2336 If lambda_p, return pce_ok instead of pce_maybe_postfix.
2338 2021-04-16 Jakub Jelinek <jakub@redhat.com>
2341 * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
2342 binding, add to data.internal also all corresponding structured
2345 2021-04-16 Jason Merrill <jason@redhat.com>
2348 * cp-tree.h (first_field): Declare.
2349 * mangle.c (range_expr_nelts): New.
2350 (write_expression): Improve class NTTP mangling.
2351 * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
2352 * tree.c (zero_init_expr_p): Improve class NTTP handling.
2353 * decl.c: Adjust comment.
2355 2021-04-15 Jason Merrill <jason@redhat.com>
2358 * call.c (build_new_method_call_1): Check again for side-effects
2359 with a volatile object.
2361 2021-04-15 Jason Merrill <jason@redhat.com>
2365 * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
2366 TYPE_RAISES_EXCEPTIONS here.
2367 * tree.c (cp_walk_subtrees): Not here.
2369 2021-04-15 Jason Merrill <jason@redhat.com>
2373 * parser.c (cp_parser_default_type_template_argument): Set
2374 parser->local_variables_forbidden_p.
2376 2021-04-15 Richard Sandiford <richard.sandiford@arm.com>
2379 * typeck.c (merge_type_attributes_from): New function.
2380 (cp_common_type): Use it for vector types.
2382 2021-04-14 Jason Merrill <jason@redhat.com>
2386 * pt.c (uses_outer_template_parms): Also look at default
2389 2021-04-14 Jason Merrill <jason@redhat.com>
2392 * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
2393 for a non-static data member in a constant-expression.
2395 2021-04-14 Patrick Palka <ppalka@redhat.com>
2399 * pt.c (deducible_expression): Look through implicit
2400 INDIRECT_REFs as well.
2402 2021-04-14 Jason Merrill <jason@redhat.com>
2405 * parser.c (cp_parser_lambda_expression): Reject lambda
2406 in template parameter type.
2408 2021-04-14 Jason Merrill <jason@redhat.com>
2411 * decl.c (duplicate_decls): Don't propagate
2412 DECL_INITIALIZED_IN_CLASS_P to a specialization.
2414 2021-04-14 Jason Merrill <jason@redhat.com>
2419 * semantics.c (set_cleanup_locs): New.
2420 (do_poplevel): Call it.
2421 * parser.c (cp_parser_compound_statement): Consume the }
2422 before finish_compound_stmt.
2424 2021-04-13 Jason Merrill <jason@redhat.com>
2427 * pt.c (get_underlying_template): Compare TYPE_QUALS.
2429 2021-04-13 Jason Merrill <jason@redhat.com>
2433 * init.c (get_nsdmi): Do more context adjustment for local classes.
2435 2021-04-13 Patrick Palka <ppalka@redhat.com>
2438 * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
2439 rather than issuing a pedwarn.
2440 * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
2441 for consistent diagnostics.
2443 2021-04-13 Jason Merrill <jason@redhat.com>
2446 * class.c (build_base_path): Shortcut simple non-pointer case.
2448 2021-04-13 Eric Botcazou <ebotcazou@adacore.com>
2450 * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
2452 (module_state::write_location): Likewise.
2454 2021-04-13 Patrick Palka <ppalka@redhat.com>
2457 * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
2458 when checking if the initializer is an equivalent class
2459 placeholder template parameter.
2461 2021-04-13 Patrick Palka <ppalka@redhat.com>
2465 * constraint.cc (satisfy_normalized_constraints): Set
2467 * parser.c (cp_parser_concept_definition): Likewise.
2468 (cp_parser_requires_clause_opt): Likewise.
2470 2021-04-12 Jason Merrill <jason@redhat.com>
2473 * pt.c (uses_outer_template_parms): Handle non-type and template
2474 template parameters specifically.
2476 2021-04-11 Jason Merrill <jason@redhat.com>
2479 * decl.c (fixup_anonymous_aggr): Prune all functions from
2480 CLASSTYPE_MEMBER_VEC.
2482 2021-04-10 Jason Merrill <jason@redhat.com>
2486 * parser.c (cp_parser_direct_declarator): Don't
2487 inject_this_parameter if static_p.
2488 (cp_parser_omp_var_list_no_open): Parse 'this' even if
2489 current_class_ptr isn't set for a better diagnostic.
2491 2021-04-10 Jason Merrill <jason@redhat.com>
2498 * pt.c (alias_ctad_tweaks): Handle failure better.
2500 2021-04-10 Jason Merrill <jason@redhat.com>
2503 * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
2505 2021-04-09 Patrick Palka <ppalka@redhat.com>
2507 * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
2508 (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
2509 (LAMBDA_EXPR_REGEN_INFO): ... this.
2510 (tree_lambda_expr::regenerated_from)
2511 (tree_lambda_expr::regenerating_targs): Replace these with ...
2512 (tree_lambda_expr::regen_info): ... this.
2513 * constraint.cc (satisfy_declaration_constraints): Adjust
2515 * lambda.c (build_lambda_expr): Likewise.
2516 * pt.c (regenerated_lambda_fn_p): Likewise.
2517 (most_general_lambda): Likewise.
2518 (tsubst_lambda_expr): Likewise.
2520 2021-04-09 Marek Polacek <polacek@redhat.com>
2523 * parser.c (cp_parser_member_declaration): Call
2524 cp_parser_save_default_args even for function templates. Use
2525 STRIP_TEMPLATE on the declaration we're passing.
2527 2021-04-08 Patrick Palka <ppalka@redhat.com>
2530 * constraint.cc (get_normalized_constraints_from_decl): Handle
2531 regenerated lambdas.
2532 (satisfy_declaration_constraints): Likewise. Check for
2533 dependent args later.
2534 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
2535 (LAMBDA_EXPR_REGENERATED_FROM): ... this.
2536 (LAMBDA_EXPR_REGENERATING_TARGS): New.
2537 (tree_lambda_expr::regenerated_from): New data member.
2538 (tree_lambda_expr::regenerating_targs): New data member.
2539 (add_to_template_args): Declare.
2540 (regenerated_lambda_fn_p): Likewise.
2541 (most_general_lambda): Likewise.
2542 * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
2543 and LAMBDA_EXPR_REGENERATING_TARGS.
2544 * pt.c (add_to_template_args): No longer static.
2545 (tsubst_function_decl): Unconditionally propagate constraints on
2546 the substituted function decl.
2547 (instantiated_lambda_fn_p): Rename to ...
2548 (regenerated_lambda_fn_p): ... this. Check
2549 LAMBDA_EXPR_REGENERATED_FROM instead of
2550 LAMBDA_EXPR_INSTANTIATED.
2551 (most_general_lambda): Define.
2552 (enclosing_instantiation_of): Adjust after renaming
2553 instantiated_lambda_fn_p.
2554 (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED. Set
2555 LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
2556 Don't substitute or set constraints on the regenerated lambda.
2558 2021-04-08 Patrick Palka <ppalka@redhat.com>
2561 * pt.c (build_deduction_guide): Document OUTER_ARGS. Substitute
2562 them into the propagated constraints.
2564 2021-04-08 Jason Merrill <jason@redhat.com>
2567 * call.c (convert_like_internal): Improve reference diagnostic.
2569 2021-04-08 Jakub Jelinek <jakub@redhat.com>
2572 * constexpr.c (addr_of_non_const_var): New function.
2573 (cxx_bind_parameters_in_call): Set *non_constant_args to true
2574 even if cp_walk_tree on arg with addr_of_non_const_var callback
2577 2021-04-08 Jason Merrill <jason@redhat.com>
2580 * pt.c (determine_specialization): Improve diagnostic.
2582 2021-04-08 Marek Polacek <polacek@redhat.com>
2585 * decl.c (build_explicit_specifier): Call
2586 check_for_bare_parameter_packs.
2587 * except.c (build_noexcept_spec): Likewise.
2589 2021-04-07 Jason Merrill <jason@redhat.com>
2592 * parser.c (cp_parser_class_name): Check dependent_scope_p.
2594 2021-04-07 Jason Merrill <jason@redhat.com>
2597 * pt.c (maybe_process_partial_specialization): Check
2598 DECL_SELF_REFERENCE_P.
2600 2021-04-07 Jason Merrill <jason@redhat.com>
2603 * name-lookup.c (push_class_level_binding_1): Do overload a new
2604 function with a previous using-declaration.
2606 2021-04-06 Jason Merrill <jason@redhat.com>
2609 * init.c (get_nsdmi): Don't defer access checking.
2611 2021-04-06 Jason Merrill <jason@redhat.com>
2614 * decl.c (cp_finish_decl): mark_needed an implicitly inline
2615 static data member with an out-of-class redeclaration.
2617 2021-04-06 Jason Merrill <jason@redhat.com>
2620 * mangle.c (write_compact_number): Add sanity check.
2621 (write_local_name): Use list_length for parm number.
2623 2021-04-06 Patrick Palka <ppalka@redhat.com>
2626 * pt.c (do_auto_deduction): Don't exit early when deducing the
2627 array type of a structured binding. Also handle adc_decomp_type
2628 during constraint checking.
2630 2021-04-05 Jason Merrill <jason@redhat.com>
2633 * typeck.c (check_return_expr): Call mark_exp_read in dependent
2636 2021-04-05 Jason Merrill <jason@redhat.com>
2639 * typeck.c (build_reinterpret_cast_1): Don't perform
2640 temporary materialization.
2642 2021-04-05 Jason Merrill <jason@redhat.com>
2645 * pt.c (lookup_template_class_1): Do tsubst_enum when
2646 tsubsting a generic lambda.
2648 2021-04-05 Jason Merrill <jason@redhat.com>
2651 * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
2652 there is no enclosing non-lambda function.
2654 2021-04-05 Nathan Sidwell <nathan@acm.org>
2657 * module.cc (name_pending_imports): Drop 'atend' parm. Don't
2658 query export when not needed.
2659 (preprocess_module, preprocessed_module): Adjust.
2661 2021-04-05 Jason Merrill <jason@redhat.com>
2664 * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
2666 2021-04-05 Jason Merrill <jason@redhat.com>
2669 * pt.c (class el_data): Add visited field.
2670 (extract_local_specs): Pass it to cp_walk_tree.
2671 (extract_locals_r): Walk into the body of a lambda.
2673 2021-04-05 Jason Merrill <jason@redhat.com>
2675 * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
2678 2021-04-04 Jason Merrill <jason@redhat.com>
2681 * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
2683 2021-04-03 Marek Polacek <polacek@redhat.com>
2686 * parser.c: Create a GC root for attributes in a decl specifier.
2687 (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
2689 2021-04-03 Jason Merrill <jason@redhat.com>
2692 * pt.c (tsubst_lambda_expr): Skip the body block from
2695 2021-04-03 Jason Merrill <jason@redhat.com>
2698 * cvt.c (can_convert_qual): Check fnptr_conv_p.
2700 2021-04-03 Jason Merrill <jason@redhat.com>
2703 * pt.c (regenerate_decl_from_template): tsubst_decl
2706 2021-04-02 Patrick Palka <ppalka@redhat.com>
2709 * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
2710 to do_auto_deduction.
2712 2021-04-02 Patrick Palka <ppalka@redhat.com>
2715 * semantics.c (finish_compound_literal): Check
2716 template_placeholder_p instead of type_uses_auto.
2718 2021-04-02 Jason Merrill <jason@redhat.com>
2721 * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
2722 * lambda.c (add_capture): Set it.
2723 * pt.c (tsubst_pack_expansion): Handle it.
2725 2021-04-02 Nathan Sidwell <nathan@acm.org>
2727 * cp-tree.h (lang_decl_base): Correct module flag comment.
2728 * module.cc (trees_in::assert_definition): Break out
2730 (trees_out::lang_decl_bools): Do not write purview for header units.
2732 2021-04-01 Marek Polacek <polacek@redhat.com>
2735 * method.c (defaulted_late_check): ++ and -- function_depth around
2736 the call to synthesize_method.
2737 * pt.c: Remove the saved_trees global.
2739 2021-04-01 Jason Merrill <jason@redhat.com>
2743 * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
2744 TYPE_RAISES_EXCEPTIONS.
2746 2021-04-01 Iain Sandoe <iain@sandoe.co.uk>
2748 * mapper-client.cc (INCLUDE_MAP): New; require map to be
2749 included from system.h.
2750 * mapper-resolver.cc (INCLUDE_MAP): Likewise.
2752 2021-04-01 Jason Merrill <jason@redhat.com>
2755 * mangle.c (write_expression): Adjust.
2756 * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
2757 (mark_abi_tags_r): Likewise.
2759 2021-04-01 Nathan Sidwell <nathan@acm.org>
2762 * module.cc (trees_out::decl_node): Adjust importedness reference
2764 (module_state::intercluster_seed): New. Seed both imports and
2765 inter-cluster references. Broken out of ...
2766 (module_state::write_cluster): ... here. Call it.
2768 2021-03-31 Jason Merrill <jason@redhat.com>
2771 * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
2773 2021-03-31 Patrick Palka <ppalka@redhat.com>
2776 * mangle.c (write_expression): Adjust the mangling of
2779 2021-03-31 Patrick Palka <ppalka@redhat.com>
2782 * pt.c (placeholder_type_constraint_dependent_p): Expand
2783 argument packs to separate the first non-pack argument
2786 2021-03-30 Nathan Sidwell <nathan@acm.org>
2789 * module.cc (dumper::operator): Make less brittle.
2790 (trees_out::core_bools): VAR_DECLs always have a context.
2791 (trees_out::key_mergeable): Use same_type_p for asserting.
2792 (trees_in::read_var_def): Propagate
2793 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2795 2021-03-30 Jakub Jelinek <jakub@redhat.com>
2798 * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
2800 2021-03-26 Marek Polacek <polacek@redhat.com>
2803 * method.c (implicitly_declare_fn): Pass &raises to
2804 synthesized_method_walk.
2806 2021-03-26 Nathan Sidwell <nathan@acm.org>
2809 * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
2810 (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
2811 * decl.c (duplicate_decls): Remove template_decl module flag
2813 * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
2814 (dumper::impl::nested_name): Adjust for template-decl module flag
2816 (trees_in::assert_definition): Likewise.
2817 (trees_in::install_entity): Likewise.
2818 (trees_out::decl_value): Likewise. Remove alias template
2819 separation of template and type_decl.
2820 (trees_in::decl_value): Likewise.
2821 (trees_out::key_mergeable): Likewise,
2822 (trees_in::key_mergeable): Likewise.
2823 (trees_out::decl_node): Adjust for template-decl module flag
2825 (depset::hash::make_dependency): Likewise.
2826 (get_originating_module, module_may_redeclare): Likewise.
2827 (set_instantiating_module, set_defining_module): Likewise.
2828 * name-lookup.c (name_lookup::search_adl): Likewise.
2829 (do_pushdecl): Likewise.
2830 * pt.c (build_template_decl): Likewise.
2831 (lookup_template_class_1): Remove special alias_template handling
2832 of DECL_TI_TEMPLATE.
2833 (tsubst_template_decl): Likewise.
2835 2021-03-26 Jakub Jelinek <jakub@redhat.com>
2838 * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
2839 in DECL_EXPR or in BIND_EXPR_VARS.
2841 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2844 * parser.c (cp_parser_postfix_expression): For calls, create
2845 combined_loc and temporarily set input_location to it before
2846 calling finish_call_expr.
2848 2021-03-25 Marek Polacek <polacek@redhat.com>
2851 * call.c (build_over_call): Maybe call mark_used in case
2852 deduce_inheriting_ctor fails and return error_mark_node.
2853 * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
2854 * method.c (deduce_inheriting_ctor): Return bool if the deduction
2856 (implicitly_declare_fn): If raises is error_mark_node, call
2857 synthesized_method_walk with diag being true.
2859 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2862 * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
2863 packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
2865 2021-03-25 Marek Polacek <polacek@redhat.com>
2868 * call.c (build_converted_constant_expr_internal): Don't emit
2869 -Wconversion warnings.
2871 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2874 * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
2876 * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
2879 2021-03-23 Nathan Sidwell <nathan@acm.org>
2882 * name-lookup.c (check_module_override): Set global or partition
2883 DUP on the binding vector.
2885 2021-03-23 Marek Polacek <polacek@redhat.com>
2888 * decl2.c (cp_warn_deprecated_use_scopes): Only call
2889 cp_warn_deprecated_use when decl is a namespace, class, or enum.
2891 2021-03-23 Nathan Sidwell <nathan@acm.org>
2894 * decl.c (duplicate_decls): Remove assert about maybe-imported
2897 2021-03-23 Jakub Jelinek <jakub@redhat.com>
2900 * decl.c (cp_finish_decomp): Diagnose void initializers when
2901 using tuple_element and get.
2903 2021-03-22 Nathan Sidwell <nathan@acm.org>
2906 * module.cc (depset::hash::make_dependency): Propagate flags for
2907 partial specialization.
2908 (module_may_redeclare): Handle partial specialization.
2910 2021-03-22 Nathan Sidwell <nathan@acm.org>
2913 * cp-tree.h (map_context_from, map_context_to): Delete.
2914 (add_mergeable_specialization): Add is_alias parm.
2915 * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
2916 * module.cc (map_context_from, map_context_to): Delete.
2917 (trees_in::decl_value): Add specializations later, adjust call.
2918 Drop useless alias lookup. Set duplicate fn parm context.
2919 (check_mergeable_decl): Drop context mapping.
2920 (trees_in::is_matching_decl): Likewise.
2921 (trees_in::read_function_def): Drop parameter context adjustment
2924 2021-03-22 Martin Liska <mliska@suse.cz>
2927 * module.cc (fini_modules): Call vec_free instead of delete.
2929 2021-03-20 Jakub Jelinek <jakub@redhat.com>
2932 * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
2933 special code, instead call c_genericize_control_stmt.
2935 2021-03-19 Jakub Jelinek <jakub@redhat.com>
2938 * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
2939 INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
2940 don't diagnose it, set *non_constant_p nor return t.
2942 2021-03-19 Marek Polacek <polacek@redhat.com>
2945 * parser.c (cp_parser_requirement_parameter_list): Handle
2948 2021-03-18 Marek Polacek <polacek@redhat.com>
2950 * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
2952 2021-03-18 Marek Polacek <polacek@redhat.com>
2954 * pt.c (tsubst_copy_and_build): Add assert.
2956 2021-03-18 Iain Sandoe <iain@sandoe.co.uk>
2959 * parser.c (cp_debug_parser): Add Objective-C++ message
2961 (cp_parser_nested_name_specifier_opt): Allow colon to
2962 terminate an assignment-expression when parsing Objective-
2964 (cp_parser_objc_message_expression): Set and clear message
2965 parsing state on entry and exit.
2966 * parser.h (struct cp_parser): Add a context flag for
2967 Objective-C++ message state.
2969 2021-03-18 Martin Liska <mliska@suse.cz>
2972 * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
2975 2021-03-17 Marek Polacek <polacek@redhat.com>
2978 * call.c (conv_unsafe_in_template_p): New.
2979 (convert_like): Use it.
2981 2021-03-17 Anthony Sharp <anthonysharp15@gmail.com>
2982 Jason Merrill <jason@redhat.com>
2984 * semantics.c (get_class_access_diagnostic_decl): New
2985 function that examines special cases when a parent
2986 class causes a private access failure.
2987 (enforce_access): Slightly modified to call function
2990 2021-03-16 Jason Merrill <jason@redhat.com>
2992 * tree.c (cp_tree_equal): Use real_identical.
2994 2021-03-16 Jakub Jelinek <jakub@redhat.com>
2997 * decl.c (expand_static_init): For thread guards, call __cxa_atexit
2998 before calling __cxa_guard_release rather than after it. Formatting
3001 2021-03-16 Martin Liska <mliska@suse.cz>
3002 Jason Merrill <jason@redhat.com>
3005 * call.c (get_function_version_dispatcher): Handle
3007 * decl.c (maybe_version_functions): Likewise.
3008 (maybe_mark_function_versioned): New.
3009 * name-lookup.c (push_local_extern_decl_alias): No longer static.
3010 * name-lookup.h (push_local_extern_decl_alias): Adjust.
3012 2021-03-16 Nathan Sidwell <nathan@acm.org>
3015 * module.cc (trees_out::decl_value): Adjust typedef streaming,
3016 indicate whether it is a dependent alias.
3017 (trees_in::decl_value): Likewise. Set as dependent alias, if it
3020 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
3023 * coroutines.cc (expand_one_await_expression): If the
3024 await_ready() expression is not a boolean then convert it
3027 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
3030 * coroutines.cc (build_actor_fn): Make destroy index 1
3031 correspond to the abnormal unhandled_exception() exit.
3032 Substitute the proxy for the resume index.
3033 (coro_rewrite_function_body): Arrange to reset the resume
3034 index and make done = true for a rethrown exception from
3035 unhandled_exception ().
3036 (morph_fn_to_coro): Adjust calls to build_actor_fn and
3037 coro_rewrite_function_body.
3039 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
3042 * coroutines.cc (replace_continue): Rewrite continue into
3044 (await_statement_walker): Handle await expressions in the
3045 initializer, condition and iteration expressions of for
3048 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
3051 * coroutines.cc (flatten_await_stmt): Allow for the case
3052 where a target expression variable only has uses in the
3053 second part of a compound expression.
3054 (maybe_promote_temps): Avoid emiting empty statements.
3056 2021-03-15 Tobias Burnus <tobias@codesourcery.com>
3059 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
3060 ensure that the varpool node is marked as offloadable.
3062 2021-03-12 Nathan Sidwell <nathan@acm.org>
3065 * module.cc (depset::hash::add_binding_entity): Assert not
3067 (depset::add::add_specializations): Likewise.
3068 * name-lookup.c (name_lookup::dedup): New.
3069 (name_lookup::~name_lookup): Assert not deduping.
3070 (name_lookup::restore_state): Likewise.
3071 (name_lookup::add_overload): Replace outlined code with dedup
3073 (name_lookup::add_value): Likewise.
3074 (name_lookup::search_namespace_only): Likewise.
3075 (name_lookup::adl_namespace_fns): Likewise.
3076 (name_lookup::adl_class_fns): Likewise.
3077 (name_lookup::search_adl): Likewise. Add clearing dedup call.
3078 (name_lookup::search_qualified): Likewise.
3079 (name_lookup::search_unqualified): Likewise.
3081 2021-03-12 Jakub Jelinek <jakub@redhat.com>
3084 * call.c (build_over_call): For immediate evaluation of functions
3085 that return references, undo convert_from_reference effects before
3086 calling cxx_constant_value and call convert_from_reference
3089 2021-03-11 Nathan Sidwell <nathan@acm.org>
3092 * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
3093 when there's a binding vector.
3094 * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
3096 2021-03-11 Nathan Sidwell <nathan@acm.org>
3099 * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
3101 (trees_in::decl_value): Adjust add_mergeable_specialization call.
3102 (trees_out::get_merge_kind): Adjust detecting a partial template
3104 (trees_out::key_mergeable): Adjust handling same.
3105 (trees_in::key_mergeabvle): Likewise.
3107 2021-03-10 Nathan Sidwell <nathan@acm.org>
3110 * module.cc (post_load_processing): Assert not gcable.
3111 (laxy_load_pendings): Extend no-gc region around
3112 post_load_processing.
3114 2021-03-10 Nathan Sidwell <nathan@acm.org>
3117 * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
3118 assembler name to the ns alias.
3120 2021-03-09 Jakub Jelinek <jakub@redhat.com>
3123 * coroutines.cc (build_co_await): Look through NOP_EXPRs in
3124 build_special_member_call return value to find the CALL_EXPR.
3127 2021-03-09 Nathan Sidwell <nathan@acm.org>
3130 * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
3131 that C++20 does not yet imply modules.
3133 2021-03-08 Nathan Sidwell <nathan@acm.org>
3136 * name-lookup.c (get_cxx_dialect_name): Add cxx23.
3138 2021-03-08 Nathan Sidwell <nathan@acm.org>
3140 * lex.c (module_token_filter::resume): Ignore module-decls inside
3142 * parser.c (cp_parser_module_declaration): Reject in header-unit.
3144 2021-03-08 Nathan Sidwell <nathan@acm.org>
3147 * cp-tree.h (match_mergeable_specialization)
3148 (add_mergeable_specialization): Adjust parms.
3149 * module.cc (trees_in::decl_value): Adjust
3150 add_mergeable_specialization calls.
3151 (trees_out::key_mergeable): Adjust match_mergeable_specialization
3153 (specialization_add): Likewise.
3154 * pt.c (match_mergeable_specialization): Do not insert.
3155 (add_mergeable_specialization): Add to hash table here.
3157 2021-03-06 Patrick Palka <ppalka@redhat.com>
3158 Jakub Jelinek <jakub@redhat.com>
3161 * constexpr.c (cxx_eval_increment_expression): Pass lval when
3162 evaluating the MODIFY_EXPR, and update 'mod' with the result of
3163 this evaluation. Check *non_constant_p afterwards. For prefix
3164 ops, just return 'mod'.
3166 2021-03-06 Patrick Palka <ppalka@redhat.com>
3167 Jakub Jelinek <jakub@redhat.com>
3170 * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
3171 variable 'fn' to 'tmpl'. Handle a variable template-id by
3172 calling lookup_template_variable.
3174 2021-03-06 Patrick Palka <ppalka@redhat.com>
3177 * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
3178 outer_targs to do_auto_deduction.
3179 (placeholder_type_constraint_dependent_p): Define.
3180 (do_auto_deduction): When processing_template_decl != 0
3181 and context is adc_unify and we have constraints, pretend the
3182 constraints are satisfied instead of punting. Otherwise don't
3183 punt unless placeholder_type_constraint_dependent_p holds.
3184 Add some clarifying sanity checks. Add a hack to add missing
3185 outermost template levels to outer_args before checking
3186 satisfaction. Don't substitute outer_targs into type if it's
3189 2021-03-05 Marek Polacek <polacek@redhat.com>
3192 * call.c (standard_conversion): When converting pointers to
3193 member, don't return NULL when the bases are equivalent but
3196 2021-03-05 Marek Polacek <polacek@redhat.com>
3199 * name-lookup.c (check_local_shadow): Check if the type of decl
3200 is non-null before checking TYPE_PTR*.
3202 2021-03-05 Nathan Sidwell <nathan@acm.org>
3205 * module.cc (module_state::write_cluster): Relax binding assert.
3207 2021-03-05 Nathan Sidwell <nathan@acm.org>
3210 * pt.c (instantiate_decl): Call set_instantiating_module.
3212 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3215 * coroutines.cc (build_co_await): Use type_build_ctor_call()
3216 to determine cases when a CTOR needs to be built.
3217 (flatten_await_stmt): Likewise.
3218 (morph_fn_to_coro): Likewise.
3220 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3223 * coroutines.cc (coro_diagnose_throwing_fn): New helper.
3224 (coro_diagnose_throwing_final_aw_expr): New helper.
3225 (build_co_await): Diagnose throwing final await expression
3227 (build_init_or_final_await): Diagnose a throwing promise
3228 final_suspend() call.
3230 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3233 * coroutines.cc (struct param_info): Track parameter copies that need
3235 (coro_get_frame_dtor): New helper function factored from build_actor().
3236 (build_actor_fn): Use coro_get_frame_dtor().
3237 (morph_fn_to_coro): Track parameters that need DTORs on exception,
3238 likewise the frame promise and the return object. On exception, run the
3239 DTORs for these, destroy the frame and then rethrow the exception.
3241 2021-03-05 Nathan Sidwell <nathan@acm.org>
3244 * pt.c (instantiate_class_template_1): Set instantiating module
3247 2021-03-05 Tobias Burnus <tobias@codesourcery.com>
3250 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
3252 2021-03-04 Jakub Jelinek <jakub@redhat.com>
3256 * cvt.c (convert_to_void): Revert 2019-10-17 changes. Clarify
3259 2021-03-04 Nathan Sidwell <nathan@acm.org>
3262 * module.cc (class uintset): Delete.
3263 (typedef attached_map_t): A hash map.
3264 (attached_table): Use attached_map_t. Adjust uses ...
3265 (trees_out::decl_value, trees_in::decl_value): ... here ...
3266 (trees_out::key_mergeable): ... here ...
3267 (trees_in::key_mergeable): ... here ...
3268 (maybe_attach_decl): ... here ...
3269 (direct_import): ... and here.
3271 2021-03-04 Nathan Sidwell <nathan@acm.org>
3275 * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
3277 * module.cc (class pending_key): New.
3278 (default_hash_traits<pending_key>): New specialization.
3279 (pending_map_t): New typedef.
3280 (pending_table): Replace old table.
3281 (trees_out::lang_decl_bools): Adjust.
3282 (trees_in::lang_decl_bools): Adjust.
3283 (trees_in::install_entity): Drop pending member and specialization
3285 (find_pending_key): New.
3286 (depset::hash::fiund_dependencies): Use it.
3287 (pendset_lazy_load): Delete.
3288 (module_state::write_cluster): Don't count pendings here. Bye
3289 Duff's device-like thing.
3290 (module_state::write_pendings): Reimplement.
3291 (module_state::read_pendings): Reimplement.
3292 (lazy_specializations_p): Delete.
3293 (module_state::write): Adjust write_pendings call.
3294 (lazy_load_pendings): New.
3295 (lazy_load_specializations): Delete.
3296 (lazy_load_members): Delete.
3297 (init_modules): Adjust.
3298 * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
3299 not lazy_load_members.
3300 (note_pending_specializations): Delete.
3301 (load_pending_specializations): Delete.
3302 * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
3303 (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
3304 (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
3305 (note_pending_specializations): Delete.
3306 (load_pending_specializations): Delete.
3307 * pt.c (lookup_template_class_1): Call lazy_load_pendings not
3308 lazy_load_specializations.
3309 (instantiate_template_class_1): Likewise.
3310 (instantiate_decl): Call lazy_load_pendings.
3311 * typeck.c (complete_type): Likewise.
3313 2021-03-03 Nathan Sidwell <nathan@acm.org>
3316 * module.cc (post_load_decls): New.
3317 (lazy_snum, recursive_lazy): Move earlier.
3318 (module_state::read_cluster): Push cloning onto post_load_decls.
3319 (post_load_processing): New. Do the cloning here.
3320 (module_state::read_inits): Call post_load_processing.
3321 (module_state::read_language): Likewise.
3322 (lazy_load_binding, lazy_load_specializations): Likewise
3323 (lazy_load_members): Likewise
3325 2021-03-03 Nathan Sidwell <nathan@acm.org>
3328 * module.cc (trees_out::decl_value): Stream specialization keys
3330 (trees_in::decl_value): Stream them back and insert after
3331 completing the decl.
3332 (trees_out::key_mergeable): Drop some streaming here ...
3333 (trees_in::key_mergeable): ... and here. Don't insert into
3334 specialization tables.
3336 2021-03-03 Patrick Palka <ppalka@redhat.com>
3338 * constraint.cc (struct sat_info): Document the different
3339 meanings of noisy() and diagnose_unsatisfaction_p() during
3340 satisfaction and requires-expression evaluation.
3341 (tsubst_valid_expression_requirement): Take a sat_info instead
3342 of a subst_info. Perform the substitution quietly first. Fold
3343 in error-replaying code from diagnose_valid_expression.
3344 (tsubst_simple_requirement): Take a sat_info instead of a
3346 (tsubst_type_requirement_1): New. Fold in error-replaying code
3347 from diagnose_valid_type.
3348 (tsubst_type_requirement): Use the above. Take a sat_info
3349 instead of a subst_info.
3350 (tsubst_compound_requirement): Likewise. Fold in
3351 error-replaying code from diagnose_compound_requirement.
3352 (tsubst_nested_requirement): Take a sat_info instead of a
3353 subst_info. Fold in error-replaying code from
3354 diagnose_nested_requirement.
3355 (tsubst_requirement): Take a sat_info instead of a subst_info.
3356 (tsubst_requires_expr): Split into two versions, one that takes
3357 a sat_info argument and another that takes a complain and
3358 in_decl argument. Remove outdated documentation. Document the
3359 effects of the sat_info argument. Don't short-circuit
3360 processing of requirements when diagnosing unsatisfaction,
3361 mirroring diagnose_requires_expr.
3362 (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
3363 assert, and se the three-parameter version of tsubst_requires_expr.
3364 (diagnose_trait_expr): Make static. Take a template argument
3365 vector instead of a parameter mapping.
3366 (diagnose_valid_expression): Remove.
3367 (diagnose_valid_type): Remove.
3368 (diagnose_simple_requirement): Remove.
3369 (diagnose_compound_requirement): Remove.
3370 (diagnose_type_requirement): Remove.
3371 (diagnose_nested_requirement): Remove.
3372 (diagnose_requirement): Remove.
3373 (diagnose_requires_expr): Remove.
3374 (diagnose_atomic_constraint): Take a sat_info instead of a
3375 subst_info. Adjust call to diagnose_trait_expr. Call
3376 tsubst_requires_expr instead of diagnose_requires_expr.
3377 (diagnose_constraints): Remove special casing of REQUIRES_EXPR
3378 and just always call constraint_satisfaction_value.
3380 2021-03-03 Patrick Palka <ppalka@redhat.com>
3382 * constexpr.c (cxx_eval_call_expression): Adjust call to
3383 evaluate_concept_check.
3384 (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
3385 evaluate_requires_expression instead of
3386 satisfy_constraint_expression.
3387 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3388 * constraint.cc (struct sat_info): Adjust comment about which
3389 satisfaction entrypoints use noisy-unsat.
3390 (normalize_template_requirements): Remove (and adjust callers
3392 (normalize_nontemplate_requirements): Likewise.
3393 (tsubst_nested_requirement): Use constraint_satisfaction_value
3394 instead of satisfy_constraint_expression, which'll do the
3395 noisy replaying of ill-formed quiet satisfaction for us.
3396 (decl_satisfied_cache): Adjust comment.
3397 (satisfy_constraint): Rename to ...
3398 (satisfy_normalized_constraints): ... this.
3399 (satisfy_associated_constraints): Remove (and make its
3400 callers check for dependent arguments).
3401 (satisfy_constraint_expression): Rename to ...
3402 (satisfy_nondeclaration_constraints): ... this. Assert that
3403 'args' is empty when 't' is a concept-id. Removing handling
3404 bare constraint-expressions, and handle REQUIRES_EXPRs
3405 specially. Adjust comment accordingly.
3406 (satisfy_declaration_constraints): Assert in the two-parameter
3407 version that 't' is not a TEMPLATE_DECL. Adjust following
3408 removal of normalize_(non)?template_requirements and
3409 satisfy_asociated_constraints.
3410 (constraint_satisfaction_value): Combine the two- and
3411 three-parameter versions in the natural way.
3412 (constraints_satisfied_p): Combine the one- and two-parameter
3413 versions in the natural way. Improve documentation.
3414 (evaluate_requires_expr): Define.
3415 (evaluate_concept_check): Remove 'complain' parameter. Use
3416 constraint_satisfaction_value instead of
3417 satisfy_constraint_expression.
3418 (diagnose_nested_requirement): Adjust following renaming of
3419 satisfy_constraint_expression.
3420 (diagnose_constraints): Handle REQUIRES_EXPR by going through
3421 diagnose_requires_expr directly instead of treating it as a
3422 constraint-expression. Improve documentation.
3423 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
3424 to evaluate_concept_check.
3425 <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
3426 constraints_satisfied_p.
3427 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3428 * cp-tree.h (evaluate_requires_expr): Declare.
3429 (evaluate_concept_check): Remove tsubst_flag_t parameter.
3430 (satisfy_constraint_expression): Remove declaration.
3431 (constraints_satisfied_p): Remove one-parameter declaration.
3432 Add a default argument to the two-parameter declaration.
3433 * cvt.c (convert_to_void): Adjust call to
3434 evaluate_concept_check.
3436 2021-03-03 Jakub Jelinek <jakub@redhat.com>
3439 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
3442 2021-03-03 Marek Polacek <polacek@redhat.com>
3446 * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
3447 (maybe_aggr_guide): Use the original template type where needed. In
3448 a class member template, partially instantiate the result of
3449 collect_ctor_idx_types.
3450 (do_class_deduction): Defer the deduction until the enclosing
3451 scope is non-dependent.
3453 2021-03-03 Jason Merrill <jason@redhat.com>
3456 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
3457 if it didn't get one before.
3459 2021-03-03 Nathan Sidwell <nathan@acm.org>
3462 * module.cc (trees_out::decl_node): Small refactor.
3463 (depset::hash::add_binding_entity): Return true on meeting an
3464 import. Set namespace's import here.
3465 (module_state:write_namespaces): Inform of purview too.
3466 (module_state:read_namespaces): Adjust.
3467 * name-lookup.c (implicitly_export_namespace): Delete.
3468 (do_pushdecl): Don't call it.
3469 (push_namespace): Likewise, set purview.
3470 (add_imported_namespace): Reorder parms.
3471 * name-lookup.h (add_imported_namespace): Alter param ordering.
3473 2021-03-02 Martin Sebor <msebor@redhat.com>
3476 * class.c (build_base_path): Call build_if_nonnull.
3477 * cp-tree.h (build_if_nonnull): Declare.
3478 * rtti.c (ifnonnull): Rename...
3479 (build_if_nonnull): ...to this. Set no-warning bit on COND_EXPR.
3480 (build_dynamic_cast_1): Adjust to name change.
3482 2021-03-02 Patrick Palka <ppalka@redhat.com>
3486 * constraint.cc (type_deducible_p): Don't substitute into the
3487 constraints, and instead just pass 'args' to do_auto_deduction
3488 as the outer template arguments.
3489 (tsubst_parameter_mapping): Remove confused code for handling
3490 placeholder type arguments.
3491 (normalize_placeholder_type_constraint): Define.
3492 (satisfy_constraint_expression): Use it to handle placeholder
3494 * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
3495 (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
3496 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
3497 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3498 (make_constrained_placeholder_type): Set
3499 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3500 (do_auto_deduction): Clarify comments about the outer_targs
3501 parameter. Rework satisfaction of a placeholder type constraint
3502 to pass in the complete set of template arguments directly to
3503 constraints_satisfied_p.
3504 (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
3505 instead. Also rebuild the the constraint info on the new auto.
3507 2021-03-02 Patrick Palka <ppalka@redhat.com>
3509 * constraint.cc (build_parameter_mapping): Rely on the caller to
3510 determine the in-scope template parameters.
3511 (norm_info::norm_info): Delegate the tsubst_flags_t constructor
3512 to the two-parameter constructor. In the two-parameter
3513 constructor, fold in the definition of make_context, set
3514 initial_parms appropriately, and don't set the now-removed
3516 (norm_info::make_context): Remove, now that its only use is
3517 inlined into the caller.
3518 (norm_info::update_context): Adjust call to
3519 build_parameter_mapping to pass in the relevant set of in-scope
3520 template parameters.
3521 (norm_info::ctx_parms): Define this member function.
3522 (norm_info::context): Initialize to NULL_TREE.
3523 (norm_info::orig_decl): Remove this data member.
3524 (norm_info::initial_parms): Define this data member.
3525 (normalize_atom): Adjust call to build_parameter_mapping to pass
3526 in the relevant set of in-scope template parameters. Use
3527 info.initial_parms instead of info.orig_decl.
3528 (normalize_constraint_expression): Take a norm_info object
3529 instead of a bool. Cache the result of normalization.
3530 (tsubst_nested_requirement): Call satisfy_constraint_expression
3531 instead of satisfy_constraint, so that we normalize on demand.
3532 (satisfy_constraint_expression): Handle a NESTED_REQ argument.
3533 Adjust call to normalize_constraint_expression.
3534 (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
3535 to current_template_parms.
3536 (diagnose_nested_requirements): Go through
3537 satisfy_constraint_expression, as with tsubst_nested_requirement.
3539 2021-03-02 Patrick Palka <ppalka@redhat.com>
3541 * constraint.cc (tsubst_parameter_mapping): Canonicalize the
3542 arguments of a substituted TYPE_ARGUMENT_PACK even if we've
3543 started with a TYPE_ARGUMENT_PACK.
3544 (finish_requires_expr): Don't set DECL_CONTEXT and
3545 CONSTRAINT_VAR_P on each of the introduced parameters here.
3546 * parser.c (cp_parser_requirement_parameter_list): Instead set
3547 these fields earlier, here.
3548 * pt.c (do_auto_deduction): Canonicalize the result of
3549 do_auto_deduction. Pass 'complain' to finish_decltype_type.
3551 2021-03-02 Patrick Palka <ppalka@redhat.com>
3553 * constraint.cc (tsubst_simple_requirement): Just return
3554 boolean_true_node on success.
3555 (tsubst_type_requirement): Likewise.
3556 (tsubst_compound_requirement): Likewise.
3557 (tsubst_nested_requirement): Likewise.
3558 (tsubst_requirement_body): Remove.
3559 (check_constaint_variables): Rename to ...
3560 (check_constraint_variables): ... this.
3561 (tsubst_constraint_variables): Adjust.
3562 (tsubst_requires_expr): Fold tsubst_requirement_body into here.
3564 2021-03-01 Nathan Sidwell <nathan@acm.org>
3567 * class.c (fixup_type_variants): Propagate mode, precision,
3568 alignment & emptiness.
3569 * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
3570 (trees_in::tree_node): Rematerialize alignment here.
3572 2021-02-27 Jason Merrill <jason@redhat.com>
3575 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
3578 2021-02-26 Jakub Jelinek <jakub@redhat.com>
3580 * parser.c (cp_parser_lambda_declarator_opt): Implement
3581 P1102R2 - Down with ()! Make ()s optional before lambda specifiers
3582 for -std={c,gnu}++2b or with pedwarn in earlier versions.
3584 2021-02-26 Jakub Jelinek <jakub@redhat.com>
3587 * lambda.c (is_lambda_ignored_entity): Before checking for
3588 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check.
3590 2021-02-26 Jason Merrill <jason@redhat.com>
3593 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
3594 to a class non-type template argument that needs it.
3596 2021-02-26 Patrick Palka <ppalka@redhat.com>
3599 * pt.c (splice_late_return_type): Rebuild the entire return type
3600 if we have to adjust the level of an auto within.
3601 (type_uses_auto): Adjust call to find_type_usage.
3602 * type-utils.h (find_type_usage): Revert r10-6571 change that
3603 made this function return a pointer to the auto node.
3605 2021-02-25 Patrick Palka <ppalka@redhat.com>
3609 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
3610 TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
3612 2021-02-25 Patrick Palka <ppalka@redhat.com>
3615 * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
3616 (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
3618 2021-02-25 Marek Polacek <polacek@redhat.com>
3622 * constexpr.c (is_std_construct_at): New overload.
3623 (is_std_allocator_allocate): New overload.
3624 (cxx_eval_call_expression): Use the new overloads.
3625 (cxx_eval_constant_expression): Reject casting
3626 from void * as per DR 1312. Don't check can_convert.
3628 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
3631 * coroutines.cc (struct param_info): Track rvalue refs.
3632 (morph_fn_to_coro): Track rvalue refs, and call the promise
3633 CTOR with the frame copy of passed parms.
3635 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
3638 * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
3639 set throwing_cleanup marker.
3641 2021-02-25 Nathan Sidwell <nathan@acm.org>
3644 * module.cc (module_state::inform_cmi_p): Renamed field.
3645 (module_state::do_import): Adjust.
3646 (init_modules, finish_module_processing): Likewise.
3647 (handle_module_option): Likewise.
3649 2021-02-25 Nathan Sidwell <nathan@acm.org>
3652 * mapper-client.cc (module_client::open_module_client): Fix typo
3655 2021-02-24 Nathan Sidwell <nathan@acm.org>
3658 * module.cc (ool): New indirection vector.
3659 (loc_spans::maybe_propagate): Location is not optional.
3660 (loc_spans::open): Likewise. Assert monotonically advancing.
3661 (module_for_ordinary_loc): Use ool indirection vector.
3662 (module_state::write_prepare_maps): Do not count empty macro
3663 expansions. Elide empty spans.
3664 (module_state::write_macro_maps): Skip empty expansions.
3665 (ool_cmp): New qsort comparator.
3666 (module_state::write): Create and destroy ool vector.
3667 (name_pending_imports): Fix dump push/pop.
3668 (preprocess_module): Likewise. Add more dumping.
3669 (preprocessed_module): Likewise.
3671 2021-02-24 Iain Sandoe <iain@sandoe.co.uk>
3674 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
3675 error reporting when instantiating for a constexpr.
3677 2021-02-23 Nathan Sidwell <nathan@acm.org>
3680 * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
3683 2021-02-23 Patrick Palka <ppalka@redhat.com>
3686 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
3687 over from tsubst_copy.
3689 2021-02-23 Patrick Palka <ppalka@redhat.com>
3691 * pt.c (instantiation_dependent_expression_p): Check
3692 processing_template_decl before calling
3693 potential_constant_expression.
3695 2021-02-22 Nathan Sidwell <nathan@acm.org>
3698 * module.cc (struct module_state): Add visited_p flag.
3699 (name_pending_imports): Use it to avoid duplicate requests.
3700 (preprocess_module): Don't read preprocessor state if we failed to
3701 load a module's config.
3703 2021-02-22 Nathan Sidwell <nathan@acm.org>
3706 * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
3708 * module.cc (set_defining_module): Add assert.
3710 2021-02-19 Nathan Sidwell <nathan@acm.org>
3713 * module.cc (pending_imports): New.
3714 (declare_module): Adjust test condition.
3715 (name_pending_imports): New.
3716 (preprocess_module): Reimplement using pending_imports.
3717 (preprocessed_module): Move name-getting to name_pending_imports.
3718 * name-lookup.c (append_imported_binding_slot): Assert module
3719 ordering is increasing.
3721 2021-02-19 Nathan Sidwell <nathan@acm.org>
3723 * module.cc (note_cmis): New.
3724 (struct module_state): Add inform_read_p bit.
3725 (module_state::do_import): Inform of CMI location, if enabled.
3726 (init_modules): Canonicalize note_cmis entries.
3727 (handle_module_option): Handle -flang-info-module-read=FOO.
3729 2021-02-19 Jason Merrill <jason@redhat.com>
3732 * call.c (perfect_conversion_p): Limit rvalueness
3733 test to reference bindings.
3735 2021-02-19 Jason Merrill <jason@redhat.com>
3738 * call.c (perfect_conversion_p): New.
3739 (perfect_candidate_p): New.
3740 (add_candidates): Ignore templates after a perfect non-template.
3742 2021-02-18 Nathan Sidwell <nathan@acm.org>
3745 * module.cc (canonicalize_header_name): Use
3746 cpp_probe_header_unit.
3747 (maybe_translate_include): Fix note_includes comparison.
3748 (init_modules): Fix note_includes string termination.
3750 2021-02-18 Jakub Jelinek <jakub@redhat.com>
3753 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
3754 cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
3755 for immediate function calls.
3757 2021-02-17 Nathan Sidwell <nathan@acm.org>
3760 * module.cc (struct macro_export): Add GTY markers.
3761 (macro_exports): Likewise, us a va_gc Vector.
3763 2021-02-17 Jakub Jelinek <jakub@redhat.com>
3766 * init.c (build_zero_init_1): For flexible array members just return
3767 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
3770 2021-02-17 Nathan Sidwell <nathan@acm.org>
3773 * name-lookup.c (do_pushdecl): Don't peek under template_parm
3775 (set_identifier_type_value_with_scope): ... or here.
3776 (do_pushtag): Only set_identifier_type_value_with_scope at
3777 non-class template parm scope, and use parent scope.
3779 2021-02-17 Nathan Sidwell <nathan@acm.org>
3782 * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
3785 2021-02-17 Patrick Palka <ppalka@redhat.com>
3789 * tree.c (build_aggr_init_expr): Revert r10-7718 change.
3791 2021-02-12 Nathan Sidwell <nathan@acm.org>
3793 * module.cc (module_state::write_cluster): Check bindings for
3794 imported using-decls.
3796 2021-02-12 Nathan Sidwell <nathan@acm.org>
3799 * module.cc (trees_in::decl_value): Call add_module_namespace_decl
3800 for new namespace-scope entities.
3801 (module_state::read_cluster): Don't call add_module_decl here.
3802 * name-lookup.h (add_module_decl): Rename to ...
3803 (add_module_namespace_decl): ... this.
3804 * name-lookup.c (newbinding_bookkeeping): Move into ...
3805 (do_pushdecl): ... here. Its only remaining caller.
3806 (add_module_decl): Rename to ...
3807 (add_module_namespace_decl): ... here. Add checking-assert for
3808 circularity. Don't call newbinding_bookkeeping, just extern_c
3809 checking and incomplete var checking.
3811 2021-02-12 Nathan Sidwell <nathan@acm.org>
3815 * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
3816 (global_type_node): Delete.
3817 (IDENTIFIER_TYPE_VALUE): Delete.
3818 (IDENTIFIER_HAS_TYPE_VALUE): Delete.
3819 (get_type_value): Delete.
3820 * name-lookup.h (identifier_type_value): Delete.
3821 * name-lookup.c (check_module_override): Don't
3822 SET_IDENTIFIER_TYPE_VALUE here.
3823 (do_pushdecl): Nor here.
3824 (identifier_type_value_1, identifier_type_value): Delete.
3825 (set_identifier_type_value_with_scope): Only
3826 SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
3827 (pushdecl_nanmespace_level): Remove shadow stack nadgering.
3828 (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
3829 * call.c (check_dtor_name): Use lookup_name.
3830 * decl.c (cxx_init_decl_processing): Drop global_type_node.
3831 * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
3833 * init.c (get_type_value): Delete.
3834 * pt.c (instantiate_class_template_1): Don't call pushtag or
3835 SET_IDENTIFIER_TYPE_VALUE here.
3836 (tsubst): Assert never an identifier.
3837 (dependent_type_p): Drop global_type_node assert.
3838 * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
3839 to determine ctorness.
3841 2021-02-12 Jakub Jelinek <jakub@redhat.com>
3844 * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
3847 2021-02-12 Jason Merrill <jason@redhat.com>
3851 * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
3852 (register_parameter_specializations): Not here.
3854 2021-02-11 Marek Polacek <polacek@redhat.com>
3857 * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
3858 for the partial instantiation.
3860 2021-02-11 Jakub Jelinek <jakub@redhat.com>
3863 * init.c (build_zero_init_1): Handle zero initialiation of
3864 flexible array members like initialization of [0] arrays.
3865 Use integer_minus_onep instead of comparison to integer_minus_one_node
3866 and integer_zerop instead of comparison against size_zero_node.
3869 2021-02-11 Marek Polacek <polacek@redhat.com>
3872 * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
3874 2021-02-11 Patrick Palka <ppalka@redhat.com>
3877 * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
3878 lookup result by discarding it if the first element is a
3879 class-scope declaration, otherwise return it.
3880 (push_operator_bindings): Handle an ambiguous lookup result by
3881 doing push_local_binding on each element in the list.
3883 2021-02-11 Marek Polacek <polacek@redhat.com>
3885 * parser.c (cp_parser_selection_statement): Use vec_free.
3887 2021-02-10 Jakub Jelinek <jakub@redhat.com>
3891 * constexpr.c: Include cgraph.h.
3892 (cxx_eval_call_expression): Call varpool_node::finalize_decl on
3893 heap artificial vars.
3894 (cxx_eval_outermost_constant_expr): Remove varpool nodes for
3895 heap artificial vars.
3897 2021-02-10 Nathan Sidwell <nathan@acm.org>
3900 * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
3901 answer if there's no local specialization.
3903 2021-02-09 Nathan Sidwell <nathan@acm.org>
3906 * module.cc (module_state::is_rooted): Rename to ...
3907 (module_state::has_location): ... here. Adjust callers.
3908 (module_state::read_partitions): Adjust validity check.
3909 Don't overwrite a known location.
3911 2021-02-09 Jason Merrill <jason@redhat.com>
3914 * pt.c (mark_decl_instantiated): Exit early if consteval.
3916 2021-02-09 Jason Merrill <jason@redhat.com>
3920 * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
3923 2021-02-09 Jason Merrill <jason@redhat.com>
3927 * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
3930 2021-02-08 Nathan Sidwell <nathan@acm.org>
3932 * decl.c (start_cleanup_fn): Push function into
3935 2021-02-08 Nathan Sidwell <nathan@acm.org>
3938 * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
3939 * decl.c (push_abi_namespace, pop_abi_namespace): Moved
3940 from rtti.c, add default namespace arg.
3941 (check_redeclaration_exception_specification): Allow a lazy
3942 builtin's eh spec to differ from an lready-declared user
3944 (declare_global_var): Use push/pop_abi_namespace.
3945 (get_atexit_node): Push the fndecl into a namespace.
3946 * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
3949 2021-02-08 Marek Polacek <polacek@redhat.com>
3951 * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
3953 2021-02-05 Marek Polacek <polacek@redhat.com>
3956 * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
3958 * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
3959 issuing the -Wvolatile warning. Only set TREE_THIS_VOLATILE if
3960 a warning was emitted.
3962 2021-02-05 Marek Polacek <polacek@redhat.com>
3965 * name-lookup.c (lookup_using_decl): Hoist the destructor check.
3967 2021-02-05 Jakub Jelinek <jakub@redhat.com>
3970 * decl.c (check_array_initializer): For structured bindings, require
3971 the array type to be complete.
3973 2021-02-04 Jason Merrill <jason@redhat.com>
3976 * constraint.cc (build_concept_check_arguments): Remove assert.
3977 (build_concept_check): Allow empty args.
3979 2021-02-04 Tom Greenslade (thomgree) <thomgree@cisco.com>
3982 * call.c (can_convert_array): Extend to handle all valid aggregate
3983 initializers of an array; including by string literals, not just by
3985 (build_aggr_conv): Call can_convert_array more often, not just in
3986 brace-init-list case.
3987 * typeck2.c (array_string_literal_compatible_p): New function.
3988 (digest_init_r): call array_string_literal_compatible_p
3989 * cp-tree.h: (array_string_literal_compatible_p): Declare.
3991 2021-02-04 Jason Merrill <jason@redhat.com>
3994 * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
3996 2021-02-04 Jason Merrill <jason@redhat.com>
3999 * pt.c (tsubst_attribute): Handle error.
4000 (apply_late_template_attributes): Return false on error.
4001 (tsubst_function_decl): Check its return value.
4002 (tsubst_decl): Likewise.
4003 (push_template_decl): Assert current_template_parms.
4004 (tsubst_template_decl): Set current_template_parms.
4006 2021-02-03 Marek Polacek <polacek@redhat.com>
4009 * call.c (struct z_candidate): Mark rewritten and reversed as const.
4010 (struct NonPublicField): Mark operator() as const.
4011 (struct NonTrivialField): Likewise.
4013 2021-02-03 Jason Merrill <jason@redhat.com>
4017 * pt.c (spec_hasher::equal): Set processing_template_decl.
4018 * Make-lang.in (check-g++-strict-gc): Add --param
4019 hash-table-verification-limit=10000.
4021 2021-02-03 Marek Polacek <polacek@redhat.com>
4024 * parser.c (cp_parser_class_specifier_1): Use any possible
4025 DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
4026 (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
4027 * pt.c (tsubst_exception_specification): Stash new_specs into
4028 DEFPARSE_INSTANTIATIONS.
4029 * tree.c (fixup_deferred_exception_variants): Use
4030 UNPARSED_NOEXCEPT_SPEC_P.
4032 2021-02-02 Jason Merrill <jason@redhat.com>
4036 * error.c (dump_expr): Ignore dummy object.
4037 * pt.c (tsubst_baselink): Handle dependent scope.
4039 2021-02-01 Patrick Palka <ppalka@redhat.com>
4042 * constexpr.c (cxx_eval_array_reference): Also set
4043 new_ctx.object when setting new_ctx.ctor.
4045 2021-02-01 Marek Polacek <polacek@redhat.com>
4048 * parser.c (cp_parser_has_attribute_expression): Use
4049 uses_template_parms instead of type_dependent_expression_p.
4051 2021-02-01 Jason Merrill <jason@redhat.com>
4054 * cp-tree.h: Declare it.
4055 * pt.c (comparing_dependent_aliases): New flag.
4056 (template_args_equal, spec_hasher::equal): Set it.
4057 (dependent_alias_template_spec_p): Assert that we don't
4058 get non-types other than error_mark_node.
4059 (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
4060 on complex alias specializations. Set TYPE_DEPENDENT_P here.
4061 (tsubst_decl): Not here.
4062 * module.cc (module_state::read_cluster): Set
4063 comparing_dependent_aliases instead of
4064 comparing_specializations.
4065 * tree.c (cp_tree_equal): Remove comparing_specializations
4067 * typeck.c (structural_comptypes): Adjust.
4068 (comptypes): Remove comparing_specializations handling.
4070 2021-01-29 Nathan Sidwell <nathan@acm.org>
4073 * module.cc (module_state_config): Add num_entities field.
4074 (module_state::read_entities): The entity_ary span is
4076 (module_state::write_config): Write num_entities.
4077 (module_state::read_config): Read num_entities.
4078 (module_state::write): Set config's num_entities.
4079 (module_state::read_initial): Allocate the entity ary
4081 (module_state::read_language): Do not set entity_lwm
4084 2021-01-29 Marek Polacek <polacek@redhat.com>
4087 * parser.c (cp_parser_class_name): If parser->scope is
4088 error_mark_node, return it, otherwise continue.
4090 2021-01-28 Jakub Jelinek <jakub@redhat.com>
4093 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
4095 2021-01-28 Jakub Jelinek <jakub@redhat.com>
4099 * decl.c (cp_finish_decl): For register vars with asmspec in templates
4100 call set_user_assembler_name and set DECL_HARD_REGISTER.
4101 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
4102 pass asmspec_tree to cp_finish_decl.
4104 2021-01-28 Nathan Sidwell <nathan@acm.org>
4107 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
4109 (trees_in::decl_value): Do typedef frobbing only when installing
4110 a new typedef, adjust is_matching_decl call. Swap is_typedef
4112 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
4113 names and deal with typedef checking.
4115 2021-01-27 Jason Merrill <jason@redhat.com>
4118 * name-lookup.c (lookup_using_decl): Clean up handling
4119 of dependency and inherited constructors.
4120 (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
4121 * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
4123 2021-01-26 Jason Merrill <jason@redhat.com>
4126 * call.c (type_passed_as): Don't mark invisiref restrict.
4128 2021-01-26 Jason Merrill <jason@redhat.com>
4132 * class.c (layout_class_type): An empty field gets size 0.
4133 (is_empty_field): New.
4134 (check_bases): Check it.
4135 * cp-tree.h (is_empty_field): Declare it.
4136 * constexpr.c (cxx_eval_store_expression): Check it.
4137 (cx_check_missing_mem_inits): Likewise.
4138 * init.c (perform_member_init): Likewise.
4139 * typeck2.c (process_init_constructor_record): Likewise.
4141 2021-01-25 Martin Sebor <msebor@redhat.com>
4144 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
4146 2021-01-25 Jason Merrill <jason@redhat.com>
4149 * constexpr.c (get_or_insert_ctor_field): Add check.
4150 (cxx_eval_store_expression): Handle discontinuity of refs.
4152 2021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
4154 * call.c (complain_about_access): Altered function.
4155 * cp-tree.h (complain_about_access): Changed parameters of function.
4156 (get_parent_with_private_access): Declared new function.
4157 * search.c (get_parent_with_private_access): Defined new function.
4158 * semantics.c (enforce_access): Modified function.
4159 * typeck.c (complain_about_unrecognized_member): Updated function
4160 arguments in complain_about_access.
4162 2021-01-23 Patrick Palka <ppalka@redhat.com>
4165 * cp-tree.h (shared_member_p): Adjust declaration.
4166 * parser.c (cp_parser_init_declarator): If the storage class
4167 specifier is sc_static, pass true for static_p to
4168 cp_parser_declarator.
4169 (cp_parser_direct_declarator): Don't do inject_this_parm when
4170 the declarator is a friend.
4171 * search.c (shared_member_p): Change return type to bool and
4172 adjust function body accordingly. Return false for a dependent
4173 USING_DECL instead of aborting.
4174 * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
4175 even when type-dependent.
4177 2021-01-22 Marek Polacek <polacek@redhat.com>
4180 * parser.c (inject_parm_decls): Remove a redundant assignment.
4181 (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
4182 before calling inject_parm_decls.
4184 2021-01-22 Jason Merrill <jason@redhat.com>
4187 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
4189 2021-01-22 Jakub Jelinek <jakub@redhat.com>
4192 * init.c (build_zero_init_1): Revert the 2018-03-06 change to
4193 return build_zero_cst for reference types.
4194 * typeck2.c (process_init_constructor_record): Instead call
4195 build_zero_cst here during error recovery instead of build_zero_init.
4197 2021-01-22 Marek Polacek <polacek@redhat.com>
4200 * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
4201 warnings regardless of abi_version_at_least.
4202 (write_expression): When the expression is a dependent name
4203 and an operator name, write "on" before writing its name.
4205 2021-01-22 Marek Polacek <polacek@redhat.com>
4208 * pt.c (instantiate_class_template_1): Instantiate members
4209 marked with attribute used only after we're done instantiating
4212 2021-01-21 Patrick Palka <ppalka@redhat.com>
4215 * semantics.c (finish_decltype_type): Set up a cp_unevaluated
4216 sentinel at the start of the function. Remove a now-redundant
4217 manual adjustment of cp_unevaluated_operand.
4219 2021-01-21 Nathan Sidwell <nathan@acm.org>
4222 * module.cc (depset::hash::find_dependencies): Add
4224 (trees_out::core_vals): Check state before calling
4226 (sort_cluster, module_state::write): Adjust
4227 find_dependencies call.
4229 2021-01-21 Jakub Jelinek <jakub@redhat.com>
4232 * constexpr.c (check_for_return_continue_data): Add break_stmt member.
4233 (check_for_return_continue): Also look for BREAK_STMT. Handle
4234 SWITCH_STMT by ignoring break_stmt from its body.
4235 (potential_constant_expression_1) <case FOR_STMT>,
4236 <case WHILE_STMT>: If the condition isn't constant true, check if
4237 the loop body can contain a return stmt.
4238 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
4239 <case IF_STMT>: If recursion with tf_none is successful,
4240 merge *jump_target from the branches - returns with highest priority,
4241 breaks or continues lower. If then branch is potentially constant and
4242 doesn't return, check the else branch if it could return, break or
4245 2021-01-21 Nathan Sidwell <nathan@acm.org>
4248 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
4250 2021-01-20 Nathan Sidwell <nathan@acm.org>
4252 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
4255 2021-01-20 Patrick Palka <ppalka@redhat.com>
4258 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
4259 CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
4260 adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
4262 2021-01-20 Patrick Palka <ppalka@redhat.com>
4265 * parser.c (cp_parser_class_head): Defer access checking when
4266 parsing the base-clause until all bases are seen and attached
4268 * pt.c (instantiate_class_template): Likewise when substituting
4269 into dependent bases.
4271 2021-01-20 Jakub Jelinek <jakub@redhat.com>
4274 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
4275 error_operand_p, remove clause without further checking. Check
4276 for non-NULL TYPE_NAME.
4278 2021-01-19 Marek Polacek <polacek@redhat.com>
4281 * pt.c (maybe_instantiate_noexcept): Return false if FN is
4284 2021-01-19 Marek Polacek <polacek@redhat.com>
4287 * name-lookup.c (push_using_decl_bindings): New, broken out of...
4288 (finish_nonmember_using_decl): ...here.
4289 * name-lookup.h (push_using_decl_bindings): Update declaration.
4290 * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
4292 2021-01-19 Patrick Palka <ppalka@redhat.com>
4296 * search.c (friend_accessible_p): If scope is a hidden friend
4297 defined inside a dependent class, consider access from the
4299 * parser.c (cp_parser_late_parsing_for_member): Don't push a
4300 dk_no_check access state.
4302 2021-01-19 Marek Polacek <polacek@redhat.com>
4305 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
4306 of NSDMIs before late-parsing of noexcept-specifiers.
4308 2021-01-19 Nathan Sidwell <nathan@acm.org>
4310 * module.cc (identifier): Merge overloads.
4312 2021-01-19 Nathan Sidwell <nathan@acm.org>
4315 * module.cc (trees_out::write_location): Make static.
4317 2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
4319 * parser.c (cp_parser_omp_clause_detach): New.
4320 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
4321 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
4322 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4323 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4324 Prevent use of detach with mergeable and overriding the data sharing
4325 mode of the event handle.
4327 2021-01-15 Nathan Sidwell <nathan@acm.org>
4330 * tree.c (cp_build_qualified_type_real): Propagate an array's
4331 dependentness to the copy, if known.
4333 2021-01-15 Jason Merrill <jason@redhat.com>
4336 * call.c (unsafe_return_slot_p): Return int.
4337 (init_by_return_slot_p): Split out from...
4338 (unsafe_copy_elision_p): ...here.
4339 (unsafe_copy_elision_p_opt): New name for old meaning.
4340 (build_over_call): Adjust.
4341 (make_safe_copy_elision): New.
4342 * typeck2.c (split_nonconstant_init_1): Elide copy from safe
4343 list-initialization.
4344 * cp-tree.h: Adjust.
4346 2021-01-15 Jason Merrill <jason@redhat.com>
4348 * call.c (base_ctor_for, make_base_init_ok): New.
4349 (build_over_call): Use make_base_init_ok.
4351 2021-01-15 Jason Merrill <jason@redhat.com>
4354 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
4355 if we got a CONSTRUCTOR.
4357 2021-01-15 Nathan Sidwell <nathan@acm.org>
4360 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
4362 2021-01-14 Jason Merrill <jason@redhat.com>
4364 * typeck2.c (process_init_constructor_record): Use fldtype
4365 variable consistently.
4367 2021-01-14 Nathan Sidwell <nathan@acm.org>
4370 * tree.c (cp_tree_equal): Correct map_context logic.
4372 2021-01-13 Marek Polacek <polacek@redhat.com>
4375 * name-lookup.c (push_using_decl_bindings): New.
4376 * name-lookup.h (push_using_decl_bindings): Declare.
4377 * pt.c (tsubst_expr): Call push_using_decl_bindings.
4379 2021-01-13 Nathan Sidwell <nathan@acm.org>
4382 * module.cc (module_add_import_initializers): Pass a
4383 zero-element argument vector.
4385 2021-01-12 Patrick Palka <ppalka@redhat.com>
4388 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
4389 the template of a CTAD placeholder.
4391 2021-01-12 Marek Polacek <polacek@redhat.com>
4394 * typeck2.c (process_init_constructor_record): Don't emit
4395 -Wmissing-field-initializers warnings in unevaluated contexts.
4397 2021-01-11 Jakub Jelinek <jakub@redhat.com>
4400 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
4402 (mark_abi_tags_r): Likewise.
4403 * decl2.c (min_vis_r): Likewise.
4404 * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
4407 2021-01-08 Patrick Palka <ppalka@redhat.com>
4410 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
4411 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
4413 2021-01-08 Patrick Palka <ppalka@redhat.com>
4416 * semantics.c (check_accessibility_of_qualified_id): Punt if
4417 we're checking access of a scoped non-static member inside a
4420 2021-01-07 Jakub Jelinek <jakub@redhat.com>
4423 * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
4424 cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
4426 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
4428 2021-01-07 Marek Polacek <polacek@redhat.com>
4431 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
4432 !late_return_type block.
4434 2021-01-07 Jason Merrill <jason@redhat.com>
4436 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
4437 (cxx_eval_store_expression): Add comment.
4439 2021-01-07 Jason Merrill <jason@redhat.com>
4441 * call.c (has_next): Factor out from...
4442 (next_conversion): ...here.
4443 (strip_standard_conversion): And here.
4444 (is_subseq): And here.
4445 (build_conv): Check it.
4446 (standard_conversion): Don't call build_conv
4449 2021-01-06 Martin Sebor <msebor@redhat.com>
4452 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
4454 2021-01-05 Patrick Palka <ppalka@redhat.com>
4456 * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
4457 the type of the NTTP, substitute into the type again. If the
4458 type is still dependent, don't unify the NTTP.
4460 2021-01-05 Jakub Jelinek <jakub@redhat.com>
4462 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
4463 $(CODYLIB) after $(BACKEND).
4465 2021-01-05 Jakub Jelinek <jakub@redhat.com>
4468 * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
4469 Punt if lval is true.
4470 * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
4471 the result if it has a class type.
4473 2021-01-05 Marek Polacek <polacek@redhat.com>
4476 * pt.c (resolve_overloaded_unification): Call
4477 maybe_instantiate_noexcept after instantiating the function
4480 2021-01-05 Nathan Sidwell <nathan@acm.org>
4482 * parser.c (cp_parser_module_declaration): Alter diagnostic
4483 text to say where is permissable.
4485 2021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4488 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
4490 2021-01-02 Jan Hubicka <jh@suse.cz>
4492 * cp-tree.h (cp_tree_c_finish_parsing): Declare.
4493 * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
4494 * tree.c (cp_tree_c_finish_parsing): New function.
4496 2021-01-01 Jakub Jelinek <jakub@redhat.com>
4498 * ChangeLog-2020: Rotate ChangeLog. New file.
4501 Copyright (C) 2021 Free Software Foundation, Inc.
4503 Copying and distribution of this file, with or without modification,
4504 are permitted in any medium without royalty provided the copyright
4505 notice and this notice are preserved.