1 2021-07-26 Jakub Jelinek <jakub@redhat.com>
3 * parser.h (struct cp_lexer): Add orphan_p member.
4 * parser.c (cp_parser_statement): Don't change in_omp_attribute_pragma
5 upon restart from CPP_PRAGMA handling. Fix up condition when a lexer
6 should be destroyed and adjust saved_tokens if it records tokens from
7 the to be destroyed lexer.
8 (cp_parser_omp_section_scan): New function.
9 (cp_parser_omp_scan_loop_body): Use it. If
10 parser->lexer->in_omp_attribute_pragma, allow optional comma
12 (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
14 2021-07-23 Jakub Jelinek <jakub@redhat.com>
16 * parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
17 * parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
18 mixing of attribute and pragma syntax directives when seeing
19 omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
20 directives are followed by OpenMP pragma.
21 (cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
22 the cp_parser_handle_statement_omp_attributes call.
23 (cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
24 if true, set parser->omp_attrs_forbidden_p.
25 (cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
26 false as disallow_omp_attrs to cp_parser_omp_structured_block.
27 (cp_parser_omp_parallel, cp_parser_omp_task): Set
28 parser->omp_attrs_forbidden_p.
30 2021-07-21 Thomas Schwinge <thomas@codesourcery.com>
31 Joseph Myers <joseph@codesourcery.com>
32 Cesar Philippidis <cesar@codesourcery.com>
34 * parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
35 (cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
36 (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
37 * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
38 * semantics.c (finish_omp_clauses): Likewise.
40 2021-07-21 Jakub Jelinek <jakub@redhat.com>
43 * semantics.c (finish_omp_reduction_clause): Also call
44 complete_type_or_else and return true if it fails.
46 2021-07-19 Iain Sandoe <iain@sandoe.co.uk>
49 * coroutines.cc (struct coroutine_info): Add fields for
50 actor and destroy function decls.
52 (coro_get_ramp_function): New.
53 (coro_get_actor_function): New.
54 (coro_get_destroy_function): New.
55 (act_des_fn): Set up mapping between ramp, actor and
57 (morph_fn_to_coro): Adjust interface to the builder for
58 helper function decls.
59 * cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
61 * mangle.c (write_encoding): Handle coroutine helpers.
62 (write_unqualified_name): Handle lambda coroutine helpers.
64 2021-07-16 Patrick Palka <ppalka@redhat.com>
67 * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
68 substituting DECL_ARGUMENTS.
70 2021-07-16 Patrick Palka <ppalka@redhat.com>
74 * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
75 when the return types are references.
77 2021-07-16 Marek Polacek <polacek@redhat.com>
79 * typeck2.c (check_narrowing): Don't suppress the pedantic error
82 2021-07-15 Jakub Jelinek <jakub@redhat.com>
85 * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
86 operands, fold them right away to true or false.
88 2021-07-15 Jason Merrill <jason@redhat.com>
91 * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
92 (cp_tree_size): Remove redundant entries.
94 2021-07-14 Patrick Palka <ppalka@redhat.com>
97 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
98 * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
100 (redeclare_class_template): Likewise.
101 (forwarding_reference_p): Define.
102 (maybe_adjust_types_for_deduction): Use it instead. Add 'tparms'
104 (unify_one_argument): Pass tparms to
105 maybe_adjust_types_for_deduction.
106 (try_one_overload): Likewise.
108 (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
111 2021-07-14 Jason Merrill <jason@redhat.com>
113 * class.c (struct find_final_overrider_data): Use auto_vec.
114 (find_final_overrider): Remove explicit release.
115 * coroutines.cc (process_conditional): Use auto_vec.
116 * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
117 (cp_genericize_tree): Remove explicit release.
118 * parser.c (cp_parser_objc_at_property_declaration): Use
120 * semantics.c (omp_reduction_lookup): Use auto_vec.
122 2021-07-14 Marek Polacek <polacek@redhat.com>
125 * constexpr.c (cxx_eval_array_reference): Create a new .object
126 and .ctor for the non-aggregate non-scalar case too when
129 2021-07-12 Patrick Palka <ppalka@redhat.com>
133 * decl.c (grokfndecl): Don't require that deduction guides are
134 declared at namespace scope. Check that class-scope deduction
135 guides have the same access as the member class template.
136 (grokdeclarator): Pretend class-scope deduction guides are static.
137 * search.c (lookup_member): Don't use a BASELINK for (class-scope)
140 2021-07-10 Patrick Palka <ppalka@redhat.com>
143 * init.c (build_aggr_init): Return error_mark_node if
144 expand_aggr_init_1 returns false.
145 (expand_default_init): Change return type to bool. Return false
146 on error, true on success.
147 (expand_aggr_init_1): Likewise.
149 2021-07-09 Jason Merrill <jason@redhat.com>
152 * decl.c (function_requirements_equivalent_p): Only compare
153 trailing requirements on a specialization.
155 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
157 * coroutines.cc (build_actor_fn): Move common code to
159 (build_destroy_fn): Likewise.
160 (act_des_fn): Build the void return here. Ensure that the
161 source location matches the original function.
163 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
166 (coro_rewrite_function_body): Connect the replacement
167 function block to the block nest correctly.
169 2021-07-09 Patrick Palka <ppalka@redhat.com>
172 * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
174 * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
175 * pt.c (build_extra_args): Make a copy of args.
176 (add_extra_args): Add complain/in_decl parameters. Enable the
177 code for handling the case where the extra arguments are
179 (tsubst_pack_expansion): Pass complain/in_decl to
181 (tsubst_template_args): Handle missing template arguments.
182 (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
185 2021-07-09 Patrick Palka <ppalka@redhat.com>
188 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
191 2021-07-08 Martin Sebor <msebor@redhat.com>
194 * module.cc (identifier): Suppress warning.
195 (module_state::read_macro_maps): Remove warning suppression.
196 (module_state::install_macros): Ditto.
198 2021-07-08 Marek Polacek <polacek@redhat.com>
201 * cp-tree.h (unevaluated_p): New.
202 * except.c (check_noexcept_r): Use it. Don't walk into
203 unevaluated operands.
205 2021-07-08 Martin Sebor <msebor@redhat.com>
208 * module.cc (module_state::read_macro_maps): Temporarily disable
210 (module_state::install_macros): Same.
212 2021-07-06 Martin Sebor <msebor@redhat.com>
214 * error.c (cp_printer): Remove support for %G and %K.
216 2021-07-02 Jakub Jelinek <jakub@redhat.com>
218 * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
219 (struct cp_omp_declare_simd_data): Likewise.
220 * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
221 (omp_identifier): Define.
222 * parser.c (cp_parser_skip_to_pragma_eol): Handle
223 in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
224 (cp_parser_require_pragma_eol): Likewise.
225 (struct cp_omp_attribute_data): New type.
226 (cp_parser_handle_statement_omp_attributes): New function.
227 (cp_parser_statement): Handle OpenMP directives in statement's
228 attribute-specifier-seq.
229 (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
231 (cp_parser_std_attribute): Handle omp::directive and omp::sequence
233 (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
234 a comma also before the first clause.
235 (cp_parser_omp_allocate): Likewise.
236 (cp_parser_omp_atomic): Likewise.
237 (cp_parser_omp_depobj): Likewise.
238 (cp_parser_omp_flush): Likewise.
239 (cp_parser_omp_ordered): Likewise.
240 (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
241 into struct cp_omp_declare_simd_data.
242 (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
243 argument. If set, allow a comma also before match clause.
244 (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
245 allow a comma also before the first clause. Adjust
246 cp_finish_omp_declare_variant caller.
247 (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
248 a comma also before the first clause.
249 (cp_parser_omp_declare_reduction_exprs): Likewise.
250 (cp_parser_omp_requires): Likewise.
251 * decl.c (initialize_predefined_identifiers): Initialize
253 * decl2.c (cplus_decl_attributes): Reject omp::directive and
254 omp::sequence attributes.
256 2021-07-02 Jakub Jelinek <jakub@redhat.com>
259 * parser.c (cp_parser_omp_atomic): Consume comma only if it
260 appears before a CPP_NAME.
262 2021-07-02 Patrick Palka <ppalka@redhat.com>
265 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
266 use common_enclosing_class and to not depend on the TREE_TYPE
267 of outer levels pointing to the corresponding primary template.
269 2021-07-01 Patrick Palka <ppalka@redhat.com>
272 * constexpr.c (cxx_eval_array_reference): When the element type
273 is an empty type and the corresponding element is omitted, just
274 return an empty CONSTRUCTOR instead of attempting value
277 2021-07-01 Patrick Palka <ppalka@redhat.com>
280 * pt.c (finish_template_variable): Pass the partially
281 instantiated template and its args to instantiate_template.
282 (instantiate_class_template_1): No need to call
283 push_nested_class and pop_nested_class around the call to
284 most_specialized_partial_spec.
285 (instantiate_template_1): Pass the partially instantiated
286 template to lookup_template_variable.
287 (most_specialized_partial_spec): Use push_access_scope_guard
288 to set the access scope appropriately. Use
289 deferring_access_check_sentinel to force access to get checked
291 (instantiate_decl): Just pass the VAR_DECL to
292 most_specialized_partial_spec.
294 2021-06-30 Patrick Palka <ppalka@redhat.com>
296 * constraint.cc (get_normalized_constraints_from_decl): Use
297 push_access_scope_guard instead of push_nested_class_guard.
298 * cp-tree.h (struct push_nested_class_guard): Replace with ...
299 (struct push_access_scope_guard): ... this.
300 * pt.c (push_access_scope): When the argument corresponds to
301 a class type, push the class instead of its context.
302 (pop_access_scope): Adjust accordingly.
304 2021-06-30 Marek Polacek <polacek@redhat.com>
308 * decl.c (create_array_type_for_decl): Allow array of auto.
310 2021-06-29 Jason Merrill <jason@redhat.com>
312 * pt.c (instantiate_decl): Only consider partial specializations of
313 actual variable templates.
315 2021-06-26 Patrick Palka <ppalka@redhat.com>
318 * pt.c (instantiate_class_template_1): Enter the scope of the
319 type when calling most_specialized_partial_spec.
321 2021-06-26 Jason Merrill <jason@redhat.com>
325 * class.c (is_empty_field): Handle null argument.
326 * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
329 2021-06-26 Marek Polacek <polacek@redhat.com>
332 * parser.c (cp_parser_declarator): Pass flags down to
333 cp_parser_declarator. Also pass static_p/member_p.
335 2021-06-25 Martin Sebor <msebor@redhat.com>
337 * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
338 with warning_suppressed_p, suppress_warning, and copy_no_warning, or
339 nothing if not necessary.
340 (set_up_extended_ref_temp): Same.
341 * class.c (layout_class_type): Same.
342 * constraint.cc (constraint_satisfaction_value): Same.
343 * coroutines.cc (finish_co_await_expr): Same.
344 (finish_co_yield_expr): Same.
345 (finish_co_return_stmt): Same.
346 (build_actor_fn): Same.
347 (coro_rewrite_function_body): Same.
348 (morph_fn_to_coro): Same.
349 * cp-gimplify.c (genericize_eh_spec_block): Same.
350 (gimplify_expr_stmt): Same.
351 (cp_genericize_r): Same.
353 * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
354 * cvt.c (cp_fold_convert): Same.
355 (convert_to_void): Same.
356 * decl.c (wrapup_namespace_globals): Same.
357 (grokdeclarator): Same.
358 (finish_function): Same.
359 (require_deduced_type): Same.
360 * decl2.c (no_linkage_error): Same.
361 (c_parse_final_cleanups): Same.
362 * except.c (expand_end_catch_block): Same.
363 * init.c (build_new_1): Same.
365 (build_vec_delete_1): Same.
366 (build_vec_init): Same.
367 (build_delete): Same.
368 * method.c (defaultable_fn_check): Same.
369 * parser.c (cp_parser_fold_expression): Same.
370 (cp_parser_primary_expression): Same.
371 * pt.c (push_tinst_level_loc): Same.
373 (tsubst_omp_udr): Same.
374 (tsubst_copy_and_build): Same.
375 * rtti.c (build_if_nonnull): Same.
376 * semantics.c (maybe_convert_cond): Same.
377 (finish_return_stmt): Same.
378 (finish_parenthesized_expr): Same.
379 (cp_check_omp_declare_reduction): Same.
380 * tree.c (build_cplus_array_type): Same.
381 * typeck.c (build_ptrmemfunc_access_expr): Same.
382 (cp_build_indirect_ref_1): Same.
383 (cp_build_function_call_vec): Same.
384 (warn_for_null_address): Same.
385 (cp_build_binary_op): Same.
386 (unary_complex_lvalue): Same.
387 (cp_build_modify_expr): Same.
388 (build_x_modify_expr): Same.
389 (convert_for_assignment): Same.
391 2021-06-24 Patrick Palka <ppalka@redhat.com>
394 * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
396 2021-06-24 Patrick Palka <ppalka@redhat.com>
399 * constraint.cc (evaluate_requires_expr): Adjust function comment.
400 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
401 (cp_fold) <case REQUIRES_EXPR>: ... here.
403 2021-06-24 Jakub Jelinek <jakub@redhat.com>
405 * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
406 C_ORT_OMP for clauses on target construct.
407 (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
408 (cp_parser_omp_target): For non-combined target add
409 map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION. Pass
410 C_ORT_OMP_TARGET to finish_omp_clauses.
411 * semantics.c (handle_omp_array_sections_1): Adjust ort handling
412 for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
413 never present on C_ORT_*DECLARE_SIMD.
414 (handle_omp_array_sections): Likewise.
415 (finish_omp_clauses): Likewise. Handle OMP_CLAUSE_IN_REDUCTION
416 on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
417 corresponding map clauses.
418 * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
419 clauses on target construct.
421 2021-06-23 Patrick Palka <ppalka@redhat.com>
424 * pt.c (push_access_scope): For artificial deduction guides,
425 set the access scope to that of the constructor.
426 (pop_access_scope): Likewise.
427 (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
429 2021-06-23 Patrick Palka <ppalka@redhat.com>
432 * call.c (print_error_for_call_failure): Constify 'args' parameter.
433 (perform_dguide_overload_resolution): Define.
434 * cp-tree.h: (perform_dguide_overload_resolution): Declare.
435 * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
436 instead of build_new_function_call. Don't use tf_decltype or
437 set cp_unevaluated_operand. Remove unnecessary NULL_TREE tests.
439 2021-06-21 Patrick Palka <ppalka@redhat.com>
442 * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
443 sooner, before the NRVO handling.
445 2021-06-21 Patrick Palka <ppalka@redhat.com>
448 * tree.c (bot_replace): Use convert_to_base to build the
449 conversion to the (morally) virtual base.
451 2021-06-21 Jakub Jelinek <jakub@redhat.com>
454 * typeck.c (cxx_mark_addressable): Diagnose trying to make
455 bit-fields addressable.
457 2021-06-17 Jason Merrill <jason@redhat.com>
460 * decl.c (duplicate_decls): Make 'deleted after first declaration'
461 pedwarn on by default.
463 2021-06-17 Jason Merrill <jason@redhat.com>
466 * init.c (build_vec_init): Preserve the type of base.
468 2021-06-16 Jason Merrill <jason@redhat.com>
472 * pt.c (tsubst_baselink): Update binfos in non-dependent case.
474 2021-06-15 Robin Dapp <rdapp@linux.ibm.com>
476 * decl.c (duplicate_decls): Likewise.
478 2021-06-14 Tobias Burnus <tobias@codesourcery.com>
481 * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
482 var in the error case.
484 2021-06-13 Trevor Saunders <tbsaunde@tbsaunde.org>
486 * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
487 with range based for.
488 (cxx_eval_store_expression): Likewise.
489 (cxx_eval_loop_expr): Likewise.
490 * decl.c (wrapup_namespace_globals): Likewise.
491 (cp_finish_decl): Likewise.
492 (cxx_simulate_enum_decl): Likewise.
493 * parser.c (cp_parser_postfix_expression): Likewise.
495 2021-06-12 Jason Merrill <jason@redhat.com>
498 * init.c (build_vec_init): Shortcut [0] case.
500 2021-06-12 Jason Merrill <jason@redhat.com>
502 * pt.c (lookup_template_class_1): Shortcut current_class_type.
504 2021-06-11 Patrick Palka <ppalka@redhat.com>
508 * pt.c (tsubst_arg_types): Rearrange so that we substitute into
509 TYPE_ARG_TYPES in forward order while short circuiting
510 appropriately. Adjust formatting.
512 2021-06-11 Jakub Jelinek <jakub@redhat.com>
515 * cp-tree.h (struct saved_scope): Add consteval_if_p
516 member. Formatting fix for the discarded_stmt comment.
517 (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
518 * parser.c (cp_parser_lambda_expression): Temporarily disable
519 in_consteval_if_p when parsing lambda body.
520 (cp_parser_selection_statement): Parse consteval if.
521 * decl.c (struct named_label_entry): Add in_consteval_if member.
522 (level_for_consteval_if): New function.
523 (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
525 * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
526 why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
527 for !ctx->manifestly_const_eval.
528 (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
529 condition as if it was __builtin_is_constant_evaluated call.
530 (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
531 recurse on both branches.
532 * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
534 * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
535 Temporarily set in_consteval_if_p when recursing on
536 IF_STMT_CONSTEVAL_P then branch.
537 (tsubst_lambda_expr): Temporarily disable
538 in_consteval_if_p when instantiating lambda body.
539 * call.c (immediate_invocation_p): Return false when
542 2021-06-11 Marek Polacek <polacek@redhat.com>
545 * constexpr.c (maybe_constexpr_fn): New.
546 * cp-tree.h (maybe_constexpr_fn): Declare.
547 * semantics.c (find_std_constant_evaluated_r): New.
548 (maybe_warn_for_constant_evaluated): New.
549 (finish_if_stmt_cond): Call it.
551 2021-06-10 Patrick Palka <ppalka@redhat.com>
554 * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
555 the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
556 a template template parameter, adjust to the
557 TEMPLATE_TEMPLATE_PARAMETER before falling through.
559 2021-06-10 Patrick Palka <ppalka@redhat.com>
562 * constraint.cc (normalize_placeholder_type_constraints): When
563 normalizing a non-templated return-type-requirement, add a dummy
564 level to initial_parms.
566 2021-06-08 Marek Polacek <polacek@redhat.com>
569 * decl.c (grokdeclarator): Store a value-dependent
570 explicit-specifier even for deduction guides.
572 2021-06-08 Jason Merrill <jason@redhat.com>
574 * parser.c (cp_parser_string_literal): Adjust diagnostic.
576 2021-06-08 Jason Merrill <jason@redhat.com>
579 * call.c (perfect_conversion_p): Check check_narrowing.
581 2021-06-08 Jason Merrill <jason@redhat.com>
584 * name-lookup.c (get_class_binding): Keep a BASELINK.
585 (set_inherited_value_binding_p): Adjust.
586 * lambda.c (is_lambda_ignored_entity): Adjust.
587 * pt.c (lookup_template_function): Copy a BASELINK before
590 2021-06-08 Jason Merrill <jason@redhat.com>
593 * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
595 2021-06-08 Jason Merrill <jason@redhat.com>
597 * module.cc (duplicate_hash::hash): Comment out.
598 (trees_in::tree_value): Adjust loop counter.
600 2021-06-08 Jason Merrill <jason@redhat.com>
603 * init.c (build_offset_ref): Return the BASELINK for a static
606 2021-06-07 Patrick Palka <ppalka@redhat.com>
609 * parser.c (cp_parser_lookup_name): Check access of the lookup
610 result before we potentially adjust an injected-class-name to
613 2021-06-06 Jakub Jelinek <jakub@redhat.com>
616 * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
617 even when target is combined with other constructs.
619 2021-06-04 Patrick Palka <ppalka@redhat.com>
622 * pt.c (convert_template_argument): Strip top-level cv-quals
623 on the substituted type of a non-type template parameter.
625 2021-06-04 Patrick Palka <ppalka@redhat.com>
628 * pt.c (tsubst_function_decl): Remove old code for reducing
629 args when it has excess levels.
631 2021-06-04 Jakub Jelinek <jakub@redhat.com>
634 * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
635 ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
638 2021-06-03 Patrick Palka <ppalka@redhat.com>
641 * decl.c (make_typename_type): After calling
642 lookup_template_class, adjust the result to its TYPE_NAME and
643 then consider the tf_keep_type_decl flag.
645 2021-06-03 Patrick Palka <ppalka@redhat.com>
648 * pt.c (set_current_access_from_decl): Move to ...
649 * class.c (set_current_access_from_decl): ... here.
650 (handle_using_decl): Use it to propagate the access of the
651 using-enum decl to the copy of the imported enumerator.
652 * cp-tree.h (set_current_access_from_decl): Declare.
653 * decl.c (build_enumerator): Simplify using make_temp_override
654 and set_current_access_from_decl.
656 2021-06-03 Jakub Jelinek <jakub@redhat.com>
659 * semantics.c (handle_omp_array_sections_1): For
660 OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
661 finish_non_static_data_member and allow this as base.
662 (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
663 after depend only cases. Let this be diagnosed by !lvalue_p
664 case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
666 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
668 2021-06-02 Jason Merrill <jason@redhat.com>
671 * call.c (convert_like_internal): Clear tf_no_cleanup when
673 (build_user_type_conversion_1): Only add ck_rvalue if
674 LOOKUP_ONLYCONVERTING.
676 2021-06-01 Patrick Palka <ppalka@redhat.com>
679 * init.c (expand_aggr_init_1): Check
680 type_has_non_user_provided_default_constructor instead of
681 type_has_user_provided_constructor.
683 2021-06-01 Jason Merrill <jason@redhat.com>
686 * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
687 for destroying delete.
688 * init.c (build_delete): Don't clobber before destroying delete.
690 2021-06-01 Jason Merrill <jason@redhat.com>
693 * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
695 2021-05-31 Richard Biener <rguenther@suse.de>
698 * cp-objcp-common.c (names_builtin_p): Handle
699 RID_BUILTIN_SHUFFLEVECTOR.
700 * cp-tree.h (build_x_shufflevector): Declare.
701 * parser.c (cp_parser_postfix_expression): Handle
702 RID_BUILTIN_SHUFFLEVECTOR.
703 * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
704 * typeck.c (build_x_shufflevector): Build either a lowered
705 VEC_PERM_EXPR or an unlowered shufflevector via a temporary
706 internal function IFN_SHUFFLEVECTOR.
708 2021-05-28 Jason Merrill <jason@redhat.com>
710 * constexpr.c (build_data_member_initialization): Use tsi_range.
711 (build_constexpr_constructor_member_initializers): Likewise.
712 (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
713 (potential_constant_expression_1): Likewise.
714 * coroutines.cc (await_statement_expander): Likewise.
715 (await_statement_walker): Likewise.
716 * module.cc (trees_out::core_vals): Likewise.
717 * pt.c (tsubst_expr): Likewise.
718 * semantics.c (set_cleanup_locs): Likewise.
720 2021-05-28 Jason Merrill <jason@redhat.com>
724 * call.c (build_over_call): Adjust base_binfo in
725 resolves_to_fixed_type_p case.
727 2021-05-28 Jakub Jelinek <jakub@redhat.com>
730 * semantics.c (handle_omp_array_sections): Copy
731 OMP_CLAUSE_MAP_IMPLICIT.
732 (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
733 marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT. Add
734 map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
735 maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
736 present too. For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
737 if present in map_head, map_field_head or map_firstprivate_head
740 2021-05-28 Tobias Burnus <tobias@codesourcery.com>
742 * parser.c (cp_parser_omp_clause_affinity): New.
743 (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
744 cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
746 * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
747 finish_omp_clauses): Likewise.
749 2021-05-27 Matthias Kretz <kretz@kde.org>
752 * error.c (dump_template_bindings): Include code to print
753 "[with" and ']', conditional on whether anything is printed at
754 all. This is tied to whether a semicolon is needed to separate
755 multiple template parameters. If the template argument repeats
756 the template parameter (T = T), then skip the parameter.
757 (dump_substitution): Moved code to print "[with" and ']' to
758 dump_template_bindings.
759 (dump_function_decl): Partial revert of PR50828, which masked
760 TFF_TEMPLATE_NAME for all of dump_function_decl. Now
761 TFF_TEMPLATE_NAME is masked for the scope of the function and
762 only carries through to dump_function_name.
763 (dump_function_name): Avoid calling dump_template_parms if
764 TFF_TEMPLATE_NAME is set.
766 2021-05-27 Matthias Kretz <kretz@kde.org>
769 * error.c: Call dump_scope when printing a typedef.
771 2021-05-27 Patrick Palka <ppalka@redhat.com>
774 * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
776 2021-05-27 Jason Merrill <jason@redhat.com>
779 * pt.c (use_pack_expansion_extra_args_p): Don't compare
780 args from the same argument pack.
782 2021-05-27 Patrick Palka <ppalka@redhat.com>
787 * pt.c (process_partial_specialization): Don't error on a
788 non-simple non-type template argument that involves template
790 (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
791 MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
793 2021-05-26 Patrick Palka <ppalka@redhat.com>
796 * typeck.c (finish_class_member_access_expr): Disable ahead
797 of time access checking during the member lookup.
799 2021-05-26 Patrick Palka <ppalka@redhat.com>
802 * tree.c (build_target_expr_with_type): Don't call force_rvalue
803 on CALL_EXPR initializer. Simplify now that bot_manip is no
805 (bot_manip): Use force_target_expr instead of
806 build_target_expr_with_type.
808 2021-05-26 Patrick Palka <ppalka@redhat.com>
811 * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
812 (fnptr_conv_p): Don't call non_reference. Use INDIRECT_TYPE_P
813 instead of TYPE_PTR_P.
814 * pt.c (convert_nontype_argument_function): Look through
815 implicit INDIRECT_REFs before calling strip_fnptr_conv.
817 2021-05-25 Jakub Jelinek <jakub@redhat.com>
820 * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
821 and side-effects, temporarily disable -Wunused-result warning when
822 building COMPOUND_EXPR.
824 2021-05-21 Jakub Jelinek <jakub@redhat.com>
827 * semantics.c (finish_omp_clauses): Move firstprivate clauses with
828 OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain. Don't error
829 if a decl is mentioned both in map clause and in such firstprivate
830 clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
832 2021-05-20 Jason Merrill <jason@redhat.com>
834 * call.c (reference_binding): Check for designator.
835 (implicit_conversion_1, build_special_member_call): Likewise.
836 * decl.c (reshape_init_r): Likewise.
837 * pt.c (do_class_deduction): Likewise.
838 * typeck2.c (digest_init_r): Likewise.
840 2021-05-20 Jason Merrill <jason@redhat.com>
843 * decl.c (reshape_init_class): Handle designator for
844 member of anonymous aggregate here.
845 * typeck2.c (process_init_constructor_record): Not here.
847 2021-05-20 Jonathan Wakely <jwakely@redhat.com>
849 * call.c (maybe_warn_array_conv): Use new warning option.
850 * decl.c (mark_inline_variable, grokdeclarator): Likewise.
851 * error.c (maybe_warn_cpp0x): Likewise.
852 * parser.c (cp_parser_primary_expression)
853 (cp_parser_unqualified_id)
854 (cp_parser_pseudo_destructor_name)
855 (cp_parser_lambda_introducer)
856 (cp_parser_lambda_declarator_opt)
857 (cp_parser_selection_statement)
858 (cp_parser_init_statement)
859 (cp_parser_decomposition_declaration)
860 (cp_parser_function_specifier_opt)
861 (cp_parser_static_assert)
862 (cp_parser_namespace_definition)
863 (cp_parser_using_declaration)
864 (cp_parser_asm_definition)
865 (cp_parser_ctor_initializer_opt_and_function_body)
866 (cp_parser_initializer_list)
867 (cp_parser_type_parameter_key)
868 (cp_parser_member_declaration)
869 (cp_parser_try_block)
870 (cp_parser_std_attribute_spec): Likewise.
871 * pt.c (check_template_variable): Likewise.
873 2021-05-20 Jason Merrill <jason@redhat.com>
876 * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
878 2021-05-20 Jason Merrill <jason@redhat.com>
881 * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
883 2021-05-19 Jason Merrill <jason@redhat.com>
887 * method.c (genericize_spaceship): Use fold_build2 for scalar
890 2021-05-19 Jason Merrill <jason@redhat.com>
892 * pt.c (build_deduction_guide): Treat the implicit deduction guide
893 as a member of the class.
895 2021-05-19 Marek Polacek <polacek@redhat.com>
898 * cp-tree.h (any_non_type_attribute_p): Remove.
899 * decl.c (grokdeclarator): Turn an error into a warning and only
900 warn for standard attributes.
901 * decl2.c (any_non_type_attribute_p): Remove.
902 * parser.c (cp_parser_elaborated_type_specifier): Turn an error
903 into a warning and only warn for standard attributes.
904 (cp_parser_member_declaration): Likewise.
906 2021-05-19 Martin Liska <mliska@suse.cz>
909 * mangle.c (write_encoding): Fix typos.
911 2021-05-19 Jakub Jelinek <jakub@redhat.com>
914 * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
915 master when combined with taskloop.
916 (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
917 parallel master when not combined with taskloop.
919 2021-05-19 Jason Merrill <jason@redhat.com>
922 * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
924 2021-05-19 Jason Merrill <jason@redhat.com>
927 * tree.c (strip_typedefs): Only look at the pattern of a
928 TYPE_PACK_EXPANSION if it's a type.
930 2021-05-18 Marek Polacek <polacek@redhat.com>
932 * class.c (classtype_has_non_deleted_copy_ctor): Remove.
933 * constraint.cc (contains_wildcard_p): Likewise.
934 (get_template_head_requirements): Likewise.
935 (check_constrained_friend): Likewise.
936 (subsumes_constraints): Likewise.
937 * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
938 (push_void_library_fn): Likewise.
939 (get_pattern_parm): Likewise.
940 (get_template_parms_at_level): Likewise.
941 (lambda_return_type): Likewise.
942 (get_template_head_requirements): Likewise.
943 (check_constrained_friend): Likewise.
944 (subsumes_constraints): Likewise.
945 * decl.c (push_void_library_fn): Likewise.
946 * lambda.c (lambda_return_type): Likewise.
947 * pt.c (get_template_parms_at_level): Likewise.
948 (get_pattern_parm): Likewise.
950 2021-05-18 Jason Merrill <jason@redhat.com>
953 * call.c (perfect_candidate_p): An implicitly deleted move
956 2021-05-18 Andreas Krebbel <krebbel@linux.ibm.com>
959 * cvt.c (cp_convert_to_pointer): Use the size of the target
961 * tree.c (cp_build_reference_type): Call
962 cp_build_reference_type_for_mode with VOIDmode.
963 (cp_build_reference_type_for_mode): Rename from
964 cp_build_reference_type. Add MODE argument and invoke
965 build_reference_type_for_mode.
966 (strip_typedefs): Use build_pointer_type_for_mode and
967 cp_build_reference_type_for_mode for pointers and references.
969 2021-05-17 Jonathan Wakely <jwakely@redhat.com>
972 * call.c (convert_like_internal): Print different diagnostic if
973 the lvalue reference is const.
975 2021-05-14 Jason Merrill <jason@redhat.com>
978 * pt.c (enclosing_instantiation_of): Just compare
979 DECL_SOURCE_LOCATION.
980 (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
982 2021-05-14 Marek Polacek <polacek@redhat.com>
983 Jason Merrill <jason@redhat.com>
986 * cp-tree.h (any_non_type_attribute_p): Declare.
987 * decl.c (grokdeclarator): Diagnose when an attribute appertains to
988 a friend declaration that is not a definition.
989 * decl2.c (any_non_type_attribute_p): New.
990 * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
991 in the middle of decl-specifiers.
992 (cp_parser_elaborated_type_specifier): Diagnose when an attribute
993 appertains to a friend declaration that is not a definition.
994 (cp_parser_member_declaration): Likewise.
996 2021-05-12 Marek Polacek <polacek@redhat.com>
998 * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
1001 2021-05-12 Marcel Vollweiler <marcel@codesourcery.com>
1003 * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
1006 2021-05-11 Jason Merrill <jason@redhat.com>
1009 * typeck.c (build_reinterpret_cast_1): Check intype on
1012 2021-05-11 Patrick Palka <ppalka@redhat.com>
1015 * name-lookup.c (maybe_save_operator_binding): Unconditionally
1016 enable for all function templates, not just generic lambdas.
1017 Handle compound-assignment operator expressions.
1018 * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
1019 in the type-dependent case.
1020 (build_x_modify_expr): Likewise. Move declaration of 'op' closer
1023 2021-05-11 Patrick Palka <ppalka@redhat.com>
1026 * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
1027 (satisfy_atom): Set up iloc_sentinel before calling
1029 * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
1030 expansion, carry over PACK_EXPANSION_LOCAL_P and
1031 PACK_EXPANSION_SIZEOF_P from the original pack expansion.
1033 2021-05-10 Richard Biener <rguenther@suse.de>
1035 PR middle-end/100464
1037 * call.c (set_up_extended_ref_temp): Mark the temporary
1038 addressable if the TARGET_EXPR was.
1040 2021-05-10 Martin Liska <mliska@suse.cz>
1042 * decl.c (duplicate_decls): Use startswith
1043 function instead of strncmp.
1044 (cxx_builtin_function): Likewise.
1045 (omp_declare_variant_finalize_one): Likewise.
1046 (grokfndecl): Likewise.
1047 * error.c (dump_decl_name): Likewise.
1048 * mangle.c (find_decomp_unqualified_name): Likewise.
1049 (write_guarded_var_name): Likewise.
1050 (decl_tls_wrapper_p): Likewise.
1051 * parser.c (cp_parser_simple_type_specifier): Likewise.
1052 (cp_parser_tx_qualifier_opt): Likewise.
1053 * pt.c (template_parm_object_p): Likewise.
1054 (dguide_name_p): Likewise.
1056 2021-05-10 Martin Liska <mliska@suse.cz>
1059 * decl.c (grokdeclarator): Remove redundant NULL check.
1061 2021-05-07 Jason Merrill <jason@redhat.com>
1063 * tree.c (rvalue): Assert expr is not a class lvalue.
1065 2021-05-07 Jason Merrill <jason@redhat.com>
1067 * cp-tree.h (build_stub_object): Declare.
1068 * method.c (build_stub_object): No longer static.
1069 * call.c (can_convert): Use it.
1070 * tree.c (build_dummy_object): Adjust comment.
1071 * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
1074 2021-05-07 Jason Merrill <jason@redhat.com>
1076 * coroutines.cc (build_co_await): Don't call 'rvalue'.
1077 (flatten_await_stmt): Simplify initialization.
1078 (morph_fn_to_coro): Change 'rvalue' to 'move'. Simplify.
1080 2021-05-04 Tobias Burnus <tobias@codesourcery.com>
1082 * semantics.c (finish_omp_reduction_clause): Accept float + complex
1083 for || and && reductions.
1085 2021-05-03 Patrick Palka <ppalka@redhat.com>
1088 * parser.c (cp_parser_class_head): Reinstate calls to pushclass
1089 and popclass when parsing the base-clause that were removed in
1092 2021-05-03 Patrick Palka <ppalka@redhat.com>
1096 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
1097 only when the callee is a FUNCTION_DECL.
1099 2021-05-03 Marek Polacek <polacek@redhat.com>
1102 * decl.c (grokfndecl): Check current_template_parms.
1104 2021-05-03 Marek Polacek <polacek@redhat.com>
1107 * constexpr.c (cxx_eval_constant_expression): Don't check
1110 2021-05-01 Jason Merrill <jason@redhat.com>
1112 * cp-tree.h (class ovl_iterator): Allow copying. Add op==.
1113 (class ovl_range, class lkp_range): New.
1114 * call.c (build_op_call_1, add_candidates): Use them.
1115 (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
1116 (has_trivial_copy_p): Likewise.
1117 * class.c (handle_using_decl, get_basefndecls): Likewise.
1118 (maybe_warn_about_overly_private_class): Likewise.
1119 (warn_hidden, add_implicitly_declared_members): Likewise.
1120 (check_methods, clone_constructors_and_destructors): Likewise.
1121 (type_has_user_nondefault_constructor): Likewise.
1123 2021-04-29 Jason Merrill <jason@redhat.com>
1125 * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
1128 2021-04-29 Jason Merrill <jason@redhat.com>
1131 * decl2.c (grokfield): Call cplus_decl_attributes for friend.
1132 (save_template_attributes): Use chainon.
1133 * friend.c (do_friend): Remove attrlist parm.
1134 * cp-tree.h (do_friend): Adjust.
1135 * class.c (add_implicitly_declared_members): Adjust.
1136 * decl.c (grokdeclarator): Adjust.
1137 * pt.c (apply_late_template_attributes): Optimize.
1139 2021-04-29 Jason Merrill <jason@redhat.com>
1142 * class.c (finish_struct_anon_r): Drop complain parm.
1143 Remove non-field diagnostic.
1144 (finish_struct_anon): Adjust.
1145 * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
1147 2021-04-29 Jason Merrill <jason@redhat.com>
1149 * cp-tree.h (cp_evaluated): Add reset parm to constructor.
1150 * parser.c (cp_parser_constant_expression): Change
1151 allow_non_constant_p to int. Use cp_evaluated.
1152 (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
1153 * semantics.c (finish_id_expression_1): Don't mess with
1154 cp_unevaluated_operand here.
1156 2021-04-29 Jason Merrill <jason@redhat.com>
1158 * cp-tree.h: Clarify comments.
1159 * pt.c (get_template_parm_object): Add assert.
1160 * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
1161 * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
1162 * typeck2.c (store_init_value): Likewise.
1164 2021-04-29 Patrick Palka <ppalka@redhat.com>
1167 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
1168 set tf_conv during the initial substitution into the function.
1170 2021-04-29 Jakub Jelinek <jakub@redhat.com>
1173 * semantics.c (finish_omp_clauses): Fix up check that variable
1174 mentioned in detach clause doesn't appear in data-sharing clauses.
1176 2021-04-28 Jakub Jelinek <jakub@redhat.com>
1178 * module.cc: Remove #error that triggers if DEV-PHASE is empty.
1180 2021-04-27 Jason Merrill <jason@redhat.com>
1183 * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
1186 2021-04-27 Patrick Palka <ppalka@redhat.com>
1189 * pt.c (tsubst_initializer_list): Correctly handle the case
1190 where an argument inside a base initializer pack expansion is
1191 itself a pack expansion.
1193 2021-04-26 Patrick Palka <ppalka@redhat.com>
1196 * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
1197 object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
1198 with a negative offset into one whose offset is nonnegative
1199 before calling cxx_fold_indirect_ref_1.
1201 2021-04-24 Patrick Palka <ppalka@redhat.com>
1208 * pt.c (do_class_deduction): Punt if the initializer is
1211 2021-04-24 Patrick Palka <ppalka@redhat.com>
1214 * parser.c (cp_parser_type_id_1): If we see a template
1215 placeholder, first try simulating an error before issuing
1218 2021-04-23 Patrick Palka <ppalka@redhat.com>
1221 * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
1222 Adjust parameter list loop to iterate over 'types' instead of
1223 'args'. Output the trailing '...' for a variadic function.
1224 Remove PARM_DECL support.
1225 (pp_cxx_requires_expr): Pretty print the parameter list directly
1226 instead of going through pp_cxx_parameter_declaration_clause.
1228 2021-04-23 Patrick Palka <ppalka@redhat.com>
1231 * decl.c (is_direct_enum_init): Check the implicit
1232 convertibility requirement added by CWG 2374.
1234 2021-04-23 Martin Liska <mliska@suse.cz>
1236 * cp-tree.h (STATIC_ASSERT): Prefer static assert.
1237 * lex.c (init_operators): Remove run-time check.
1239 2021-04-22 Marek Polacek <polacek@redhat.com>
1242 * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
1243 op1 separately for value- or type-dependence.
1245 2021-04-21 Marek Polacek <polacek@redhat.com>
1248 * parser.c (cp_parser_enum_specifier): Don't allow defining
1251 2021-04-21 Martin Liska <mliska@suse.cz>
1254 2021-04-21 Martin Liska <mliska@suse.cz>
1256 * error.c (dump_decl): Use flags in dump_generic_node call.
1258 2021-04-21 Martin Liska <mliska@suse.cz>
1260 * error.c (dump_decl): Use flags in dump_generic_node call.
1262 2021-04-21 Martin Liska <mliska@suse.cz>
1264 * error.c (dump_decl): Support anonymous labels.
1266 2021-04-20 Jason Merrill <jason@redhat.com>
1269 * pt.c (find_parameter_packs_r): Look into enum initializers.
1271 2021-04-19 Marek Polacek <polacek@redhat.com>
1274 * decl.c (grokvardecl): Given an error when a concept is not defined
1277 2021-04-16 Jakub Jelinek <jakub@redhat.com>
1280 * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
1281 for empty classes into *valp when types don't match even when *valp
1284 2021-04-16 Marek Polacek <polacek@redhat.com>
1287 * decl.c (make_typename_type): Give an error and return when
1288 name is is_overloaded_fn.
1289 * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
1290 before calling make_typename_type.
1292 2021-04-16 Patrick Palka <ppalka@redhat.com>
1295 * constexpr.c (reduced_constant_expression_p): For array
1296 CONSTRUCTORs, use a dedicated loop that additionally verifies
1297 the CONSTRUCTOR spans the entire array.
1299 2021-04-16 Jakub Jelinek <jakub@redhat.com>
1302 * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
1303 If lambda_p, return pce_ok instead of pce_maybe_postfix.
1305 2021-04-16 Jakub Jelinek <jakub@redhat.com>
1308 * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
1309 binding, add to data.internal also all corresponding structured
1312 2021-04-16 Jason Merrill <jason@redhat.com>
1315 * cp-tree.h (first_field): Declare.
1316 * mangle.c (range_expr_nelts): New.
1317 (write_expression): Improve class NTTP mangling.
1318 * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
1319 * tree.c (zero_init_expr_p): Improve class NTTP handling.
1320 * decl.c: Adjust comment.
1322 2021-04-15 Jason Merrill <jason@redhat.com>
1325 * call.c (build_new_method_call_1): Check again for side-effects
1326 with a volatile object.
1328 2021-04-15 Jason Merrill <jason@redhat.com>
1332 * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
1333 TYPE_RAISES_EXCEPTIONS here.
1334 * tree.c (cp_walk_subtrees): Not here.
1336 2021-04-15 Jason Merrill <jason@redhat.com>
1340 * parser.c (cp_parser_default_type_template_argument): Set
1341 parser->local_variables_forbidden_p.
1343 2021-04-15 Richard Sandiford <richard.sandiford@arm.com>
1346 * typeck.c (merge_type_attributes_from): New function.
1347 (cp_common_type): Use it for vector types.
1349 2021-04-14 Jason Merrill <jason@redhat.com>
1353 * pt.c (uses_outer_template_parms): Also look at default
1356 2021-04-14 Jason Merrill <jason@redhat.com>
1359 * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
1360 for a non-static data member in a constant-expression.
1362 2021-04-14 Patrick Palka <ppalka@redhat.com>
1366 * pt.c (deducible_expression): Look through implicit
1367 INDIRECT_REFs as well.
1369 2021-04-14 Jason Merrill <jason@redhat.com>
1372 * parser.c (cp_parser_lambda_expression): Reject lambda
1373 in template parameter type.
1375 2021-04-14 Jason Merrill <jason@redhat.com>
1378 * decl.c (duplicate_decls): Don't propagate
1379 DECL_INITIALIZED_IN_CLASS_P to a specialization.
1381 2021-04-14 Jason Merrill <jason@redhat.com>
1386 * semantics.c (set_cleanup_locs): New.
1387 (do_poplevel): Call it.
1388 * parser.c (cp_parser_compound_statement): Consume the }
1389 before finish_compound_stmt.
1391 2021-04-13 Jason Merrill <jason@redhat.com>
1394 * pt.c (get_underlying_template): Compare TYPE_QUALS.
1396 2021-04-13 Jason Merrill <jason@redhat.com>
1400 * init.c (get_nsdmi): Do more context adjustment for local classes.
1402 2021-04-13 Patrick Palka <ppalka@redhat.com>
1405 * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
1406 rather than issuing a pedwarn.
1407 * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
1408 for consistent diagnostics.
1410 2021-04-13 Jason Merrill <jason@redhat.com>
1413 * class.c (build_base_path): Shortcut simple non-pointer case.
1415 2021-04-13 Eric Botcazou <ebotcazou@adacore.com>
1417 * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
1419 (module_state::write_location): Likewise.
1421 2021-04-13 Patrick Palka <ppalka@redhat.com>
1424 * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
1425 when checking if the initializer is an equivalent class
1426 placeholder template parameter.
1428 2021-04-13 Patrick Palka <ppalka@redhat.com>
1432 * constraint.cc (satisfy_normalized_constraints): Set
1434 * parser.c (cp_parser_concept_definition): Likewise.
1435 (cp_parser_requires_clause_opt): Likewise.
1437 2021-04-12 Jason Merrill <jason@redhat.com>
1440 * pt.c (uses_outer_template_parms): Handle non-type and template
1441 template parameters specifically.
1443 2021-04-11 Jason Merrill <jason@redhat.com>
1446 * decl.c (fixup_anonymous_aggr): Prune all functions from
1447 CLASSTYPE_MEMBER_VEC.
1449 2021-04-10 Jason Merrill <jason@redhat.com>
1453 * parser.c (cp_parser_direct_declarator): Don't
1454 inject_this_parameter if static_p.
1455 (cp_parser_omp_var_list_no_open): Parse 'this' even if
1456 current_class_ptr isn't set for a better diagnostic.
1458 2021-04-10 Jason Merrill <jason@redhat.com>
1465 * pt.c (alias_ctad_tweaks): Handle failure better.
1467 2021-04-10 Jason Merrill <jason@redhat.com>
1470 * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
1472 2021-04-09 Patrick Palka <ppalka@redhat.com>
1474 * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
1475 (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
1476 (LAMBDA_EXPR_REGEN_INFO): ... this.
1477 (tree_lambda_expr::regenerated_from)
1478 (tree_lambda_expr::regenerating_targs): Replace these with ...
1479 (tree_lambda_expr::regen_info): ... this.
1480 * constraint.cc (satisfy_declaration_constraints): Adjust
1482 * lambda.c (build_lambda_expr): Likewise.
1483 * pt.c (regenerated_lambda_fn_p): Likewise.
1484 (most_general_lambda): Likewise.
1485 (tsubst_lambda_expr): Likewise.
1487 2021-04-09 Marek Polacek <polacek@redhat.com>
1490 * parser.c (cp_parser_member_declaration): Call
1491 cp_parser_save_default_args even for function templates. Use
1492 STRIP_TEMPLATE on the declaration we're passing.
1494 2021-04-08 Patrick Palka <ppalka@redhat.com>
1497 * constraint.cc (get_normalized_constraints_from_decl): Handle
1498 regenerated lambdas.
1499 (satisfy_declaration_constraints): Likewise. Check for
1500 dependent args later.
1501 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
1502 (LAMBDA_EXPR_REGENERATED_FROM): ... this.
1503 (LAMBDA_EXPR_REGENERATING_TARGS): New.
1504 (tree_lambda_expr::regenerated_from): New data member.
1505 (tree_lambda_expr::regenerating_targs): New data member.
1506 (add_to_template_args): Declare.
1507 (regenerated_lambda_fn_p): Likewise.
1508 (most_general_lambda): Likewise.
1509 * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
1510 and LAMBDA_EXPR_REGENERATING_TARGS.
1511 * pt.c (add_to_template_args): No longer static.
1512 (tsubst_function_decl): Unconditionally propagate constraints on
1513 the substituted function decl.
1514 (instantiated_lambda_fn_p): Rename to ...
1515 (regenerated_lambda_fn_p): ... this. Check
1516 LAMBDA_EXPR_REGENERATED_FROM instead of
1517 LAMBDA_EXPR_INSTANTIATED.
1518 (most_general_lambda): Define.
1519 (enclosing_instantiation_of): Adjust after renaming
1520 instantiated_lambda_fn_p.
1521 (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED. Set
1522 LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
1523 Don't substitute or set constraints on the regenerated lambda.
1525 2021-04-08 Patrick Palka <ppalka@redhat.com>
1528 * pt.c (build_deduction_guide): Document OUTER_ARGS. Substitute
1529 them into the propagated constraints.
1531 2021-04-08 Jason Merrill <jason@redhat.com>
1534 * call.c (convert_like_internal): Improve reference diagnostic.
1536 2021-04-08 Jakub Jelinek <jakub@redhat.com>
1539 * constexpr.c (addr_of_non_const_var): New function.
1540 (cxx_bind_parameters_in_call): Set *non_constant_args to true
1541 even if cp_walk_tree on arg with addr_of_non_const_var callback
1544 2021-04-08 Jason Merrill <jason@redhat.com>
1547 * pt.c (determine_specialization): Improve diagnostic.
1549 2021-04-08 Marek Polacek <polacek@redhat.com>
1552 * decl.c (build_explicit_specifier): Call
1553 check_for_bare_parameter_packs.
1554 * except.c (build_noexcept_spec): Likewise.
1556 2021-04-07 Jason Merrill <jason@redhat.com>
1559 * parser.c (cp_parser_class_name): Check dependent_scope_p.
1561 2021-04-07 Jason Merrill <jason@redhat.com>
1564 * pt.c (maybe_process_partial_specialization): Check
1565 DECL_SELF_REFERENCE_P.
1567 2021-04-07 Jason Merrill <jason@redhat.com>
1570 * name-lookup.c (push_class_level_binding_1): Do overload a new
1571 function with a previous using-declaration.
1573 2021-04-06 Jason Merrill <jason@redhat.com>
1576 * init.c (get_nsdmi): Don't defer access checking.
1578 2021-04-06 Jason Merrill <jason@redhat.com>
1581 * decl.c (cp_finish_decl): mark_needed an implicitly inline
1582 static data member with an out-of-class redeclaration.
1584 2021-04-06 Jason Merrill <jason@redhat.com>
1587 * mangle.c (write_compact_number): Add sanity check.
1588 (write_local_name): Use list_length for parm number.
1590 2021-04-06 Patrick Palka <ppalka@redhat.com>
1593 * pt.c (do_auto_deduction): Don't exit early when deducing the
1594 array type of a structured binding. Also handle adc_decomp_type
1595 during constraint checking.
1597 2021-04-05 Jason Merrill <jason@redhat.com>
1600 * typeck.c (check_return_expr): Call mark_exp_read in dependent
1603 2021-04-05 Jason Merrill <jason@redhat.com>
1606 * typeck.c (build_reinterpret_cast_1): Don't perform
1607 temporary materialization.
1609 2021-04-05 Jason Merrill <jason@redhat.com>
1612 * pt.c (lookup_template_class_1): Do tsubst_enum when
1613 tsubsting a generic lambda.
1615 2021-04-05 Jason Merrill <jason@redhat.com>
1618 * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
1619 there is no enclosing non-lambda function.
1621 2021-04-05 Nathan Sidwell <nathan@acm.org>
1624 * module.cc (name_pending_imports): Drop 'atend' parm. Don't
1625 query export when not needed.
1626 (preprocess_module, preprocessed_module): Adjust.
1628 2021-04-05 Jason Merrill <jason@redhat.com>
1631 * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
1633 2021-04-05 Jason Merrill <jason@redhat.com>
1636 * pt.c (class el_data): Add visited field.
1637 (extract_local_specs): Pass it to cp_walk_tree.
1638 (extract_locals_r): Walk into the body of a lambda.
1640 2021-04-05 Jason Merrill <jason@redhat.com>
1642 * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
1645 2021-04-04 Jason Merrill <jason@redhat.com>
1648 * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
1650 2021-04-03 Marek Polacek <polacek@redhat.com>
1653 * parser.c: Create a GC root for attributes in a decl specifier.
1654 (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
1656 2021-04-03 Jason Merrill <jason@redhat.com>
1659 * pt.c (tsubst_lambda_expr): Skip the body block from
1662 2021-04-03 Jason Merrill <jason@redhat.com>
1665 * cvt.c (can_convert_qual): Check fnptr_conv_p.
1667 2021-04-03 Jason Merrill <jason@redhat.com>
1670 * pt.c (regenerate_decl_from_template): tsubst_decl
1673 2021-04-02 Patrick Palka <ppalka@redhat.com>
1676 * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
1677 to do_auto_deduction.
1679 2021-04-02 Patrick Palka <ppalka@redhat.com>
1682 * semantics.c (finish_compound_literal): Check
1683 template_placeholder_p instead of type_uses_auto.
1685 2021-04-02 Jason Merrill <jason@redhat.com>
1688 * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
1689 * lambda.c (add_capture): Set it.
1690 * pt.c (tsubst_pack_expansion): Handle it.
1692 2021-04-02 Nathan Sidwell <nathan@acm.org>
1694 * cp-tree.h (lang_decl_base): Correct module flag comment.
1695 * module.cc (trees_in::assert_definition): Break out
1697 (trees_out::lang_decl_bools): Do not write purview for header units.
1699 2021-04-01 Marek Polacek <polacek@redhat.com>
1702 * method.c (defaulted_late_check): ++ and -- function_depth around
1703 the call to synthesize_method.
1704 * pt.c: Remove the saved_trees global.
1706 2021-04-01 Jason Merrill <jason@redhat.com>
1710 * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
1711 TYPE_RAISES_EXCEPTIONS.
1713 2021-04-01 Iain Sandoe <iain@sandoe.co.uk>
1715 * mapper-client.cc (INCLUDE_MAP): New; require map to be
1716 included from system.h.
1717 * mapper-resolver.cc (INCLUDE_MAP): Likewise.
1719 2021-04-01 Jason Merrill <jason@redhat.com>
1722 * mangle.c (write_expression): Adjust.
1723 * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
1724 (mark_abi_tags_r): Likewise.
1726 2021-04-01 Nathan Sidwell <nathan@acm.org>
1729 * module.cc (trees_out::decl_node): Adjust importedness reference
1731 (module_state::intercluster_seed): New. Seed both imports and
1732 inter-cluster references. Broken out of ...
1733 (module_state::write_cluster): ... here. Call it.
1735 2021-03-31 Jason Merrill <jason@redhat.com>
1738 * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
1740 2021-03-31 Patrick Palka <ppalka@redhat.com>
1743 * mangle.c (write_expression): Adjust the mangling of
1746 2021-03-31 Patrick Palka <ppalka@redhat.com>
1749 * pt.c (placeholder_type_constraint_dependent_p): Expand
1750 argument packs to separate the first non-pack argument
1753 2021-03-30 Nathan Sidwell <nathan@acm.org>
1756 * module.cc (dumper::operator): Make less brittle.
1757 (trees_out::core_bools): VAR_DECLs always have a context.
1758 (trees_out::key_mergeable): Use same_type_p for asserting.
1759 (trees_in::read_var_def): Propagate
1760 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1762 2021-03-30 Jakub Jelinek <jakub@redhat.com>
1765 * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
1767 2021-03-26 Marek Polacek <polacek@redhat.com>
1770 * method.c (implicitly_declare_fn): Pass &raises to
1771 synthesized_method_walk.
1773 2021-03-26 Nathan Sidwell <nathan@acm.org>
1776 * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
1777 (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
1778 * decl.c (duplicate_decls): Remove template_decl module flag
1780 * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
1781 (dumper::impl::nested_name): Adjust for template-decl module flag
1783 (trees_in::assert_definition): Likewise.
1784 (trees_in::install_entity): Likewise.
1785 (trees_out::decl_value): Likewise. Remove alias template
1786 separation of template and type_decl.
1787 (trees_in::decl_value): Likewise.
1788 (trees_out::key_mergeable): Likewise,
1789 (trees_in::key_mergeable): Likewise.
1790 (trees_out::decl_node): Adjust for template-decl module flag
1792 (depset::hash::make_dependency): Likewise.
1793 (get_originating_module, module_may_redeclare): Likewise.
1794 (set_instantiating_module, set_defining_module): Likewise.
1795 * name-lookup.c (name_lookup::search_adl): Likewise.
1796 (do_pushdecl): Likewise.
1797 * pt.c (build_template_decl): Likewise.
1798 (lookup_template_class_1): Remove special alias_template handling
1799 of DECL_TI_TEMPLATE.
1800 (tsubst_template_decl): Likewise.
1802 2021-03-26 Jakub Jelinek <jakub@redhat.com>
1805 * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
1806 in DECL_EXPR or in BIND_EXPR_VARS.
1808 2021-03-25 Jakub Jelinek <jakub@redhat.com>
1811 * parser.c (cp_parser_postfix_expression): For calls, create
1812 combined_loc and temporarily set input_location to it before
1813 calling finish_call_expr.
1815 2021-03-25 Marek Polacek <polacek@redhat.com>
1818 * call.c (build_over_call): Maybe call mark_used in case
1819 deduce_inheriting_ctor fails and return error_mark_node.
1820 * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
1821 * method.c (deduce_inheriting_ctor): Return bool if the deduction
1823 (implicitly_declare_fn): If raises is error_mark_node, call
1824 synthesized_method_walk with diag being true.
1826 2021-03-25 Jakub Jelinek <jakub@redhat.com>
1829 * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
1830 packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
1832 2021-03-25 Marek Polacek <polacek@redhat.com>
1835 * call.c (build_converted_constant_expr_internal): Don't emit
1836 -Wconversion warnings.
1838 2021-03-25 Jakub Jelinek <jakub@redhat.com>
1841 * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
1843 * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
1846 2021-03-23 Nathan Sidwell <nathan@acm.org>
1849 * name-lookup.c (check_module_override): Set global or partition
1850 DUP on the binding vector.
1852 2021-03-23 Marek Polacek <polacek@redhat.com>
1855 * decl2.c (cp_warn_deprecated_use_scopes): Only call
1856 cp_warn_deprecated_use when decl is a namespace, class, or enum.
1858 2021-03-23 Nathan Sidwell <nathan@acm.org>
1861 * decl.c (duplicate_decls): Remove assert about maybe-imported
1864 2021-03-23 Jakub Jelinek <jakub@redhat.com>
1867 * decl.c (cp_finish_decomp): Diagnose void initializers when
1868 using tuple_element and get.
1870 2021-03-22 Nathan Sidwell <nathan@acm.org>
1873 * module.cc (depset::hash::make_dependency): Propagate flags for
1874 partial specialization.
1875 (module_may_redeclare): Handle partial specialization.
1877 2021-03-22 Nathan Sidwell <nathan@acm.org>
1880 * cp-tree.h (map_context_from, map_context_to): Delete.
1881 (add_mergeable_specialization): Add is_alias parm.
1882 * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
1883 * module.cc (map_context_from, map_context_to): Delete.
1884 (trees_in::decl_value): Add specializations later, adjust call.
1885 Drop useless alias lookup. Set duplicate fn parm context.
1886 (check_mergeable_decl): Drop context mapping.
1887 (trees_in::is_matching_decl): Likewise.
1888 (trees_in::read_function_def): Drop parameter context adjustment
1891 2021-03-22 Martin Liska <mliska@suse.cz>
1894 * module.cc (fini_modules): Call vec_free instead of delete.
1896 2021-03-20 Jakub Jelinek <jakub@redhat.com>
1899 * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
1900 special code, instead call c_genericize_control_stmt.
1902 2021-03-19 Jakub Jelinek <jakub@redhat.com>
1905 * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
1906 INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
1907 don't diagnose it, set *non_constant_p nor return t.
1909 2021-03-19 Marek Polacek <polacek@redhat.com>
1912 * parser.c (cp_parser_requirement_parameter_list): Handle
1915 2021-03-18 Marek Polacek <polacek@redhat.com>
1917 * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
1919 2021-03-18 Marek Polacek <polacek@redhat.com>
1921 * pt.c (tsubst_copy_and_build): Add assert.
1923 2021-03-18 Iain Sandoe <iain@sandoe.co.uk>
1926 * parser.c (cp_debug_parser): Add Objective-C++ message
1928 (cp_parser_nested_name_specifier_opt): Allow colon to
1929 terminate an assignment-expression when parsing Objective-
1931 (cp_parser_objc_message_expression): Set and clear message
1932 parsing state on entry and exit.
1933 * parser.h (struct cp_parser): Add a context flag for
1934 Objective-C++ message state.
1936 2021-03-18 Martin Liska <mliska@suse.cz>
1939 * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
1942 2021-03-17 Marek Polacek <polacek@redhat.com>
1945 * call.c (conv_unsafe_in_template_p): New.
1946 (convert_like): Use it.
1948 2021-03-17 Anthony Sharp <anthonysharp15@gmail.com>
1949 Jason Merrill <jason@redhat.com>
1951 * semantics.c (get_class_access_diagnostic_decl): New
1952 function that examines special cases when a parent
1953 class causes a private access failure.
1954 (enforce_access): Slightly modified to call function
1957 2021-03-16 Jason Merrill <jason@redhat.com>
1959 * tree.c (cp_tree_equal): Use real_identical.
1961 2021-03-16 Jakub Jelinek <jakub@redhat.com>
1964 * decl.c (expand_static_init): For thread guards, call __cxa_atexit
1965 before calling __cxa_guard_release rather than after it. Formatting
1968 2021-03-16 Martin Liska <mliska@suse.cz>
1969 Jason Merrill <jason@redhat.com>
1972 * call.c (get_function_version_dispatcher): Handle
1974 * decl.c (maybe_version_functions): Likewise.
1975 (maybe_mark_function_versioned): New.
1976 * name-lookup.c (push_local_extern_decl_alias): No longer static.
1977 * name-lookup.h (push_local_extern_decl_alias): Adjust.
1979 2021-03-16 Nathan Sidwell <nathan@acm.org>
1982 * module.cc (trees_out::decl_value): Adjust typedef streaming,
1983 indicate whether it is a dependent alias.
1984 (trees_in::decl_value): Likewise. Set as dependent alias, if it
1987 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
1990 * coroutines.cc (expand_one_await_expression): If the
1991 await_ready() expression is not a boolean then convert it
1994 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
1997 * coroutines.cc (build_actor_fn): Make destroy index 1
1998 correspond to the abnormal unhandled_exception() exit.
1999 Substitute the proxy for the resume index.
2000 (coro_rewrite_function_body): Arrange to reset the resume
2001 index and make done = true for a rethrown exception from
2002 unhandled_exception ().
2003 (morph_fn_to_coro): Adjust calls to build_actor_fn and
2004 coro_rewrite_function_body.
2006 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2009 * coroutines.cc (replace_continue): Rewrite continue into
2011 (await_statement_walker): Handle await expressions in the
2012 initializer, condition and iteration expressions of for
2015 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2018 * coroutines.cc (flatten_await_stmt): Allow for the case
2019 where a target expression variable only has uses in the
2020 second part of a compound expression.
2021 (maybe_promote_temps): Avoid emiting empty statements.
2023 2021-03-15 Tobias Burnus <tobias@codesourcery.com>
2026 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
2027 ensure that the varpool node is marked as offloadable.
2029 2021-03-12 Nathan Sidwell <nathan@acm.org>
2032 * module.cc (depset::hash::add_binding_entity): Assert not
2034 (depset::add::add_specializations): Likewise.
2035 * name-lookup.c (name_lookup::dedup): New.
2036 (name_lookup::~name_lookup): Assert not deduping.
2037 (name_lookup::restore_state): Likewise.
2038 (name_lookup::add_overload): Replace outlined code with dedup
2040 (name_lookup::add_value): Likewise.
2041 (name_lookup::search_namespace_only): Likewise.
2042 (name_lookup::adl_namespace_fns): Likewise.
2043 (name_lookup::adl_class_fns): Likewise.
2044 (name_lookup::search_adl): Likewise. Add clearing dedup call.
2045 (name_lookup::search_qualified): Likewise.
2046 (name_lookup::search_unqualified): Likewise.
2048 2021-03-12 Jakub Jelinek <jakub@redhat.com>
2051 * call.c (build_over_call): For immediate evaluation of functions
2052 that return references, undo convert_from_reference effects before
2053 calling cxx_constant_value and call convert_from_reference
2056 2021-03-11 Nathan Sidwell <nathan@acm.org>
2059 * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
2060 when there's a binding vector.
2061 * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
2063 2021-03-11 Nathan Sidwell <nathan@acm.org>
2066 * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
2068 (trees_in::decl_value): Adjust add_mergeable_specialization call.
2069 (trees_out::get_merge_kind): Adjust detecting a partial template
2071 (trees_out::key_mergeable): Adjust handling same.
2072 (trees_in::key_mergeabvle): Likewise.
2074 2021-03-10 Nathan Sidwell <nathan@acm.org>
2077 * module.cc (post_load_processing): Assert not gcable.
2078 (laxy_load_pendings): Extend no-gc region around
2079 post_load_processing.
2081 2021-03-10 Nathan Sidwell <nathan@acm.org>
2084 * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
2085 assembler name to the ns alias.
2087 2021-03-09 Jakub Jelinek <jakub@redhat.com>
2090 * coroutines.cc (build_co_await): Look through NOP_EXPRs in
2091 build_special_member_call return value to find the CALL_EXPR.
2094 2021-03-09 Nathan Sidwell <nathan@acm.org>
2097 * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
2098 that C++20 does not yet imply modules.
2100 2021-03-08 Nathan Sidwell <nathan@acm.org>
2103 * name-lookup.c (get_cxx_dialect_name): Add cxx23.
2105 2021-03-08 Nathan Sidwell <nathan@acm.org>
2107 * lex.c (module_token_filter::resume): Ignore module-decls inside
2109 * parser.c (cp_parser_module_declaration): Reject in header-unit.
2111 2021-03-08 Nathan Sidwell <nathan@acm.org>
2114 * cp-tree.h (match_mergeable_specialization)
2115 (add_mergeable_specialization): Adjust parms.
2116 * module.cc (trees_in::decl_value): Adjust
2117 add_mergeable_specialization calls.
2118 (trees_out::key_mergeable): Adjust match_mergeable_specialization
2120 (specialization_add): Likewise.
2121 * pt.c (match_mergeable_specialization): Do not insert.
2122 (add_mergeable_specialization): Add to hash table here.
2124 2021-03-06 Patrick Palka <ppalka@redhat.com>
2125 Jakub Jelinek <jakub@redhat.com>
2128 * constexpr.c (cxx_eval_increment_expression): Pass lval when
2129 evaluating the MODIFY_EXPR, and update 'mod' with the result of
2130 this evaluation. Check *non_constant_p afterwards. For prefix
2131 ops, just return 'mod'.
2133 2021-03-06 Patrick Palka <ppalka@redhat.com>
2134 Jakub Jelinek <jakub@redhat.com>
2137 * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
2138 variable 'fn' to 'tmpl'. Handle a variable template-id by
2139 calling lookup_template_variable.
2141 2021-03-06 Patrick Palka <ppalka@redhat.com>
2144 * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
2145 outer_targs to do_auto_deduction.
2146 (placeholder_type_constraint_dependent_p): Define.
2147 (do_auto_deduction): When processing_template_decl != 0
2148 and context is adc_unify and we have constraints, pretend the
2149 constraints are satisfied instead of punting. Otherwise don't
2150 punt unless placeholder_type_constraint_dependent_p holds.
2151 Add some clarifying sanity checks. Add a hack to add missing
2152 outermost template levels to outer_args before checking
2153 satisfaction. Don't substitute outer_targs into type if it's
2156 2021-03-05 Marek Polacek <polacek@redhat.com>
2159 * call.c (standard_conversion): When converting pointers to
2160 member, don't return NULL when the bases are equivalent but
2163 2021-03-05 Marek Polacek <polacek@redhat.com>
2166 * name-lookup.c (check_local_shadow): Check if the type of decl
2167 is non-null before checking TYPE_PTR*.
2169 2021-03-05 Nathan Sidwell <nathan@acm.org>
2172 * module.cc (module_state::write_cluster): Relax binding assert.
2174 2021-03-05 Nathan Sidwell <nathan@acm.org>
2177 * pt.c (instantiate_decl): Call set_instantiating_module.
2179 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
2182 * coroutines.cc (build_co_await): Use type_build_ctor_call()
2183 to determine cases when a CTOR needs to be built.
2184 (flatten_await_stmt): Likewise.
2185 (morph_fn_to_coro): Likewise.
2187 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
2190 * coroutines.cc (coro_diagnose_throwing_fn): New helper.
2191 (coro_diagnose_throwing_final_aw_expr): New helper.
2192 (build_co_await): Diagnose throwing final await expression
2194 (build_init_or_final_await): Diagnose a throwing promise
2195 final_suspend() call.
2197 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
2200 * coroutines.cc (struct param_info): Track parameter copies that need
2202 (coro_get_frame_dtor): New helper function factored from build_actor().
2203 (build_actor_fn): Use coro_get_frame_dtor().
2204 (morph_fn_to_coro): Track parameters that need DTORs on exception,
2205 likewise the frame promise and the return object. On exception, run the
2206 DTORs for these, destroy the frame and then rethrow the exception.
2208 2021-03-05 Nathan Sidwell <nathan@acm.org>
2211 * pt.c (instantiate_class_template_1): Set instantiating module
2214 2021-03-05 Tobias Burnus <tobias@codesourcery.com>
2217 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
2219 2021-03-04 Jakub Jelinek <jakub@redhat.com>
2223 * cvt.c (convert_to_void): Revert 2019-10-17 changes. Clarify
2226 2021-03-04 Nathan Sidwell <nathan@acm.org>
2229 * module.cc (class uintset): Delete.
2230 (typedef attached_map_t): A hash map.
2231 (attached_table): Use attached_map_t. Adjust uses ...
2232 (trees_out::decl_value, trees_in::decl_value): ... here ...
2233 (trees_out::key_mergeable): ... here ...
2234 (trees_in::key_mergeable): ... here ...
2235 (maybe_attach_decl): ... here ...
2236 (direct_import): ... and here.
2238 2021-03-04 Nathan Sidwell <nathan@acm.org>
2242 * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
2244 * module.cc (class pending_key): New.
2245 (default_hash_traits<pending_key>): New specialization.
2246 (pending_map_t): New typedef.
2247 (pending_table): Replace old table.
2248 (trees_out::lang_decl_bools): Adjust.
2249 (trees_in::lang_decl_bools): Adjust.
2250 (trees_in::install_entity): Drop pending member and specialization
2252 (find_pending_key): New.
2253 (depset::hash::fiund_dependencies): Use it.
2254 (pendset_lazy_load): Delete.
2255 (module_state::write_cluster): Don't count pendings here. Bye
2256 Duff's device-like thing.
2257 (module_state::write_pendings): Reimplement.
2258 (module_state::read_pendings): Reimplement.
2259 (lazy_specializations_p): Delete.
2260 (module_state::write): Adjust write_pendings call.
2261 (lazy_load_pendings): New.
2262 (lazy_load_specializations): Delete.
2263 (lazy_load_members): Delete.
2264 (init_modules): Adjust.
2265 * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
2266 not lazy_load_members.
2267 (note_pending_specializations): Delete.
2268 (load_pending_specializations): Delete.
2269 * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
2270 (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
2271 (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
2272 (note_pending_specializations): Delete.
2273 (load_pending_specializations): Delete.
2274 * pt.c (lookup_template_class_1): Call lazy_load_pendings not
2275 lazy_load_specializations.
2276 (instantiate_template_class_1): Likewise.
2277 (instantiate_decl): Call lazy_load_pendings.
2278 * typeck.c (complete_type): Likewise.
2280 2021-03-03 Nathan Sidwell <nathan@acm.org>
2283 * module.cc (post_load_decls): New.
2284 (lazy_snum, recursive_lazy): Move earlier.
2285 (module_state::read_cluster): Push cloning onto post_load_decls.
2286 (post_load_processing): New. Do the cloning here.
2287 (module_state::read_inits): Call post_load_processing.
2288 (module_state::read_language): Likewise.
2289 (lazy_load_binding, lazy_load_specializations): Likewise
2290 (lazy_load_members): Likewise
2292 2021-03-03 Nathan Sidwell <nathan@acm.org>
2295 * module.cc (trees_out::decl_value): Stream specialization keys
2297 (trees_in::decl_value): Stream them back and insert after
2298 completing the decl.
2299 (trees_out::key_mergeable): Drop some streaming here ...
2300 (trees_in::key_mergeable): ... and here. Don't insert into
2301 specialization tables.
2303 2021-03-03 Patrick Palka <ppalka@redhat.com>
2305 * constraint.cc (struct sat_info): Document the different
2306 meanings of noisy() and diagnose_unsatisfaction_p() during
2307 satisfaction and requires-expression evaluation.
2308 (tsubst_valid_expression_requirement): Take a sat_info instead
2309 of a subst_info. Perform the substitution quietly first. Fold
2310 in error-replaying code from diagnose_valid_expression.
2311 (tsubst_simple_requirement): Take a sat_info instead of a
2313 (tsubst_type_requirement_1): New. Fold in error-replaying code
2314 from diagnose_valid_type.
2315 (tsubst_type_requirement): Use the above. Take a sat_info
2316 instead of a subst_info.
2317 (tsubst_compound_requirement): Likewise. Fold in
2318 error-replaying code from diagnose_compound_requirement.
2319 (tsubst_nested_requirement): Take a sat_info instead of a
2320 subst_info. Fold in error-replaying code from
2321 diagnose_nested_requirement.
2322 (tsubst_requirement): Take a sat_info instead of a subst_info.
2323 (tsubst_requires_expr): Split into two versions, one that takes
2324 a sat_info argument and another that takes a complain and
2325 in_decl argument. Remove outdated documentation. Document the
2326 effects of the sat_info argument. Don't short-circuit
2327 processing of requirements when diagnosing unsatisfaction,
2328 mirroring diagnose_requires_expr.
2329 (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
2330 assert, and se the three-parameter version of tsubst_requires_expr.
2331 (diagnose_trait_expr): Make static. Take a template argument
2332 vector instead of a parameter mapping.
2333 (diagnose_valid_expression): Remove.
2334 (diagnose_valid_type): Remove.
2335 (diagnose_simple_requirement): Remove.
2336 (diagnose_compound_requirement): Remove.
2337 (diagnose_type_requirement): Remove.
2338 (diagnose_nested_requirement): Remove.
2339 (diagnose_requirement): Remove.
2340 (diagnose_requires_expr): Remove.
2341 (diagnose_atomic_constraint): Take a sat_info instead of a
2342 subst_info. Adjust call to diagnose_trait_expr. Call
2343 tsubst_requires_expr instead of diagnose_requires_expr.
2344 (diagnose_constraints): Remove special casing of REQUIRES_EXPR
2345 and just always call constraint_satisfaction_value.
2347 2021-03-03 Patrick Palka <ppalka@redhat.com>
2349 * constexpr.c (cxx_eval_call_expression): Adjust call to
2350 evaluate_concept_check.
2351 (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
2352 evaluate_requires_expression instead of
2353 satisfy_constraint_expression.
2354 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
2355 * constraint.cc (struct sat_info): Adjust comment about which
2356 satisfaction entrypoints use noisy-unsat.
2357 (normalize_template_requirements): Remove (and adjust callers
2359 (normalize_nontemplate_requirements): Likewise.
2360 (tsubst_nested_requirement): Use constraint_satisfaction_value
2361 instead of satisfy_constraint_expression, which'll do the
2362 noisy replaying of ill-formed quiet satisfaction for us.
2363 (decl_satisfied_cache): Adjust comment.
2364 (satisfy_constraint): Rename to ...
2365 (satisfy_normalized_constraints): ... this.
2366 (satisfy_associated_constraints): Remove (and make its
2367 callers check for dependent arguments).
2368 (satisfy_constraint_expression): Rename to ...
2369 (satisfy_nondeclaration_constraints): ... this. Assert that
2370 'args' is empty when 't' is a concept-id. Removing handling
2371 bare constraint-expressions, and handle REQUIRES_EXPRs
2372 specially. Adjust comment accordingly.
2373 (satisfy_declaration_constraints): Assert in the two-parameter
2374 version that 't' is not a TEMPLATE_DECL. Adjust following
2375 removal of normalize_(non)?template_requirements and
2376 satisfy_asociated_constraints.
2377 (constraint_satisfaction_value): Combine the two- and
2378 three-parameter versions in the natural way.
2379 (constraints_satisfied_p): Combine the one- and two-parameter
2380 versions in the natural way. Improve documentation.
2381 (evaluate_requires_expr): Define.
2382 (evaluate_concept_check): Remove 'complain' parameter. Use
2383 constraint_satisfaction_value instead of
2384 satisfy_constraint_expression.
2385 (diagnose_nested_requirement): Adjust following renaming of
2386 satisfy_constraint_expression.
2387 (diagnose_constraints): Handle REQUIRES_EXPR by going through
2388 diagnose_requires_expr directly instead of treating it as a
2389 constraint-expression. Improve documentation.
2390 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
2391 to evaluate_concept_check.
2392 <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
2393 constraints_satisfied_p.
2394 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
2395 * cp-tree.h (evaluate_requires_expr): Declare.
2396 (evaluate_concept_check): Remove tsubst_flag_t parameter.
2397 (satisfy_constraint_expression): Remove declaration.
2398 (constraints_satisfied_p): Remove one-parameter declaration.
2399 Add a default argument to the two-parameter declaration.
2400 * cvt.c (convert_to_void): Adjust call to
2401 evaluate_concept_check.
2403 2021-03-03 Jakub Jelinek <jakub@redhat.com>
2406 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
2409 2021-03-03 Marek Polacek <polacek@redhat.com>
2413 * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
2414 (maybe_aggr_guide): Use the original template type where needed. In
2415 a class member template, partially instantiate the result of
2416 collect_ctor_idx_types.
2417 (do_class_deduction): Defer the deduction until the enclosing
2418 scope is non-dependent.
2420 2021-03-03 Jason Merrill <jason@redhat.com>
2423 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
2424 if it didn't get one before.
2426 2021-03-03 Nathan Sidwell <nathan@acm.org>
2429 * module.cc (trees_out::decl_node): Small refactor.
2430 (depset::hash::add_binding_entity): Return true on meeting an
2431 import. Set namespace's import here.
2432 (module_state:write_namespaces): Inform of purview too.
2433 (module_state:read_namespaces): Adjust.
2434 * name-lookup.c (implicitly_export_namespace): Delete.
2435 (do_pushdecl): Don't call it.
2436 (push_namespace): Likewise, set purview.
2437 (add_imported_namespace): Reorder parms.
2438 * name-lookup.h (add_imported_namespace): Alter param ordering.
2440 2021-03-02 Martin Sebor <msebor@redhat.com>
2443 * class.c (build_base_path): Call build_if_nonnull.
2444 * cp-tree.h (build_if_nonnull): Declare.
2445 * rtti.c (ifnonnull): Rename...
2446 (build_if_nonnull): ...to this. Set no-warning bit on COND_EXPR.
2447 (build_dynamic_cast_1): Adjust to name change.
2449 2021-03-02 Patrick Palka <ppalka@redhat.com>
2453 * constraint.cc (type_deducible_p): Don't substitute into the
2454 constraints, and instead just pass 'args' to do_auto_deduction
2455 as the outer template arguments.
2456 (tsubst_parameter_mapping): Remove confused code for handling
2457 placeholder type arguments.
2458 (normalize_placeholder_type_constraint): Define.
2459 (satisfy_constraint_expression): Use it to handle placeholder
2461 * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
2462 (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
2463 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
2464 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
2465 (make_constrained_placeholder_type): Set
2466 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
2467 (do_auto_deduction): Clarify comments about the outer_targs
2468 parameter. Rework satisfaction of a placeholder type constraint
2469 to pass in the complete set of template arguments directly to
2470 constraints_satisfied_p.
2471 (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
2472 instead. Also rebuild the the constraint info on the new auto.
2474 2021-03-02 Patrick Palka <ppalka@redhat.com>
2476 * constraint.cc (build_parameter_mapping): Rely on the caller to
2477 determine the in-scope template parameters.
2478 (norm_info::norm_info): Delegate the tsubst_flags_t constructor
2479 to the two-parameter constructor. In the two-parameter
2480 constructor, fold in the definition of make_context, set
2481 initial_parms appropriately, and don't set the now-removed
2483 (norm_info::make_context): Remove, now that its only use is
2484 inlined into the caller.
2485 (norm_info::update_context): Adjust call to
2486 build_parameter_mapping to pass in the relevant set of in-scope
2487 template parameters.
2488 (norm_info::ctx_parms): Define this member function.
2489 (norm_info::context): Initialize to NULL_TREE.
2490 (norm_info::orig_decl): Remove this data member.
2491 (norm_info::initial_parms): Define this data member.
2492 (normalize_atom): Adjust call to build_parameter_mapping to pass
2493 in the relevant set of in-scope template parameters. Use
2494 info.initial_parms instead of info.orig_decl.
2495 (normalize_constraint_expression): Take a norm_info object
2496 instead of a bool. Cache the result of normalization.
2497 (tsubst_nested_requirement): Call satisfy_constraint_expression
2498 instead of satisfy_constraint, so that we normalize on demand.
2499 (satisfy_constraint_expression): Handle a NESTED_REQ argument.
2500 Adjust call to normalize_constraint_expression.
2501 (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
2502 to current_template_parms.
2503 (diagnose_nested_requirements): Go through
2504 satisfy_constraint_expression, as with tsubst_nested_requirement.
2506 2021-03-02 Patrick Palka <ppalka@redhat.com>
2508 * constraint.cc (tsubst_parameter_mapping): Canonicalize the
2509 arguments of a substituted TYPE_ARGUMENT_PACK even if we've
2510 started with a TYPE_ARGUMENT_PACK.
2511 (finish_requires_expr): Don't set DECL_CONTEXT and
2512 CONSTRAINT_VAR_P on each of the introduced parameters here.
2513 * parser.c (cp_parser_requirement_parameter_list): Instead set
2514 these fields earlier, here.
2515 * pt.c (do_auto_deduction): Canonicalize the result of
2516 do_auto_deduction. Pass 'complain' to finish_decltype_type.
2518 2021-03-02 Patrick Palka <ppalka@redhat.com>
2520 * constraint.cc (tsubst_simple_requirement): Just return
2521 boolean_true_node on success.
2522 (tsubst_type_requirement): Likewise.
2523 (tsubst_compound_requirement): Likewise.
2524 (tsubst_nested_requirement): Likewise.
2525 (tsubst_requirement_body): Remove.
2526 (check_constaint_variables): Rename to ...
2527 (check_constraint_variables): ... this.
2528 (tsubst_constraint_variables): Adjust.
2529 (tsubst_requires_expr): Fold tsubst_requirement_body into here.
2531 2021-03-01 Nathan Sidwell <nathan@acm.org>
2534 * class.c (fixup_type_variants): Propagate mode, precision,
2535 alignment & emptiness.
2536 * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
2537 (trees_in::tree_node): Rematerialize alignment here.
2539 2021-02-27 Jason Merrill <jason@redhat.com>
2542 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
2545 2021-02-26 Jakub Jelinek <jakub@redhat.com>
2547 * parser.c (cp_parser_lambda_declarator_opt): Implement
2548 P1102R2 - Down with ()! Make ()s optional before lambda specifiers
2549 for -std={c,gnu}++2b or with pedwarn in earlier versions.
2551 2021-02-26 Jakub Jelinek <jakub@redhat.com>
2554 * lambda.c (is_lambda_ignored_entity): Before checking for
2555 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check.
2557 2021-02-26 Jason Merrill <jason@redhat.com>
2560 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
2561 to a class non-type template argument that needs it.
2563 2021-02-26 Patrick Palka <ppalka@redhat.com>
2566 * pt.c (splice_late_return_type): Rebuild the entire return type
2567 if we have to adjust the level of an auto within.
2568 (type_uses_auto): Adjust call to find_type_usage.
2569 * type-utils.h (find_type_usage): Revert r10-6571 change that
2570 made this function return a pointer to the auto node.
2572 2021-02-25 Patrick Palka <ppalka@redhat.com>
2576 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
2577 TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
2579 2021-02-25 Patrick Palka <ppalka@redhat.com>
2582 * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
2583 (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
2585 2021-02-25 Marek Polacek <polacek@redhat.com>
2589 * constexpr.c (is_std_construct_at): New overload.
2590 (is_std_allocator_allocate): New overload.
2591 (cxx_eval_call_expression): Use the new overloads.
2592 (cxx_eval_constant_expression): Reject casting
2593 from void * as per DR 1312. Don't check can_convert.
2595 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
2598 * coroutines.cc (struct param_info): Track rvalue refs.
2599 (morph_fn_to_coro): Track rvalue refs, and call the promise
2600 CTOR with the frame copy of passed parms.
2602 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
2605 * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
2606 set throwing_cleanup marker.
2608 2021-02-25 Nathan Sidwell <nathan@acm.org>
2611 * module.cc (module_state::inform_cmi_p): Renamed field.
2612 (module_state::do_import): Adjust.
2613 (init_modules, finish_module_processing): Likewise.
2614 (handle_module_option): Likewise.
2616 2021-02-25 Nathan Sidwell <nathan@acm.org>
2619 * mapper-client.cc (module_client::open_module_client): Fix typo
2622 2021-02-24 Nathan Sidwell <nathan@acm.org>
2625 * module.cc (ool): New indirection vector.
2626 (loc_spans::maybe_propagate): Location is not optional.
2627 (loc_spans::open): Likewise. Assert monotonically advancing.
2628 (module_for_ordinary_loc): Use ool indirection vector.
2629 (module_state::write_prepare_maps): Do not count empty macro
2630 expansions. Elide empty spans.
2631 (module_state::write_macro_maps): Skip empty expansions.
2632 (ool_cmp): New qsort comparator.
2633 (module_state::write): Create and destroy ool vector.
2634 (name_pending_imports): Fix dump push/pop.
2635 (preprocess_module): Likewise. Add more dumping.
2636 (preprocessed_module): Likewise.
2638 2021-02-24 Iain Sandoe <iain@sandoe.co.uk>
2641 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
2642 error reporting when instantiating for a constexpr.
2644 2021-02-23 Nathan Sidwell <nathan@acm.org>
2647 * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
2650 2021-02-23 Patrick Palka <ppalka@redhat.com>
2653 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
2654 over from tsubst_copy.
2656 2021-02-23 Patrick Palka <ppalka@redhat.com>
2658 * pt.c (instantiation_dependent_expression_p): Check
2659 processing_template_decl before calling
2660 potential_constant_expression.
2662 2021-02-22 Nathan Sidwell <nathan@acm.org>
2665 * module.cc (struct module_state): Add visited_p flag.
2666 (name_pending_imports): Use it to avoid duplicate requests.
2667 (preprocess_module): Don't read preprocessor state if we failed to
2668 load a module's config.
2670 2021-02-22 Nathan Sidwell <nathan@acm.org>
2673 * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
2675 * module.cc (set_defining_module): Add assert.
2677 2021-02-19 Nathan Sidwell <nathan@acm.org>
2680 * module.cc (pending_imports): New.
2681 (declare_module): Adjust test condition.
2682 (name_pending_imports): New.
2683 (preprocess_module): Reimplement using pending_imports.
2684 (preprocessed_module): Move name-getting to name_pending_imports.
2685 * name-lookup.c (append_imported_binding_slot): Assert module
2686 ordering is increasing.
2688 2021-02-19 Nathan Sidwell <nathan@acm.org>
2690 * module.cc (note_cmis): New.
2691 (struct module_state): Add inform_read_p bit.
2692 (module_state::do_import): Inform of CMI location, if enabled.
2693 (init_modules): Canonicalize note_cmis entries.
2694 (handle_module_option): Handle -flang-info-module-read=FOO.
2696 2021-02-19 Jason Merrill <jason@redhat.com>
2699 * call.c (perfect_conversion_p): Limit rvalueness
2700 test to reference bindings.
2702 2021-02-19 Jason Merrill <jason@redhat.com>
2705 * call.c (perfect_conversion_p): New.
2706 (perfect_candidate_p): New.
2707 (add_candidates): Ignore templates after a perfect non-template.
2709 2021-02-18 Nathan Sidwell <nathan@acm.org>
2712 * module.cc (canonicalize_header_name): Use
2713 cpp_probe_header_unit.
2714 (maybe_translate_include): Fix note_includes comparison.
2715 (init_modules): Fix note_includes string termination.
2717 2021-02-18 Jakub Jelinek <jakub@redhat.com>
2720 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
2721 cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
2722 for immediate function calls.
2724 2021-02-17 Nathan Sidwell <nathan@acm.org>
2727 * module.cc (struct macro_export): Add GTY markers.
2728 (macro_exports): Likewise, us a va_gc Vector.
2730 2021-02-17 Jakub Jelinek <jakub@redhat.com>
2733 * init.c (build_zero_init_1): For flexible array members just return
2734 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
2737 2021-02-17 Nathan Sidwell <nathan@acm.org>
2740 * name-lookup.c (do_pushdecl): Don't peek under template_parm
2742 (set_identifier_type_value_with_scope): ... or here.
2743 (do_pushtag): Only set_identifier_type_value_with_scope at
2744 non-class template parm scope, and use parent scope.
2746 2021-02-17 Nathan Sidwell <nathan@acm.org>
2749 * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
2752 2021-02-17 Patrick Palka <ppalka@redhat.com>
2756 * tree.c (build_aggr_init_expr): Revert r10-7718 change.
2758 2021-02-12 Nathan Sidwell <nathan@acm.org>
2760 * module.cc (module_state::write_cluster): Check bindings for
2761 imported using-decls.
2763 2021-02-12 Nathan Sidwell <nathan@acm.org>
2766 * module.cc (trees_in::decl_value): Call add_module_namespace_decl
2767 for new namespace-scope entities.
2768 (module_state::read_cluster): Don't call add_module_decl here.
2769 * name-lookup.h (add_module_decl): Rename to ...
2770 (add_module_namespace_decl): ... this.
2771 * name-lookup.c (newbinding_bookkeeping): Move into ...
2772 (do_pushdecl): ... here. Its only remaining caller.
2773 (add_module_decl): Rename to ...
2774 (add_module_namespace_decl): ... here. Add checking-assert for
2775 circularity. Don't call newbinding_bookkeeping, just extern_c
2776 checking and incomplete var checking.
2778 2021-02-12 Nathan Sidwell <nathan@acm.org>
2782 * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
2783 (global_type_node): Delete.
2784 (IDENTIFIER_TYPE_VALUE): Delete.
2785 (IDENTIFIER_HAS_TYPE_VALUE): Delete.
2786 (get_type_value): Delete.
2787 * name-lookup.h (identifier_type_value): Delete.
2788 * name-lookup.c (check_module_override): Don't
2789 SET_IDENTIFIER_TYPE_VALUE here.
2790 (do_pushdecl): Nor here.
2791 (identifier_type_value_1, identifier_type_value): Delete.
2792 (set_identifier_type_value_with_scope): Only
2793 SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
2794 (pushdecl_nanmespace_level): Remove shadow stack nadgering.
2795 (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
2796 * call.c (check_dtor_name): Use lookup_name.
2797 * decl.c (cxx_init_decl_processing): Drop global_type_node.
2798 * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
2800 * init.c (get_type_value): Delete.
2801 * pt.c (instantiate_class_template_1): Don't call pushtag or
2802 SET_IDENTIFIER_TYPE_VALUE here.
2803 (tsubst): Assert never an identifier.
2804 (dependent_type_p): Drop global_type_node assert.
2805 * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
2806 to determine ctorness.
2808 2021-02-12 Jakub Jelinek <jakub@redhat.com>
2811 * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
2814 2021-02-12 Jason Merrill <jason@redhat.com>
2818 * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
2819 (register_parameter_specializations): Not here.
2821 2021-02-11 Marek Polacek <polacek@redhat.com>
2824 * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
2825 for the partial instantiation.
2827 2021-02-11 Jakub Jelinek <jakub@redhat.com>
2830 * init.c (build_zero_init_1): Handle zero initialiation of
2831 flexible array members like initialization of [0] arrays.
2832 Use integer_minus_onep instead of comparison to integer_minus_one_node
2833 and integer_zerop instead of comparison against size_zero_node.
2836 2021-02-11 Marek Polacek <polacek@redhat.com>
2839 * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
2841 2021-02-11 Patrick Palka <ppalka@redhat.com>
2844 * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
2845 lookup result by discarding it if the first element is a
2846 class-scope declaration, otherwise return it.
2847 (push_operator_bindings): Handle an ambiguous lookup result by
2848 doing push_local_binding on each element in the list.
2850 2021-02-11 Marek Polacek <polacek@redhat.com>
2852 * parser.c (cp_parser_selection_statement): Use vec_free.
2854 2021-02-10 Jakub Jelinek <jakub@redhat.com>
2858 * constexpr.c: Include cgraph.h.
2859 (cxx_eval_call_expression): Call varpool_node::finalize_decl on
2860 heap artificial vars.
2861 (cxx_eval_outermost_constant_expr): Remove varpool nodes for
2862 heap artificial vars.
2864 2021-02-10 Nathan Sidwell <nathan@acm.org>
2867 * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
2868 answer if there's no local specialization.
2870 2021-02-09 Nathan Sidwell <nathan@acm.org>
2873 * module.cc (module_state::is_rooted): Rename to ...
2874 (module_state::has_location): ... here. Adjust callers.
2875 (module_state::read_partitions): Adjust validity check.
2876 Don't overwrite a known location.
2878 2021-02-09 Jason Merrill <jason@redhat.com>
2881 * pt.c (mark_decl_instantiated): Exit early if consteval.
2883 2021-02-09 Jason Merrill <jason@redhat.com>
2887 * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
2890 2021-02-09 Jason Merrill <jason@redhat.com>
2894 * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
2897 2021-02-08 Nathan Sidwell <nathan@acm.org>
2899 * decl.c (start_cleanup_fn): Push function into
2902 2021-02-08 Nathan Sidwell <nathan@acm.org>
2905 * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
2906 * decl.c (push_abi_namespace, pop_abi_namespace): Moved
2907 from rtti.c, add default namespace arg.
2908 (check_redeclaration_exception_specification): Allow a lazy
2909 builtin's eh spec to differ from an lready-declared user
2911 (declare_global_var): Use push/pop_abi_namespace.
2912 (get_atexit_node): Push the fndecl into a namespace.
2913 * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
2916 2021-02-08 Marek Polacek <polacek@redhat.com>
2918 * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
2920 2021-02-05 Marek Polacek <polacek@redhat.com>
2923 * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
2925 * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
2926 issuing the -Wvolatile warning. Only set TREE_THIS_VOLATILE if
2927 a warning was emitted.
2929 2021-02-05 Marek Polacek <polacek@redhat.com>
2932 * name-lookup.c (lookup_using_decl): Hoist the destructor check.
2934 2021-02-05 Jakub Jelinek <jakub@redhat.com>
2937 * decl.c (check_array_initializer): For structured bindings, require
2938 the array type to be complete.
2940 2021-02-04 Jason Merrill <jason@redhat.com>
2943 * constraint.cc (build_concept_check_arguments): Remove assert.
2944 (build_concept_check): Allow empty args.
2946 2021-02-04 Tom Greenslade (thomgree) <thomgree@cisco.com>
2949 * call.c (can_convert_array): Extend to handle all valid aggregate
2950 initializers of an array; including by string literals, not just by
2952 (build_aggr_conv): Call can_convert_array more often, not just in
2953 brace-init-list case.
2954 * typeck2.c (array_string_literal_compatible_p): New function.
2955 (digest_init_r): call array_string_literal_compatible_p
2956 * cp-tree.h: (array_string_literal_compatible_p): Declare.
2958 2021-02-04 Jason Merrill <jason@redhat.com>
2961 * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
2963 2021-02-04 Jason Merrill <jason@redhat.com>
2966 * pt.c (tsubst_attribute): Handle error.
2967 (apply_late_template_attributes): Return false on error.
2968 (tsubst_function_decl): Check its return value.
2969 (tsubst_decl): Likewise.
2970 (push_template_decl): Assert current_template_parms.
2971 (tsubst_template_decl): Set current_template_parms.
2973 2021-02-03 Marek Polacek <polacek@redhat.com>
2976 * call.c (struct z_candidate): Mark rewritten and reversed as const.
2977 (struct NonPublicField): Mark operator() as const.
2978 (struct NonTrivialField): Likewise.
2980 2021-02-03 Jason Merrill <jason@redhat.com>
2984 * pt.c (spec_hasher::equal): Set processing_template_decl.
2985 * Make-lang.in (check-g++-strict-gc): Add --param
2986 hash-table-verification-limit=10000.
2988 2021-02-03 Marek Polacek <polacek@redhat.com>
2991 * parser.c (cp_parser_class_specifier_1): Use any possible
2992 DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
2993 (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
2994 * pt.c (tsubst_exception_specification): Stash new_specs into
2995 DEFPARSE_INSTANTIATIONS.
2996 * tree.c (fixup_deferred_exception_variants): Use
2997 UNPARSED_NOEXCEPT_SPEC_P.
2999 2021-02-02 Jason Merrill <jason@redhat.com>
3003 * error.c (dump_expr): Ignore dummy object.
3004 * pt.c (tsubst_baselink): Handle dependent scope.
3006 2021-02-01 Patrick Palka <ppalka@redhat.com>
3009 * constexpr.c (cxx_eval_array_reference): Also set
3010 new_ctx.object when setting new_ctx.ctor.
3012 2021-02-01 Marek Polacek <polacek@redhat.com>
3015 * parser.c (cp_parser_has_attribute_expression): Use
3016 uses_template_parms instead of type_dependent_expression_p.
3018 2021-02-01 Jason Merrill <jason@redhat.com>
3021 * cp-tree.h: Declare it.
3022 * pt.c (comparing_dependent_aliases): New flag.
3023 (template_args_equal, spec_hasher::equal): Set it.
3024 (dependent_alias_template_spec_p): Assert that we don't
3025 get non-types other than error_mark_node.
3026 (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
3027 on complex alias specializations. Set TYPE_DEPENDENT_P here.
3028 (tsubst_decl): Not here.
3029 * module.cc (module_state::read_cluster): Set
3030 comparing_dependent_aliases instead of
3031 comparing_specializations.
3032 * tree.c (cp_tree_equal): Remove comparing_specializations
3034 * typeck.c (structural_comptypes): Adjust.
3035 (comptypes): Remove comparing_specializations handling.
3037 2021-01-29 Nathan Sidwell <nathan@acm.org>
3040 * module.cc (module_state_config): Add num_entities field.
3041 (module_state::read_entities): The entity_ary span is
3043 (module_state::write_config): Write num_entities.
3044 (module_state::read_config): Read num_entities.
3045 (module_state::write): Set config's num_entities.
3046 (module_state::read_initial): Allocate the entity ary
3048 (module_state::read_language): Do not set entity_lwm
3051 2021-01-29 Marek Polacek <polacek@redhat.com>
3054 * parser.c (cp_parser_class_name): If parser->scope is
3055 error_mark_node, return it, otherwise continue.
3057 2021-01-28 Jakub Jelinek <jakub@redhat.com>
3060 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
3062 2021-01-28 Jakub Jelinek <jakub@redhat.com>
3066 * decl.c (cp_finish_decl): For register vars with asmspec in templates
3067 call set_user_assembler_name and set DECL_HARD_REGISTER.
3068 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
3069 pass asmspec_tree to cp_finish_decl.
3071 2021-01-28 Nathan Sidwell <nathan@acm.org>
3074 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
3076 (trees_in::decl_value): Do typedef frobbing only when installing
3077 a new typedef, adjust is_matching_decl call. Swap is_typedef
3079 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
3080 names and deal with typedef checking.
3082 2021-01-27 Jason Merrill <jason@redhat.com>
3085 * name-lookup.c (lookup_using_decl): Clean up handling
3086 of dependency and inherited constructors.
3087 (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
3088 * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
3090 2021-01-26 Jason Merrill <jason@redhat.com>
3093 * call.c (type_passed_as): Don't mark invisiref restrict.
3095 2021-01-26 Jason Merrill <jason@redhat.com>
3099 * class.c (layout_class_type): An empty field gets size 0.
3100 (is_empty_field): New.
3101 (check_bases): Check it.
3102 * cp-tree.h (is_empty_field): Declare it.
3103 * constexpr.c (cxx_eval_store_expression): Check it.
3104 (cx_check_missing_mem_inits): Likewise.
3105 * init.c (perform_member_init): Likewise.
3106 * typeck2.c (process_init_constructor_record): Likewise.
3108 2021-01-25 Martin Sebor <msebor@redhat.com>
3111 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
3113 2021-01-25 Jason Merrill <jason@redhat.com>
3116 * constexpr.c (get_or_insert_ctor_field): Add check.
3117 (cxx_eval_store_expression): Handle discontinuity of refs.
3119 2021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
3121 * call.c (complain_about_access): Altered function.
3122 * cp-tree.h (complain_about_access): Changed parameters of function.
3123 (get_parent_with_private_access): Declared new function.
3124 * search.c (get_parent_with_private_access): Defined new function.
3125 * semantics.c (enforce_access): Modified function.
3126 * typeck.c (complain_about_unrecognized_member): Updated function
3127 arguments in complain_about_access.
3129 2021-01-23 Patrick Palka <ppalka@redhat.com>
3132 * cp-tree.h (shared_member_p): Adjust declaration.
3133 * parser.c (cp_parser_init_declarator): If the storage class
3134 specifier is sc_static, pass true for static_p to
3135 cp_parser_declarator.
3136 (cp_parser_direct_declarator): Don't do inject_this_parm when
3137 the declarator is a friend.
3138 * search.c (shared_member_p): Change return type to bool and
3139 adjust function body accordingly. Return false for a dependent
3140 USING_DECL instead of aborting.
3141 * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
3142 even when type-dependent.
3144 2021-01-22 Marek Polacek <polacek@redhat.com>
3147 * parser.c (inject_parm_decls): Remove a redundant assignment.
3148 (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
3149 before calling inject_parm_decls.
3151 2021-01-22 Jason Merrill <jason@redhat.com>
3154 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
3156 2021-01-22 Jakub Jelinek <jakub@redhat.com>
3159 * init.c (build_zero_init_1): Revert the 2018-03-06 change to
3160 return build_zero_cst for reference types.
3161 * typeck2.c (process_init_constructor_record): Instead call
3162 build_zero_cst here during error recovery instead of build_zero_init.
3164 2021-01-22 Marek Polacek <polacek@redhat.com>
3167 * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
3168 warnings regardless of abi_version_at_least.
3169 (write_expression): When the expression is a dependent name
3170 and an operator name, write "on" before writing its name.
3172 2021-01-22 Marek Polacek <polacek@redhat.com>
3175 * pt.c (instantiate_class_template_1): Instantiate members
3176 marked with attribute used only after we're done instantiating
3179 2021-01-21 Patrick Palka <ppalka@redhat.com>
3182 * semantics.c (finish_decltype_type): Set up a cp_unevaluated
3183 sentinel at the start of the function. Remove a now-redundant
3184 manual adjustment of cp_unevaluated_operand.
3186 2021-01-21 Nathan Sidwell <nathan@acm.org>
3189 * module.cc (depset::hash::find_dependencies): Add
3191 (trees_out::core_vals): Check state before calling
3193 (sort_cluster, module_state::write): Adjust
3194 find_dependencies call.
3196 2021-01-21 Jakub Jelinek <jakub@redhat.com>
3199 * constexpr.c (check_for_return_continue_data): Add break_stmt member.
3200 (check_for_return_continue): Also look for BREAK_STMT. Handle
3201 SWITCH_STMT by ignoring break_stmt from its body.
3202 (potential_constant_expression_1) <case FOR_STMT>,
3203 <case WHILE_STMT>: If the condition isn't constant true, check if
3204 the loop body can contain a return stmt.
3205 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
3206 <case IF_STMT>: If recursion with tf_none is successful,
3207 merge *jump_target from the branches - returns with highest priority,
3208 breaks or continues lower. If then branch is potentially constant and
3209 doesn't return, check the else branch if it could return, break or
3212 2021-01-21 Nathan Sidwell <nathan@acm.org>
3215 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
3217 2021-01-20 Nathan Sidwell <nathan@acm.org>
3219 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
3222 2021-01-20 Patrick Palka <ppalka@redhat.com>
3225 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
3226 CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
3227 adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
3229 2021-01-20 Patrick Palka <ppalka@redhat.com>
3232 * parser.c (cp_parser_class_head): Defer access checking when
3233 parsing the base-clause until all bases are seen and attached
3235 * pt.c (instantiate_class_template): Likewise when substituting
3236 into dependent bases.
3238 2021-01-20 Jakub Jelinek <jakub@redhat.com>
3241 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
3242 error_operand_p, remove clause without further checking. Check
3243 for non-NULL TYPE_NAME.
3245 2021-01-19 Marek Polacek <polacek@redhat.com>
3248 * pt.c (maybe_instantiate_noexcept): Return false if FN is
3251 2021-01-19 Marek Polacek <polacek@redhat.com>
3254 * name-lookup.c (push_using_decl_bindings): New, broken out of...
3255 (finish_nonmember_using_decl): ...here.
3256 * name-lookup.h (push_using_decl_bindings): Update declaration.
3257 * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
3259 2021-01-19 Patrick Palka <ppalka@redhat.com>
3263 * search.c (friend_accessible_p): If scope is a hidden friend
3264 defined inside a dependent class, consider access from the
3266 * parser.c (cp_parser_late_parsing_for_member): Don't push a
3267 dk_no_check access state.
3269 2021-01-19 Marek Polacek <polacek@redhat.com>
3272 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
3273 of NSDMIs before late-parsing of noexcept-specifiers.
3275 2021-01-19 Nathan Sidwell <nathan@acm.org>
3277 * module.cc (identifier): Merge overloads.
3279 2021-01-19 Nathan Sidwell <nathan@acm.org>
3282 * module.cc (trees_out::write_location): Make static.
3284 2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
3286 * parser.c (cp_parser_omp_clause_detach): New.
3287 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
3288 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
3289 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
3290 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
3291 Prevent use of detach with mergeable and overriding the data sharing
3292 mode of the event handle.
3294 2021-01-15 Nathan Sidwell <nathan@acm.org>
3297 * tree.c (cp_build_qualified_type_real): Propagate an array's
3298 dependentness to the copy, if known.
3300 2021-01-15 Jason Merrill <jason@redhat.com>
3303 * call.c (unsafe_return_slot_p): Return int.
3304 (init_by_return_slot_p): Split out from...
3305 (unsafe_copy_elision_p): ...here.
3306 (unsafe_copy_elision_p_opt): New name for old meaning.
3307 (build_over_call): Adjust.
3308 (make_safe_copy_elision): New.
3309 * typeck2.c (split_nonconstant_init_1): Elide copy from safe
3310 list-initialization.
3311 * cp-tree.h: Adjust.
3313 2021-01-15 Jason Merrill <jason@redhat.com>
3315 * call.c (base_ctor_for, make_base_init_ok): New.
3316 (build_over_call): Use make_base_init_ok.
3318 2021-01-15 Jason Merrill <jason@redhat.com>
3321 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
3322 if we got a CONSTRUCTOR.
3324 2021-01-15 Nathan Sidwell <nathan@acm.org>
3327 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
3329 2021-01-14 Jason Merrill <jason@redhat.com>
3331 * typeck2.c (process_init_constructor_record): Use fldtype
3332 variable consistently.
3334 2021-01-14 Nathan Sidwell <nathan@acm.org>
3337 * tree.c (cp_tree_equal): Correct map_context logic.
3339 2021-01-13 Marek Polacek <polacek@redhat.com>
3342 * name-lookup.c (push_using_decl_bindings): New.
3343 * name-lookup.h (push_using_decl_bindings): Declare.
3344 * pt.c (tsubst_expr): Call push_using_decl_bindings.
3346 2021-01-13 Nathan Sidwell <nathan@acm.org>
3349 * module.cc (module_add_import_initializers): Pass a
3350 zero-element argument vector.
3352 2021-01-12 Patrick Palka <ppalka@redhat.com>
3355 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
3356 the template of a CTAD placeholder.
3358 2021-01-12 Marek Polacek <polacek@redhat.com>
3361 * typeck2.c (process_init_constructor_record): Don't emit
3362 -Wmissing-field-initializers warnings in unevaluated contexts.
3364 2021-01-11 Jakub Jelinek <jakub@redhat.com>
3367 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
3369 (mark_abi_tags_r): Likewise.
3370 * decl2.c (min_vis_r): Likewise.
3371 * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
3374 2021-01-08 Patrick Palka <ppalka@redhat.com>
3377 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
3378 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
3380 2021-01-08 Patrick Palka <ppalka@redhat.com>
3383 * semantics.c (check_accessibility_of_qualified_id): Punt if
3384 we're checking access of a scoped non-static member inside a
3387 2021-01-07 Jakub Jelinek <jakub@redhat.com>
3390 * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
3391 cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
3393 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
3395 2021-01-07 Marek Polacek <polacek@redhat.com>
3398 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
3399 !late_return_type block.
3401 2021-01-07 Jason Merrill <jason@redhat.com>
3403 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
3404 (cxx_eval_store_expression): Add comment.
3406 2021-01-07 Jason Merrill <jason@redhat.com>
3408 * call.c (has_next): Factor out from...
3409 (next_conversion): ...here.
3410 (strip_standard_conversion): And here.
3411 (is_subseq): And here.
3412 (build_conv): Check it.
3413 (standard_conversion): Don't call build_conv
3416 2021-01-06 Martin Sebor <msebor@redhat.com>
3419 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
3421 2021-01-05 Patrick Palka <ppalka@redhat.com>
3423 * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
3424 the type of the NTTP, substitute into the type again. If the
3425 type is still dependent, don't unify the NTTP.
3427 2021-01-05 Jakub Jelinek <jakub@redhat.com>
3429 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
3430 $(CODYLIB) after $(BACKEND).
3432 2021-01-05 Jakub Jelinek <jakub@redhat.com>
3435 * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
3436 Punt if lval is true.
3437 * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
3438 the result if it has a class type.
3440 2021-01-05 Marek Polacek <polacek@redhat.com>
3443 * pt.c (resolve_overloaded_unification): Call
3444 maybe_instantiate_noexcept after instantiating the function
3447 2021-01-05 Nathan Sidwell <nathan@acm.org>
3449 * parser.c (cp_parser_module_declaration): Alter diagnostic
3450 text to say where is permissable.
3452 2021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3455 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
3457 2021-01-02 Jan Hubicka <jh@suse.cz>
3459 * cp-tree.h (cp_tree_c_finish_parsing): Declare.
3460 * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
3461 * tree.c (cp_tree_c_finish_parsing): New function.
3463 2021-01-01 Jakub Jelinek <jakub@redhat.com>
3465 * ChangeLog-2020: Rotate ChangeLog. New file.
3468 Copyright (C) 2021 Free Software Foundation, Inc.
3470 Copying and distribution of this file, with or without modification,
3471 are permitted in any medium without royalty provided the copyright
3472 notice and this notice are preserved.