1 2021-07-10 Patrick Palka <ppalka@redhat.com>
4 * init.c (build_aggr_init): Return error_mark_node if
5 expand_aggr_init_1 returns false.
6 (expand_default_init): Change return type to bool. Return false
7 on error, true on success.
8 (expand_aggr_init_1): Likewise.
10 2021-07-09 Jason Merrill <jason@redhat.com>
13 * decl.c (function_requirements_equivalent_p): Only compare
14 trailing requirements on a specialization.
16 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
18 * coroutines.cc (build_actor_fn): Move common code to
20 (build_destroy_fn): Likewise.
21 (act_des_fn): Build the void return here. Ensure that the
22 source location matches the original function.
24 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
27 (coro_rewrite_function_body): Connect the replacement
28 function block to the block nest correctly.
30 2021-07-09 Patrick Palka <ppalka@redhat.com>
33 * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
35 * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
36 * pt.c (build_extra_args): Make a copy of args.
37 (add_extra_args): Add complain/in_decl parameters. Enable the
38 code for handling the case where the extra arguments are
40 (tsubst_pack_expansion): Pass complain/in_decl to
42 (tsubst_template_args): Handle missing template arguments.
43 (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
46 2021-07-09 Patrick Palka <ppalka@redhat.com>
49 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
52 2021-07-08 Martin Sebor <msebor@redhat.com>
55 * module.cc (identifier): Suppress warning.
56 (module_state::read_macro_maps): Remove warning suppression.
57 (module_state::install_macros): Ditto.
59 2021-07-08 Marek Polacek <polacek@redhat.com>
62 * cp-tree.h (unevaluated_p): New.
63 * except.c (check_noexcept_r): Use it. Don't walk into
66 2021-07-08 Martin Sebor <msebor@redhat.com>
69 * module.cc (module_state::read_macro_maps): Temporarily disable
71 (module_state::install_macros): Same.
73 2021-07-06 Martin Sebor <msebor@redhat.com>
75 * error.c (cp_printer): Remove support for %G and %K.
77 2021-07-02 Jakub Jelinek <jakub@redhat.com>
79 * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
80 (struct cp_omp_declare_simd_data): Likewise.
81 * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
82 (omp_identifier): Define.
83 * parser.c (cp_parser_skip_to_pragma_eol): Handle
84 in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
85 (cp_parser_require_pragma_eol): Likewise.
86 (struct cp_omp_attribute_data): New type.
87 (cp_parser_handle_statement_omp_attributes): New function.
88 (cp_parser_statement): Handle OpenMP directives in statement's
89 attribute-specifier-seq.
90 (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
92 (cp_parser_std_attribute): Handle omp::directive and omp::sequence
94 (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
95 a comma also before the first clause.
96 (cp_parser_omp_allocate): Likewise.
97 (cp_parser_omp_atomic): Likewise.
98 (cp_parser_omp_depobj): Likewise.
99 (cp_parser_omp_flush): Likewise.
100 (cp_parser_omp_ordered): Likewise.
101 (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
102 into struct cp_omp_declare_simd_data.
103 (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
104 argument. If set, allow a comma also before match clause.
105 (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
106 allow a comma also before the first clause. Adjust
107 cp_finish_omp_declare_variant caller.
108 (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
109 a comma also before the first clause.
110 (cp_parser_omp_declare_reduction_exprs): Likewise.
111 (cp_parser_omp_requires): Likewise.
112 * decl.c (initialize_predefined_identifiers): Initialize
114 * decl2.c (cplus_decl_attributes): Reject omp::directive and
115 omp::sequence attributes.
117 2021-07-02 Jakub Jelinek <jakub@redhat.com>
120 * parser.c (cp_parser_omp_atomic): Consume comma only if it
121 appears before a CPP_NAME.
123 2021-07-02 Patrick Palka <ppalka@redhat.com>
126 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
127 use common_enclosing_class and to not depend on the TREE_TYPE
128 of outer levels pointing to the corresponding primary template.
130 2021-07-01 Patrick Palka <ppalka@redhat.com>
133 * constexpr.c (cxx_eval_array_reference): When the element type
134 is an empty type and the corresponding element is omitted, just
135 return an empty CONSTRUCTOR instead of attempting value
138 2021-07-01 Patrick Palka <ppalka@redhat.com>
141 * pt.c (finish_template_variable): Pass the partially
142 instantiated template and its args to instantiate_template.
143 (instantiate_class_template_1): No need to call
144 push_nested_class and pop_nested_class around the call to
145 most_specialized_partial_spec.
146 (instantiate_template_1): Pass the partially instantiated
147 template to lookup_template_variable.
148 (most_specialized_partial_spec): Use push_access_scope_guard
149 to set the access scope appropriately. Use
150 deferring_access_check_sentinel to force access to get checked
152 (instantiate_decl): Just pass the VAR_DECL to
153 most_specialized_partial_spec.
155 2021-06-30 Patrick Palka <ppalka@redhat.com>
157 * constraint.cc (get_normalized_constraints_from_decl): Use
158 push_access_scope_guard instead of push_nested_class_guard.
159 * cp-tree.h (struct push_nested_class_guard): Replace with ...
160 (struct push_access_scope_guard): ... this.
161 * pt.c (push_access_scope): When the argument corresponds to
162 a class type, push the class instead of its context.
163 (pop_access_scope): Adjust accordingly.
165 2021-06-30 Marek Polacek <polacek@redhat.com>
169 * decl.c (create_array_type_for_decl): Allow array of auto.
171 2021-06-29 Jason Merrill <jason@redhat.com>
173 * pt.c (instantiate_decl): Only consider partial specializations of
174 actual variable templates.
176 2021-06-26 Patrick Palka <ppalka@redhat.com>
179 * pt.c (instantiate_class_template_1): Enter the scope of the
180 type when calling most_specialized_partial_spec.
182 2021-06-26 Jason Merrill <jason@redhat.com>
186 * class.c (is_empty_field): Handle null argument.
187 * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
190 2021-06-26 Marek Polacek <polacek@redhat.com>
193 * parser.c (cp_parser_declarator): Pass flags down to
194 cp_parser_declarator. Also pass static_p/member_p.
196 2021-06-25 Martin Sebor <msebor@redhat.com>
198 * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
199 with warning_suppressed_p, suppress_warning, and copy_no_warning, or
200 nothing if not necessary.
201 (set_up_extended_ref_temp): Same.
202 * class.c (layout_class_type): Same.
203 * constraint.cc (constraint_satisfaction_value): Same.
204 * coroutines.cc (finish_co_await_expr): Same.
205 (finish_co_yield_expr): Same.
206 (finish_co_return_stmt): Same.
207 (build_actor_fn): Same.
208 (coro_rewrite_function_body): Same.
209 (morph_fn_to_coro): Same.
210 * cp-gimplify.c (genericize_eh_spec_block): Same.
211 (gimplify_expr_stmt): Same.
212 (cp_genericize_r): Same.
214 * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
215 * cvt.c (cp_fold_convert): Same.
216 (convert_to_void): Same.
217 * decl.c (wrapup_namespace_globals): Same.
218 (grokdeclarator): Same.
219 (finish_function): Same.
220 (require_deduced_type): Same.
221 * decl2.c (no_linkage_error): Same.
222 (c_parse_final_cleanups): Same.
223 * except.c (expand_end_catch_block): Same.
224 * init.c (build_new_1): Same.
226 (build_vec_delete_1): Same.
227 (build_vec_init): Same.
228 (build_delete): Same.
229 * method.c (defaultable_fn_check): Same.
230 * parser.c (cp_parser_fold_expression): Same.
231 (cp_parser_primary_expression): Same.
232 * pt.c (push_tinst_level_loc): Same.
234 (tsubst_omp_udr): Same.
235 (tsubst_copy_and_build): Same.
236 * rtti.c (build_if_nonnull): Same.
237 * semantics.c (maybe_convert_cond): Same.
238 (finish_return_stmt): Same.
239 (finish_parenthesized_expr): Same.
240 (cp_check_omp_declare_reduction): Same.
241 * tree.c (build_cplus_array_type): Same.
242 * typeck.c (build_ptrmemfunc_access_expr): Same.
243 (cp_build_indirect_ref_1): Same.
244 (cp_build_function_call_vec): Same.
245 (warn_for_null_address): Same.
246 (cp_build_binary_op): Same.
247 (unary_complex_lvalue): Same.
248 (cp_build_modify_expr): Same.
249 (build_x_modify_expr): Same.
250 (convert_for_assignment): Same.
252 2021-06-24 Patrick Palka <ppalka@redhat.com>
255 * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
257 2021-06-24 Patrick Palka <ppalka@redhat.com>
260 * constraint.cc (evaluate_requires_expr): Adjust function comment.
261 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
262 (cp_fold) <case REQUIRES_EXPR>: ... here.
264 2021-06-24 Jakub Jelinek <jakub@redhat.com>
266 * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
267 C_ORT_OMP for clauses on target construct.
268 (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
269 (cp_parser_omp_target): For non-combined target add
270 map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION. Pass
271 C_ORT_OMP_TARGET to finish_omp_clauses.
272 * semantics.c (handle_omp_array_sections_1): Adjust ort handling
273 for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
274 never present on C_ORT_*DECLARE_SIMD.
275 (handle_omp_array_sections): Likewise.
276 (finish_omp_clauses): Likewise. Handle OMP_CLAUSE_IN_REDUCTION
277 on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
278 corresponding map clauses.
279 * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
280 clauses on target construct.
282 2021-06-23 Patrick Palka <ppalka@redhat.com>
285 * pt.c (push_access_scope): For artificial deduction guides,
286 set the access scope to that of the constructor.
287 (pop_access_scope): Likewise.
288 (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
290 2021-06-23 Patrick Palka <ppalka@redhat.com>
293 * call.c (print_error_for_call_failure): Constify 'args' parameter.
294 (perform_dguide_overload_resolution): Define.
295 * cp-tree.h: (perform_dguide_overload_resolution): Declare.
296 * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
297 instead of build_new_function_call. Don't use tf_decltype or
298 set cp_unevaluated_operand. Remove unnecessary NULL_TREE tests.
300 2021-06-21 Patrick Palka <ppalka@redhat.com>
303 * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
304 sooner, before the NRVO handling.
306 2021-06-21 Patrick Palka <ppalka@redhat.com>
309 * tree.c (bot_replace): Use convert_to_base to build the
310 conversion to the (morally) virtual base.
312 2021-06-21 Jakub Jelinek <jakub@redhat.com>
315 * typeck.c (cxx_mark_addressable): Diagnose trying to make
316 bit-fields addressable.
318 2021-06-17 Jason Merrill <jason@redhat.com>
321 * decl.c (duplicate_decls): Make 'deleted after first declaration'
322 pedwarn on by default.
324 2021-06-17 Jason Merrill <jason@redhat.com>
327 * init.c (build_vec_init): Preserve the type of base.
329 2021-06-16 Jason Merrill <jason@redhat.com>
333 * pt.c (tsubst_baselink): Update binfos in non-dependent case.
335 2021-06-15 Robin Dapp <rdapp@linux.ibm.com>
337 * decl.c (duplicate_decls): Likewise.
339 2021-06-14 Tobias Burnus <tobias@codesourcery.com>
342 * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
343 var in the error case.
345 2021-06-13 Trevor Saunders <tbsaunde@tbsaunde.org>
347 * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
348 with range based for.
349 (cxx_eval_store_expression): Likewise.
350 (cxx_eval_loop_expr): Likewise.
351 * decl.c (wrapup_namespace_globals): Likewise.
352 (cp_finish_decl): Likewise.
353 (cxx_simulate_enum_decl): Likewise.
354 * parser.c (cp_parser_postfix_expression): Likewise.
356 2021-06-12 Jason Merrill <jason@redhat.com>
359 * init.c (build_vec_init): Shortcut [0] case.
361 2021-06-12 Jason Merrill <jason@redhat.com>
363 * pt.c (lookup_template_class_1): Shortcut current_class_type.
365 2021-06-11 Patrick Palka <ppalka@redhat.com>
369 * pt.c (tsubst_arg_types): Rearrange so that we substitute into
370 TYPE_ARG_TYPES in forward order while short circuiting
371 appropriately. Adjust formatting.
373 2021-06-11 Jakub Jelinek <jakub@redhat.com>
376 * cp-tree.h (struct saved_scope): Add consteval_if_p
377 member. Formatting fix for the discarded_stmt comment.
378 (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
379 * parser.c (cp_parser_lambda_expression): Temporarily disable
380 in_consteval_if_p when parsing lambda body.
381 (cp_parser_selection_statement): Parse consteval if.
382 * decl.c (struct named_label_entry): Add in_consteval_if member.
383 (level_for_consteval_if): New function.
384 (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
386 * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
387 why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
388 for !ctx->manifestly_const_eval.
389 (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
390 condition as if it was __builtin_is_constant_evaluated call.
391 (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
392 recurse on both branches.
393 * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
395 * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
396 Temporarily set in_consteval_if_p when recursing on
397 IF_STMT_CONSTEVAL_P then branch.
398 (tsubst_lambda_expr): Temporarily disable
399 in_consteval_if_p when instantiating lambda body.
400 * call.c (immediate_invocation_p): Return false when
403 2021-06-11 Marek Polacek <polacek@redhat.com>
406 * constexpr.c (maybe_constexpr_fn): New.
407 * cp-tree.h (maybe_constexpr_fn): Declare.
408 * semantics.c (find_std_constant_evaluated_r): New.
409 (maybe_warn_for_constant_evaluated): New.
410 (finish_if_stmt_cond): Call it.
412 2021-06-10 Patrick Palka <ppalka@redhat.com>
415 * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
416 the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
417 a template template parameter, adjust to the
418 TEMPLATE_TEMPLATE_PARAMETER before falling through.
420 2021-06-10 Patrick Palka <ppalka@redhat.com>
423 * constraint.cc (normalize_placeholder_type_constraints): When
424 normalizing a non-templated return-type-requirement, add a dummy
425 level to initial_parms.
427 2021-06-08 Marek Polacek <polacek@redhat.com>
430 * decl.c (grokdeclarator): Store a value-dependent
431 explicit-specifier even for deduction guides.
433 2021-06-08 Jason Merrill <jason@redhat.com>
435 * parser.c (cp_parser_string_literal): Adjust diagnostic.
437 2021-06-08 Jason Merrill <jason@redhat.com>
440 * call.c (perfect_conversion_p): Check check_narrowing.
442 2021-06-08 Jason Merrill <jason@redhat.com>
445 * name-lookup.c (get_class_binding): Keep a BASELINK.
446 (set_inherited_value_binding_p): Adjust.
447 * lambda.c (is_lambda_ignored_entity): Adjust.
448 * pt.c (lookup_template_function): Copy a BASELINK before
451 2021-06-08 Jason Merrill <jason@redhat.com>
454 * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
456 2021-06-08 Jason Merrill <jason@redhat.com>
458 * module.cc (duplicate_hash::hash): Comment out.
459 (trees_in::tree_value): Adjust loop counter.
461 2021-06-08 Jason Merrill <jason@redhat.com>
464 * init.c (build_offset_ref): Return the BASELINK for a static
467 2021-06-07 Patrick Palka <ppalka@redhat.com>
470 * parser.c (cp_parser_lookup_name): Check access of the lookup
471 result before we potentially adjust an injected-class-name to
474 2021-06-06 Jakub Jelinek <jakub@redhat.com>
477 * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
478 even when target is combined with other constructs.
480 2021-06-04 Patrick Palka <ppalka@redhat.com>
483 * pt.c (convert_template_argument): Strip top-level cv-quals
484 on the substituted type of a non-type template parameter.
486 2021-06-04 Patrick Palka <ppalka@redhat.com>
489 * pt.c (tsubst_function_decl): Remove old code for reducing
490 args when it has excess levels.
492 2021-06-04 Jakub Jelinek <jakub@redhat.com>
495 * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
496 ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
499 2021-06-03 Patrick Palka <ppalka@redhat.com>
502 * decl.c (make_typename_type): After calling
503 lookup_template_class, adjust the result to its TYPE_NAME and
504 then consider the tf_keep_type_decl flag.
506 2021-06-03 Patrick Palka <ppalka@redhat.com>
509 * pt.c (set_current_access_from_decl): Move to ...
510 * class.c (set_current_access_from_decl): ... here.
511 (handle_using_decl): Use it to propagate the access of the
512 using-enum decl to the copy of the imported enumerator.
513 * cp-tree.h (set_current_access_from_decl): Declare.
514 * decl.c (build_enumerator): Simplify using make_temp_override
515 and set_current_access_from_decl.
517 2021-06-03 Jakub Jelinek <jakub@redhat.com>
520 * semantics.c (handle_omp_array_sections_1): For
521 OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
522 finish_non_static_data_member and allow this as base.
523 (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
524 after depend only cases. Let this be diagnosed by !lvalue_p
525 case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
527 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
529 2021-06-02 Jason Merrill <jason@redhat.com>
532 * call.c (convert_like_internal): Clear tf_no_cleanup when
534 (build_user_type_conversion_1): Only add ck_rvalue if
535 LOOKUP_ONLYCONVERTING.
537 2021-06-01 Patrick Palka <ppalka@redhat.com>
540 * init.c (expand_aggr_init_1): Check
541 type_has_non_user_provided_default_constructor instead of
542 type_has_user_provided_constructor.
544 2021-06-01 Jason Merrill <jason@redhat.com>
547 * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
548 for destroying delete.
549 * init.c (build_delete): Don't clobber before destroying delete.
551 2021-06-01 Jason Merrill <jason@redhat.com>
554 * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
556 2021-05-31 Richard Biener <rguenther@suse.de>
559 * cp-objcp-common.c (names_builtin_p): Handle
560 RID_BUILTIN_SHUFFLEVECTOR.
561 * cp-tree.h (build_x_shufflevector): Declare.
562 * parser.c (cp_parser_postfix_expression): Handle
563 RID_BUILTIN_SHUFFLEVECTOR.
564 * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
565 * typeck.c (build_x_shufflevector): Build either a lowered
566 VEC_PERM_EXPR or an unlowered shufflevector via a temporary
567 internal function IFN_SHUFFLEVECTOR.
569 2021-05-28 Jason Merrill <jason@redhat.com>
571 * constexpr.c (build_data_member_initialization): Use tsi_range.
572 (build_constexpr_constructor_member_initializers): Likewise.
573 (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
574 (potential_constant_expression_1): Likewise.
575 * coroutines.cc (await_statement_expander): Likewise.
576 (await_statement_walker): Likewise.
577 * module.cc (trees_out::core_vals): Likewise.
578 * pt.c (tsubst_expr): Likewise.
579 * semantics.c (set_cleanup_locs): Likewise.
581 2021-05-28 Jason Merrill <jason@redhat.com>
585 * call.c (build_over_call): Adjust base_binfo in
586 resolves_to_fixed_type_p case.
588 2021-05-28 Jakub Jelinek <jakub@redhat.com>
591 * semantics.c (handle_omp_array_sections): Copy
592 OMP_CLAUSE_MAP_IMPLICIT.
593 (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
594 marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT. Add
595 map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
596 maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
597 present too. For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
598 if present in map_head, map_field_head or map_firstprivate_head
601 2021-05-28 Tobias Burnus <tobias@codesourcery.com>
603 * parser.c (cp_parser_omp_clause_affinity): New.
604 (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
605 cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
607 * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
608 finish_omp_clauses): Likewise.
610 2021-05-27 Matthias Kretz <kretz@kde.org>
613 * error.c (dump_template_bindings): Include code to print
614 "[with" and ']', conditional on whether anything is printed at
615 all. This is tied to whether a semicolon is needed to separate
616 multiple template parameters. If the template argument repeats
617 the template parameter (T = T), then skip the parameter.
618 (dump_substitution): Moved code to print "[with" and ']' to
619 dump_template_bindings.
620 (dump_function_decl): Partial revert of PR50828, which masked
621 TFF_TEMPLATE_NAME for all of dump_function_decl. Now
622 TFF_TEMPLATE_NAME is masked for the scope of the function and
623 only carries through to dump_function_name.
624 (dump_function_name): Avoid calling dump_template_parms if
625 TFF_TEMPLATE_NAME is set.
627 2021-05-27 Matthias Kretz <kretz@kde.org>
630 * error.c: Call dump_scope when printing a typedef.
632 2021-05-27 Patrick Palka <ppalka@redhat.com>
635 * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
637 2021-05-27 Jason Merrill <jason@redhat.com>
640 * pt.c (use_pack_expansion_extra_args_p): Don't compare
641 args from the same argument pack.
643 2021-05-27 Patrick Palka <ppalka@redhat.com>
648 * pt.c (process_partial_specialization): Don't error on a
649 non-simple non-type template argument that involves template
651 (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
652 MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
654 2021-05-26 Patrick Palka <ppalka@redhat.com>
657 * typeck.c (finish_class_member_access_expr): Disable ahead
658 of time access checking during the member lookup.
660 2021-05-26 Patrick Palka <ppalka@redhat.com>
663 * tree.c (build_target_expr_with_type): Don't call force_rvalue
664 on CALL_EXPR initializer. Simplify now that bot_manip is no
666 (bot_manip): Use force_target_expr instead of
667 build_target_expr_with_type.
669 2021-05-26 Patrick Palka <ppalka@redhat.com>
672 * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
673 (fnptr_conv_p): Don't call non_reference. Use INDIRECT_TYPE_P
674 instead of TYPE_PTR_P.
675 * pt.c (convert_nontype_argument_function): Look through
676 implicit INDIRECT_REFs before calling strip_fnptr_conv.
678 2021-05-25 Jakub Jelinek <jakub@redhat.com>
681 * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
682 and side-effects, temporarily disable -Wunused-result warning when
683 building COMPOUND_EXPR.
685 2021-05-21 Jakub Jelinek <jakub@redhat.com>
688 * semantics.c (finish_omp_clauses): Move firstprivate clauses with
689 OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain. Don't error
690 if a decl is mentioned both in map clause and in such firstprivate
691 clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
693 2021-05-20 Jason Merrill <jason@redhat.com>
695 * call.c (reference_binding): Check for designator.
696 (implicit_conversion_1, build_special_member_call): Likewise.
697 * decl.c (reshape_init_r): Likewise.
698 * pt.c (do_class_deduction): Likewise.
699 * typeck2.c (digest_init_r): Likewise.
701 2021-05-20 Jason Merrill <jason@redhat.com>
704 * decl.c (reshape_init_class): Handle designator for
705 member of anonymous aggregate here.
706 * typeck2.c (process_init_constructor_record): Not here.
708 2021-05-20 Jonathan Wakely <jwakely@redhat.com>
710 * call.c (maybe_warn_array_conv): Use new warning option.
711 * decl.c (mark_inline_variable, grokdeclarator): Likewise.
712 * error.c (maybe_warn_cpp0x): Likewise.
713 * parser.c (cp_parser_primary_expression)
714 (cp_parser_unqualified_id)
715 (cp_parser_pseudo_destructor_name)
716 (cp_parser_lambda_introducer)
717 (cp_parser_lambda_declarator_opt)
718 (cp_parser_selection_statement)
719 (cp_parser_init_statement)
720 (cp_parser_decomposition_declaration)
721 (cp_parser_function_specifier_opt)
722 (cp_parser_static_assert)
723 (cp_parser_namespace_definition)
724 (cp_parser_using_declaration)
725 (cp_parser_asm_definition)
726 (cp_parser_ctor_initializer_opt_and_function_body)
727 (cp_parser_initializer_list)
728 (cp_parser_type_parameter_key)
729 (cp_parser_member_declaration)
730 (cp_parser_try_block)
731 (cp_parser_std_attribute_spec): Likewise.
732 * pt.c (check_template_variable): Likewise.
734 2021-05-20 Jason Merrill <jason@redhat.com>
737 * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
739 2021-05-20 Jason Merrill <jason@redhat.com>
742 * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
744 2021-05-19 Jason Merrill <jason@redhat.com>
748 * method.c (genericize_spaceship): Use fold_build2 for scalar
751 2021-05-19 Jason Merrill <jason@redhat.com>
753 * pt.c (build_deduction_guide): Treat the implicit deduction guide
754 as a member of the class.
756 2021-05-19 Marek Polacek <polacek@redhat.com>
759 * cp-tree.h (any_non_type_attribute_p): Remove.
760 * decl.c (grokdeclarator): Turn an error into a warning and only
761 warn for standard attributes.
762 * decl2.c (any_non_type_attribute_p): Remove.
763 * parser.c (cp_parser_elaborated_type_specifier): Turn an error
764 into a warning and only warn for standard attributes.
765 (cp_parser_member_declaration): Likewise.
767 2021-05-19 Martin Liska <mliska@suse.cz>
770 * mangle.c (write_encoding): Fix typos.
772 2021-05-19 Jakub Jelinek <jakub@redhat.com>
775 * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
776 master when combined with taskloop.
777 (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
778 parallel master when not combined with taskloop.
780 2021-05-19 Jason Merrill <jason@redhat.com>
783 * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
785 2021-05-19 Jason Merrill <jason@redhat.com>
788 * tree.c (strip_typedefs): Only look at the pattern of a
789 TYPE_PACK_EXPANSION if it's a type.
791 2021-05-18 Marek Polacek <polacek@redhat.com>
793 * class.c (classtype_has_non_deleted_copy_ctor): Remove.
794 * constraint.cc (contains_wildcard_p): Likewise.
795 (get_template_head_requirements): Likewise.
796 (check_constrained_friend): Likewise.
797 (subsumes_constraints): Likewise.
798 * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
799 (push_void_library_fn): Likewise.
800 (get_pattern_parm): Likewise.
801 (get_template_parms_at_level): Likewise.
802 (lambda_return_type): Likewise.
803 (get_template_head_requirements): Likewise.
804 (check_constrained_friend): Likewise.
805 (subsumes_constraints): Likewise.
806 * decl.c (push_void_library_fn): Likewise.
807 * lambda.c (lambda_return_type): Likewise.
808 * pt.c (get_template_parms_at_level): Likewise.
809 (get_pattern_parm): Likewise.
811 2021-05-18 Jason Merrill <jason@redhat.com>
814 * call.c (perfect_candidate_p): An implicitly deleted move
817 2021-05-18 Andreas Krebbel <krebbel@linux.ibm.com>
820 * cvt.c (cp_convert_to_pointer): Use the size of the target
822 * tree.c (cp_build_reference_type): Call
823 cp_build_reference_type_for_mode with VOIDmode.
824 (cp_build_reference_type_for_mode): Rename from
825 cp_build_reference_type. Add MODE argument and invoke
826 build_reference_type_for_mode.
827 (strip_typedefs): Use build_pointer_type_for_mode and
828 cp_build_reference_type_for_mode for pointers and references.
830 2021-05-17 Jonathan Wakely <jwakely@redhat.com>
833 * call.c (convert_like_internal): Print different diagnostic if
834 the lvalue reference is const.
836 2021-05-14 Jason Merrill <jason@redhat.com>
839 * pt.c (enclosing_instantiation_of): Just compare
840 DECL_SOURCE_LOCATION.
841 (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
843 2021-05-14 Marek Polacek <polacek@redhat.com>
844 Jason Merrill <jason@redhat.com>
847 * cp-tree.h (any_non_type_attribute_p): Declare.
848 * decl.c (grokdeclarator): Diagnose when an attribute appertains to
849 a friend declaration that is not a definition.
850 * decl2.c (any_non_type_attribute_p): New.
851 * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
852 in the middle of decl-specifiers.
853 (cp_parser_elaborated_type_specifier): Diagnose when an attribute
854 appertains to a friend declaration that is not a definition.
855 (cp_parser_member_declaration): Likewise.
857 2021-05-12 Marek Polacek <polacek@redhat.com>
859 * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
862 2021-05-12 Marcel Vollweiler <marcel@codesourcery.com>
864 * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
867 2021-05-11 Jason Merrill <jason@redhat.com>
870 * typeck.c (build_reinterpret_cast_1): Check intype on
873 2021-05-11 Patrick Palka <ppalka@redhat.com>
876 * name-lookup.c (maybe_save_operator_binding): Unconditionally
877 enable for all function templates, not just generic lambdas.
878 Handle compound-assignment operator expressions.
879 * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
880 in the type-dependent case.
881 (build_x_modify_expr): Likewise. Move declaration of 'op' closer
884 2021-05-11 Patrick Palka <ppalka@redhat.com>
887 * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
888 (satisfy_atom): Set up iloc_sentinel before calling
890 * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
891 expansion, carry over PACK_EXPANSION_LOCAL_P and
892 PACK_EXPANSION_SIZEOF_P from the original pack expansion.
894 2021-05-10 Richard Biener <rguenther@suse.de>
898 * call.c (set_up_extended_ref_temp): Mark the temporary
899 addressable if the TARGET_EXPR was.
901 2021-05-10 Martin Liska <mliska@suse.cz>
903 * decl.c (duplicate_decls): Use startswith
904 function instead of strncmp.
905 (cxx_builtin_function): Likewise.
906 (omp_declare_variant_finalize_one): Likewise.
907 (grokfndecl): Likewise.
908 * error.c (dump_decl_name): Likewise.
909 * mangle.c (find_decomp_unqualified_name): Likewise.
910 (write_guarded_var_name): Likewise.
911 (decl_tls_wrapper_p): Likewise.
912 * parser.c (cp_parser_simple_type_specifier): Likewise.
913 (cp_parser_tx_qualifier_opt): Likewise.
914 * pt.c (template_parm_object_p): Likewise.
915 (dguide_name_p): Likewise.
917 2021-05-10 Martin Liska <mliska@suse.cz>
920 * decl.c (grokdeclarator): Remove redundant NULL check.
922 2021-05-07 Jason Merrill <jason@redhat.com>
924 * tree.c (rvalue): Assert expr is not a class lvalue.
926 2021-05-07 Jason Merrill <jason@redhat.com>
928 * cp-tree.h (build_stub_object): Declare.
929 * method.c (build_stub_object): No longer static.
930 * call.c (can_convert): Use it.
931 * tree.c (build_dummy_object): Adjust comment.
932 * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
935 2021-05-07 Jason Merrill <jason@redhat.com>
937 * coroutines.cc (build_co_await): Don't call 'rvalue'.
938 (flatten_await_stmt): Simplify initialization.
939 (morph_fn_to_coro): Change 'rvalue' to 'move'. Simplify.
941 2021-05-04 Tobias Burnus <tobias@codesourcery.com>
943 * semantics.c (finish_omp_reduction_clause): Accept float + complex
944 for || and && reductions.
946 2021-05-03 Patrick Palka <ppalka@redhat.com>
949 * parser.c (cp_parser_class_head): Reinstate calls to pushclass
950 and popclass when parsing the base-clause that were removed in
953 2021-05-03 Patrick Palka <ppalka@redhat.com>
957 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
958 only when the callee is a FUNCTION_DECL.
960 2021-05-03 Marek Polacek <polacek@redhat.com>
963 * decl.c (grokfndecl): Check current_template_parms.
965 2021-05-03 Marek Polacek <polacek@redhat.com>
968 * constexpr.c (cxx_eval_constant_expression): Don't check
971 2021-05-01 Jason Merrill <jason@redhat.com>
973 * cp-tree.h (class ovl_iterator): Allow copying. Add op==.
974 (class ovl_range, class lkp_range): New.
975 * call.c (build_op_call_1, add_candidates): Use them.
976 (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
977 (has_trivial_copy_p): Likewise.
978 * class.c (handle_using_decl, get_basefndecls): Likewise.
979 (maybe_warn_about_overly_private_class): Likewise.
980 (warn_hidden, add_implicitly_declared_members): Likewise.
981 (check_methods, clone_constructors_and_destructors): Likewise.
982 (type_has_user_nondefault_constructor): Likewise.
984 2021-04-29 Jason Merrill <jason@redhat.com>
986 * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
989 2021-04-29 Jason Merrill <jason@redhat.com>
992 * decl2.c (grokfield): Call cplus_decl_attributes for friend.
993 (save_template_attributes): Use chainon.
994 * friend.c (do_friend): Remove attrlist parm.
995 * cp-tree.h (do_friend): Adjust.
996 * class.c (add_implicitly_declared_members): Adjust.
997 * decl.c (grokdeclarator): Adjust.
998 * pt.c (apply_late_template_attributes): Optimize.
1000 2021-04-29 Jason Merrill <jason@redhat.com>
1003 * class.c (finish_struct_anon_r): Drop complain parm.
1004 Remove non-field diagnostic.
1005 (finish_struct_anon): Adjust.
1006 * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
1008 2021-04-29 Jason Merrill <jason@redhat.com>
1010 * cp-tree.h (cp_evaluated): Add reset parm to constructor.
1011 * parser.c (cp_parser_constant_expression): Change
1012 allow_non_constant_p to int. Use cp_evaluated.
1013 (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
1014 * semantics.c (finish_id_expression_1): Don't mess with
1015 cp_unevaluated_operand here.
1017 2021-04-29 Jason Merrill <jason@redhat.com>
1019 * cp-tree.h: Clarify comments.
1020 * pt.c (get_template_parm_object): Add assert.
1021 * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
1022 * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
1023 * typeck2.c (store_init_value): Likewise.
1025 2021-04-29 Patrick Palka <ppalka@redhat.com>
1028 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
1029 set tf_conv during the initial substitution into the function.
1031 2021-04-29 Jakub Jelinek <jakub@redhat.com>
1034 * semantics.c (finish_omp_clauses): Fix up check that variable
1035 mentioned in detach clause doesn't appear in data-sharing clauses.
1037 2021-04-28 Jakub Jelinek <jakub@redhat.com>
1039 * module.cc: Remove #error that triggers if DEV-PHASE is empty.
1041 2021-04-27 Jason Merrill <jason@redhat.com>
1044 * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
1047 2021-04-27 Patrick Palka <ppalka@redhat.com>
1050 * pt.c (tsubst_initializer_list): Correctly handle the case
1051 where an argument inside a base initializer pack expansion is
1052 itself a pack expansion.
1054 2021-04-26 Patrick Palka <ppalka@redhat.com>
1057 * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
1058 object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
1059 with a negative offset into one whose offset is nonnegative
1060 before calling cxx_fold_indirect_ref_1.
1062 2021-04-24 Patrick Palka <ppalka@redhat.com>
1069 * pt.c (do_class_deduction): Punt if the initializer is
1072 2021-04-24 Patrick Palka <ppalka@redhat.com>
1075 * parser.c (cp_parser_type_id_1): If we see a template
1076 placeholder, first try simulating an error before issuing
1079 2021-04-23 Patrick Palka <ppalka@redhat.com>
1082 * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
1083 Adjust parameter list loop to iterate over 'types' instead of
1084 'args'. Output the trailing '...' for a variadic function.
1085 Remove PARM_DECL support.
1086 (pp_cxx_requires_expr): Pretty print the parameter list directly
1087 instead of going through pp_cxx_parameter_declaration_clause.
1089 2021-04-23 Patrick Palka <ppalka@redhat.com>
1092 * decl.c (is_direct_enum_init): Check the implicit
1093 convertibility requirement added by CWG 2374.
1095 2021-04-23 Martin Liska <mliska@suse.cz>
1097 * cp-tree.h (STATIC_ASSERT): Prefer static assert.
1098 * lex.c (init_operators): Remove run-time check.
1100 2021-04-22 Marek Polacek <polacek@redhat.com>
1103 * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
1104 op1 separately for value- or type-dependence.
1106 2021-04-21 Marek Polacek <polacek@redhat.com>
1109 * parser.c (cp_parser_enum_specifier): Don't allow defining
1112 2021-04-21 Martin Liska <mliska@suse.cz>
1115 2021-04-21 Martin Liska <mliska@suse.cz>
1117 * error.c (dump_decl): Use flags in dump_generic_node call.
1119 2021-04-21 Martin Liska <mliska@suse.cz>
1121 * error.c (dump_decl): Use flags in dump_generic_node call.
1123 2021-04-21 Martin Liska <mliska@suse.cz>
1125 * error.c (dump_decl): Support anonymous labels.
1127 2021-04-20 Jason Merrill <jason@redhat.com>
1130 * pt.c (find_parameter_packs_r): Look into enum initializers.
1132 2021-04-19 Marek Polacek <polacek@redhat.com>
1135 * decl.c (grokvardecl): Given an error when a concept is not defined
1138 2021-04-16 Jakub Jelinek <jakub@redhat.com>
1141 * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
1142 for empty classes into *valp when types don't match even when *valp
1145 2021-04-16 Marek Polacek <polacek@redhat.com>
1148 * decl.c (make_typename_type): Give an error and return when
1149 name is is_overloaded_fn.
1150 * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
1151 before calling make_typename_type.
1153 2021-04-16 Patrick Palka <ppalka@redhat.com>
1156 * constexpr.c (reduced_constant_expression_p): For array
1157 CONSTRUCTORs, use a dedicated loop that additionally verifies
1158 the CONSTRUCTOR spans the entire array.
1160 2021-04-16 Jakub Jelinek <jakub@redhat.com>
1163 * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
1164 If lambda_p, return pce_ok instead of pce_maybe_postfix.
1166 2021-04-16 Jakub Jelinek <jakub@redhat.com>
1169 * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
1170 binding, add to data.internal also all corresponding structured
1173 2021-04-16 Jason Merrill <jason@redhat.com>
1176 * cp-tree.h (first_field): Declare.
1177 * mangle.c (range_expr_nelts): New.
1178 (write_expression): Improve class NTTP mangling.
1179 * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
1180 * tree.c (zero_init_expr_p): Improve class NTTP handling.
1181 * decl.c: Adjust comment.
1183 2021-04-15 Jason Merrill <jason@redhat.com>
1186 * call.c (build_new_method_call_1): Check again for side-effects
1187 with a volatile object.
1189 2021-04-15 Jason Merrill <jason@redhat.com>
1193 * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
1194 TYPE_RAISES_EXCEPTIONS here.
1195 * tree.c (cp_walk_subtrees): Not here.
1197 2021-04-15 Jason Merrill <jason@redhat.com>
1201 * parser.c (cp_parser_default_type_template_argument): Set
1202 parser->local_variables_forbidden_p.
1204 2021-04-15 Richard Sandiford <richard.sandiford@arm.com>
1207 * typeck.c (merge_type_attributes_from): New function.
1208 (cp_common_type): Use it for vector types.
1210 2021-04-14 Jason Merrill <jason@redhat.com>
1214 * pt.c (uses_outer_template_parms): Also look at default
1217 2021-04-14 Jason Merrill <jason@redhat.com>
1220 * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
1221 for a non-static data member in a constant-expression.
1223 2021-04-14 Patrick Palka <ppalka@redhat.com>
1227 * pt.c (deducible_expression): Look through implicit
1228 INDIRECT_REFs as well.
1230 2021-04-14 Jason Merrill <jason@redhat.com>
1233 * parser.c (cp_parser_lambda_expression): Reject lambda
1234 in template parameter type.
1236 2021-04-14 Jason Merrill <jason@redhat.com>
1239 * decl.c (duplicate_decls): Don't propagate
1240 DECL_INITIALIZED_IN_CLASS_P to a specialization.
1242 2021-04-14 Jason Merrill <jason@redhat.com>
1247 * semantics.c (set_cleanup_locs): New.
1248 (do_poplevel): Call it.
1249 * parser.c (cp_parser_compound_statement): Consume the }
1250 before finish_compound_stmt.
1252 2021-04-13 Jason Merrill <jason@redhat.com>
1255 * pt.c (get_underlying_template): Compare TYPE_QUALS.
1257 2021-04-13 Jason Merrill <jason@redhat.com>
1261 * init.c (get_nsdmi): Do more context adjustment for local classes.
1263 2021-04-13 Patrick Palka <ppalka@redhat.com>
1266 * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
1267 rather than issuing a pedwarn.
1268 * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
1269 for consistent diagnostics.
1271 2021-04-13 Jason Merrill <jason@redhat.com>
1274 * class.c (build_base_path): Shortcut simple non-pointer case.
1276 2021-04-13 Eric Botcazou <ebotcazou@adacore.com>
1278 * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
1280 (module_state::write_location): Likewise.
1282 2021-04-13 Patrick Palka <ppalka@redhat.com>
1285 * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
1286 when checking if the initializer is an equivalent class
1287 placeholder template parameter.
1289 2021-04-13 Patrick Palka <ppalka@redhat.com>
1293 * constraint.cc (satisfy_normalized_constraints): Set
1295 * parser.c (cp_parser_concept_definition): Likewise.
1296 (cp_parser_requires_clause_opt): Likewise.
1298 2021-04-12 Jason Merrill <jason@redhat.com>
1301 * pt.c (uses_outer_template_parms): Handle non-type and template
1302 template parameters specifically.
1304 2021-04-11 Jason Merrill <jason@redhat.com>
1307 * decl.c (fixup_anonymous_aggr): Prune all functions from
1308 CLASSTYPE_MEMBER_VEC.
1310 2021-04-10 Jason Merrill <jason@redhat.com>
1314 * parser.c (cp_parser_direct_declarator): Don't
1315 inject_this_parameter if static_p.
1316 (cp_parser_omp_var_list_no_open): Parse 'this' even if
1317 current_class_ptr isn't set for a better diagnostic.
1319 2021-04-10 Jason Merrill <jason@redhat.com>
1326 * pt.c (alias_ctad_tweaks): Handle failure better.
1328 2021-04-10 Jason Merrill <jason@redhat.com>
1331 * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
1333 2021-04-09 Patrick Palka <ppalka@redhat.com>
1335 * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
1336 (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
1337 (LAMBDA_EXPR_REGEN_INFO): ... this.
1338 (tree_lambda_expr::regenerated_from)
1339 (tree_lambda_expr::regenerating_targs): Replace these with ...
1340 (tree_lambda_expr::regen_info): ... this.
1341 * constraint.cc (satisfy_declaration_constraints): Adjust
1343 * lambda.c (build_lambda_expr): Likewise.
1344 * pt.c (regenerated_lambda_fn_p): Likewise.
1345 (most_general_lambda): Likewise.
1346 (tsubst_lambda_expr): Likewise.
1348 2021-04-09 Marek Polacek <polacek@redhat.com>
1351 * parser.c (cp_parser_member_declaration): Call
1352 cp_parser_save_default_args even for function templates. Use
1353 STRIP_TEMPLATE on the declaration we're passing.
1355 2021-04-08 Patrick Palka <ppalka@redhat.com>
1358 * constraint.cc (get_normalized_constraints_from_decl): Handle
1359 regenerated lambdas.
1360 (satisfy_declaration_constraints): Likewise. Check for
1361 dependent args later.
1362 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
1363 (LAMBDA_EXPR_REGENERATED_FROM): ... this.
1364 (LAMBDA_EXPR_REGENERATING_TARGS): New.
1365 (tree_lambda_expr::regenerated_from): New data member.
1366 (tree_lambda_expr::regenerating_targs): New data member.
1367 (add_to_template_args): Declare.
1368 (regenerated_lambda_fn_p): Likewise.
1369 (most_general_lambda): Likewise.
1370 * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
1371 and LAMBDA_EXPR_REGENERATING_TARGS.
1372 * pt.c (add_to_template_args): No longer static.
1373 (tsubst_function_decl): Unconditionally propagate constraints on
1374 the substituted function decl.
1375 (instantiated_lambda_fn_p): Rename to ...
1376 (regenerated_lambda_fn_p): ... this. Check
1377 LAMBDA_EXPR_REGENERATED_FROM instead of
1378 LAMBDA_EXPR_INSTANTIATED.
1379 (most_general_lambda): Define.
1380 (enclosing_instantiation_of): Adjust after renaming
1381 instantiated_lambda_fn_p.
1382 (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED. Set
1383 LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
1384 Don't substitute or set constraints on the regenerated lambda.
1386 2021-04-08 Patrick Palka <ppalka@redhat.com>
1389 * pt.c (build_deduction_guide): Document OUTER_ARGS. Substitute
1390 them into the propagated constraints.
1392 2021-04-08 Jason Merrill <jason@redhat.com>
1395 * call.c (convert_like_internal): Improve reference diagnostic.
1397 2021-04-08 Jakub Jelinek <jakub@redhat.com>
1400 * constexpr.c (addr_of_non_const_var): New function.
1401 (cxx_bind_parameters_in_call): Set *non_constant_args to true
1402 even if cp_walk_tree on arg with addr_of_non_const_var callback
1405 2021-04-08 Jason Merrill <jason@redhat.com>
1408 * pt.c (determine_specialization): Improve diagnostic.
1410 2021-04-08 Marek Polacek <polacek@redhat.com>
1413 * decl.c (build_explicit_specifier): Call
1414 check_for_bare_parameter_packs.
1415 * except.c (build_noexcept_spec): Likewise.
1417 2021-04-07 Jason Merrill <jason@redhat.com>
1420 * parser.c (cp_parser_class_name): Check dependent_scope_p.
1422 2021-04-07 Jason Merrill <jason@redhat.com>
1425 * pt.c (maybe_process_partial_specialization): Check
1426 DECL_SELF_REFERENCE_P.
1428 2021-04-07 Jason Merrill <jason@redhat.com>
1431 * name-lookup.c (push_class_level_binding_1): Do overload a new
1432 function with a previous using-declaration.
1434 2021-04-06 Jason Merrill <jason@redhat.com>
1437 * init.c (get_nsdmi): Don't defer access checking.
1439 2021-04-06 Jason Merrill <jason@redhat.com>
1442 * decl.c (cp_finish_decl): mark_needed an implicitly inline
1443 static data member with an out-of-class redeclaration.
1445 2021-04-06 Jason Merrill <jason@redhat.com>
1448 * mangle.c (write_compact_number): Add sanity check.
1449 (write_local_name): Use list_length for parm number.
1451 2021-04-06 Patrick Palka <ppalka@redhat.com>
1454 * pt.c (do_auto_deduction): Don't exit early when deducing the
1455 array type of a structured binding. Also handle adc_decomp_type
1456 during constraint checking.
1458 2021-04-05 Jason Merrill <jason@redhat.com>
1461 * typeck.c (check_return_expr): Call mark_exp_read in dependent
1464 2021-04-05 Jason Merrill <jason@redhat.com>
1467 * typeck.c (build_reinterpret_cast_1): Don't perform
1468 temporary materialization.
1470 2021-04-05 Jason Merrill <jason@redhat.com>
1473 * pt.c (lookup_template_class_1): Do tsubst_enum when
1474 tsubsting a generic lambda.
1476 2021-04-05 Jason Merrill <jason@redhat.com>
1479 * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
1480 there is no enclosing non-lambda function.
1482 2021-04-05 Nathan Sidwell <nathan@acm.org>
1485 * module.cc (name_pending_imports): Drop 'atend' parm. Don't
1486 query export when not needed.
1487 (preprocess_module, preprocessed_module): Adjust.
1489 2021-04-05 Jason Merrill <jason@redhat.com>
1492 * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
1494 2021-04-05 Jason Merrill <jason@redhat.com>
1497 * pt.c (class el_data): Add visited field.
1498 (extract_local_specs): Pass it to cp_walk_tree.
1499 (extract_locals_r): Walk into the body of a lambda.
1501 2021-04-05 Jason Merrill <jason@redhat.com>
1503 * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
1506 2021-04-04 Jason Merrill <jason@redhat.com>
1509 * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
1511 2021-04-03 Marek Polacek <polacek@redhat.com>
1514 * parser.c: Create a GC root for attributes in a decl specifier.
1515 (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
1517 2021-04-03 Jason Merrill <jason@redhat.com>
1520 * pt.c (tsubst_lambda_expr): Skip the body block from
1523 2021-04-03 Jason Merrill <jason@redhat.com>
1526 * cvt.c (can_convert_qual): Check fnptr_conv_p.
1528 2021-04-03 Jason Merrill <jason@redhat.com>
1531 * pt.c (regenerate_decl_from_template): tsubst_decl
1534 2021-04-02 Patrick Palka <ppalka@redhat.com>
1537 * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
1538 to do_auto_deduction.
1540 2021-04-02 Patrick Palka <ppalka@redhat.com>
1543 * semantics.c (finish_compound_literal): Check
1544 template_placeholder_p instead of type_uses_auto.
1546 2021-04-02 Jason Merrill <jason@redhat.com>
1549 * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
1550 * lambda.c (add_capture): Set it.
1551 * pt.c (tsubst_pack_expansion): Handle it.
1553 2021-04-02 Nathan Sidwell <nathan@acm.org>
1555 * cp-tree.h (lang_decl_base): Correct module flag comment.
1556 * module.cc (trees_in::assert_definition): Break out
1558 (trees_out::lang_decl_bools): Do not write purview for header units.
1560 2021-04-01 Marek Polacek <polacek@redhat.com>
1563 * method.c (defaulted_late_check): ++ and -- function_depth around
1564 the call to synthesize_method.
1565 * pt.c: Remove the saved_trees global.
1567 2021-04-01 Jason Merrill <jason@redhat.com>
1571 * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
1572 TYPE_RAISES_EXCEPTIONS.
1574 2021-04-01 Iain Sandoe <iain@sandoe.co.uk>
1576 * mapper-client.cc (INCLUDE_MAP): New; require map to be
1577 included from system.h.
1578 * mapper-resolver.cc (INCLUDE_MAP): Likewise.
1580 2021-04-01 Jason Merrill <jason@redhat.com>
1583 * mangle.c (write_expression): Adjust.
1584 * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
1585 (mark_abi_tags_r): Likewise.
1587 2021-04-01 Nathan Sidwell <nathan@acm.org>
1590 * module.cc (trees_out::decl_node): Adjust importedness reference
1592 (module_state::intercluster_seed): New. Seed both imports and
1593 inter-cluster references. Broken out of ...
1594 (module_state::write_cluster): ... here. Call it.
1596 2021-03-31 Jason Merrill <jason@redhat.com>
1599 * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
1601 2021-03-31 Patrick Palka <ppalka@redhat.com>
1604 * mangle.c (write_expression): Adjust the mangling of
1607 2021-03-31 Patrick Palka <ppalka@redhat.com>
1610 * pt.c (placeholder_type_constraint_dependent_p): Expand
1611 argument packs to separate the first non-pack argument
1614 2021-03-30 Nathan Sidwell <nathan@acm.org>
1617 * module.cc (dumper::operator): Make less brittle.
1618 (trees_out::core_bools): VAR_DECLs always have a context.
1619 (trees_out::key_mergeable): Use same_type_p for asserting.
1620 (trees_in::read_var_def): Propagate
1621 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1623 2021-03-30 Jakub Jelinek <jakub@redhat.com>
1626 * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
1628 2021-03-26 Marek Polacek <polacek@redhat.com>
1631 * method.c (implicitly_declare_fn): Pass &raises to
1632 synthesized_method_walk.
1634 2021-03-26 Nathan Sidwell <nathan@acm.org>
1637 * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
1638 (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
1639 * decl.c (duplicate_decls): Remove template_decl module flag
1641 * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
1642 (dumper::impl::nested_name): Adjust for template-decl module flag
1644 (trees_in::assert_definition): Likewise.
1645 (trees_in::install_entity): Likewise.
1646 (trees_out::decl_value): Likewise. Remove alias template
1647 separation of template and type_decl.
1648 (trees_in::decl_value): Likewise.
1649 (trees_out::key_mergeable): Likewise,
1650 (trees_in::key_mergeable): Likewise.
1651 (trees_out::decl_node): Adjust for template-decl module flag
1653 (depset::hash::make_dependency): Likewise.
1654 (get_originating_module, module_may_redeclare): Likewise.
1655 (set_instantiating_module, set_defining_module): Likewise.
1656 * name-lookup.c (name_lookup::search_adl): Likewise.
1657 (do_pushdecl): Likewise.
1658 * pt.c (build_template_decl): Likewise.
1659 (lookup_template_class_1): Remove special alias_template handling
1660 of DECL_TI_TEMPLATE.
1661 (tsubst_template_decl): Likewise.
1663 2021-03-26 Jakub Jelinek <jakub@redhat.com>
1666 * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
1667 in DECL_EXPR or in BIND_EXPR_VARS.
1669 2021-03-25 Jakub Jelinek <jakub@redhat.com>
1672 * parser.c (cp_parser_postfix_expression): For calls, create
1673 combined_loc and temporarily set input_location to it before
1674 calling finish_call_expr.
1676 2021-03-25 Marek Polacek <polacek@redhat.com>
1679 * call.c (build_over_call): Maybe call mark_used in case
1680 deduce_inheriting_ctor fails and return error_mark_node.
1681 * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
1682 * method.c (deduce_inheriting_ctor): Return bool if the deduction
1684 (implicitly_declare_fn): If raises is error_mark_node, call
1685 synthesized_method_walk with diag being true.
1687 2021-03-25 Jakub Jelinek <jakub@redhat.com>
1690 * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
1691 packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
1693 2021-03-25 Marek Polacek <polacek@redhat.com>
1696 * call.c (build_converted_constant_expr_internal): Don't emit
1697 -Wconversion warnings.
1699 2021-03-25 Jakub Jelinek <jakub@redhat.com>
1702 * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
1704 * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
1707 2021-03-23 Nathan Sidwell <nathan@acm.org>
1710 * name-lookup.c (check_module_override): Set global or partition
1711 DUP on the binding vector.
1713 2021-03-23 Marek Polacek <polacek@redhat.com>
1716 * decl2.c (cp_warn_deprecated_use_scopes): Only call
1717 cp_warn_deprecated_use when decl is a namespace, class, or enum.
1719 2021-03-23 Nathan Sidwell <nathan@acm.org>
1722 * decl.c (duplicate_decls): Remove assert about maybe-imported
1725 2021-03-23 Jakub Jelinek <jakub@redhat.com>
1728 * decl.c (cp_finish_decomp): Diagnose void initializers when
1729 using tuple_element and get.
1731 2021-03-22 Nathan Sidwell <nathan@acm.org>
1734 * module.cc (depset::hash::make_dependency): Propagate flags for
1735 partial specialization.
1736 (module_may_redeclare): Handle partial specialization.
1738 2021-03-22 Nathan Sidwell <nathan@acm.org>
1741 * cp-tree.h (map_context_from, map_context_to): Delete.
1742 (add_mergeable_specialization): Add is_alias parm.
1743 * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
1744 * module.cc (map_context_from, map_context_to): Delete.
1745 (trees_in::decl_value): Add specializations later, adjust call.
1746 Drop useless alias lookup. Set duplicate fn parm context.
1747 (check_mergeable_decl): Drop context mapping.
1748 (trees_in::is_matching_decl): Likewise.
1749 (trees_in::read_function_def): Drop parameter context adjustment
1752 2021-03-22 Martin Liska <mliska@suse.cz>
1755 * module.cc (fini_modules): Call vec_free instead of delete.
1757 2021-03-20 Jakub Jelinek <jakub@redhat.com>
1760 * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
1761 special code, instead call c_genericize_control_stmt.
1763 2021-03-19 Jakub Jelinek <jakub@redhat.com>
1766 * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
1767 INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
1768 don't diagnose it, set *non_constant_p nor return t.
1770 2021-03-19 Marek Polacek <polacek@redhat.com>
1773 * parser.c (cp_parser_requirement_parameter_list): Handle
1776 2021-03-18 Marek Polacek <polacek@redhat.com>
1778 * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
1780 2021-03-18 Marek Polacek <polacek@redhat.com>
1782 * pt.c (tsubst_copy_and_build): Add assert.
1784 2021-03-18 Iain Sandoe <iain@sandoe.co.uk>
1787 * parser.c (cp_debug_parser): Add Objective-C++ message
1789 (cp_parser_nested_name_specifier_opt): Allow colon to
1790 terminate an assignment-expression when parsing Objective-
1792 (cp_parser_objc_message_expression): Set and clear message
1793 parsing state on entry and exit.
1794 * parser.h (struct cp_parser): Add a context flag for
1795 Objective-C++ message state.
1797 2021-03-18 Martin Liska <mliska@suse.cz>
1800 * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
1803 2021-03-17 Marek Polacek <polacek@redhat.com>
1806 * call.c (conv_unsafe_in_template_p): New.
1807 (convert_like): Use it.
1809 2021-03-17 Anthony Sharp <anthonysharp15@gmail.com>
1810 Jason Merrill <jason@redhat.com>
1812 * semantics.c (get_class_access_diagnostic_decl): New
1813 function that examines special cases when a parent
1814 class causes a private access failure.
1815 (enforce_access): Slightly modified to call function
1818 2021-03-16 Jason Merrill <jason@redhat.com>
1820 * tree.c (cp_tree_equal): Use real_identical.
1822 2021-03-16 Jakub Jelinek <jakub@redhat.com>
1825 * decl.c (expand_static_init): For thread guards, call __cxa_atexit
1826 before calling __cxa_guard_release rather than after it. Formatting
1829 2021-03-16 Martin Liska <mliska@suse.cz>
1830 Jason Merrill <jason@redhat.com>
1833 * call.c (get_function_version_dispatcher): Handle
1835 * decl.c (maybe_version_functions): Likewise.
1836 (maybe_mark_function_versioned): New.
1837 * name-lookup.c (push_local_extern_decl_alias): No longer static.
1838 * name-lookup.h (push_local_extern_decl_alias): Adjust.
1840 2021-03-16 Nathan Sidwell <nathan@acm.org>
1843 * module.cc (trees_out::decl_value): Adjust typedef streaming,
1844 indicate whether it is a dependent alias.
1845 (trees_in::decl_value): Likewise. Set as dependent alias, if it
1848 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
1851 * coroutines.cc (expand_one_await_expression): If the
1852 await_ready() expression is not a boolean then convert it
1855 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
1858 * coroutines.cc (build_actor_fn): Make destroy index 1
1859 correspond to the abnormal unhandled_exception() exit.
1860 Substitute the proxy for the resume index.
1861 (coro_rewrite_function_body): Arrange to reset the resume
1862 index and make done = true for a rethrown exception from
1863 unhandled_exception ().
1864 (morph_fn_to_coro): Adjust calls to build_actor_fn and
1865 coro_rewrite_function_body.
1867 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
1870 * coroutines.cc (replace_continue): Rewrite continue into
1872 (await_statement_walker): Handle await expressions in the
1873 initializer, condition and iteration expressions of for
1876 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
1879 * coroutines.cc (flatten_await_stmt): Allow for the case
1880 where a target expression variable only has uses in the
1881 second part of a compound expression.
1882 (maybe_promote_temps): Avoid emiting empty statements.
1884 2021-03-15 Tobias Burnus <tobias@codesourcery.com>
1887 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
1888 ensure that the varpool node is marked as offloadable.
1890 2021-03-12 Nathan Sidwell <nathan@acm.org>
1893 * module.cc (depset::hash::add_binding_entity): Assert not
1895 (depset::add::add_specializations): Likewise.
1896 * name-lookup.c (name_lookup::dedup): New.
1897 (name_lookup::~name_lookup): Assert not deduping.
1898 (name_lookup::restore_state): Likewise.
1899 (name_lookup::add_overload): Replace outlined code with dedup
1901 (name_lookup::add_value): Likewise.
1902 (name_lookup::search_namespace_only): Likewise.
1903 (name_lookup::adl_namespace_fns): Likewise.
1904 (name_lookup::adl_class_fns): Likewise.
1905 (name_lookup::search_adl): Likewise. Add clearing dedup call.
1906 (name_lookup::search_qualified): Likewise.
1907 (name_lookup::search_unqualified): Likewise.
1909 2021-03-12 Jakub Jelinek <jakub@redhat.com>
1912 * call.c (build_over_call): For immediate evaluation of functions
1913 that return references, undo convert_from_reference effects before
1914 calling cxx_constant_value and call convert_from_reference
1917 2021-03-11 Nathan Sidwell <nathan@acm.org>
1920 * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
1921 when there's a binding vector.
1922 * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
1924 2021-03-11 Nathan Sidwell <nathan@acm.org>
1927 * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
1929 (trees_in::decl_value): Adjust add_mergeable_specialization call.
1930 (trees_out::get_merge_kind): Adjust detecting a partial template
1932 (trees_out::key_mergeable): Adjust handling same.
1933 (trees_in::key_mergeabvle): Likewise.
1935 2021-03-10 Nathan Sidwell <nathan@acm.org>
1938 * module.cc (post_load_processing): Assert not gcable.
1939 (laxy_load_pendings): Extend no-gc region around
1940 post_load_processing.
1942 2021-03-10 Nathan Sidwell <nathan@acm.org>
1945 * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
1946 assembler name to the ns alias.
1948 2021-03-09 Jakub Jelinek <jakub@redhat.com>
1951 * coroutines.cc (build_co_await): Look through NOP_EXPRs in
1952 build_special_member_call return value to find the CALL_EXPR.
1955 2021-03-09 Nathan Sidwell <nathan@acm.org>
1958 * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
1959 that C++20 does not yet imply modules.
1961 2021-03-08 Nathan Sidwell <nathan@acm.org>
1964 * name-lookup.c (get_cxx_dialect_name): Add cxx23.
1966 2021-03-08 Nathan Sidwell <nathan@acm.org>
1968 * lex.c (module_token_filter::resume): Ignore module-decls inside
1970 * parser.c (cp_parser_module_declaration): Reject in header-unit.
1972 2021-03-08 Nathan Sidwell <nathan@acm.org>
1975 * cp-tree.h (match_mergeable_specialization)
1976 (add_mergeable_specialization): Adjust parms.
1977 * module.cc (trees_in::decl_value): Adjust
1978 add_mergeable_specialization calls.
1979 (trees_out::key_mergeable): Adjust match_mergeable_specialization
1981 (specialization_add): Likewise.
1982 * pt.c (match_mergeable_specialization): Do not insert.
1983 (add_mergeable_specialization): Add to hash table here.
1985 2021-03-06 Patrick Palka <ppalka@redhat.com>
1986 Jakub Jelinek <jakub@redhat.com>
1989 * constexpr.c (cxx_eval_increment_expression): Pass lval when
1990 evaluating the MODIFY_EXPR, and update 'mod' with the result of
1991 this evaluation. Check *non_constant_p afterwards. For prefix
1992 ops, just return 'mod'.
1994 2021-03-06 Patrick Palka <ppalka@redhat.com>
1995 Jakub Jelinek <jakub@redhat.com>
1998 * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
1999 variable 'fn' to 'tmpl'. Handle a variable template-id by
2000 calling lookup_template_variable.
2002 2021-03-06 Patrick Palka <ppalka@redhat.com>
2005 * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
2006 outer_targs to do_auto_deduction.
2007 (placeholder_type_constraint_dependent_p): Define.
2008 (do_auto_deduction): When processing_template_decl != 0
2009 and context is adc_unify and we have constraints, pretend the
2010 constraints are satisfied instead of punting. Otherwise don't
2011 punt unless placeholder_type_constraint_dependent_p holds.
2012 Add some clarifying sanity checks. Add a hack to add missing
2013 outermost template levels to outer_args before checking
2014 satisfaction. Don't substitute outer_targs into type if it's
2017 2021-03-05 Marek Polacek <polacek@redhat.com>
2020 * call.c (standard_conversion): When converting pointers to
2021 member, don't return NULL when the bases are equivalent but
2024 2021-03-05 Marek Polacek <polacek@redhat.com>
2027 * name-lookup.c (check_local_shadow): Check if the type of decl
2028 is non-null before checking TYPE_PTR*.
2030 2021-03-05 Nathan Sidwell <nathan@acm.org>
2033 * module.cc (module_state::write_cluster): Relax binding assert.
2035 2021-03-05 Nathan Sidwell <nathan@acm.org>
2038 * pt.c (instantiate_decl): Call set_instantiating_module.
2040 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
2043 * coroutines.cc (build_co_await): Use type_build_ctor_call()
2044 to determine cases when a CTOR needs to be built.
2045 (flatten_await_stmt): Likewise.
2046 (morph_fn_to_coro): Likewise.
2048 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
2051 * coroutines.cc (coro_diagnose_throwing_fn): New helper.
2052 (coro_diagnose_throwing_final_aw_expr): New helper.
2053 (build_co_await): Diagnose throwing final await expression
2055 (build_init_or_final_await): Diagnose a throwing promise
2056 final_suspend() call.
2058 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
2061 * coroutines.cc (struct param_info): Track parameter copies that need
2063 (coro_get_frame_dtor): New helper function factored from build_actor().
2064 (build_actor_fn): Use coro_get_frame_dtor().
2065 (morph_fn_to_coro): Track parameters that need DTORs on exception,
2066 likewise the frame promise and the return object. On exception, run the
2067 DTORs for these, destroy the frame and then rethrow the exception.
2069 2021-03-05 Nathan Sidwell <nathan@acm.org>
2072 * pt.c (instantiate_class_template_1): Set instantiating module
2075 2021-03-05 Tobias Burnus <tobias@codesourcery.com>
2078 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
2080 2021-03-04 Jakub Jelinek <jakub@redhat.com>
2084 * cvt.c (convert_to_void): Revert 2019-10-17 changes. Clarify
2087 2021-03-04 Nathan Sidwell <nathan@acm.org>
2090 * module.cc (class uintset): Delete.
2091 (typedef attached_map_t): A hash map.
2092 (attached_table): Use attached_map_t. Adjust uses ...
2093 (trees_out::decl_value, trees_in::decl_value): ... here ...
2094 (trees_out::key_mergeable): ... here ...
2095 (trees_in::key_mergeable): ... here ...
2096 (maybe_attach_decl): ... here ...
2097 (direct_import): ... and here.
2099 2021-03-04 Nathan Sidwell <nathan@acm.org>
2103 * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
2105 * module.cc (class pending_key): New.
2106 (default_hash_traits<pending_key>): New specialization.
2107 (pending_map_t): New typedef.
2108 (pending_table): Replace old table.
2109 (trees_out::lang_decl_bools): Adjust.
2110 (trees_in::lang_decl_bools): Adjust.
2111 (trees_in::install_entity): Drop pending member and specialization
2113 (find_pending_key): New.
2114 (depset::hash::fiund_dependencies): Use it.
2115 (pendset_lazy_load): Delete.
2116 (module_state::write_cluster): Don't count pendings here. Bye
2117 Duff's device-like thing.
2118 (module_state::write_pendings): Reimplement.
2119 (module_state::read_pendings): Reimplement.
2120 (lazy_specializations_p): Delete.
2121 (module_state::write): Adjust write_pendings call.
2122 (lazy_load_pendings): New.
2123 (lazy_load_specializations): Delete.
2124 (lazy_load_members): Delete.
2125 (init_modules): Adjust.
2126 * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
2127 not lazy_load_members.
2128 (note_pending_specializations): Delete.
2129 (load_pending_specializations): Delete.
2130 * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
2131 (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
2132 (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
2133 (note_pending_specializations): Delete.
2134 (load_pending_specializations): Delete.
2135 * pt.c (lookup_template_class_1): Call lazy_load_pendings not
2136 lazy_load_specializations.
2137 (instantiate_template_class_1): Likewise.
2138 (instantiate_decl): Call lazy_load_pendings.
2139 * typeck.c (complete_type): Likewise.
2141 2021-03-03 Nathan Sidwell <nathan@acm.org>
2144 * module.cc (post_load_decls): New.
2145 (lazy_snum, recursive_lazy): Move earlier.
2146 (module_state::read_cluster): Push cloning onto post_load_decls.
2147 (post_load_processing): New. Do the cloning here.
2148 (module_state::read_inits): Call post_load_processing.
2149 (module_state::read_language): Likewise.
2150 (lazy_load_binding, lazy_load_specializations): Likewise
2151 (lazy_load_members): Likewise
2153 2021-03-03 Nathan Sidwell <nathan@acm.org>
2156 * module.cc (trees_out::decl_value): Stream specialization keys
2158 (trees_in::decl_value): Stream them back and insert after
2159 completing the decl.
2160 (trees_out::key_mergeable): Drop some streaming here ...
2161 (trees_in::key_mergeable): ... and here. Don't insert into
2162 specialization tables.
2164 2021-03-03 Patrick Palka <ppalka@redhat.com>
2166 * constraint.cc (struct sat_info): Document the different
2167 meanings of noisy() and diagnose_unsatisfaction_p() during
2168 satisfaction and requires-expression evaluation.
2169 (tsubst_valid_expression_requirement): Take a sat_info instead
2170 of a subst_info. Perform the substitution quietly first. Fold
2171 in error-replaying code from diagnose_valid_expression.
2172 (tsubst_simple_requirement): Take a sat_info instead of a
2174 (tsubst_type_requirement_1): New. Fold in error-replaying code
2175 from diagnose_valid_type.
2176 (tsubst_type_requirement): Use the above. Take a sat_info
2177 instead of a subst_info.
2178 (tsubst_compound_requirement): Likewise. Fold in
2179 error-replaying code from diagnose_compound_requirement.
2180 (tsubst_nested_requirement): Take a sat_info instead of a
2181 subst_info. Fold in error-replaying code from
2182 diagnose_nested_requirement.
2183 (tsubst_requirement): Take a sat_info instead of a subst_info.
2184 (tsubst_requires_expr): Split into two versions, one that takes
2185 a sat_info argument and another that takes a complain and
2186 in_decl argument. Remove outdated documentation. Document the
2187 effects of the sat_info argument. Don't short-circuit
2188 processing of requirements when diagnosing unsatisfaction,
2189 mirroring diagnose_requires_expr.
2190 (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
2191 assert, and se the three-parameter version of tsubst_requires_expr.
2192 (diagnose_trait_expr): Make static. Take a template argument
2193 vector instead of a parameter mapping.
2194 (diagnose_valid_expression): Remove.
2195 (diagnose_valid_type): Remove.
2196 (diagnose_simple_requirement): Remove.
2197 (diagnose_compound_requirement): Remove.
2198 (diagnose_type_requirement): Remove.
2199 (diagnose_nested_requirement): Remove.
2200 (diagnose_requirement): Remove.
2201 (diagnose_requires_expr): Remove.
2202 (diagnose_atomic_constraint): Take a sat_info instead of a
2203 subst_info. Adjust call to diagnose_trait_expr. Call
2204 tsubst_requires_expr instead of diagnose_requires_expr.
2205 (diagnose_constraints): Remove special casing of REQUIRES_EXPR
2206 and just always call constraint_satisfaction_value.
2208 2021-03-03 Patrick Palka <ppalka@redhat.com>
2210 * constexpr.c (cxx_eval_call_expression): Adjust call to
2211 evaluate_concept_check.
2212 (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
2213 evaluate_requires_expression instead of
2214 satisfy_constraint_expression.
2215 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
2216 * constraint.cc (struct sat_info): Adjust comment about which
2217 satisfaction entrypoints use noisy-unsat.
2218 (normalize_template_requirements): Remove (and adjust callers
2220 (normalize_nontemplate_requirements): Likewise.
2221 (tsubst_nested_requirement): Use constraint_satisfaction_value
2222 instead of satisfy_constraint_expression, which'll do the
2223 noisy replaying of ill-formed quiet satisfaction for us.
2224 (decl_satisfied_cache): Adjust comment.
2225 (satisfy_constraint): Rename to ...
2226 (satisfy_normalized_constraints): ... this.
2227 (satisfy_associated_constraints): Remove (and make its
2228 callers check for dependent arguments).
2229 (satisfy_constraint_expression): Rename to ...
2230 (satisfy_nondeclaration_constraints): ... this. Assert that
2231 'args' is empty when 't' is a concept-id. Removing handling
2232 bare constraint-expressions, and handle REQUIRES_EXPRs
2233 specially. Adjust comment accordingly.
2234 (satisfy_declaration_constraints): Assert in the two-parameter
2235 version that 't' is not a TEMPLATE_DECL. Adjust following
2236 removal of normalize_(non)?template_requirements and
2237 satisfy_asociated_constraints.
2238 (constraint_satisfaction_value): Combine the two- and
2239 three-parameter versions in the natural way.
2240 (constraints_satisfied_p): Combine the one- and two-parameter
2241 versions in the natural way. Improve documentation.
2242 (evaluate_requires_expr): Define.
2243 (evaluate_concept_check): Remove 'complain' parameter. Use
2244 constraint_satisfaction_value instead of
2245 satisfy_constraint_expression.
2246 (diagnose_nested_requirement): Adjust following renaming of
2247 satisfy_constraint_expression.
2248 (diagnose_constraints): Handle REQUIRES_EXPR by going through
2249 diagnose_requires_expr directly instead of treating it as a
2250 constraint-expression. Improve documentation.
2251 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
2252 to evaluate_concept_check.
2253 <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
2254 constraints_satisfied_p.
2255 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
2256 * cp-tree.h (evaluate_requires_expr): Declare.
2257 (evaluate_concept_check): Remove tsubst_flag_t parameter.
2258 (satisfy_constraint_expression): Remove declaration.
2259 (constraints_satisfied_p): Remove one-parameter declaration.
2260 Add a default argument to the two-parameter declaration.
2261 * cvt.c (convert_to_void): Adjust call to
2262 evaluate_concept_check.
2264 2021-03-03 Jakub Jelinek <jakub@redhat.com>
2267 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
2270 2021-03-03 Marek Polacek <polacek@redhat.com>
2274 * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
2275 (maybe_aggr_guide): Use the original template type where needed. In
2276 a class member template, partially instantiate the result of
2277 collect_ctor_idx_types.
2278 (do_class_deduction): Defer the deduction until the enclosing
2279 scope is non-dependent.
2281 2021-03-03 Jason Merrill <jason@redhat.com>
2284 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
2285 if it didn't get one before.
2287 2021-03-03 Nathan Sidwell <nathan@acm.org>
2290 * module.cc (trees_out::decl_node): Small refactor.
2291 (depset::hash::add_binding_entity): Return true on meeting an
2292 import. Set namespace's import here.
2293 (module_state:write_namespaces): Inform of purview too.
2294 (module_state:read_namespaces): Adjust.
2295 * name-lookup.c (implicitly_export_namespace): Delete.
2296 (do_pushdecl): Don't call it.
2297 (push_namespace): Likewise, set purview.
2298 (add_imported_namespace): Reorder parms.
2299 * name-lookup.h (add_imported_namespace): Alter param ordering.
2301 2021-03-02 Martin Sebor <msebor@redhat.com>
2304 * class.c (build_base_path): Call build_if_nonnull.
2305 * cp-tree.h (build_if_nonnull): Declare.
2306 * rtti.c (ifnonnull): Rename...
2307 (build_if_nonnull): ...to this. Set no-warning bit on COND_EXPR.
2308 (build_dynamic_cast_1): Adjust to name change.
2310 2021-03-02 Patrick Palka <ppalka@redhat.com>
2314 * constraint.cc (type_deducible_p): Don't substitute into the
2315 constraints, and instead just pass 'args' to do_auto_deduction
2316 as the outer template arguments.
2317 (tsubst_parameter_mapping): Remove confused code for handling
2318 placeholder type arguments.
2319 (normalize_placeholder_type_constraint): Define.
2320 (satisfy_constraint_expression): Use it to handle placeholder
2322 * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
2323 (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
2324 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
2325 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
2326 (make_constrained_placeholder_type): Set
2327 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
2328 (do_auto_deduction): Clarify comments about the outer_targs
2329 parameter. Rework satisfaction of a placeholder type constraint
2330 to pass in the complete set of template arguments directly to
2331 constraints_satisfied_p.
2332 (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
2333 instead. Also rebuild the the constraint info on the new auto.
2335 2021-03-02 Patrick Palka <ppalka@redhat.com>
2337 * constraint.cc (build_parameter_mapping): Rely on the caller to
2338 determine the in-scope template parameters.
2339 (norm_info::norm_info): Delegate the tsubst_flags_t constructor
2340 to the two-parameter constructor. In the two-parameter
2341 constructor, fold in the definition of make_context, set
2342 initial_parms appropriately, and don't set the now-removed
2344 (norm_info::make_context): Remove, now that its only use is
2345 inlined into the caller.
2346 (norm_info::update_context): Adjust call to
2347 build_parameter_mapping to pass in the relevant set of in-scope
2348 template parameters.
2349 (norm_info::ctx_parms): Define this member function.
2350 (norm_info::context): Initialize to NULL_TREE.
2351 (norm_info::orig_decl): Remove this data member.
2352 (norm_info::initial_parms): Define this data member.
2353 (normalize_atom): Adjust call to build_parameter_mapping to pass
2354 in the relevant set of in-scope template parameters. Use
2355 info.initial_parms instead of info.orig_decl.
2356 (normalize_constraint_expression): Take a norm_info object
2357 instead of a bool. Cache the result of normalization.
2358 (tsubst_nested_requirement): Call satisfy_constraint_expression
2359 instead of satisfy_constraint, so that we normalize on demand.
2360 (satisfy_constraint_expression): Handle a NESTED_REQ argument.
2361 Adjust call to normalize_constraint_expression.
2362 (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
2363 to current_template_parms.
2364 (diagnose_nested_requirements): Go through
2365 satisfy_constraint_expression, as with tsubst_nested_requirement.
2367 2021-03-02 Patrick Palka <ppalka@redhat.com>
2369 * constraint.cc (tsubst_parameter_mapping): Canonicalize the
2370 arguments of a substituted TYPE_ARGUMENT_PACK even if we've
2371 started with a TYPE_ARGUMENT_PACK.
2372 (finish_requires_expr): Don't set DECL_CONTEXT and
2373 CONSTRAINT_VAR_P on each of the introduced parameters here.
2374 * parser.c (cp_parser_requirement_parameter_list): Instead set
2375 these fields earlier, here.
2376 * pt.c (do_auto_deduction): Canonicalize the result of
2377 do_auto_deduction. Pass 'complain' to finish_decltype_type.
2379 2021-03-02 Patrick Palka <ppalka@redhat.com>
2381 * constraint.cc (tsubst_simple_requirement): Just return
2382 boolean_true_node on success.
2383 (tsubst_type_requirement): Likewise.
2384 (tsubst_compound_requirement): Likewise.
2385 (tsubst_nested_requirement): Likewise.
2386 (tsubst_requirement_body): Remove.
2387 (check_constaint_variables): Rename to ...
2388 (check_constraint_variables): ... this.
2389 (tsubst_constraint_variables): Adjust.
2390 (tsubst_requires_expr): Fold tsubst_requirement_body into here.
2392 2021-03-01 Nathan Sidwell <nathan@acm.org>
2395 * class.c (fixup_type_variants): Propagate mode, precision,
2396 alignment & emptiness.
2397 * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
2398 (trees_in::tree_node): Rematerialize alignment here.
2400 2021-02-27 Jason Merrill <jason@redhat.com>
2403 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
2406 2021-02-26 Jakub Jelinek <jakub@redhat.com>
2408 * parser.c (cp_parser_lambda_declarator_opt): Implement
2409 P1102R2 - Down with ()! Make ()s optional before lambda specifiers
2410 for -std={c,gnu}++2b or with pedwarn in earlier versions.
2412 2021-02-26 Jakub Jelinek <jakub@redhat.com>
2415 * lambda.c (is_lambda_ignored_entity): Before checking for
2416 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check.
2418 2021-02-26 Jason Merrill <jason@redhat.com>
2421 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
2422 to a class non-type template argument that needs it.
2424 2021-02-26 Patrick Palka <ppalka@redhat.com>
2427 * pt.c (splice_late_return_type): Rebuild the entire return type
2428 if we have to adjust the level of an auto within.
2429 (type_uses_auto): Adjust call to find_type_usage.
2430 * type-utils.h (find_type_usage): Revert r10-6571 change that
2431 made this function return a pointer to the auto node.
2433 2021-02-25 Patrick Palka <ppalka@redhat.com>
2437 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
2438 TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
2440 2021-02-25 Patrick Palka <ppalka@redhat.com>
2443 * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
2444 (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
2446 2021-02-25 Marek Polacek <polacek@redhat.com>
2450 * constexpr.c (is_std_construct_at): New overload.
2451 (is_std_allocator_allocate): New overload.
2452 (cxx_eval_call_expression): Use the new overloads.
2453 (cxx_eval_constant_expression): Reject casting
2454 from void * as per DR 1312. Don't check can_convert.
2456 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
2459 * coroutines.cc (struct param_info): Track rvalue refs.
2460 (morph_fn_to_coro): Track rvalue refs, and call the promise
2461 CTOR with the frame copy of passed parms.
2463 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
2466 * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
2467 set throwing_cleanup marker.
2469 2021-02-25 Nathan Sidwell <nathan@acm.org>
2472 * module.cc (module_state::inform_cmi_p): Renamed field.
2473 (module_state::do_import): Adjust.
2474 (init_modules, finish_module_processing): Likewise.
2475 (handle_module_option): Likewise.
2477 2021-02-25 Nathan Sidwell <nathan@acm.org>
2480 * mapper-client.cc (module_client::open_module_client): Fix typo
2483 2021-02-24 Nathan Sidwell <nathan@acm.org>
2486 * module.cc (ool): New indirection vector.
2487 (loc_spans::maybe_propagate): Location is not optional.
2488 (loc_spans::open): Likewise. Assert monotonically advancing.
2489 (module_for_ordinary_loc): Use ool indirection vector.
2490 (module_state::write_prepare_maps): Do not count empty macro
2491 expansions. Elide empty spans.
2492 (module_state::write_macro_maps): Skip empty expansions.
2493 (ool_cmp): New qsort comparator.
2494 (module_state::write): Create and destroy ool vector.
2495 (name_pending_imports): Fix dump push/pop.
2496 (preprocess_module): Likewise. Add more dumping.
2497 (preprocessed_module): Likewise.
2499 2021-02-24 Iain Sandoe <iain@sandoe.co.uk>
2502 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
2503 error reporting when instantiating for a constexpr.
2505 2021-02-23 Nathan Sidwell <nathan@acm.org>
2508 * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
2511 2021-02-23 Patrick Palka <ppalka@redhat.com>
2514 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
2515 over from tsubst_copy.
2517 2021-02-23 Patrick Palka <ppalka@redhat.com>
2519 * pt.c (instantiation_dependent_expression_p): Check
2520 processing_template_decl before calling
2521 potential_constant_expression.
2523 2021-02-22 Nathan Sidwell <nathan@acm.org>
2526 * module.cc (struct module_state): Add visited_p flag.
2527 (name_pending_imports): Use it to avoid duplicate requests.
2528 (preprocess_module): Don't read preprocessor state if we failed to
2529 load a module's config.
2531 2021-02-22 Nathan Sidwell <nathan@acm.org>
2534 * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
2536 * module.cc (set_defining_module): Add assert.
2538 2021-02-19 Nathan Sidwell <nathan@acm.org>
2541 * module.cc (pending_imports): New.
2542 (declare_module): Adjust test condition.
2543 (name_pending_imports): New.
2544 (preprocess_module): Reimplement using pending_imports.
2545 (preprocessed_module): Move name-getting to name_pending_imports.
2546 * name-lookup.c (append_imported_binding_slot): Assert module
2547 ordering is increasing.
2549 2021-02-19 Nathan Sidwell <nathan@acm.org>
2551 * module.cc (note_cmis): New.
2552 (struct module_state): Add inform_read_p bit.
2553 (module_state::do_import): Inform of CMI location, if enabled.
2554 (init_modules): Canonicalize note_cmis entries.
2555 (handle_module_option): Handle -flang-info-module-read=FOO.
2557 2021-02-19 Jason Merrill <jason@redhat.com>
2560 * call.c (perfect_conversion_p): Limit rvalueness
2561 test to reference bindings.
2563 2021-02-19 Jason Merrill <jason@redhat.com>
2566 * call.c (perfect_conversion_p): New.
2567 (perfect_candidate_p): New.
2568 (add_candidates): Ignore templates after a perfect non-template.
2570 2021-02-18 Nathan Sidwell <nathan@acm.org>
2573 * module.cc (canonicalize_header_name): Use
2574 cpp_probe_header_unit.
2575 (maybe_translate_include): Fix note_includes comparison.
2576 (init_modules): Fix note_includes string termination.
2578 2021-02-18 Jakub Jelinek <jakub@redhat.com>
2581 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
2582 cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
2583 for immediate function calls.
2585 2021-02-17 Nathan Sidwell <nathan@acm.org>
2588 * module.cc (struct macro_export): Add GTY markers.
2589 (macro_exports): Likewise, us a va_gc Vector.
2591 2021-02-17 Jakub Jelinek <jakub@redhat.com>
2594 * init.c (build_zero_init_1): For flexible array members just return
2595 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
2598 2021-02-17 Nathan Sidwell <nathan@acm.org>
2601 * name-lookup.c (do_pushdecl): Don't peek under template_parm
2603 (set_identifier_type_value_with_scope): ... or here.
2604 (do_pushtag): Only set_identifier_type_value_with_scope at
2605 non-class template parm scope, and use parent scope.
2607 2021-02-17 Nathan Sidwell <nathan@acm.org>
2610 * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
2613 2021-02-17 Patrick Palka <ppalka@redhat.com>
2617 * tree.c (build_aggr_init_expr): Revert r10-7718 change.
2619 2021-02-12 Nathan Sidwell <nathan@acm.org>
2621 * module.cc (module_state::write_cluster): Check bindings for
2622 imported using-decls.
2624 2021-02-12 Nathan Sidwell <nathan@acm.org>
2627 * module.cc (trees_in::decl_value): Call add_module_namespace_decl
2628 for new namespace-scope entities.
2629 (module_state::read_cluster): Don't call add_module_decl here.
2630 * name-lookup.h (add_module_decl): Rename to ...
2631 (add_module_namespace_decl): ... this.
2632 * name-lookup.c (newbinding_bookkeeping): Move into ...
2633 (do_pushdecl): ... here. Its only remaining caller.
2634 (add_module_decl): Rename to ...
2635 (add_module_namespace_decl): ... here. Add checking-assert for
2636 circularity. Don't call newbinding_bookkeeping, just extern_c
2637 checking and incomplete var checking.
2639 2021-02-12 Nathan Sidwell <nathan@acm.org>
2643 * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
2644 (global_type_node): Delete.
2645 (IDENTIFIER_TYPE_VALUE): Delete.
2646 (IDENTIFIER_HAS_TYPE_VALUE): Delete.
2647 (get_type_value): Delete.
2648 * name-lookup.h (identifier_type_value): Delete.
2649 * name-lookup.c (check_module_override): Don't
2650 SET_IDENTIFIER_TYPE_VALUE here.
2651 (do_pushdecl): Nor here.
2652 (identifier_type_value_1, identifier_type_value): Delete.
2653 (set_identifier_type_value_with_scope): Only
2654 SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
2655 (pushdecl_nanmespace_level): Remove shadow stack nadgering.
2656 (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
2657 * call.c (check_dtor_name): Use lookup_name.
2658 * decl.c (cxx_init_decl_processing): Drop global_type_node.
2659 * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
2661 * init.c (get_type_value): Delete.
2662 * pt.c (instantiate_class_template_1): Don't call pushtag or
2663 SET_IDENTIFIER_TYPE_VALUE here.
2664 (tsubst): Assert never an identifier.
2665 (dependent_type_p): Drop global_type_node assert.
2666 * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
2667 to determine ctorness.
2669 2021-02-12 Jakub Jelinek <jakub@redhat.com>
2672 * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
2675 2021-02-12 Jason Merrill <jason@redhat.com>
2679 * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
2680 (register_parameter_specializations): Not here.
2682 2021-02-11 Marek Polacek <polacek@redhat.com>
2685 * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
2686 for the partial instantiation.
2688 2021-02-11 Jakub Jelinek <jakub@redhat.com>
2691 * init.c (build_zero_init_1): Handle zero initialiation of
2692 flexible array members like initialization of [0] arrays.
2693 Use integer_minus_onep instead of comparison to integer_minus_one_node
2694 and integer_zerop instead of comparison against size_zero_node.
2697 2021-02-11 Marek Polacek <polacek@redhat.com>
2700 * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
2702 2021-02-11 Patrick Palka <ppalka@redhat.com>
2705 * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
2706 lookup result by discarding it if the first element is a
2707 class-scope declaration, otherwise return it.
2708 (push_operator_bindings): Handle an ambiguous lookup result by
2709 doing push_local_binding on each element in the list.
2711 2021-02-11 Marek Polacek <polacek@redhat.com>
2713 * parser.c (cp_parser_selection_statement): Use vec_free.
2715 2021-02-10 Jakub Jelinek <jakub@redhat.com>
2719 * constexpr.c: Include cgraph.h.
2720 (cxx_eval_call_expression): Call varpool_node::finalize_decl on
2721 heap artificial vars.
2722 (cxx_eval_outermost_constant_expr): Remove varpool nodes for
2723 heap artificial vars.
2725 2021-02-10 Nathan Sidwell <nathan@acm.org>
2728 * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
2729 answer if there's no local specialization.
2731 2021-02-09 Nathan Sidwell <nathan@acm.org>
2734 * module.cc (module_state::is_rooted): Rename to ...
2735 (module_state::has_location): ... here. Adjust callers.
2736 (module_state::read_partitions): Adjust validity check.
2737 Don't overwrite a known location.
2739 2021-02-09 Jason Merrill <jason@redhat.com>
2742 * pt.c (mark_decl_instantiated): Exit early if consteval.
2744 2021-02-09 Jason Merrill <jason@redhat.com>
2748 * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
2751 2021-02-09 Jason Merrill <jason@redhat.com>
2755 * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
2758 2021-02-08 Nathan Sidwell <nathan@acm.org>
2760 * decl.c (start_cleanup_fn): Push function into
2763 2021-02-08 Nathan Sidwell <nathan@acm.org>
2766 * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
2767 * decl.c (push_abi_namespace, pop_abi_namespace): Moved
2768 from rtti.c, add default namespace arg.
2769 (check_redeclaration_exception_specification): Allow a lazy
2770 builtin's eh spec to differ from an lready-declared user
2772 (declare_global_var): Use push/pop_abi_namespace.
2773 (get_atexit_node): Push the fndecl into a namespace.
2774 * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
2777 2021-02-08 Marek Polacek <polacek@redhat.com>
2779 * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
2781 2021-02-05 Marek Polacek <polacek@redhat.com>
2784 * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
2786 * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
2787 issuing the -Wvolatile warning. Only set TREE_THIS_VOLATILE if
2788 a warning was emitted.
2790 2021-02-05 Marek Polacek <polacek@redhat.com>
2793 * name-lookup.c (lookup_using_decl): Hoist the destructor check.
2795 2021-02-05 Jakub Jelinek <jakub@redhat.com>
2798 * decl.c (check_array_initializer): For structured bindings, require
2799 the array type to be complete.
2801 2021-02-04 Jason Merrill <jason@redhat.com>
2804 * constraint.cc (build_concept_check_arguments): Remove assert.
2805 (build_concept_check): Allow empty args.
2807 2021-02-04 Tom Greenslade (thomgree) <thomgree@cisco.com>
2810 * call.c (can_convert_array): Extend to handle all valid aggregate
2811 initializers of an array; including by string literals, not just by
2813 (build_aggr_conv): Call can_convert_array more often, not just in
2814 brace-init-list case.
2815 * typeck2.c (array_string_literal_compatible_p): New function.
2816 (digest_init_r): call array_string_literal_compatible_p
2817 * cp-tree.h: (array_string_literal_compatible_p): Declare.
2819 2021-02-04 Jason Merrill <jason@redhat.com>
2822 * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
2824 2021-02-04 Jason Merrill <jason@redhat.com>
2827 * pt.c (tsubst_attribute): Handle error.
2828 (apply_late_template_attributes): Return false on error.
2829 (tsubst_function_decl): Check its return value.
2830 (tsubst_decl): Likewise.
2831 (push_template_decl): Assert current_template_parms.
2832 (tsubst_template_decl): Set current_template_parms.
2834 2021-02-03 Marek Polacek <polacek@redhat.com>
2837 * call.c (struct z_candidate): Mark rewritten and reversed as const.
2838 (struct NonPublicField): Mark operator() as const.
2839 (struct NonTrivialField): Likewise.
2841 2021-02-03 Jason Merrill <jason@redhat.com>
2845 * pt.c (spec_hasher::equal): Set processing_template_decl.
2846 * Make-lang.in (check-g++-strict-gc): Add --param
2847 hash-table-verification-limit=10000.
2849 2021-02-03 Marek Polacek <polacek@redhat.com>
2852 * parser.c (cp_parser_class_specifier_1): Use any possible
2853 DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
2854 (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
2855 * pt.c (tsubst_exception_specification): Stash new_specs into
2856 DEFPARSE_INSTANTIATIONS.
2857 * tree.c (fixup_deferred_exception_variants): Use
2858 UNPARSED_NOEXCEPT_SPEC_P.
2860 2021-02-02 Jason Merrill <jason@redhat.com>
2864 * error.c (dump_expr): Ignore dummy object.
2865 * pt.c (tsubst_baselink): Handle dependent scope.
2867 2021-02-01 Patrick Palka <ppalka@redhat.com>
2870 * constexpr.c (cxx_eval_array_reference): Also set
2871 new_ctx.object when setting new_ctx.ctor.
2873 2021-02-01 Marek Polacek <polacek@redhat.com>
2876 * parser.c (cp_parser_has_attribute_expression): Use
2877 uses_template_parms instead of type_dependent_expression_p.
2879 2021-02-01 Jason Merrill <jason@redhat.com>
2882 * cp-tree.h: Declare it.
2883 * pt.c (comparing_dependent_aliases): New flag.
2884 (template_args_equal, spec_hasher::equal): Set it.
2885 (dependent_alias_template_spec_p): Assert that we don't
2886 get non-types other than error_mark_node.
2887 (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
2888 on complex alias specializations. Set TYPE_DEPENDENT_P here.
2889 (tsubst_decl): Not here.
2890 * module.cc (module_state::read_cluster): Set
2891 comparing_dependent_aliases instead of
2892 comparing_specializations.
2893 * tree.c (cp_tree_equal): Remove comparing_specializations
2895 * typeck.c (structural_comptypes): Adjust.
2896 (comptypes): Remove comparing_specializations handling.
2898 2021-01-29 Nathan Sidwell <nathan@acm.org>
2901 * module.cc (module_state_config): Add num_entities field.
2902 (module_state::read_entities): The entity_ary span is
2904 (module_state::write_config): Write num_entities.
2905 (module_state::read_config): Read num_entities.
2906 (module_state::write): Set config's num_entities.
2907 (module_state::read_initial): Allocate the entity ary
2909 (module_state::read_language): Do not set entity_lwm
2912 2021-01-29 Marek Polacek <polacek@redhat.com>
2915 * parser.c (cp_parser_class_name): If parser->scope is
2916 error_mark_node, return it, otherwise continue.
2918 2021-01-28 Jakub Jelinek <jakub@redhat.com>
2921 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
2923 2021-01-28 Jakub Jelinek <jakub@redhat.com>
2927 * decl.c (cp_finish_decl): For register vars with asmspec in templates
2928 call set_user_assembler_name and set DECL_HARD_REGISTER.
2929 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
2930 pass asmspec_tree to cp_finish_decl.
2932 2021-01-28 Nathan Sidwell <nathan@acm.org>
2935 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
2937 (trees_in::decl_value): Do typedef frobbing only when installing
2938 a new typedef, adjust is_matching_decl call. Swap is_typedef
2940 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
2941 names and deal with typedef checking.
2943 2021-01-27 Jason Merrill <jason@redhat.com>
2946 * name-lookup.c (lookup_using_decl): Clean up handling
2947 of dependency and inherited constructors.
2948 (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
2949 * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
2951 2021-01-26 Jason Merrill <jason@redhat.com>
2954 * call.c (type_passed_as): Don't mark invisiref restrict.
2956 2021-01-26 Jason Merrill <jason@redhat.com>
2960 * class.c (layout_class_type): An empty field gets size 0.
2961 (is_empty_field): New.
2962 (check_bases): Check it.
2963 * cp-tree.h (is_empty_field): Declare it.
2964 * constexpr.c (cxx_eval_store_expression): Check it.
2965 (cx_check_missing_mem_inits): Likewise.
2966 * init.c (perform_member_init): Likewise.
2967 * typeck2.c (process_init_constructor_record): Likewise.
2969 2021-01-25 Martin Sebor <msebor@redhat.com>
2972 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
2974 2021-01-25 Jason Merrill <jason@redhat.com>
2977 * constexpr.c (get_or_insert_ctor_field): Add check.
2978 (cxx_eval_store_expression): Handle discontinuity of refs.
2980 2021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
2982 * call.c (complain_about_access): Altered function.
2983 * cp-tree.h (complain_about_access): Changed parameters of function.
2984 (get_parent_with_private_access): Declared new function.
2985 * search.c (get_parent_with_private_access): Defined new function.
2986 * semantics.c (enforce_access): Modified function.
2987 * typeck.c (complain_about_unrecognized_member): Updated function
2988 arguments in complain_about_access.
2990 2021-01-23 Patrick Palka <ppalka@redhat.com>
2993 * cp-tree.h (shared_member_p): Adjust declaration.
2994 * parser.c (cp_parser_init_declarator): If the storage class
2995 specifier is sc_static, pass true for static_p to
2996 cp_parser_declarator.
2997 (cp_parser_direct_declarator): Don't do inject_this_parm when
2998 the declarator is a friend.
2999 * search.c (shared_member_p): Change return type to bool and
3000 adjust function body accordingly. Return false for a dependent
3001 USING_DECL instead of aborting.
3002 * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
3003 even when type-dependent.
3005 2021-01-22 Marek Polacek <polacek@redhat.com>
3008 * parser.c (inject_parm_decls): Remove a redundant assignment.
3009 (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
3010 before calling inject_parm_decls.
3012 2021-01-22 Jason Merrill <jason@redhat.com>
3015 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
3017 2021-01-22 Jakub Jelinek <jakub@redhat.com>
3020 * init.c (build_zero_init_1): Revert the 2018-03-06 change to
3021 return build_zero_cst for reference types.
3022 * typeck2.c (process_init_constructor_record): Instead call
3023 build_zero_cst here during error recovery instead of build_zero_init.
3025 2021-01-22 Marek Polacek <polacek@redhat.com>
3028 * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
3029 warnings regardless of abi_version_at_least.
3030 (write_expression): When the expression is a dependent name
3031 and an operator name, write "on" before writing its name.
3033 2021-01-22 Marek Polacek <polacek@redhat.com>
3036 * pt.c (instantiate_class_template_1): Instantiate members
3037 marked with attribute used only after we're done instantiating
3040 2021-01-21 Patrick Palka <ppalka@redhat.com>
3043 * semantics.c (finish_decltype_type): Set up a cp_unevaluated
3044 sentinel at the start of the function. Remove a now-redundant
3045 manual adjustment of cp_unevaluated_operand.
3047 2021-01-21 Nathan Sidwell <nathan@acm.org>
3050 * module.cc (depset::hash::find_dependencies): Add
3052 (trees_out::core_vals): Check state before calling
3054 (sort_cluster, module_state::write): Adjust
3055 find_dependencies call.
3057 2021-01-21 Jakub Jelinek <jakub@redhat.com>
3060 * constexpr.c (check_for_return_continue_data): Add break_stmt member.
3061 (check_for_return_continue): Also look for BREAK_STMT. Handle
3062 SWITCH_STMT by ignoring break_stmt from its body.
3063 (potential_constant_expression_1) <case FOR_STMT>,
3064 <case WHILE_STMT>: If the condition isn't constant true, check if
3065 the loop body can contain a return stmt.
3066 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
3067 <case IF_STMT>: If recursion with tf_none is successful,
3068 merge *jump_target from the branches - returns with highest priority,
3069 breaks or continues lower. If then branch is potentially constant and
3070 doesn't return, check the else branch if it could return, break or
3073 2021-01-21 Nathan Sidwell <nathan@acm.org>
3076 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
3078 2021-01-20 Nathan Sidwell <nathan@acm.org>
3080 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
3083 2021-01-20 Patrick Palka <ppalka@redhat.com>
3086 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
3087 CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
3088 adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
3090 2021-01-20 Patrick Palka <ppalka@redhat.com>
3093 * parser.c (cp_parser_class_head): Defer access checking when
3094 parsing the base-clause until all bases are seen and attached
3096 * pt.c (instantiate_class_template): Likewise when substituting
3097 into dependent bases.
3099 2021-01-20 Jakub Jelinek <jakub@redhat.com>
3102 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
3103 error_operand_p, remove clause without further checking. Check
3104 for non-NULL TYPE_NAME.
3106 2021-01-19 Marek Polacek <polacek@redhat.com>
3109 * pt.c (maybe_instantiate_noexcept): Return false if FN is
3112 2021-01-19 Marek Polacek <polacek@redhat.com>
3115 * name-lookup.c (push_using_decl_bindings): New, broken out of...
3116 (finish_nonmember_using_decl): ...here.
3117 * name-lookup.h (push_using_decl_bindings): Update declaration.
3118 * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
3120 2021-01-19 Patrick Palka <ppalka@redhat.com>
3124 * search.c (friend_accessible_p): If scope is a hidden friend
3125 defined inside a dependent class, consider access from the
3127 * parser.c (cp_parser_late_parsing_for_member): Don't push a
3128 dk_no_check access state.
3130 2021-01-19 Marek Polacek <polacek@redhat.com>
3133 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
3134 of NSDMIs before late-parsing of noexcept-specifiers.
3136 2021-01-19 Nathan Sidwell <nathan@acm.org>
3138 * module.cc (identifier): Merge overloads.
3140 2021-01-19 Nathan Sidwell <nathan@acm.org>
3143 * module.cc (trees_out::write_location): Make static.
3145 2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
3147 * parser.c (cp_parser_omp_clause_detach): New.
3148 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
3149 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
3150 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
3151 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
3152 Prevent use of detach with mergeable and overriding the data sharing
3153 mode of the event handle.
3155 2021-01-15 Nathan Sidwell <nathan@acm.org>
3158 * tree.c (cp_build_qualified_type_real): Propagate an array's
3159 dependentness to the copy, if known.
3161 2021-01-15 Jason Merrill <jason@redhat.com>
3164 * call.c (unsafe_return_slot_p): Return int.
3165 (init_by_return_slot_p): Split out from...
3166 (unsafe_copy_elision_p): ...here.
3167 (unsafe_copy_elision_p_opt): New name for old meaning.
3168 (build_over_call): Adjust.
3169 (make_safe_copy_elision): New.
3170 * typeck2.c (split_nonconstant_init_1): Elide copy from safe
3171 list-initialization.
3172 * cp-tree.h: Adjust.
3174 2021-01-15 Jason Merrill <jason@redhat.com>
3176 * call.c (base_ctor_for, make_base_init_ok): New.
3177 (build_over_call): Use make_base_init_ok.
3179 2021-01-15 Jason Merrill <jason@redhat.com>
3182 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
3183 if we got a CONSTRUCTOR.
3185 2021-01-15 Nathan Sidwell <nathan@acm.org>
3188 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
3190 2021-01-14 Jason Merrill <jason@redhat.com>
3192 * typeck2.c (process_init_constructor_record): Use fldtype
3193 variable consistently.
3195 2021-01-14 Nathan Sidwell <nathan@acm.org>
3198 * tree.c (cp_tree_equal): Correct map_context logic.
3200 2021-01-13 Marek Polacek <polacek@redhat.com>
3203 * name-lookup.c (push_using_decl_bindings): New.
3204 * name-lookup.h (push_using_decl_bindings): Declare.
3205 * pt.c (tsubst_expr): Call push_using_decl_bindings.
3207 2021-01-13 Nathan Sidwell <nathan@acm.org>
3210 * module.cc (module_add_import_initializers): Pass a
3211 zero-element argument vector.
3213 2021-01-12 Patrick Palka <ppalka@redhat.com>
3216 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
3217 the template of a CTAD placeholder.
3219 2021-01-12 Marek Polacek <polacek@redhat.com>
3222 * typeck2.c (process_init_constructor_record): Don't emit
3223 -Wmissing-field-initializers warnings in unevaluated contexts.
3225 2021-01-11 Jakub Jelinek <jakub@redhat.com>
3228 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
3230 (mark_abi_tags_r): Likewise.
3231 * decl2.c (min_vis_r): Likewise.
3232 * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
3235 2021-01-08 Patrick Palka <ppalka@redhat.com>
3238 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
3239 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
3241 2021-01-08 Patrick Palka <ppalka@redhat.com>
3244 * semantics.c (check_accessibility_of_qualified_id): Punt if
3245 we're checking access of a scoped non-static member inside a
3248 2021-01-07 Jakub Jelinek <jakub@redhat.com>
3251 * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
3252 cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
3254 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
3256 2021-01-07 Marek Polacek <polacek@redhat.com>
3259 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
3260 !late_return_type block.
3262 2021-01-07 Jason Merrill <jason@redhat.com>
3264 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
3265 (cxx_eval_store_expression): Add comment.
3267 2021-01-07 Jason Merrill <jason@redhat.com>
3269 * call.c (has_next): Factor out from...
3270 (next_conversion): ...here.
3271 (strip_standard_conversion): And here.
3272 (is_subseq): And here.
3273 (build_conv): Check it.
3274 (standard_conversion): Don't call build_conv
3277 2021-01-06 Martin Sebor <msebor@redhat.com>
3280 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
3282 2021-01-05 Patrick Palka <ppalka@redhat.com>
3284 * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
3285 the type of the NTTP, substitute into the type again. If the
3286 type is still dependent, don't unify the NTTP.
3288 2021-01-05 Jakub Jelinek <jakub@redhat.com>
3290 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
3291 $(CODYLIB) after $(BACKEND).
3293 2021-01-05 Jakub Jelinek <jakub@redhat.com>
3296 * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
3297 Punt if lval is true.
3298 * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
3299 the result if it has a class type.
3301 2021-01-05 Marek Polacek <polacek@redhat.com>
3304 * pt.c (resolve_overloaded_unification): Call
3305 maybe_instantiate_noexcept after instantiating the function
3308 2021-01-05 Nathan Sidwell <nathan@acm.org>
3310 * parser.c (cp_parser_module_declaration): Alter diagnostic
3311 text to say where is permissable.
3313 2021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3316 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
3318 2021-01-02 Jan Hubicka <jh@suse.cz>
3320 * cp-tree.h (cp_tree_c_finish_parsing): Declare.
3321 * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
3322 * tree.c (cp_tree_c_finish_parsing): New function.
3324 2021-01-01 Jakub Jelinek <jakub@redhat.com>
3326 * ChangeLog-2020: Rotate ChangeLog. New file.
3329 Copyright (C) 2021 Free Software Foundation, Inc.
3331 Copying and distribution of this file, with or without modification,
3332 are permitted in any medium without royalty provided the copyright
3333 notice and this notice are preserved.