1 2021-07-16 Patrick Palka <ppalka@redhat.com>
4 * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
5 substituting DECL_ARGUMENTS.
7 2021-07-16 Patrick Palka <ppalka@redhat.com>
11 * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
12 when the return types are references.
14 2021-07-16 Marek Polacek <polacek@redhat.com>
16 * typeck2.c (check_narrowing): Don't suppress the pedantic error
19 2021-07-15 Jakub Jelinek <jakub@redhat.com>
22 * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
23 operands, fold them right away to true or false.
25 2021-07-15 Jason Merrill <jason@redhat.com>
28 * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
29 (cp_tree_size): Remove redundant entries.
31 2021-07-14 Patrick Palka <ppalka@redhat.com>
34 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
35 * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
37 (redeclare_class_template): Likewise.
38 (forwarding_reference_p): Define.
39 (maybe_adjust_types_for_deduction): Use it instead. Add 'tparms'
41 (unify_one_argument): Pass tparms to
42 maybe_adjust_types_for_deduction.
43 (try_one_overload): Likewise.
45 (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
48 2021-07-14 Jason Merrill <jason@redhat.com>
50 * class.c (struct find_final_overrider_data): Use auto_vec.
51 (find_final_overrider): Remove explicit release.
52 * coroutines.cc (process_conditional): Use auto_vec.
53 * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
54 (cp_genericize_tree): Remove explicit release.
55 * parser.c (cp_parser_objc_at_property_declaration): Use
57 * semantics.c (omp_reduction_lookup): Use auto_vec.
59 2021-07-14 Marek Polacek <polacek@redhat.com>
62 * constexpr.c (cxx_eval_array_reference): Create a new .object
63 and .ctor for the non-aggregate non-scalar case too when
66 2021-07-12 Patrick Palka <ppalka@redhat.com>
70 * decl.c (grokfndecl): Don't require that deduction guides are
71 declared at namespace scope. Check that class-scope deduction
72 guides have the same access as the member class template.
73 (grokdeclarator): Pretend class-scope deduction guides are static.
74 * search.c (lookup_member): Don't use a BASELINK for (class-scope)
77 2021-07-10 Patrick Palka <ppalka@redhat.com>
80 * init.c (build_aggr_init): Return error_mark_node if
81 expand_aggr_init_1 returns false.
82 (expand_default_init): Change return type to bool. Return false
83 on error, true on success.
84 (expand_aggr_init_1): Likewise.
86 2021-07-09 Jason Merrill <jason@redhat.com>
89 * decl.c (function_requirements_equivalent_p): Only compare
90 trailing requirements on a specialization.
92 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
94 * coroutines.cc (build_actor_fn): Move common code to
96 (build_destroy_fn): Likewise.
97 (act_des_fn): Build the void return here. Ensure that the
98 source location matches the original function.
100 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
103 (coro_rewrite_function_body): Connect the replacement
104 function block to the block nest correctly.
106 2021-07-09 Patrick Palka <ppalka@redhat.com>
109 * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
111 * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
112 * pt.c (build_extra_args): Make a copy of args.
113 (add_extra_args): Add complain/in_decl parameters. Enable the
114 code for handling the case where the extra arguments are
116 (tsubst_pack_expansion): Pass complain/in_decl to
118 (tsubst_template_args): Handle missing template arguments.
119 (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
122 2021-07-09 Patrick Palka <ppalka@redhat.com>
125 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
128 2021-07-08 Martin Sebor <msebor@redhat.com>
131 * module.cc (identifier): Suppress warning.
132 (module_state::read_macro_maps): Remove warning suppression.
133 (module_state::install_macros): Ditto.
135 2021-07-08 Marek Polacek <polacek@redhat.com>
138 * cp-tree.h (unevaluated_p): New.
139 * except.c (check_noexcept_r): Use it. Don't walk into
140 unevaluated operands.
142 2021-07-08 Martin Sebor <msebor@redhat.com>
145 * module.cc (module_state::read_macro_maps): Temporarily disable
147 (module_state::install_macros): Same.
149 2021-07-06 Martin Sebor <msebor@redhat.com>
151 * error.c (cp_printer): Remove support for %G and %K.
153 2021-07-02 Jakub Jelinek <jakub@redhat.com>
155 * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
156 (struct cp_omp_declare_simd_data): Likewise.
157 * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
158 (omp_identifier): Define.
159 * parser.c (cp_parser_skip_to_pragma_eol): Handle
160 in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
161 (cp_parser_require_pragma_eol): Likewise.
162 (struct cp_omp_attribute_data): New type.
163 (cp_parser_handle_statement_omp_attributes): New function.
164 (cp_parser_statement): Handle OpenMP directives in statement's
165 attribute-specifier-seq.
166 (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
168 (cp_parser_std_attribute): Handle omp::directive and omp::sequence
170 (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
171 a comma also before the first clause.
172 (cp_parser_omp_allocate): Likewise.
173 (cp_parser_omp_atomic): Likewise.
174 (cp_parser_omp_depobj): Likewise.
175 (cp_parser_omp_flush): Likewise.
176 (cp_parser_omp_ordered): Likewise.
177 (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
178 into struct cp_omp_declare_simd_data.
179 (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
180 argument. If set, allow a comma also before match clause.
181 (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
182 allow a comma also before the first clause. Adjust
183 cp_finish_omp_declare_variant caller.
184 (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
185 a comma also before the first clause.
186 (cp_parser_omp_declare_reduction_exprs): Likewise.
187 (cp_parser_omp_requires): Likewise.
188 * decl.c (initialize_predefined_identifiers): Initialize
190 * decl2.c (cplus_decl_attributes): Reject omp::directive and
191 omp::sequence attributes.
193 2021-07-02 Jakub Jelinek <jakub@redhat.com>
196 * parser.c (cp_parser_omp_atomic): Consume comma only if it
197 appears before a CPP_NAME.
199 2021-07-02 Patrick Palka <ppalka@redhat.com>
202 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
203 use common_enclosing_class and to not depend on the TREE_TYPE
204 of outer levels pointing to the corresponding primary template.
206 2021-07-01 Patrick Palka <ppalka@redhat.com>
209 * constexpr.c (cxx_eval_array_reference): When the element type
210 is an empty type and the corresponding element is omitted, just
211 return an empty CONSTRUCTOR instead of attempting value
214 2021-07-01 Patrick Palka <ppalka@redhat.com>
217 * pt.c (finish_template_variable): Pass the partially
218 instantiated template and its args to instantiate_template.
219 (instantiate_class_template_1): No need to call
220 push_nested_class and pop_nested_class around the call to
221 most_specialized_partial_spec.
222 (instantiate_template_1): Pass the partially instantiated
223 template to lookup_template_variable.
224 (most_specialized_partial_spec): Use push_access_scope_guard
225 to set the access scope appropriately. Use
226 deferring_access_check_sentinel to force access to get checked
228 (instantiate_decl): Just pass the VAR_DECL to
229 most_specialized_partial_spec.
231 2021-06-30 Patrick Palka <ppalka@redhat.com>
233 * constraint.cc (get_normalized_constraints_from_decl): Use
234 push_access_scope_guard instead of push_nested_class_guard.
235 * cp-tree.h (struct push_nested_class_guard): Replace with ...
236 (struct push_access_scope_guard): ... this.
237 * pt.c (push_access_scope): When the argument corresponds to
238 a class type, push the class instead of its context.
239 (pop_access_scope): Adjust accordingly.
241 2021-06-30 Marek Polacek <polacek@redhat.com>
245 * decl.c (create_array_type_for_decl): Allow array of auto.
247 2021-06-29 Jason Merrill <jason@redhat.com>
249 * pt.c (instantiate_decl): Only consider partial specializations of
250 actual variable templates.
252 2021-06-26 Patrick Palka <ppalka@redhat.com>
255 * pt.c (instantiate_class_template_1): Enter the scope of the
256 type when calling most_specialized_partial_spec.
258 2021-06-26 Jason Merrill <jason@redhat.com>
262 * class.c (is_empty_field): Handle null argument.
263 * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
266 2021-06-26 Marek Polacek <polacek@redhat.com>
269 * parser.c (cp_parser_declarator): Pass flags down to
270 cp_parser_declarator. Also pass static_p/member_p.
272 2021-06-25 Martin Sebor <msebor@redhat.com>
274 * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
275 with warning_suppressed_p, suppress_warning, and copy_no_warning, or
276 nothing if not necessary.
277 (set_up_extended_ref_temp): Same.
278 * class.c (layout_class_type): Same.
279 * constraint.cc (constraint_satisfaction_value): Same.
280 * coroutines.cc (finish_co_await_expr): Same.
281 (finish_co_yield_expr): Same.
282 (finish_co_return_stmt): Same.
283 (build_actor_fn): Same.
284 (coro_rewrite_function_body): Same.
285 (morph_fn_to_coro): Same.
286 * cp-gimplify.c (genericize_eh_spec_block): Same.
287 (gimplify_expr_stmt): Same.
288 (cp_genericize_r): Same.
290 * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
291 * cvt.c (cp_fold_convert): Same.
292 (convert_to_void): Same.
293 * decl.c (wrapup_namespace_globals): Same.
294 (grokdeclarator): Same.
295 (finish_function): Same.
296 (require_deduced_type): Same.
297 * decl2.c (no_linkage_error): Same.
298 (c_parse_final_cleanups): Same.
299 * except.c (expand_end_catch_block): Same.
300 * init.c (build_new_1): Same.
302 (build_vec_delete_1): Same.
303 (build_vec_init): Same.
304 (build_delete): Same.
305 * method.c (defaultable_fn_check): Same.
306 * parser.c (cp_parser_fold_expression): Same.
307 (cp_parser_primary_expression): Same.
308 * pt.c (push_tinst_level_loc): Same.
310 (tsubst_omp_udr): Same.
311 (tsubst_copy_and_build): Same.
312 * rtti.c (build_if_nonnull): Same.
313 * semantics.c (maybe_convert_cond): Same.
314 (finish_return_stmt): Same.
315 (finish_parenthesized_expr): Same.
316 (cp_check_omp_declare_reduction): Same.
317 * tree.c (build_cplus_array_type): Same.
318 * typeck.c (build_ptrmemfunc_access_expr): Same.
319 (cp_build_indirect_ref_1): Same.
320 (cp_build_function_call_vec): Same.
321 (warn_for_null_address): Same.
322 (cp_build_binary_op): Same.
323 (unary_complex_lvalue): Same.
324 (cp_build_modify_expr): Same.
325 (build_x_modify_expr): Same.
326 (convert_for_assignment): Same.
328 2021-06-24 Patrick Palka <ppalka@redhat.com>
331 * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
333 2021-06-24 Patrick Palka <ppalka@redhat.com>
336 * constraint.cc (evaluate_requires_expr): Adjust function comment.
337 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
338 (cp_fold) <case REQUIRES_EXPR>: ... here.
340 2021-06-24 Jakub Jelinek <jakub@redhat.com>
342 * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
343 C_ORT_OMP for clauses on target construct.
344 (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
345 (cp_parser_omp_target): For non-combined target add
346 map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION. Pass
347 C_ORT_OMP_TARGET to finish_omp_clauses.
348 * semantics.c (handle_omp_array_sections_1): Adjust ort handling
349 for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
350 never present on C_ORT_*DECLARE_SIMD.
351 (handle_omp_array_sections): Likewise.
352 (finish_omp_clauses): Likewise. Handle OMP_CLAUSE_IN_REDUCTION
353 on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
354 corresponding map clauses.
355 * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
356 clauses on target construct.
358 2021-06-23 Patrick Palka <ppalka@redhat.com>
361 * pt.c (push_access_scope): For artificial deduction guides,
362 set the access scope to that of the constructor.
363 (pop_access_scope): Likewise.
364 (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
366 2021-06-23 Patrick Palka <ppalka@redhat.com>
369 * call.c (print_error_for_call_failure): Constify 'args' parameter.
370 (perform_dguide_overload_resolution): Define.
371 * cp-tree.h: (perform_dguide_overload_resolution): Declare.
372 * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
373 instead of build_new_function_call. Don't use tf_decltype or
374 set cp_unevaluated_operand. Remove unnecessary NULL_TREE tests.
376 2021-06-21 Patrick Palka <ppalka@redhat.com>
379 * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
380 sooner, before the NRVO handling.
382 2021-06-21 Patrick Palka <ppalka@redhat.com>
385 * tree.c (bot_replace): Use convert_to_base to build the
386 conversion to the (morally) virtual base.
388 2021-06-21 Jakub Jelinek <jakub@redhat.com>
391 * typeck.c (cxx_mark_addressable): Diagnose trying to make
392 bit-fields addressable.
394 2021-06-17 Jason Merrill <jason@redhat.com>
397 * decl.c (duplicate_decls): Make 'deleted after first declaration'
398 pedwarn on by default.
400 2021-06-17 Jason Merrill <jason@redhat.com>
403 * init.c (build_vec_init): Preserve the type of base.
405 2021-06-16 Jason Merrill <jason@redhat.com>
409 * pt.c (tsubst_baselink): Update binfos in non-dependent case.
411 2021-06-15 Robin Dapp <rdapp@linux.ibm.com>
413 * decl.c (duplicate_decls): Likewise.
415 2021-06-14 Tobias Burnus <tobias@codesourcery.com>
418 * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
419 var in the error case.
421 2021-06-13 Trevor Saunders <tbsaunde@tbsaunde.org>
423 * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
424 with range based for.
425 (cxx_eval_store_expression): Likewise.
426 (cxx_eval_loop_expr): Likewise.
427 * decl.c (wrapup_namespace_globals): Likewise.
428 (cp_finish_decl): Likewise.
429 (cxx_simulate_enum_decl): Likewise.
430 * parser.c (cp_parser_postfix_expression): Likewise.
432 2021-06-12 Jason Merrill <jason@redhat.com>
435 * init.c (build_vec_init): Shortcut [0] case.
437 2021-06-12 Jason Merrill <jason@redhat.com>
439 * pt.c (lookup_template_class_1): Shortcut current_class_type.
441 2021-06-11 Patrick Palka <ppalka@redhat.com>
445 * pt.c (tsubst_arg_types): Rearrange so that we substitute into
446 TYPE_ARG_TYPES in forward order while short circuiting
447 appropriately. Adjust formatting.
449 2021-06-11 Jakub Jelinek <jakub@redhat.com>
452 * cp-tree.h (struct saved_scope): Add consteval_if_p
453 member. Formatting fix for the discarded_stmt comment.
454 (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
455 * parser.c (cp_parser_lambda_expression): Temporarily disable
456 in_consteval_if_p when parsing lambda body.
457 (cp_parser_selection_statement): Parse consteval if.
458 * decl.c (struct named_label_entry): Add in_consteval_if member.
459 (level_for_consteval_if): New function.
460 (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
462 * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
463 why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
464 for !ctx->manifestly_const_eval.
465 (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
466 condition as if it was __builtin_is_constant_evaluated call.
467 (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
468 recurse on both branches.
469 * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
471 * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
472 Temporarily set in_consteval_if_p when recursing on
473 IF_STMT_CONSTEVAL_P then branch.
474 (tsubst_lambda_expr): Temporarily disable
475 in_consteval_if_p when instantiating lambda body.
476 * call.c (immediate_invocation_p): Return false when
479 2021-06-11 Marek Polacek <polacek@redhat.com>
482 * constexpr.c (maybe_constexpr_fn): New.
483 * cp-tree.h (maybe_constexpr_fn): Declare.
484 * semantics.c (find_std_constant_evaluated_r): New.
485 (maybe_warn_for_constant_evaluated): New.
486 (finish_if_stmt_cond): Call it.
488 2021-06-10 Patrick Palka <ppalka@redhat.com>
491 * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
492 the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
493 a template template parameter, adjust to the
494 TEMPLATE_TEMPLATE_PARAMETER before falling through.
496 2021-06-10 Patrick Palka <ppalka@redhat.com>
499 * constraint.cc (normalize_placeholder_type_constraints): When
500 normalizing a non-templated return-type-requirement, add a dummy
501 level to initial_parms.
503 2021-06-08 Marek Polacek <polacek@redhat.com>
506 * decl.c (grokdeclarator): Store a value-dependent
507 explicit-specifier even for deduction guides.
509 2021-06-08 Jason Merrill <jason@redhat.com>
511 * parser.c (cp_parser_string_literal): Adjust diagnostic.
513 2021-06-08 Jason Merrill <jason@redhat.com>
516 * call.c (perfect_conversion_p): Check check_narrowing.
518 2021-06-08 Jason Merrill <jason@redhat.com>
521 * name-lookup.c (get_class_binding): Keep a BASELINK.
522 (set_inherited_value_binding_p): Adjust.
523 * lambda.c (is_lambda_ignored_entity): Adjust.
524 * pt.c (lookup_template_function): Copy a BASELINK before
527 2021-06-08 Jason Merrill <jason@redhat.com>
530 * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
532 2021-06-08 Jason Merrill <jason@redhat.com>
534 * module.cc (duplicate_hash::hash): Comment out.
535 (trees_in::tree_value): Adjust loop counter.
537 2021-06-08 Jason Merrill <jason@redhat.com>
540 * init.c (build_offset_ref): Return the BASELINK for a static
543 2021-06-07 Patrick Palka <ppalka@redhat.com>
546 * parser.c (cp_parser_lookup_name): Check access of the lookup
547 result before we potentially adjust an injected-class-name to
550 2021-06-06 Jakub Jelinek <jakub@redhat.com>
553 * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
554 even when target is combined with other constructs.
556 2021-06-04 Patrick Palka <ppalka@redhat.com>
559 * pt.c (convert_template_argument): Strip top-level cv-quals
560 on the substituted type of a non-type template parameter.
562 2021-06-04 Patrick Palka <ppalka@redhat.com>
565 * pt.c (tsubst_function_decl): Remove old code for reducing
566 args when it has excess levels.
568 2021-06-04 Jakub Jelinek <jakub@redhat.com>
571 * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
572 ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
575 2021-06-03 Patrick Palka <ppalka@redhat.com>
578 * decl.c (make_typename_type): After calling
579 lookup_template_class, adjust the result to its TYPE_NAME and
580 then consider the tf_keep_type_decl flag.
582 2021-06-03 Patrick Palka <ppalka@redhat.com>
585 * pt.c (set_current_access_from_decl): Move to ...
586 * class.c (set_current_access_from_decl): ... here.
587 (handle_using_decl): Use it to propagate the access of the
588 using-enum decl to the copy of the imported enumerator.
589 * cp-tree.h (set_current_access_from_decl): Declare.
590 * decl.c (build_enumerator): Simplify using make_temp_override
591 and set_current_access_from_decl.
593 2021-06-03 Jakub Jelinek <jakub@redhat.com>
596 * semantics.c (handle_omp_array_sections_1): For
597 OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
598 finish_non_static_data_member and allow this as base.
599 (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
600 after depend only cases. Let this be diagnosed by !lvalue_p
601 case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
603 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
605 2021-06-02 Jason Merrill <jason@redhat.com>
608 * call.c (convert_like_internal): Clear tf_no_cleanup when
610 (build_user_type_conversion_1): Only add ck_rvalue if
611 LOOKUP_ONLYCONVERTING.
613 2021-06-01 Patrick Palka <ppalka@redhat.com>
616 * init.c (expand_aggr_init_1): Check
617 type_has_non_user_provided_default_constructor instead of
618 type_has_user_provided_constructor.
620 2021-06-01 Jason Merrill <jason@redhat.com>
623 * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
624 for destroying delete.
625 * init.c (build_delete): Don't clobber before destroying delete.
627 2021-06-01 Jason Merrill <jason@redhat.com>
630 * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
632 2021-05-31 Richard Biener <rguenther@suse.de>
635 * cp-objcp-common.c (names_builtin_p): Handle
636 RID_BUILTIN_SHUFFLEVECTOR.
637 * cp-tree.h (build_x_shufflevector): Declare.
638 * parser.c (cp_parser_postfix_expression): Handle
639 RID_BUILTIN_SHUFFLEVECTOR.
640 * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
641 * typeck.c (build_x_shufflevector): Build either a lowered
642 VEC_PERM_EXPR or an unlowered shufflevector via a temporary
643 internal function IFN_SHUFFLEVECTOR.
645 2021-05-28 Jason Merrill <jason@redhat.com>
647 * constexpr.c (build_data_member_initialization): Use tsi_range.
648 (build_constexpr_constructor_member_initializers): Likewise.
649 (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
650 (potential_constant_expression_1): Likewise.
651 * coroutines.cc (await_statement_expander): Likewise.
652 (await_statement_walker): Likewise.
653 * module.cc (trees_out::core_vals): Likewise.
654 * pt.c (tsubst_expr): Likewise.
655 * semantics.c (set_cleanup_locs): Likewise.
657 2021-05-28 Jason Merrill <jason@redhat.com>
661 * call.c (build_over_call): Adjust base_binfo in
662 resolves_to_fixed_type_p case.
664 2021-05-28 Jakub Jelinek <jakub@redhat.com>
667 * semantics.c (handle_omp_array_sections): Copy
668 OMP_CLAUSE_MAP_IMPLICIT.
669 (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
670 marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT. Add
671 map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
672 maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
673 present too. For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
674 if present in map_head, map_field_head or map_firstprivate_head
677 2021-05-28 Tobias Burnus <tobias@codesourcery.com>
679 * parser.c (cp_parser_omp_clause_affinity): New.
680 (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
681 cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
683 * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
684 finish_omp_clauses): Likewise.
686 2021-05-27 Matthias Kretz <kretz@kde.org>
689 * error.c (dump_template_bindings): Include code to print
690 "[with" and ']', conditional on whether anything is printed at
691 all. This is tied to whether a semicolon is needed to separate
692 multiple template parameters. If the template argument repeats
693 the template parameter (T = T), then skip the parameter.
694 (dump_substitution): Moved code to print "[with" and ']' to
695 dump_template_bindings.
696 (dump_function_decl): Partial revert of PR50828, which masked
697 TFF_TEMPLATE_NAME for all of dump_function_decl. Now
698 TFF_TEMPLATE_NAME is masked for the scope of the function and
699 only carries through to dump_function_name.
700 (dump_function_name): Avoid calling dump_template_parms if
701 TFF_TEMPLATE_NAME is set.
703 2021-05-27 Matthias Kretz <kretz@kde.org>
706 * error.c: Call dump_scope when printing a typedef.
708 2021-05-27 Patrick Palka <ppalka@redhat.com>
711 * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
713 2021-05-27 Jason Merrill <jason@redhat.com>
716 * pt.c (use_pack_expansion_extra_args_p): Don't compare
717 args from the same argument pack.
719 2021-05-27 Patrick Palka <ppalka@redhat.com>
724 * pt.c (process_partial_specialization): Don't error on a
725 non-simple non-type template argument that involves template
727 (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
728 MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
730 2021-05-26 Patrick Palka <ppalka@redhat.com>
733 * typeck.c (finish_class_member_access_expr): Disable ahead
734 of time access checking during the member lookup.
736 2021-05-26 Patrick Palka <ppalka@redhat.com>
739 * tree.c (build_target_expr_with_type): Don't call force_rvalue
740 on CALL_EXPR initializer. Simplify now that bot_manip is no
742 (bot_manip): Use force_target_expr instead of
743 build_target_expr_with_type.
745 2021-05-26 Patrick Palka <ppalka@redhat.com>
748 * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
749 (fnptr_conv_p): Don't call non_reference. Use INDIRECT_TYPE_P
750 instead of TYPE_PTR_P.
751 * pt.c (convert_nontype_argument_function): Look through
752 implicit INDIRECT_REFs before calling strip_fnptr_conv.
754 2021-05-25 Jakub Jelinek <jakub@redhat.com>
757 * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
758 and side-effects, temporarily disable -Wunused-result warning when
759 building COMPOUND_EXPR.
761 2021-05-21 Jakub Jelinek <jakub@redhat.com>
764 * semantics.c (finish_omp_clauses): Move firstprivate clauses with
765 OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain. Don't error
766 if a decl is mentioned both in map clause and in such firstprivate
767 clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
769 2021-05-20 Jason Merrill <jason@redhat.com>
771 * call.c (reference_binding): Check for designator.
772 (implicit_conversion_1, build_special_member_call): Likewise.
773 * decl.c (reshape_init_r): Likewise.
774 * pt.c (do_class_deduction): Likewise.
775 * typeck2.c (digest_init_r): Likewise.
777 2021-05-20 Jason Merrill <jason@redhat.com>
780 * decl.c (reshape_init_class): Handle designator for
781 member of anonymous aggregate here.
782 * typeck2.c (process_init_constructor_record): Not here.
784 2021-05-20 Jonathan Wakely <jwakely@redhat.com>
786 * call.c (maybe_warn_array_conv): Use new warning option.
787 * decl.c (mark_inline_variable, grokdeclarator): Likewise.
788 * error.c (maybe_warn_cpp0x): Likewise.
789 * parser.c (cp_parser_primary_expression)
790 (cp_parser_unqualified_id)
791 (cp_parser_pseudo_destructor_name)
792 (cp_parser_lambda_introducer)
793 (cp_parser_lambda_declarator_opt)
794 (cp_parser_selection_statement)
795 (cp_parser_init_statement)
796 (cp_parser_decomposition_declaration)
797 (cp_parser_function_specifier_opt)
798 (cp_parser_static_assert)
799 (cp_parser_namespace_definition)
800 (cp_parser_using_declaration)
801 (cp_parser_asm_definition)
802 (cp_parser_ctor_initializer_opt_and_function_body)
803 (cp_parser_initializer_list)
804 (cp_parser_type_parameter_key)
805 (cp_parser_member_declaration)
806 (cp_parser_try_block)
807 (cp_parser_std_attribute_spec): Likewise.
808 * pt.c (check_template_variable): Likewise.
810 2021-05-20 Jason Merrill <jason@redhat.com>
813 * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
815 2021-05-20 Jason Merrill <jason@redhat.com>
818 * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
820 2021-05-19 Jason Merrill <jason@redhat.com>
824 * method.c (genericize_spaceship): Use fold_build2 for scalar
827 2021-05-19 Jason Merrill <jason@redhat.com>
829 * pt.c (build_deduction_guide): Treat the implicit deduction guide
830 as a member of the class.
832 2021-05-19 Marek Polacek <polacek@redhat.com>
835 * cp-tree.h (any_non_type_attribute_p): Remove.
836 * decl.c (grokdeclarator): Turn an error into a warning and only
837 warn for standard attributes.
838 * decl2.c (any_non_type_attribute_p): Remove.
839 * parser.c (cp_parser_elaborated_type_specifier): Turn an error
840 into a warning and only warn for standard attributes.
841 (cp_parser_member_declaration): Likewise.
843 2021-05-19 Martin Liska <mliska@suse.cz>
846 * mangle.c (write_encoding): Fix typos.
848 2021-05-19 Jakub Jelinek <jakub@redhat.com>
851 * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
852 master when combined with taskloop.
853 (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
854 parallel master when not combined with taskloop.
856 2021-05-19 Jason Merrill <jason@redhat.com>
859 * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
861 2021-05-19 Jason Merrill <jason@redhat.com>
864 * tree.c (strip_typedefs): Only look at the pattern of a
865 TYPE_PACK_EXPANSION if it's a type.
867 2021-05-18 Marek Polacek <polacek@redhat.com>
869 * class.c (classtype_has_non_deleted_copy_ctor): Remove.
870 * constraint.cc (contains_wildcard_p): Likewise.
871 (get_template_head_requirements): Likewise.
872 (check_constrained_friend): Likewise.
873 (subsumes_constraints): Likewise.
874 * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
875 (push_void_library_fn): Likewise.
876 (get_pattern_parm): Likewise.
877 (get_template_parms_at_level): Likewise.
878 (lambda_return_type): Likewise.
879 (get_template_head_requirements): Likewise.
880 (check_constrained_friend): Likewise.
881 (subsumes_constraints): Likewise.
882 * decl.c (push_void_library_fn): Likewise.
883 * lambda.c (lambda_return_type): Likewise.
884 * pt.c (get_template_parms_at_level): Likewise.
885 (get_pattern_parm): Likewise.
887 2021-05-18 Jason Merrill <jason@redhat.com>
890 * call.c (perfect_candidate_p): An implicitly deleted move
893 2021-05-18 Andreas Krebbel <krebbel@linux.ibm.com>
896 * cvt.c (cp_convert_to_pointer): Use the size of the target
898 * tree.c (cp_build_reference_type): Call
899 cp_build_reference_type_for_mode with VOIDmode.
900 (cp_build_reference_type_for_mode): Rename from
901 cp_build_reference_type. Add MODE argument and invoke
902 build_reference_type_for_mode.
903 (strip_typedefs): Use build_pointer_type_for_mode and
904 cp_build_reference_type_for_mode for pointers and references.
906 2021-05-17 Jonathan Wakely <jwakely@redhat.com>
909 * call.c (convert_like_internal): Print different diagnostic if
910 the lvalue reference is const.
912 2021-05-14 Jason Merrill <jason@redhat.com>
915 * pt.c (enclosing_instantiation_of): Just compare
916 DECL_SOURCE_LOCATION.
917 (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
919 2021-05-14 Marek Polacek <polacek@redhat.com>
920 Jason Merrill <jason@redhat.com>
923 * cp-tree.h (any_non_type_attribute_p): Declare.
924 * decl.c (grokdeclarator): Diagnose when an attribute appertains to
925 a friend declaration that is not a definition.
926 * decl2.c (any_non_type_attribute_p): New.
927 * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
928 in the middle of decl-specifiers.
929 (cp_parser_elaborated_type_specifier): Diagnose when an attribute
930 appertains to a friend declaration that is not a definition.
931 (cp_parser_member_declaration): Likewise.
933 2021-05-12 Marek Polacek <polacek@redhat.com>
935 * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
938 2021-05-12 Marcel Vollweiler <marcel@codesourcery.com>
940 * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
943 2021-05-11 Jason Merrill <jason@redhat.com>
946 * typeck.c (build_reinterpret_cast_1): Check intype on
949 2021-05-11 Patrick Palka <ppalka@redhat.com>
952 * name-lookup.c (maybe_save_operator_binding): Unconditionally
953 enable for all function templates, not just generic lambdas.
954 Handle compound-assignment operator expressions.
955 * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
956 in the type-dependent case.
957 (build_x_modify_expr): Likewise. Move declaration of 'op' closer
960 2021-05-11 Patrick Palka <ppalka@redhat.com>
963 * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
964 (satisfy_atom): Set up iloc_sentinel before calling
966 * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
967 expansion, carry over PACK_EXPANSION_LOCAL_P and
968 PACK_EXPANSION_SIZEOF_P from the original pack expansion.
970 2021-05-10 Richard Biener <rguenther@suse.de>
974 * call.c (set_up_extended_ref_temp): Mark the temporary
975 addressable if the TARGET_EXPR was.
977 2021-05-10 Martin Liska <mliska@suse.cz>
979 * decl.c (duplicate_decls): Use startswith
980 function instead of strncmp.
981 (cxx_builtin_function): Likewise.
982 (omp_declare_variant_finalize_one): Likewise.
983 (grokfndecl): Likewise.
984 * error.c (dump_decl_name): Likewise.
985 * mangle.c (find_decomp_unqualified_name): Likewise.
986 (write_guarded_var_name): Likewise.
987 (decl_tls_wrapper_p): Likewise.
988 * parser.c (cp_parser_simple_type_specifier): Likewise.
989 (cp_parser_tx_qualifier_opt): Likewise.
990 * pt.c (template_parm_object_p): Likewise.
991 (dguide_name_p): Likewise.
993 2021-05-10 Martin Liska <mliska@suse.cz>
996 * decl.c (grokdeclarator): Remove redundant NULL check.
998 2021-05-07 Jason Merrill <jason@redhat.com>
1000 * tree.c (rvalue): Assert expr is not a class lvalue.
1002 2021-05-07 Jason Merrill <jason@redhat.com>
1004 * cp-tree.h (build_stub_object): Declare.
1005 * method.c (build_stub_object): No longer static.
1006 * call.c (can_convert): Use it.
1007 * tree.c (build_dummy_object): Adjust comment.
1008 * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
1011 2021-05-07 Jason Merrill <jason@redhat.com>
1013 * coroutines.cc (build_co_await): Don't call 'rvalue'.
1014 (flatten_await_stmt): Simplify initialization.
1015 (morph_fn_to_coro): Change 'rvalue' to 'move'. Simplify.
1017 2021-05-04 Tobias Burnus <tobias@codesourcery.com>
1019 * semantics.c (finish_omp_reduction_clause): Accept float + complex
1020 for || and && reductions.
1022 2021-05-03 Patrick Palka <ppalka@redhat.com>
1025 * parser.c (cp_parser_class_head): Reinstate calls to pushclass
1026 and popclass when parsing the base-clause that were removed in
1029 2021-05-03 Patrick Palka <ppalka@redhat.com>
1033 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
1034 only when the callee is a FUNCTION_DECL.
1036 2021-05-03 Marek Polacek <polacek@redhat.com>
1039 * decl.c (grokfndecl): Check current_template_parms.
1041 2021-05-03 Marek Polacek <polacek@redhat.com>
1044 * constexpr.c (cxx_eval_constant_expression): Don't check
1047 2021-05-01 Jason Merrill <jason@redhat.com>
1049 * cp-tree.h (class ovl_iterator): Allow copying. Add op==.
1050 (class ovl_range, class lkp_range): New.
1051 * call.c (build_op_call_1, add_candidates): Use them.
1052 (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
1053 (has_trivial_copy_p): Likewise.
1054 * class.c (handle_using_decl, get_basefndecls): Likewise.
1055 (maybe_warn_about_overly_private_class): Likewise.
1056 (warn_hidden, add_implicitly_declared_members): Likewise.
1057 (check_methods, clone_constructors_and_destructors): Likewise.
1058 (type_has_user_nondefault_constructor): Likewise.
1060 2021-04-29 Jason Merrill <jason@redhat.com>
1062 * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
1065 2021-04-29 Jason Merrill <jason@redhat.com>
1068 * decl2.c (grokfield): Call cplus_decl_attributes for friend.
1069 (save_template_attributes): Use chainon.
1070 * friend.c (do_friend): Remove attrlist parm.
1071 * cp-tree.h (do_friend): Adjust.
1072 * class.c (add_implicitly_declared_members): Adjust.
1073 * decl.c (grokdeclarator): Adjust.
1074 * pt.c (apply_late_template_attributes): Optimize.
1076 2021-04-29 Jason Merrill <jason@redhat.com>
1079 * class.c (finish_struct_anon_r): Drop complain parm.
1080 Remove non-field diagnostic.
1081 (finish_struct_anon): Adjust.
1082 * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
1084 2021-04-29 Jason Merrill <jason@redhat.com>
1086 * cp-tree.h (cp_evaluated): Add reset parm to constructor.
1087 * parser.c (cp_parser_constant_expression): Change
1088 allow_non_constant_p to int. Use cp_evaluated.
1089 (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
1090 * semantics.c (finish_id_expression_1): Don't mess with
1091 cp_unevaluated_operand here.
1093 2021-04-29 Jason Merrill <jason@redhat.com>
1095 * cp-tree.h: Clarify comments.
1096 * pt.c (get_template_parm_object): Add assert.
1097 * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
1098 * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
1099 * typeck2.c (store_init_value): Likewise.
1101 2021-04-29 Patrick Palka <ppalka@redhat.com>
1104 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
1105 set tf_conv during the initial substitution into the function.
1107 2021-04-29 Jakub Jelinek <jakub@redhat.com>
1110 * semantics.c (finish_omp_clauses): Fix up check that variable
1111 mentioned in detach clause doesn't appear in data-sharing clauses.
1113 2021-04-28 Jakub Jelinek <jakub@redhat.com>
1115 * module.cc: Remove #error that triggers if DEV-PHASE is empty.
1117 2021-04-27 Jason Merrill <jason@redhat.com>
1120 * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
1123 2021-04-27 Patrick Palka <ppalka@redhat.com>
1126 * pt.c (tsubst_initializer_list): Correctly handle the case
1127 where an argument inside a base initializer pack expansion is
1128 itself a pack expansion.
1130 2021-04-26 Patrick Palka <ppalka@redhat.com>
1133 * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
1134 object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
1135 with a negative offset into one whose offset is nonnegative
1136 before calling cxx_fold_indirect_ref_1.
1138 2021-04-24 Patrick Palka <ppalka@redhat.com>
1145 * pt.c (do_class_deduction): Punt if the initializer is
1148 2021-04-24 Patrick Palka <ppalka@redhat.com>
1151 * parser.c (cp_parser_type_id_1): If we see a template
1152 placeholder, first try simulating an error before issuing
1155 2021-04-23 Patrick Palka <ppalka@redhat.com>
1158 * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
1159 Adjust parameter list loop to iterate over 'types' instead of
1160 'args'. Output the trailing '...' for a variadic function.
1161 Remove PARM_DECL support.
1162 (pp_cxx_requires_expr): Pretty print the parameter list directly
1163 instead of going through pp_cxx_parameter_declaration_clause.
1165 2021-04-23 Patrick Palka <ppalka@redhat.com>
1168 * decl.c (is_direct_enum_init): Check the implicit
1169 convertibility requirement added by CWG 2374.
1171 2021-04-23 Martin Liska <mliska@suse.cz>
1173 * cp-tree.h (STATIC_ASSERT): Prefer static assert.
1174 * lex.c (init_operators): Remove run-time check.
1176 2021-04-22 Marek Polacek <polacek@redhat.com>
1179 * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
1180 op1 separately for value- or type-dependence.
1182 2021-04-21 Marek Polacek <polacek@redhat.com>
1185 * parser.c (cp_parser_enum_specifier): Don't allow defining
1188 2021-04-21 Martin Liska <mliska@suse.cz>
1191 2021-04-21 Martin Liska <mliska@suse.cz>
1193 * error.c (dump_decl): Use flags in dump_generic_node call.
1195 2021-04-21 Martin Liska <mliska@suse.cz>
1197 * error.c (dump_decl): Use flags in dump_generic_node call.
1199 2021-04-21 Martin Liska <mliska@suse.cz>
1201 * error.c (dump_decl): Support anonymous labels.
1203 2021-04-20 Jason Merrill <jason@redhat.com>
1206 * pt.c (find_parameter_packs_r): Look into enum initializers.
1208 2021-04-19 Marek Polacek <polacek@redhat.com>
1211 * decl.c (grokvardecl): Given an error when a concept is not defined
1214 2021-04-16 Jakub Jelinek <jakub@redhat.com>
1217 * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
1218 for empty classes into *valp when types don't match even when *valp
1221 2021-04-16 Marek Polacek <polacek@redhat.com>
1224 * decl.c (make_typename_type): Give an error and return when
1225 name is is_overloaded_fn.
1226 * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
1227 before calling make_typename_type.
1229 2021-04-16 Patrick Palka <ppalka@redhat.com>
1232 * constexpr.c (reduced_constant_expression_p): For array
1233 CONSTRUCTORs, use a dedicated loop that additionally verifies
1234 the CONSTRUCTOR spans the entire array.
1236 2021-04-16 Jakub Jelinek <jakub@redhat.com>
1239 * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
1240 If lambda_p, return pce_ok instead of pce_maybe_postfix.
1242 2021-04-16 Jakub Jelinek <jakub@redhat.com>
1245 * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
1246 binding, add to data.internal also all corresponding structured
1249 2021-04-16 Jason Merrill <jason@redhat.com>
1252 * cp-tree.h (first_field): Declare.
1253 * mangle.c (range_expr_nelts): New.
1254 (write_expression): Improve class NTTP mangling.
1255 * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
1256 * tree.c (zero_init_expr_p): Improve class NTTP handling.
1257 * decl.c: Adjust comment.
1259 2021-04-15 Jason Merrill <jason@redhat.com>
1262 * call.c (build_new_method_call_1): Check again for side-effects
1263 with a volatile object.
1265 2021-04-15 Jason Merrill <jason@redhat.com>
1269 * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
1270 TYPE_RAISES_EXCEPTIONS here.
1271 * tree.c (cp_walk_subtrees): Not here.
1273 2021-04-15 Jason Merrill <jason@redhat.com>
1277 * parser.c (cp_parser_default_type_template_argument): Set
1278 parser->local_variables_forbidden_p.
1280 2021-04-15 Richard Sandiford <richard.sandiford@arm.com>
1283 * typeck.c (merge_type_attributes_from): New function.
1284 (cp_common_type): Use it for vector types.
1286 2021-04-14 Jason Merrill <jason@redhat.com>
1290 * pt.c (uses_outer_template_parms): Also look at default
1293 2021-04-14 Jason Merrill <jason@redhat.com>
1296 * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
1297 for a non-static data member in a constant-expression.
1299 2021-04-14 Patrick Palka <ppalka@redhat.com>
1303 * pt.c (deducible_expression): Look through implicit
1304 INDIRECT_REFs as well.
1306 2021-04-14 Jason Merrill <jason@redhat.com>
1309 * parser.c (cp_parser_lambda_expression): Reject lambda
1310 in template parameter type.
1312 2021-04-14 Jason Merrill <jason@redhat.com>
1315 * decl.c (duplicate_decls): Don't propagate
1316 DECL_INITIALIZED_IN_CLASS_P to a specialization.
1318 2021-04-14 Jason Merrill <jason@redhat.com>
1323 * semantics.c (set_cleanup_locs): New.
1324 (do_poplevel): Call it.
1325 * parser.c (cp_parser_compound_statement): Consume the }
1326 before finish_compound_stmt.
1328 2021-04-13 Jason Merrill <jason@redhat.com>
1331 * pt.c (get_underlying_template): Compare TYPE_QUALS.
1333 2021-04-13 Jason Merrill <jason@redhat.com>
1337 * init.c (get_nsdmi): Do more context adjustment for local classes.
1339 2021-04-13 Patrick Palka <ppalka@redhat.com>
1342 * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
1343 rather than issuing a pedwarn.
1344 * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
1345 for consistent diagnostics.
1347 2021-04-13 Jason Merrill <jason@redhat.com>
1350 * class.c (build_base_path): Shortcut simple non-pointer case.
1352 2021-04-13 Eric Botcazou <ebotcazou@adacore.com>
1354 * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
1356 (module_state::write_location): Likewise.
1358 2021-04-13 Patrick Palka <ppalka@redhat.com>
1361 * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
1362 when checking if the initializer is an equivalent class
1363 placeholder template parameter.
1365 2021-04-13 Patrick Palka <ppalka@redhat.com>
1369 * constraint.cc (satisfy_normalized_constraints): Set
1371 * parser.c (cp_parser_concept_definition): Likewise.
1372 (cp_parser_requires_clause_opt): Likewise.
1374 2021-04-12 Jason Merrill <jason@redhat.com>
1377 * pt.c (uses_outer_template_parms): Handle non-type and template
1378 template parameters specifically.
1380 2021-04-11 Jason Merrill <jason@redhat.com>
1383 * decl.c (fixup_anonymous_aggr): Prune all functions from
1384 CLASSTYPE_MEMBER_VEC.
1386 2021-04-10 Jason Merrill <jason@redhat.com>
1390 * parser.c (cp_parser_direct_declarator): Don't
1391 inject_this_parameter if static_p.
1392 (cp_parser_omp_var_list_no_open): Parse 'this' even if
1393 current_class_ptr isn't set for a better diagnostic.
1395 2021-04-10 Jason Merrill <jason@redhat.com>
1402 * pt.c (alias_ctad_tweaks): Handle failure better.
1404 2021-04-10 Jason Merrill <jason@redhat.com>
1407 * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
1409 2021-04-09 Patrick Palka <ppalka@redhat.com>
1411 * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
1412 (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
1413 (LAMBDA_EXPR_REGEN_INFO): ... this.
1414 (tree_lambda_expr::regenerated_from)
1415 (tree_lambda_expr::regenerating_targs): Replace these with ...
1416 (tree_lambda_expr::regen_info): ... this.
1417 * constraint.cc (satisfy_declaration_constraints): Adjust
1419 * lambda.c (build_lambda_expr): Likewise.
1420 * pt.c (regenerated_lambda_fn_p): Likewise.
1421 (most_general_lambda): Likewise.
1422 (tsubst_lambda_expr): Likewise.
1424 2021-04-09 Marek Polacek <polacek@redhat.com>
1427 * parser.c (cp_parser_member_declaration): Call
1428 cp_parser_save_default_args even for function templates. Use
1429 STRIP_TEMPLATE on the declaration we're passing.
1431 2021-04-08 Patrick Palka <ppalka@redhat.com>
1434 * constraint.cc (get_normalized_constraints_from_decl): Handle
1435 regenerated lambdas.
1436 (satisfy_declaration_constraints): Likewise. Check for
1437 dependent args later.
1438 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
1439 (LAMBDA_EXPR_REGENERATED_FROM): ... this.
1440 (LAMBDA_EXPR_REGENERATING_TARGS): New.
1441 (tree_lambda_expr::regenerated_from): New data member.
1442 (tree_lambda_expr::regenerating_targs): New data member.
1443 (add_to_template_args): Declare.
1444 (regenerated_lambda_fn_p): Likewise.
1445 (most_general_lambda): Likewise.
1446 * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
1447 and LAMBDA_EXPR_REGENERATING_TARGS.
1448 * pt.c (add_to_template_args): No longer static.
1449 (tsubst_function_decl): Unconditionally propagate constraints on
1450 the substituted function decl.
1451 (instantiated_lambda_fn_p): Rename to ...
1452 (regenerated_lambda_fn_p): ... this. Check
1453 LAMBDA_EXPR_REGENERATED_FROM instead of
1454 LAMBDA_EXPR_INSTANTIATED.
1455 (most_general_lambda): Define.
1456 (enclosing_instantiation_of): Adjust after renaming
1457 instantiated_lambda_fn_p.
1458 (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED. Set
1459 LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
1460 Don't substitute or set constraints on the regenerated lambda.
1462 2021-04-08 Patrick Palka <ppalka@redhat.com>
1465 * pt.c (build_deduction_guide): Document OUTER_ARGS. Substitute
1466 them into the propagated constraints.
1468 2021-04-08 Jason Merrill <jason@redhat.com>
1471 * call.c (convert_like_internal): Improve reference diagnostic.
1473 2021-04-08 Jakub Jelinek <jakub@redhat.com>
1476 * constexpr.c (addr_of_non_const_var): New function.
1477 (cxx_bind_parameters_in_call): Set *non_constant_args to true
1478 even if cp_walk_tree on arg with addr_of_non_const_var callback
1481 2021-04-08 Jason Merrill <jason@redhat.com>
1484 * pt.c (determine_specialization): Improve diagnostic.
1486 2021-04-08 Marek Polacek <polacek@redhat.com>
1489 * decl.c (build_explicit_specifier): Call
1490 check_for_bare_parameter_packs.
1491 * except.c (build_noexcept_spec): Likewise.
1493 2021-04-07 Jason Merrill <jason@redhat.com>
1496 * parser.c (cp_parser_class_name): Check dependent_scope_p.
1498 2021-04-07 Jason Merrill <jason@redhat.com>
1501 * pt.c (maybe_process_partial_specialization): Check
1502 DECL_SELF_REFERENCE_P.
1504 2021-04-07 Jason Merrill <jason@redhat.com>
1507 * name-lookup.c (push_class_level_binding_1): Do overload a new
1508 function with a previous using-declaration.
1510 2021-04-06 Jason Merrill <jason@redhat.com>
1513 * init.c (get_nsdmi): Don't defer access checking.
1515 2021-04-06 Jason Merrill <jason@redhat.com>
1518 * decl.c (cp_finish_decl): mark_needed an implicitly inline
1519 static data member with an out-of-class redeclaration.
1521 2021-04-06 Jason Merrill <jason@redhat.com>
1524 * mangle.c (write_compact_number): Add sanity check.
1525 (write_local_name): Use list_length for parm number.
1527 2021-04-06 Patrick Palka <ppalka@redhat.com>
1530 * pt.c (do_auto_deduction): Don't exit early when deducing the
1531 array type of a structured binding. Also handle adc_decomp_type
1532 during constraint checking.
1534 2021-04-05 Jason Merrill <jason@redhat.com>
1537 * typeck.c (check_return_expr): Call mark_exp_read in dependent
1540 2021-04-05 Jason Merrill <jason@redhat.com>
1543 * typeck.c (build_reinterpret_cast_1): Don't perform
1544 temporary materialization.
1546 2021-04-05 Jason Merrill <jason@redhat.com>
1549 * pt.c (lookup_template_class_1): Do tsubst_enum when
1550 tsubsting a generic lambda.
1552 2021-04-05 Jason Merrill <jason@redhat.com>
1555 * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
1556 there is no enclosing non-lambda function.
1558 2021-04-05 Nathan Sidwell <nathan@acm.org>
1561 * module.cc (name_pending_imports): Drop 'atend' parm. Don't
1562 query export when not needed.
1563 (preprocess_module, preprocessed_module): Adjust.
1565 2021-04-05 Jason Merrill <jason@redhat.com>
1568 * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
1570 2021-04-05 Jason Merrill <jason@redhat.com>
1573 * pt.c (class el_data): Add visited field.
1574 (extract_local_specs): Pass it to cp_walk_tree.
1575 (extract_locals_r): Walk into the body of a lambda.
1577 2021-04-05 Jason Merrill <jason@redhat.com>
1579 * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
1582 2021-04-04 Jason Merrill <jason@redhat.com>
1585 * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
1587 2021-04-03 Marek Polacek <polacek@redhat.com>
1590 * parser.c: Create a GC root for attributes in a decl specifier.
1591 (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
1593 2021-04-03 Jason Merrill <jason@redhat.com>
1596 * pt.c (tsubst_lambda_expr): Skip the body block from
1599 2021-04-03 Jason Merrill <jason@redhat.com>
1602 * cvt.c (can_convert_qual): Check fnptr_conv_p.
1604 2021-04-03 Jason Merrill <jason@redhat.com>
1607 * pt.c (regenerate_decl_from_template): tsubst_decl
1610 2021-04-02 Patrick Palka <ppalka@redhat.com>
1613 * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
1614 to do_auto_deduction.
1616 2021-04-02 Patrick Palka <ppalka@redhat.com>
1619 * semantics.c (finish_compound_literal): Check
1620 template_placeholder_p instead of type_uses_auto.
1622 2021-04-02 Jason Merrill <jason@redhat.com>
1625 * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
1626 * lambda.c (add_capture): Set it.
1627 * pt.c (tsubst_pack_expansion): Handle it.
1629 2021-04-02 Nathan Sidwell <nathan@acm.org>
1631 * cp-tree.h (lang_decl_base): Correct module flag comment.
1632 * module.cc (trees_in::assert_definition): Break out
1634 (trees_out::lang_decl_bools): Do not write purview for header units.
1636 2021-04-01 Marek Polacek <polacek@redhat.com>
1639 * method.c (defaulted_late_check): ++ and -- function_depth around
1640 the call to synthesize_method.
1641 * pt.c: Remove the saved_trees global.
1643 2021-04-01 Jason Merrill <jason@redhat.com>
1647 * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
1648 TYPE_RAISES_EXCEPTIONS.
1650 2021-04-01 Iain Sandoe <iain@sandoe.co.uk>
1652 * mapper-client.cc (INCLUDE_MAP): New; require map to be
1653 included from system.h.
1654 * mapper-resolver.cc (INCLUDE_MAP): Likewise.
1656 2021-04-01 Jason Merrill <jason@redhat.com>
1659 * mangle.c (write_expression): Adjust.
1660 * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
1661 (mark_abi_tags_r): Likewise.
1663 2021-04-01 Nathan Sidwell <nathan@acm.org>
1666 * module.cc (trees_out::decl_node): Adjust importedness reference
1668 (module_state::intercluster_seed): New. Seed both imports and
1669 inter-cluster references. Broken out of ...
1670 (module_state::write_cluster): ... here. Call it.
1672 2021-03-31 Jason Merrill <jason@redhat.com>
1675 * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
1677 2021-03-31 Patrick Palka <ppalka@redhat.com>
1680 * mangle.c (write_expression): Adjust the mangling of
1683 2021-03-31 Patrick Palka <ppalka@redhat.com>
1686 * pt.c (placeholder_type_constraint_dependent_p): Expand
1687 argument packs to separate the first non-pack argument
1690 2021-03-30 Nathan Sidwell <nathan@acm.org>
1693 * module.cc (dumper::operator): Make less brittle.
1694 (trees_out::core_bools): VAR_DECLs always have a context.
1695 (trees_out::key_mergeable): Use same_type_p for asserting.
1696 (trees_in::read_var_def): Propagate
1697 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1699 2021-03-30 Jakub Jelinek <jakub@redhat.com>
1702 * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
1704 2021-03-26 Marek Polacek <polacek@redhat.com>
1707 * method.c (implicitly_declare_fn): Pass &raises to
1708 synthesized_method_walk.
1710 2021-03-26 Nathan Sidwell <nathan@acm.org>
1713 * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
1714 (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
1715 * decl.c (duplicate_decls): Remove template_decl module flag
1717 * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
1718 (dumper::impl::nested_name): Adjust for template-decl module flag
1720 (trees_in::assert_definition): Likewise.
1721 (trees_in::install_entity): Likewise.
1722 (trees_out::decl_value): Likewise. Remove alias template
1723 separation of template and type_decl.
1724 (trees_in::decl_value): Likewise.
1725 (trees_out::key_mergeable): Likewise,
1726 (trees_in::key_mergeable): Likewise.
1727 (trees_out::decl_node): Adjust for template-decl module flag
1729 (depset::hash::make_dependency): Likewise.
1730 (get_originating_module, module_may_redeclare): Likewise.
1731 (set_instantiating_module, set_defining_module): Likewise.
1732 * name-lookup.c (name_lookup::search_adl): Likewise.
1733 (do_pushdecl): Likewise.
1734 * pt.c (build_template_decl): Likewise.
1735 (lookup_template_class_1): Remove special alias_template handling
1736 of DECL_TI_TEMPLATE.
1737 (tsubst_template_decl): Likewise.
1739 2021-03-26 Jakub Jelinek <jakub@redhat.com>
1742 * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
1743 in DECL_EXPR or in BIND_EXPR_VARS.
1745 2021-03-25 Jakub Jelinek <jakub@redhat.com>
1748 * parser.c (cp_parser_postfix_expression): For calls, create
1749 combined_loc and temporarily set input_location to it before
1750 calling finish_call_expr.
1752 2021-03-25 Marek Polacek <polacek@redhat.com>
1755 * call.c (build_over_call): Maybe call mark_used in case
1756 deduce_inheriting_ctor fails and return error_mark_node.
1757 * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
1758 * method.c (deduce_inheriting_ctor): Return bool if the deduction
1760 (implicitly_declare_fn): If raises is error_mark_node, call
1761 synthesized_method_walk with diag being true.
1763 2021-03-25 Jakub Jelinek <jakub@redhat.com>
1766 * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
1767 packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
1769 2021-03-25 Marek Polacek <polacek@redhat.com>
1772 * call.c (build_converted_constant_expr_internal): Don't emit
1773 -Wconversion warnings.
1775 2021-03-25 Jakub Jelinek <jakub@redhat.com>
1778 * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
1780 * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
1783 2021-03-23 Nathan Sidwell <nathan@acm.org>
1786 * name-lookup.c (check_module_override): Set global or partition
1787 DUP on the binding vector.
1789 2021-03-23 Marek Polacek <polacek@redhat.com>
1792 * decl2.c (cp_warn_deprecated_use_scopes): Only call
1793 cp_warn_deprecated_use when decl is a namespace, class, or enum.
1795 2021-03-23 Nathan Sidwell <nathan@acm.org>
1798 * decl.c (duplicate_decls): Remove assert about maybe-imported
1801 2021-03-23 Jakub Jelinek <jakub@redhat.com>
1804 * decl.c (cp_finish_decomp): Diagnose void initializers when
1805 using tuple_element and get.
1807 2021-03-22 Nathan Sidwell <nathan@acm.org>
1810 * module.cc (depset::hash::make_dependency): Propagate flags for
1811 partial specialization.
1812 (module_may_redeclare): Handle partial specialization.
1814 2021-03-22 Nathan Sidwell <nathan@acm.org>
1817 * cp-tree.h (map_context_from, map_context_to): Delete.
1818 (add_mergeable_specialization): Add is_alias parm.
1819 * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
1820 * module.cc (map_context_from, map_context_to): Delete.
1821 (trees_in::decl_value): Add specializations later, adjust call.
1822 Drop useless alias lookup. Set duplicate fn parm context.
1823 (check_mergeable_decl): Drop context mapping.
1824 (trees_in::is_matching_decl): Likewise.
1825 (trees_in::read_function_def): Drop parameter context adjustment
1828 2021-03-22 Martin Liska <mliska@suse.cz>
1831 * module.cc (fini_modules): Call vec_free instead of delete.
1833 2021-03-20 Jakub Jelinek <jakub@redhat.com>
1836 * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
1837 special code, instead call c_genericize_control_stmt.
1839 2021-03-19 Jakub Jelinek <jakub@redhat.com>
1842 * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
1843 INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
1844 don't diagnose it, set *non_constant_p nor return t.
1846 2021-03-19 Marek Polacek <polacek@redhat.com>
1849 * parser.c (cp_parser_requirement_parameter_list): Handle
1852 2021-03-18 Marek Polacek <polacek@redhat.com>
1854 * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
1856 2021-03-18 Marek Polacek <polacek@redhat.com>
1858 * pt.c (tsubst_copy_and_build): Add assert.
1860 2021-03-18 Iain Sandoe <iain@sandoe.co.uk>
1863 * parser.c (cp_debug_parser): Add Objective-C++ message
1865 (cp_parser_nested_name_specifier_opt): Allow colon to
1866 terminate an assignment-expression when parsing Objective-
1868 (cp_parser_objc_message_expression): Set and clear message
1869 parsing state on entry and exit.
1870 * parser.h (struct cp_parser): Add a context flag for
1871 Objective-C++ message state.
1873 2021-03-18 Martin Liska <mliska@suse.cz>
1876 * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
1879 2021-03-17 Marek Polacek <polacek@redhat.com>
1882 * call.c (conv_unsafe_in_template_p): New.
1883 (convert_like): Use it.
1885 2021-03-17 Anthony Sharp <anthonysharp15@gmail.com>
1886 Jason Merrill <jason@redhat.com>
1888 * semantics.c (get_class_access_diagnostic_decl): New
1889 function that examines special cases when a parent
1890 class causes a private access failure.
1891 (enforce_access): Slightly modified to call function
1894 2021-03-16 Jason Merrill <jason@redhat.com>
1896 * tree.c (cp_tree_equal): Use real_identical.
1898 2021-03-16 Jakub Jelinek <jakub@redhat.com>
1901 * decl.c (expand_static_init): For thread guards, call __cxa_atexit
1902 before calling __cxa_guard_release rather than after it. Formatting
1905 2021-03-16 Martin Liska <mliska@suse.cz>
1906 Jason Merrill <jason@redhat.com>
1909 * call.c (get_function_version_dispatcher): Handle
1911 * decl.c (maybe_version_functions): Likewise.
1912 (maybe_mark_function_versioned): New.
1913 * name-lookup.c (push_local_extern_decl_alias): No longer static.
1914 * name-lookup.h (push_local_extern_decl_alias): Adjust.
1916 2021-03-16 Nathan Sidwell <nathan@acm.org>
1919 * module.cc (trees_out::decl_value): Adjust typedef streaming,
1920 indicate whether it is a dependent alias.
1921 (trees_in::decl_value): Likewise. Set as dependent alias, if it
1924 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
1927 * coroutines.cc (expand_one_await_expression): If the
1928 await_ready() expression is not a boolean then convert it
1931 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
1934 * coroutines.cc (build_actor_fn): Make destroy index 1
1935 correspond to the abnormal unhandled_exception() exit.
1936 Substitute the proxy for the resume index.
1937 (coro_rewrite_function_body): Arrange to reset the resume
1938 index and make done = true for a rethrown exception from
1939 unhandled_exception ().
1940 (morph_fn_to_coro): Adjust calls to build_actor_fn and
1941 coro_rewrite_function_body.
1943 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
1946 * coroutines.cc (replace_continue): Rewrite continue into
1948 (await_statement_walker): Handle await expressions in the
1949 initializer, condition and iteration expressions of for
1952 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
1955 * coroutines.cc (flatten_await_stmt): Allow for the case
1956 where a target expression variable only has uses in the
1957 second part of a compound expression.
1958 (maybe_promote_temps): Avoid emiting empty statements.
1960 2021-03-15 Tobias Burnus <tobias@codesourcery.com>
1963 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
1964 ensure that the varpool node is marked as offloadable.
1966 2021-03-12 Nathan Sidwell <nathan@acm.org>
1969 * module.cc (depset::hash::add_binding_entity): Assert not
1971 (depset::add::add_specializations): Likewise.
1972 * name-lookup.c (name_lookup::dedup): New.
1973 (name_lookup::~name_lookup): Assert not deduping.
1974 (name_lookup::restore_state): Likewise.
1975 (name_lookup::add_overload): Replace outlined code with dedup
1977 (name_lookup::add_value): Likewise.
1978 (name_lookup::search_namespace_only): Likewise.
1979 (name_lookup::adl_namespace_fns): Likewise.
1980 (name_lookup::adl_class_fns): Likewise.
1981 (name_lookup::search_adl): Likewise. Add clearing dedup call.
1982 (name_lookup::search_qualified): Likewise.
1983 (name_lookup::search_unqualified): Likewise.
1985 2021-03-12 Jakub Jelinek <jakub@redhat.com>
1988 * call.c (build_over_call): For immediate evaluation of functions
1989 that return references, undo convert_from_reference effects before
1990 calling cxx_constant_value and call convert_from_reference
1993 2021-03-11 Nathan Sidwell <nathan@acm.org>
1996 * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
1997 when there's a binding vector.
1998 * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
2000 2021-03-11 Nathan Sidwell <nathan@acm.org>
2003 * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
2005 (trees_in::decl_value): Adjust add_mergeable_specialization call.
2006 (trees_out::get_merge_kind): Adjust detecting a partial template
2008 (trees_out::key_mergeable): Adjust handling same.
2009 (trees_in::key_mergeabvle): Likewise.
2011 2021-03-10 Nathan Sidwell <nathan@acm.org>
2014 * module.cc (post_load_processing): Assert not gcable.
2015 (laxy_load_pendings): Extend no-gc region around
2016 post_load_processing.
2018 2021-03-10 Nathan Sidwell <nathan@acm.org>
2021 * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
2022 assembler name to the ns alias.
2024 2021-03-09 Jakub Jelinek <jakub@redhat.com>
2027 * coroutines.cc (build_co_await): Look through NOP_EXPRs in
2028 build_special_member_call return value to find the CALL_EXPR.
2031 2021-03-09 Nathan Sidwell <nathan@acm.org>
2034 * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
2035 that C++20 does not yet imply modules.
2037 2021-03-08 Nathan Sidwell <nathan@acm.org>
2040 * name-lookup.c (get_cxx_dialect_name): Add cxx23.
2042 2021-03-08 Nathan Sidwell <nathan@acm.org>
2044 * lex.c (module_token_filter::resume): Ignore module-decls inside
2046 * parser.c (cp_parser_module_declaration): Reject in header-unit.
2048 2021-03-08 Nathan Sidwell <nathan@acm.org>
2051 * cp-tree.h (match_mergeable_specialization)
2052 (add_mergeable_specialization): Adjust parms.
2053 * module.cc (trees_in::decl_value): Adjust
2054 add_mergeable_specialization calls.
2055 (trees_out::key_mergeable): Adjust match_mergeable_specialization
2057 (specialization_add): Likewise.
2058 * pt.c (match_mergeable_specialization): Do not insert.
2059 (add_mergeable_specialization): Add to hash table here.
2061 2021-03-06 Patrick Palka <ppalka@redhat.com>
2062 Jakub Jelinek <jakub@redhat.com>
2065 * constexpr.c (cxx_eval_increment_expression): Pass lval when
2066 evaluating the MODIFY_EXPR, and update 'mod' with the result of
2067 this evaluation. Check *non_constant_p afterwards. For prefix
2068 ops, just return 'mod'.
2070 2021-03-06 Patrick Palka <ppalka@redhat.com>
2071 Jakub Jelinek <jakub@redhat.com>
2074 * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
2075 variable 'fn' to 'tmpl'. Handle a variable template-id by
2076 calling lookup_template_variable.
2078 2021-03-06 Patrick Palka <ppalka@redhat.com>
2081 * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
2082 outer_targs to do_auto_deduction.
2083 (placeholder_type_constraint_dependent_p): Define.
2084 (do_auto_deduction): When processing_template_decl != 0
2085 and context is adc_unify and we have constraints, pretend the
2086 constraints are satisfied instead of punting. Otherwise don't
2087 punt unless placeholder_type_constraint_dependent_p holds.
2088 Add some clarifying sanity checks. Add a hack to add missing
2089 outermost template levels to outer_args before checking
2090 satisfaction. Don't substitute outer_targs into type if it's
2093 2021-03-05 Marek Polacek <polacek@redhat.com>
2096 * call.c (standard_conversion): When converting pointers to
2097 member, don't return NULL when the bases are equivalent but
2100 2021-03-05 Marek Polacek <polacek@redhat.com>
2103 * name-lookup.c (check_local_shadow): Check if the type of decl
2104 is non-null before checking TYPE_PTR*.
2106 2021-03-05 Nathan Sidwell <nathan@acm.org>
2109 * module.cc (module_state::write_cluster): Relax binding assert.
2111 2021-03-05 Nathan Sidwell <nathan@acm.org>
2114 * pt.c (instantiate_decl): Call set_instantiating_module.
2116 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
2119 * coroutines.cc (build_co_await): Use type_build_ctor_call()
2120 to determine cases when a CTOR needs to be built.
2121 (flatten_await_stmt): Likewise.
2122 (morph_fn_to_coro): Likewise.
2124 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
2127 * coroutines.cc (coro_diagnose_throwing_fn): New helper.
2128 (coro_diagnose_throwing_final_aw_expr): New helper.
2129 (build_co_await): Diagnose throwing final await expression
2131 (build_init_or_final_await): Diagnose a throwing promise
2132 final_suspend() call.
2134 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
2137 * coroutines.cc (struct param_info): Track parameter copies that need
2139 (coro_get_frame_dtor): New helper function factored from build_actor().
2140 (build_actor_fn): Use coro_get_frame_dtor().
2141 (morph_fn_to_coro): Track parameters that need DTORs on exception,
2142 likewise the frame promise and the return object. On exception, run the
2143 DTORs for these, destroy the frame and then rethrow the exception.
2145 2021-03-05 Nathan Sidwell <nathan@acm.org>
2148 * pt.c (instantiate_class_template_1): Set instantiating module
2151 2021-03-05 Tobias Burnus <tobias@codesourcery.com>
2154 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
2156 2021-03-04 Jakub Jelinek <jakub@redhat.com>
2160 * cvt.c (convert_to_void): Revert 2019-10-17 changes. Clarify
2163 2021-03-04 Nathan Sidwell <nathan@acm.org>
2166 * module.cc (class uintset): Delete.
2167 (typedef attached_map_t): A hash map.
2168 (attached_table): Use attached_map_t. Adjust uses ...
2169 (trees_out::decl_value, trees_in::decl_value): ... here ...
2170 (trees_out::key_mergeable): ... here ...
2171 (trees_in::key_mergeable): ... here ...
2172 (maybe_attach_decl): ... here ...
2173 (direct_import): ... and here.
2175 2021-03-04 Nathan Sidwell <nathan@acm.org>
2179 * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
2181 * module.cc (class pending_key): New.
2182 (default_hash_traits<pending_key>): New specialization.
2183 (pending_map_t): New typedef.
2184 (pending_table): Replace old table.
2185 (trees_out::lang_decl_bools): Adjust.
2186 (trees_in::lang_decl_bools): Adjust.
2187 (trees_in::install_entity): Drop pending member and specialization
2189 (find_pending_key): New.
2190 (depset::hash::fiund_dependencies): Use it.
2191 (pendset_lazy_load): Delete.
2192 (module_state::write_cluster): Don't count pendings here. Bye
2193 Duff's device-like thing.
2194 (module_state::write_pendings): Reimplement.
2195 (module_state::read_pendings): Reimplement.
2196 (lazy_specializations_p): Delete.
2197 (module_state::write): Adjust write_pendings call.
2198 (lazy_load_pendings): New.
2199 (lazy_load_specializations): Delete.
2200 (lazy_load_members): Delete.
2201 (init_modules): Adjust.
2202 * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
2203 not lazy_load_members.
2204 (note_pending_specializations): Delete.
2205 (load_pending_specializations): Delete.
2206 * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
2207 (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
2208 (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
2209 (note_pending_specializations): Delete.
2210 (load_pending_specializations): Delete.
2211 * pt.c (lookup_template_class_1): Call lazy_load_pendings not
2212 lazy_load_specializations.
2213 (instantiate_template_class_1): Likewise.
2214 (instantiate_decl): Call lazy_load_pendings.
2215 * typeck.c (complete_type): Likewise.
2217 2021-03-03 Nathan Sidwell <nathan@acm.org>
2220 * module.cc (post_load_decls): New.
2221 (lazy_snum, recursive_lazy): Move earlier.
2222 (module_state::read_cluster): Push cloning onto post_load_decls.
2223 (post_load_processing): New. Do the cloning here.
2224 (module_state::read_inits): Call post_load_processing.
2225 (module_state::read_language): Likewise.
2226 (lazy_load_binding, lazy_load_specializations): Likewise
2227 (lazy_load_members): Likewise
2229 2021-03-03 Nathan Sidwell <nathan@acm.org>
2232 * module.cc (trees_out::decl_value): Stream specialization keys
2234 (trees_in::decl_value): Stream them back and insert after
2235 completing the decl.
2236 (trees_out::key_mergeable): Drop some streaming here ...
2237 (trees_in::key_mergeable): ... and here. Don't insert into
2238 specialization tables.
2240 2021-03-03 Patrick Palka <ppalka@redhat.com>
2242 * constraint.cc (struct sat_info): Document the different
2243 meanings of noisy() and diagnose_unsatisfaction_p() during
2244 satisfaction and requires-expression evaluation.
2245 (tsubst_valid_expression_requirement): Take a sat_info instead
2246 of a subst_info. Perform the substitution quietly first. Fold
2247 in error-replaying code from diagnose_valid_expression.
2248 (tsubst_simple_requirement): Take a sat_info instead of a
2250 (tsubst_type_requirement_1): New. Fold in error-replaying code
2251 from diagnose_valid_type.
2252 (tsubst_type_requirement): Use the above. Take a sat_info
2253 instead of a subst_info.
2254 (tsubst_compound_requirement): Likewise. Fold in
2255 error-replaying code from diagnose_compound_requirement.
2256 (tsubst_nested_requirement): Take a sat_info instead of a
2257 subst_info. Fold in error-replaying code from
2258 diagnose_nested_requirement.
2259 (tsubst_requirement): Take a sat_info instead of a subst_info.
2260 (tsubst_requires_expr): Split into two versions, one that takes
2261 a sat_info argument and another that takes a complain and
2262 in_decl argument. Remove outdated documentation. Document the
2263 effects of the sat_info argument. Don't short-circuit
2264 processing of requirements when diagnosing unsatisfaction,
2265 mirroring diagnose_requires_expr.
2266 (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
2267 assert, and se the three-parameter version of tsubst_requires_expr.
2268 (diagnose_trait_expr): Make static. Take a template argument
2269 vector instead of a parameter mapping.
2270 (diagnose_valid_expression): Remove.
2271 (diagnose_valid_type): Remove.
2272 (diagnose_simple_requirement): Remove.
2273 (diagnose_compound_requirement): Remove.
2274 (diagnose_type_requirement): Remove.
2275 (diagnose_nested_requirement): Remove.
2276 (diagnose_requirement): Remove.
2277 (diagnose_requires_expr): Remove.
2278 (diagnose_atomic_constraint): Take a sat_info instead of a
2279 subst_info. Adjust call to diagnose_trait_expr. Call
2280 tsubst_requires_expr instead of diagnose_requires_expr.
2281 (diagnose_constraints): Remove special casing of REQUIRES_EXPR
2282 and just always call constraint_satisfaction_value.
2284 2021-03-03 Patrick Palka <ppalka@redhat.com>
2286 * constexpr.c (cxx_eval_call_expression): Adjust call to
2287 evaluate_concept_check.
2288 (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
2289 evaluate_requires_expression instead of
2290 satisfy_constraint_expression.
2291 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
2292 * constraint.cc (struct sat_info): Adjust comment about which
2293 satisfaction entrypoints use noisy-unsat.
2294 (normalize_template_requirements): Remove (and adjust callers
2296 (normalize_nontemplate_requirements): Likewise.
2297 (tsubst_nested_requirement): Use constraint_satisfaction_value
2298 instead of satisfy_constraint_expression, which'll do the
2299 noisy replaying of ill-formed quiet satisfaction for us.
2300 (decl_satisfied_cache): Adjust comment.
2301 (satisfy_constraint): Rename to ...
2302 (satisfy_normalized_constraints): ... this.
2303 (satisfy_associated_constraints): Remove (and make its
2304 callers check for dependent arguments).
2305 (satisfy_constraint_expression): Rename to ...
2306 (satisfy_nondeclaration_constraints): ... this. Assert that
2307 'args' is empty when 't' is a concept-id. Removing handling
2308 bare constraint-expressions, and handle REQUIRES_EXPRs
2309 specially. Adjust comment accordingly.
2310 (satisfy_declaration_constraints): Assert in the two-parameter
2311 version that 't' is not a TEMPLATE_DECL. Adjust following
2312 removal of normalize_(non)?template_requirements and
2313 satisfy_asociated_constraints.
2314 (constraint_satisfaction_value): Combine the two- and
2315 three-parameter versions in the natural way.
2316 (constraints_satisfied_p): Combine the one- and two-parameter
2317 versions in the natural way. Improve documentation.
2318 (evaluate_requires_expr): Define.
2319 (evaluate_concept_check): Remove 'complain' parameter. Use
2320 constraint_satisfaction_value instead of
2321 satisfy_constraint_expression.
2322 (diagnose_nested_requirement): Adjust following renaming of
2323 satisfy_constraint_expression.
2324 (diagnose_constraints): Handle REQUIRES_EXPR by going through
2325 diagnose_requires_expr directly instead of treating it as a
2326 constraint-expression. Improve documentation.
2327 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
2328 to evaluate_concept_check.
2329 <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
2330 constraints_satisfied_p.
2331 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
2332 * cp-tree.h (evaluate_requires_expr): Declare.
2333 (evaluate_concept_check): Remove tsubst_flag_t parameter.
2334 (satisfy_constraint_expression): Remove declaration.
2335 (constraints_satisfied_p): Remove one-parameter declaration.
2336 Add a default argument to the two-parameter declaration.
2337 * cvt.c (convert_to_void): Adjust call to
2338 evaluate_concept_check.
2340 2021-03-03 Jakub Jelinek <jakub@redhat.com>
2343 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
2346 2021-03-03 Marek Polacek <polacek@redhat.com>
2350 * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
2351 (maybe_aggr_guide): Use the original template type where needed. In
2352 a class member template, partially instantiate the result of
2353 collect_ctor_idx_types.
2354 (do_class_deduction): Defer the deduction until the enclosing
2355 scope is non-dependent.
2357 2021-03-03 Jason Merrill <jason@redhat.com>
2360 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
2361 if it didn't get one before.
2363 2021-03-03 Nathan Sidwell <nathan@acm.org>
2366 * module.cc (trees_out::decl_node): Small refactor.
2367 (depset::hash::add_binding_entity): Return true on meeting an
2368 import. Set namespace's import here.
2369 (module_state:write_namespaces): Inform of purview too.
2370 (module_state:read_namespaces): Adjust.
2371 * name-lookup.c (implicitly_export_namespace): Delete.
2372 (do_pushdecl): Don't call it.
2373 (push_namespace): Likewise, set purview.
2374 (add_imported_namespace): Reorder parms.
2375 * name-lookup.h (add_imported_namespace): Alter param ordering.
2377 2021-03-02 Martin Sebor <msebor@redhat.com>
2380 * class.c (build_base_path): Call build_if_nonnull.
2381 * cp-tree.h (build_if_nonnull): Declare.
2382 * rtti.c (ifnonnull): Rename...
2383 (build_if_nonnull): ...to this. Set no-warning bit on COND_EXPR.
2384 (build_dynamic_cast_1): Adjust to name change.
2386 2021-03-02 Patrick Palka <ppalka@redhat.com>
2390 * constraint.cc (type_deducible_p): Don't substitute into the
2391 constraints, and instead just pass 'args' to do_auto_deduction
2392 as the outer template arguments.
2393 (tsubst_parameter_mapping): Remove confused code for handling
2394 placeholder type arguments.
2395 (normalize_placeholder_type_constraint): Define.
2396 (satisfy_constraint_expression): Use it to handle placeholder
2398 * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
2399 (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
2400 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
2401 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
2402 (make_constrained_placeholder_type): Set
2403 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
2404 (do_auto_deduction): Clarify comments about the outer_targs
2405 parameter. Rework satisfaction of a placeholder type constraint
2406 to pass in the complete set of template arguments directly to
2407 constraints_satisfied_p.
2408 (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
2409 instead. Also rebuild the the constraint info on the new auto.
2411 2021-03-02 Patrick Palka <ppalka@redhat.com>
2413 * constraint.cc (build_parameter_mapping): Rely on the caller to
2414 determine the in-scope template parameters.
2415 (norm_info::norm_info): Delegate the tsubst_flags_t constructor
2416 to the two-parameter constructor. In the two-parameter
2417 constructor, fold in the definition of make_context, set
2418 initial_parms appropriately, and don't set the now-removed
2420 (norm_info::make_context): Remove, now that its only use is
2421 inlined into the caller.
2422 (norm_info::update_context): Adjust call to
2423 build_parameter_mapping to pass in the relevant set of in-scope
2424 template parameters.
2425 (norm_info::ctx_parms): Define this member function.
2426 (norm_info::context): Initialize to NULL_TREE.
2427 (norm_info::orig_decl): Remove this data member.
2428 (norm_info::initial_parms): Define this data member.
2429 (normalize_atom): Adjust call to build_parameter_mapping to pass
2430 in the relevant set of in-scope template parameters. Use
2431 info.initial_parms instead of info.orig_decl.
2432 (normalize_constraint_expression): Take a norm_info object
2433 instead of a bool. Cache the result of normalization.
2434 (tsubst_nested_requirement): Call satisfy_constraint_expression
2435 instead of satisfy_constraint, so that we normalize on demand.
2436 (satisfy_constraint_expression): Handle a NESTED_REQ argument.
2437 Adjust call to normalize_constraint_expression.
2438 (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
2439 to current_template_parms.
2440 (diagnose_nested_requirements): Go through
2441 satisfy_constraint_expression, as with tsubst_nested_requirement.
2443 2021-03-02 Patrick Palka <ppalka@redhat.com>
2445 * constraint.cc (tsubst_parameter_mapping): Canonicalize the
2446 arguments of a substituted TYPE_ARGUMENT_PACK even if we've
2447 started with a TYPE_ARGUMENT_PACK.
2448 (finish_requires_expr): Don't set DECL_CONTEXT and
2449 CONSTRAINT_VAR_P on each of the introduced parameters here.
2450 * parser.c (cp_parser_requirement_parameter_list): Instead set
2451 these fields earlier, here.
2452 * pt.c (do_auto_deduction): Canonicalize the result of
2453 do_auto_deduction. Pass 'complain' to finish_decltype_type.
2455 2021-03-02 Patrick Palka <ppalka@redhat.com>
2457 * constraint.cc (tsubst_simple_requirement): Just return
2458 boolean_true_node on success.
2459 (tsubst_type_requirement): Likewise.
2460 (tsubst_compound_requirement): Likewise.
2461 (tsubst_nested_requirement): Likewise.
2462 (tsubst_requirement_body): Remove.
2463 (check_constaint_variables): Rename to ...
2464 (check_constraint_variables): ... this.
2465 (tsubst_constraint_variables): Adjust.
2466 (tsubst_requires_expr): Fold tsubst_requirement_body into here.
2468 2021-03-01 Nathan Sidwell <nathan@acm.org>
2471 * class.c (fixup_type_variants): Propagate mode, precision,
2472 alignment & emptiness.
2473 * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
2474 (trees_in::tree_node): Rematerialize alignment here.
2476 2021-02-27 Jason Merrill <jason@redhat.com>
2479 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
2482 2021-02-26 Jakub Jelinek <jakub@redhat.com>
2484 * parser.c (cp_parser_lambda_declarator_opt): Implement
2485 P1102R2 - Down with ()! Make ()s optional before lambda specifiers
2486 for -std={c,gnu}++2b or with pedwarn in earlier versions.
2488 2021-02-26 Jakub Jelinek <jakub@redhat.com>
2491 * lambda.c (is_lambda_ignored_entity): Before checking for
2492 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check.
2494 2021-02-26 Jason Merrill <jason@redhat.com>
2497 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
2498 to a class non-type template argument that needs it.
2500 2021-02-26 Patrick Palka <ppalka@redhat.com>
2503 * pt.c (splice_late_return_type): Rebuild the entire return type
2504 if we have to adjust the level of an auto within.
2505 (type_uses_auto): Adjust call to find_type_usage.
2506 * type-utils.h (find_type_usage): Revert r10-6571 change that
2507 made this function return a pointer to the auto node.
2509 2021-02-25 Patrick Palka <ppalka@redhat.com>
2513 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
2514 TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
2516 2021-02-25 Patrick Palka <ppalka@redhat.com>
2519 * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
2520 (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
2522 2021-02-25 Marek Polacek <polacek@redhat.com>
2526 * constexpr.c (is_std_construct_at): New overload.
2527 (is_std_allocator_allocate): New overload.
2528 (cxx_eval_call_expression): Use the new overloads.
2529 (cxx_eval_constant_expression): Reject casting
2530 from void * as per DR 1312. Don't check can_convert.
2532 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
2535 * coroutines.cc (struct param_info): Track rvalue refs.
2536 (morph_fn_to_coro): Track rvalue refs, and call the promise
2537 CTOR with the frame copy of passed parms.
2539 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
2542 * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
2543 set throwing_cleanup marker.
2545 2021-02-25 Nathan Sidwell <nathan@acm.org>
2548 * module.cc (module_state::inform_cmi_p): Renamed field.
2549 (module_state::do_import): Adjust.
2550 (init_modules, finish_module_processing): Likewise.
2551 (handle_module_option): Likewise.
2553 2021-02-25 Nathan Sidwell <nathan@acm.org>
2556 * mapper-client.cc (module_client::open_module_client): Fix typo
2559 2021-02-24 Nathan Sidwell <nathan@acm.org>
2562 * module.cc (ool): New indirection vector.
2563 (loc_spans::maybe_propagate): Location is not optional.
2564 (loc_spans::open): Likewise. Assert monotonically advancing.
2565 (module_for_ordinary_loc): Use ool indirection vector.
2566 (module_state::write_prepare_maps): Do not count empty macro
2567 expansions. Elide empty spans.
2568 (module_state::write_macro_maps): Skip empty expansions.
2569 (ool_cmp): New qsort comparator.
2570 (module_state::write): Create and destroy ool vector.
2571 (name_pending_imports): Fix dump push/pop.
2572 (preprocess_module): Likewise. Add more dumping.
2573 (preprocessed_module): Likewise.
2575 2021-02-24 Iain Sandoe <iain@sandoe.co.uk>
2578 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
2579 error reporting when instantiating for a constexpr.
2581 2021-02-23 Nathan Sidwell <nathan@acm.org>
2584 * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
2587 2021-02-23 Patrick Palka <ppalka@redhat.com>
2590 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
2591 over from tsubst_copy.
2593 2021-02-23 Patrick Palka <ppalka@redhat.com>
2595 * pt.c (instantiation_dependent_expression_p): Check
2596 processing_template_decl before calling
2597 potential_constant_expression.
2599 2021-02-22 Nathan Sidwell <nathan@acm.org>
2602 * module.cc (struct module_state): Add visited_p flag.
2603 (name_pending_imports): Use it to avoid duplicate requests.
2604 (preprocess_module): Don't read preprocessor state if we failed to
2605 load a module's config.
2607 2021-02-22 Nathan Sidwell <nathan@acm.org>
2610 * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
2612 * module.cc (set_defining_module): Add assert.
2614 2021-02-19 Nathan Sidwell <nathan@acm.org>
2617 * module.cc (pending_imports): New.
2618 (declare_module): Adjust test condition.
2619 (name_pending_imports): New.
2620 (preprocess_module): Reimplement using pending_imports.
2621 (preprocessed_module): Move name-getting to name_pending_imports.
2622 * name-lookup.c (append_imported_binding_slot): Assert module
2623 ordering is increasing.
2625 2021-02-19 Nathan Sidwell <nathan@acm.org>
2627 * module.cc (note_cmis): New.
2628 (struct module_state): Add inform_read_p bit.
2629 (module_state::do_import): Inform of CMI location, if enabled.
2630 (init_modules): Canonicalize note_cmis entries.
2631 (handle_module_option): Handle -flang-info-module-read=FOO.
2633 2021-02-19 Jason Merrill <jason@redhat.com>
2636 * call.c (perfect_conversion_p): Limit rvalueness
2637 test to reference bindings.
2639 2021-02-19 Jason Merrill <jason@redhat.com>
2642 * call.c (perfect_conversion_p): New.
2643 (perfect_candidate_p): New.
2644 (add_candidates): Ignore templates after a perfect non-template.
2646 2021-02-18 Nathan Sidwell <nathan@acm.org>
2649 * module.cc (canonicalize_header_name): Use
2650 cpp_probe_header_unit.
2651 (maybe_translate_include): Fix note_includes comparison.
2652 (init_modules): Fix note_includes string termination.
2654 2021-02-18 Jakub Jelinek <jakub@redhat.com>
2657 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
2658 cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
2659 for immediate function calls.
2661 2021-02-17 Nathan Sidwell <nathan@acm.org>
2664 * module.cc (struct macro_export): Add GTY markers.
2665 (macro_exports): Likewise, us a va_gc Vector.
2667 2021-02-17 Jakub Jelinek <jakub@redhat.com>
2670 * init.c (build_zero_init_1): For flexible array members just return
2671 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
2674 2021-02-17 Nathan Sidwell <nathan@acm.org>
2677 * name-lookup.c (do_pushdecl): Don't peek under template_parm
2679 (set_identifier_type_value_with_scope): ... or here.
2680 (do_pushtag): Only set_identifier_type_value_with_scope at
2681 non-class template parm scope, and use parent scope.
2683 2021-02-17 Nathan Sidwell <nathan@acm.org>
2686 * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
2689 2021-02-17 Patrick Palka <ppalka@redhat.com>
2693 * tree.c (build_aggr_init_expr): Revert r10-7718 change.
2695 2021-02-12 Nathan Sidwell <nathan@acm.org>
2697 * module.cc (module_state::write_cluster): Check bindings for
2698 imported using-decls.
2700 2021-02-12 Nathan Sidwell <nathan@acm.org>
2703 * module.cc (trees_in::decl_value): Call add_module_namespace_decl
2704 for new namespace-scope entities.
2705 (module_state::read_cluster): Don't call add_module_decl here.
2706 * name-lookup.h (add_module_decl): Rename to ...
2707 (add_module_namespace_decl): ... this.
2708 * name-lookup.c (newbinding_bookkeeping): Move into ...
2709 (do_pushdecl): ... here. Its only remaining caller.
2710 (add_module_decl): Rename to ...
2711 (add_module_namespace_decl): ... here. Add checking-assert for
2712 circularity. Don't call newbinding_bookkeeping, just extern_c
2713 checking and incomplete var checking.
2715 2021-02-12 Nathan Sidwell <nathan@acm.org>
2719 * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
2720 (global_type_node): Delete.
2721 (IDENTIFIER_TYPE_VALUE): Delete.
2722 (IDENTIFIER_HAS_TYPE_VALUE): Delete.
2723 (get_type_value): Delete.
2724 * name-lookup.h (identifier_type_value): Delete.
2725 * name-lookup.c (check_module_override): Don't
2726 SET_IDENTIFIER_TYPE_VALUE here.
2727 (do_pushdecl): Nor here.
2728 (identifier_type_value_1, identifier_type_value): Delete.
2729 (set_identifier_type_value_with_scope): Only
2730 SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
2731 (pushdecl_nanmespace_level): Remove shadow stack nadgering.
2732 (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
2733 * call.c (check_dtor_name): Use lookup_name.
2734 * decl.c (cxx_init_decl_processing): Drop global_type_node.
2735 * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
2737 * init.c (get_type_value): Delete.
2738 * pt.c (instantiate_class_template_1): Don't call pushtag or
2739 SET_IDENTIFIER_TYPE_VALUE here.
2740 (tsubst): Assert never an identifier.
2741 (dependent_type_p): Drop global_type_node assert.
2742 * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
2743 to determine ctorness.
2745 2021-02-12 Jakub Jelinek <jakub@redhat.com>
2748 * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
2751 2021-02-12 Jason Merrill <jason@redhat.com>
2755 * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
2756 (register_parameter_specializations): Not here.
2758 2021-02-11 Marek Polacek <polacek@redhat.com>
2761 * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
2762 for the partial instantiation.
2764 2021-02-11 Jakub Jelinek <jakub@redhat.com>
2767 * init.c (build_zero_init_1): Handle zero initialiation of
2768 flexible array members like initialization of [0] arrays.
2769 Use integer_minus_onep instead of comparison to integer_minus_one_node
2770 and integer_zerop instead of comparison against size_zero_node.
2773 2021-02-11 Marek Polacek <polacek@redhat.com>
2776 * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
2778 2021-02-11 Patrick Palka <ppalka@redhat.com>
2781 * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
2782 lookup result by discarding it if the first element is a
2783 class-scope declaration, otherwise return it.
2784 (push_operator_bindings): Handle an ambiguous lookup result by
2785 doing push_local_binding on each element in the list.
2787 2021-02-11 Marek Polacek <polacek@redhat.com>
2789 * parser.c (cp_parser_selection_statement): Use vec_free.
2791 2021-02-10 Jakub Jelinek <jakub@redhat.com>
2795 * constexpr.c: Include cgraph.h.
2796 (cxx_eval_call_expression): Call varpool_node::finalize_decl on
2797 heap artificial vars.
2798 (cxx_eval_outermost_constant_expr): Remove varpool nodes for
2799 heap artificial vars.
2801 2021-02-10 Nathan Sidwell <nathan@acm.org>
2804 * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
2805 answer if there's no local specialization.
2807 2021-02-09 Nathan Sidwell <nathan@acm.org>
2810 * module.cc (module_state::is_rooted): Rename to ...
2811 (module_state::has_location): ... here. Adjust callers.
2812 (module_state::read_partitions): Adjust validity check.
2813 Don't overwrite a known location.
2815 2021-02-09 Jason Merrill <jason@redhat.com>
2818 * pt.c (mark_decl_instantiated): Exit early if consteval.
2820 2021-02-09 Jason Merrill <jason@redhat.com>
2824 * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
2827 2021-02-09 Jason Merrill <jason@redhat.com>
2831 * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
2834 2021-02-08 Nathan Sidwell <nathan@acm.org>
2836 * decl.c (start_cleanup_fn): Push function into
2839 2021-02-08 Nathan Sidwell <nathan@acm.org>
2842 * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
2843 * decl.c (push_abi_namespace, pop_abi_namespace): Moved
2844 from rtti.c, add default namespace arg.
2845 (check_redeclaration_exception_specification): Allow a lazy
2846 builtin's eh spec to differ from an lready-declared user
2848 (declare_global_var): Use push/pop_abi_namespace.
2849 (get_atexit_node): Push the fndecl into a namespace.
2850 * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
2853 2021-02-08 Marek Polacek <polacek@redhat.com>
2855 * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
2857 2021-02-05 Marek Polacek <polacek@redhat.com>
2860 * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
2862 * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
2863 issuing the -Wvolatile warning. Only set TREE_THIS_VOLATILE if
2864 a warning was emitted.
2866 2021-02-05 Marek Polacek <polacek@redhat.com>
2869 * name-lookup.c (lookup_using_decl): Hoist the destructor check.
2871 2021-02-05 Jakub Jelinek <jakub@redhat.com>
2874 * decl.c (check_array_initializer): For structured bindings, require
2875 the array type to be complete.
2877 2021-02-04 Jason Merrill <jason@redhat.com>
2880 * constraint.cc (build_concept_check_arguments): Remove assert.
2881 (build_concept_check): Allow empty args.
2883 2021-02-04 Tom Greenslade (thomgree) <thomgree@cisco.com>
2886 * call.c (can_convert_array): Extend to handle all valid aggregate
2887 initializers of an array; including by string literals, not just by
2889 (build_aggr_conv): Call can_convert_array more often, not just in
2890 brace-init-list case.
2891 * typeck2.c (array_string_literal_compatible_p): New function.
2892 (digest_init_r): call array_string_literal_compatible_p
2893 * cp-tree.h: (array_string_literal_compatible_p): Declare.
2895 2021-02-04 Jason Merrill <jason@redhat.com>
2898 * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
2900 2021-02-04 Jason Merrill <jason@redhat.com>
2903 * pt.c (tsubst_attribute): Handle error.
2904 (apply_late_template_attributes): Return false on error.
2905 (tsubst_function_decl): Check its return value.
2906 (tsubst_decl): Likewise.
2907 (push_template_decl): Assert current_template_parms.
2908 (tsubst_template_decl): Set current_template_parms.
2910 2021-02-03 Marek Polacek <polacek@redhat.com>
2913 * call.c (struct z_candidate): Mark rewritten and reversed as const.
2914 (struct NonPublicField): Mark operator() as const.
2915 (struct NonTrivialField): Likewise.
2917 2021-02-03 Jason Merrill <jason@redhat.com>
2921 * pt.c (spec_hasher::equal): Set processing_template_decl.
2922 * Make-lang.in (check-g++-strict-gc): Add --param
2923 hash-table-verification-limit=10000.
2925 2021-02-03 Marek Polacek <polacek@redhat.com>
2928 * parser.c (cp_parser_class_specifier_1): Use any possible
2929 DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
2930 (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
2931 * pt.c (tsubst_exception_specification): Stash new_specs into
2932 DEFPARSE_INSTANTIATIONS.
2933 * tree.c (fixup_deferred_exception_variants): Use
2934 UNPARSED_NOEXCEPT_SPEC_P.
2936 2021-02-02 Jason Merrill <jason@redhat.com>
2940 * error.c (dump_expr): Ignore dummy object.
2941 * pt.c (tsubst_baselink): Handle dependent scope.
2943 2021-02-01 Patrick Palka <ppalka@redhat.com>
2946 * constexpr.c (cxx_eval_array_reference): Also set
2947 new_ctx.object when setting new_ctx.ctor.
2949 2021-02-01 Marek Polacek <polacek@redhat.com>
2952 * parser.c (cp_parser_has_attribute_expression): Use
2953 uses_template_parms instead of type_dependent_expression_p.
2955 2021-02-01 Jason Merrill <jason@redhat.com>
2958 * cp-tree.h: Declare it.
2959 * pt.c (comparing_dependent_aliases): New flag.
2960 (template_args_equal, spec_hasher::equal): Set it.
2961 (dependent_alias_template_spec_p): Assert that we don't
2962 get non-types other than error_mark_node.
2963 (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
2964 on complex alias specializations. Set TYPE_DEPENDENT_P here.
2965 (tsubst_decl): Not here.
2966 * module.cc (module_state::read_cluster): Set
2967 comparing_dependent_aliases instead of
2968 comparing_specializations.
2969 * tree.c (cp_tree_equal): Remove comparing_specializations
2971 * typeck.c (structural_comptypes): Adjust.
2972 (comptypes): Remove comparing_specializations handling.
2974 2021-01-29 Nathan Sidwell <nathan@acm.org>
2977 * module.cc (module_state_config): Add num_entities field.
2978 (module_state::read_entities): The entity_ary span is
2980 (module_state::write_config): Write num_entities.
2981 (module_state::read_config): Read num_entities.
2982 (module_state::write): Set config's num_entities.
2983 (module_state::read_initial): Allocate the entity ary
2985 (module_state::read_language): Do not set entity_lwm
2988 2021-01-29 Marek Polacek <polacek@redhat.com>
2991 * parser.c (cp_parser_class_name): If parser->scope is
2992 error_mark_node, return it, otherwise continue.
2994 2021-01-28 Jakub Jelinek <jakub@redhat.com>
2997 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
2999 2021-01-28 Jakub Jelinek <jakub@redhat.com>
3003 * decl.c (cp_finish_decl): For register vars with asmspec in templates
3004 call set_user_assembler_name and set DECL_HARD_REGISTER.
3005 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
3006 pass asmspec_tree to cp_finish_decl.
3008 2021-01-28 Nathan Sidwell <nathan@acm.org>
3011 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
3013 (trees_in::decl_value): Do typedef frobbing only when installing
3014 a new typedef, adjust is_matching_decl call. Swap is_typedef
3016 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
3017 names and deal with typedef checking.
3019 2021-01-27 Jason Merrill <jason@redhat.com>
3022 * name-lookup.c (lookup_using_decl): Clean up handling
3023 of dependency and inherited constructors.
3024 (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
3025 * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
3027 2021-01-26 Jason Merrill <jason@redhat.com>
3030 * call.c (type_passed_as): Don't mark invisiref restrict.
3032 2021-01-26 Jason Merrill <jason@redhat.com>
3036 * class.c (layout_class_type): An empty field gets size 0.
3037 (is_empty_field): New.
3038 (check_bases): Check it.
3039 * cp-tree.h (is_empty_field): Declare it.
3040 * constexpr.c (cxx_eval_store_expression): Check it.
3041 (cx_check_missing_mem_inits): Likewise.
3042 * init.c (perform_member_init): Likewise.
3043 * typeck2.c (process_init_constructor_record): Likewise.
3045 2021-01-25 Martin Sebor <msebor@redhat.com>
3048 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
3050 2021-01-25 Jason Merrill <jason@redhat.com>
3053 * constexpr.c (get_or_insert_ctor_field): Add check.
3054 (cxx_eval_store_expression): Handle discontinuity of refs.
3056 2021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
3058 * call.c (complain_about_access): Altered function.
3059 * cp-tree.h (complain_about_access): Changed parameters of function.
3060 (get_parent_with_private_access): Declared new function.
3061 * search.c (get_parent_with_private_access): Defined new function.
3062 * semantics.c (enforce_access): Modified function.
3063 * typeck.c (complain_about_unrecognized_member): Updated function
3064 arguments in complain_about_access.
3066 2021-01-23 Patrick Palka <ppalka@redhat.com>
3069 * cp-tree.h (shared_member_p): Adjust declaration.
3070 * parser.c (cp_parser_init_declarator): If the storage class
3071 specifier is sc_static, pass true for static_p to
3072 cp_parser_declarator.
3073 (cp_parser_direct_declarator): Don't do inject_this_parm when
3074 the declarator is a friend.
3075 * search.c (shared_member_p): Change return type to bool and
3076 adjust function body accordingly. Return false for a dependent
3077 USING_DECL instead of aborting.
3078 * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
3079 even when type-dependent.
3081 2021-01-22 Marek Polacek <polacek@redhat.com>
3084 * parser.c (inject_parm_decls): Remove a redundant assignment.
3085 (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
3086 before calling inject_parm_decls.
3088 2021-01-22 Jason Merrill <jason@redhat.com>
3091 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
3093 2021-01-22 Jakub Jelinek <jakub@redhat.com>
3096 * init.c (build_zero_init_1): Revert the 2018-03-06 change to
3097 return build_zero_cst for reference types.
3098 * typeck2.c (process_init_constructor_record): Instead call
3099 build_zero_cst here during error recovery instead of build_zero_init.
3101 2021-01-22 Marek Polacek <polacek@redhat.com>
3104 * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
3105 warnings regardless of abi_version_at_least.
3106 (write_expression): When the expression is a dependent name
3107 and an operator name, write "on" before writing its name.
3109 2021-01-22 Marek Polacek <polacek@redhat.com>
3112 * pt.c (instantiate_class_template_1): Instantiate members
3113 marked with attribute used only after we're done instantiating
3116 2021-01-21 Patrick Palka <ppalka@redhat.com>
3119 * semantics.c (finish_decltype_type): Set up a cp_unevaluated
3120 sentinel at the start of the function. Remove a now-redundant
3121 manual adjustment of cp_unevaluated_operand.
3123 2021-01-21 Nathan Sidwell <nathan@acm.org>
3126 * module.cc (depset::hash::find_dependencies): Add
3128 (trees_out::core_vals): Check state before calling
3130 (sort_cluster, module_state::write): Adjust
3131 find_dependencies call.
3133 2021-01-21 Jakub Jelinek <jakub@redhat.com>
3136 * constexpr.c (check_for_return_continue_data): Add break_stmt member.
3137 (check_for_return_continue): Also look for BREAK_STMT. Handle
3138 SWITCH_STMT by ignoring break_stmt from its body.
3139 (potential_constant_expression_1) <case FOR_STMT>,
3140 <case WHILE_STMT>: If the condition isn't constant true, check if
3141 the loop body can contain a return stmt.
3142 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
3143 <case IF_STMT>: If recursion with tf_none is successful,
3144 merge *jump_target from the branches - returns with highest priority,
3145 breaks or continues lower. If then branch is potentially constant and
3146 doesn't return, check the else branch if it could return, break or
3149 2021-01-21 Nathan Sidwell <nathan@acm.org>
3152 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
3154 2021-01-20 Nathan Sidwell <nathan@acm.org>
3156 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
3159 2021-01-20 Patrick Palka <ppalka@redhat.com>
3162 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
3163 CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
3164 adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
3166 2021-01-20 Patrick Palka <ppalka@redhat.com>
3169 * parser.c (cp_parser_class_head): Defer access checking when
3170 parsing the base-clause until all bases are seen and attached
3172 * pt.c (instantiate_class_template): Likewise when substituting
3173 into dependent bases.
3175 2021-01-20 Jakub Jelinek <jakub@redhat.com>
3178 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
3179 error_operand_p, remove clause without further checking. Check
3180 for non-NULL TYPE_NAME.
3182 2021-01-19 Marek Polacek <polacek@redhat.com>
3185 * pt.c (maybe_instantiate_noexcept): Return false if FN is
3188 2021-01-19 Marek Polacek <polacek@redhat.com>
3191 * name-lookup.c (push_using_decl_bindings): New, broken out of...
3192 (finish_nonmember_using_decl): ...here.
3193 * name-lookup.h (push_using_decl_bindings): Update declaration.
3194 * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
3196 2021-01-19 Patrick Palka <ppalka@redhat.com>
3200 * search.c (friend_accessible_p): If scope is a hidden friend
3201 defined inside a dependent class, consider access from the
3203 * parser.c (cp_parser_late_parsing_for_member): Don't push a
3204 dk_no_check access state.
3206 2021-01-19 Marek Polacek <polacek@redhat.com>
3209 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
3210 of NSDMIs before late-parsing of noexcept-specifiers.
3212 2021-01-19 Nathan Sidwell <nathan@acm.org>
3214 * module.cc (identifier): Merge overloads.
3216 2021-01-19 Nathan Sidwell <nathan@acm.org>
3219 * module.cc (trees_out::write_location): Make static.
3221 2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
3223 * parser.c (cp_parser_omp_clause_detach): New.
3224 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
3225 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
3226 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
3227 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
3228 Prevent use of detach with mergeable and overriding the data sharing
3229 mode of the event handle.
3231 2021-01-15 Nathan Sidwell <nathan@acm.org>
3234 * tree.c (cp_build_qualified_type_real): Propagate an array's
3235 dependentness to the copy, if known.
3237 2021-01-15 Jason Merrill <jason@redhat.com>
3240 * call.c (unsafe_return_slot_p): Return int.
3241 (init_by_return_slot_p): Split out from...
3242 (unsafe_copy_elision_p): ...here.
3243 (unsafe_copy_elision_p_opt): New name for old meaning.
3244 (build_over_call): Adjust.
3245 (make_safe_copy_elision): New.
3246 * typeck2.c (split_nonconstant_init_1): Elide copy from safe
3247 list-initialization.
3248 * cp-tree.h: Adjust.
3250 2021-01-15 Jason Merrill <jason@redhat.com>
3252 * call.c (base_ctor_for, make_base_init_ok): New.
3253 (build_over_call): Use make_base_init_ok.
3255 2021-01-15 Jason Merrill <jason@redhat.com>
3258 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
3259 if we got a CONSTRUCTOR.
3261 2021-01-15 Nathan Sidwell <nathan@acm.org>
3264 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
3266 2021-01-14 Jason Merrill <jason@redhat.com>
3268 * typeck2.c (process_init_constructor_record): Use fldtype
3269 variable consistently.
3271 2021-01-14 Nathan Sidwell <nathan@acm.org>
3274 * tree.c (cp_tree_equal): Correct map_context logic.
3276 2021-01-13 Marek Polacek <polacek@redhat.com>
3279 * name-lookup.c (push_using_decl_bindings): New.
3280 * name-lookup.h (push_using_decl_bindings): Declare.
3281 * pt.c (tsubst_expr): Call push_using_decl_bindings.
3283 2021-01-13 Nathan Sidwell <nathan@acm.org>
3286 * module.cc (module_add_import_initializers): Pass a
3287 zero-element argument vector.
3289 2021-01-12 Patrick Palka <ppalka@redhat.com>
3292 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
3293 the template of a CTAD placeholder.
3295 2021-01-12 Marek Polacek <polacek@redhat.com>
3298 * typeck2.c (process_init_constructor_record): Don't emit
3299 -Wmissing-field-initializers warnings in unevaluated contexts.
3301 2021-01-11 Jakub Jelinek <jakub@redhat.com>
3304 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
3306 (mark_abi_tags_r): Likewise.
3307 * decl2.c (min_vis_r): Likewise.
3308 * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
3311 2021-01-08 Patrick Palka <ppalka@redhat.com>
3314 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
3315 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
3317 2021-01-08 Patrick Palka <ppalka@redhat.com>
3320 * semantics.c (check_accessibility_of_qualified_id): Punt if
3321 we're checking access of a scoped non-static member inside a
3324 2021-01-07 Jakub Jelinek <jakub@redhat.com>
3327 * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
3328 cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
3330 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
3332 2021-01-07 Marek Polacek <polacek@redhat.com>
3335 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
3336 !late_return_type block.
3338 2021-01-07 Jason Merrill <jason@redhat.com>
3340 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
3341 (cxx_eval_store_expression): Add comment.
3343 2021-01-07 Jason Merrill <jason@redhat.com>
3345 * call.c (has_next): Factor out from...
3346 (next_conversion): ...here.
3347 (strip_standard_conversion): And here.
3348 (is_subseq): And here.
3349 (build_conv): Check it.
3350 (standard_conversion): Don't call build_conv
3353 2021-01-06 Martin Sebor <msebor@redhat.com>
3356 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
3358 2021-01-05 Patrick Palka <ppalka@redhat.com>
3360 * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
3361 the type of the NTTP, substitute into the type again. If the
3362 type is still dependent, don't unify the NTTP.
3364 2021-01-05 Jakub Jelinek <jakub@redhat.com>
3366 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
3367 $(CODYLIB) after $(BACKEND).
3369 2021-01-05 Jakub Jelinek <jakub@redhat.com>
3372 * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
3373 Punt if lval is true.
3374 * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
3375 the result if it has a class type.
3377 2021-01-05 Marek Polacek <polacek@redhat.com>
3380 * pt.c (resolve_overloaded_unification): Call
3381 maybe_instantiate_noexcept after instantiating the function
3384 2021-01-05 Nathan Sidwell <nathan@acm.org>
3386 * parser.c (cp_parser_module_declaration): Alter diagnostic
3387 text to say where is permissable.
3389 2021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3392 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
3394 2021-01-02 Jan Hubicka <jh@suse.cz>
3396 * cp-tree.h (cp_tree_c_finish_parsing): Declare.
3397 * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
3398 * tree.c (cp_tree_c_finish_parsing): New function.
3400 2021-01-01 Jakub Jelinek <jakub@redhat.com>
3402 * ChangeLog-2020: Rotate ChangeLog. New file.
3405 Copyright (C) 2021 Free Software Foundation, Inc.
3407 Copying and distribution of this file, with or without modification,
3408 are permitted in any medium without royalty provided the copyright
3409 notice and this notice are preserved.