1 2022-01-31 Marek Polacek <polacek@redhat.com>
5 * decl.cc (create_array_type_for_decl): Use template_placeholder_p.
6 Sorry on a variable-length array of auto.
8 2022-01-31 Marek Polacek <polacek@redhat.com>
11 * class.cc (finish_struct): Don't allow union initializer_list.
13 2022-01-31 Patrick Palka <ppalka@redhat.com>
16 * pt.cc (ctor_deduction_guides_for): Correct computation of
19 2022-01-31 Patrick Palka <ppalka@redhat.com>
22 * pt.cc (for_each_template_parm_r) <case CONSTRUCTOR>: Clear
23 walk_subtrees if !include_nondeduced_p. Simplify given that
24 cp_walk_subtrees already walks TYPE_PTRMEMFUNC_FN_TYPE_RAW.
26 2022-01-28 Patrick Palka <ppalka@redhat.com>
27 Jason Merrill <jason@redhat.com>
30 * typeck.cc (build_ptrmemfunc): Cast a nullptr constant to the
31 unqualified pointer type not the qualified one.
33 2022-01-28 Patrick Palka <ppalka@redhat.com>
36 * decl.cc (cp_finish_decl): Pass the template arguments of a
37 variable template specialization or a templated static data
38 member to do_auto_deduction when the auto is constrained.
40 2022-01-28 Jason Merrill <jason@redhat.com>
45 * parser.cc (cp_parser_enumerator_definition): Sorry on parameter
47 (cp_parser_class_head): And in class attributes.
48 * pt.cc (check_for_bare_parameter_packs): Sorry instead of error
51 2022-01-27 Jason Merrill <jason@redhat.com>
55 * decl2.cc (save_template_attributes): Take late attrs as parm.
56 (cplus_decl_attributes): Call it after decl_attributes,
57 splice_template_attributes before.
59 2022-01-27 Patrick Palka <ppalka@redhat.com>
62 * call.cc (build_over_call): For a non-dependent member call,
63 build up a CALL_EXPR using a COMPONENT_REF callee, as in
64 build_new_method_call.
65 * pt.cc (build_non_dependent_expr): Don't wrap PARM_DECL either.
66 * tree.cc (build_min_non_dep_op_overload): Adjust accordingly
67 after the build_over_call change.
69 2022-01-27 Patrick Palka <ppalka@redhat.com>
73 * parser.cc (cp_parser_class_head): Update 'type' with the result
74 of maybe_process_partial_specialization in the
75 nested_name_specifier branch. Refactor nearby code to accomodate
76 that maybe_process_partial_specialization returns a _TYPE, not a
77 TYPE_DECL, and eliminate local variable 'class_type' in passing.
79 2022-01-27 Marek Polacek <polacek@redhat.com>
82 * decl.cc (create_array_type_for_decl): Reject forming an array of
83 placeholder for a deduced class type.
85 2022-01-26 Jason Merrill <jason@redhat.com>
89 * semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
91 2022-01-26 Jakub Jelinek <jakub@redhat.com>
94 * constexpr.cc (init_subob_ctx): For vector ctors containing
95 vector elements, ensure appending to the same ctor instead of
98 2022-01-26 Marek Polacek <polacek@redhat.com>
101 * decl.cc (finish_constructor_body): Suppress -Wuse-after-free.
102 (finish_destructor_body): Likewise.
103 * optimize.cc (build_delete_destructor_body): Likewise.
105 2022-01-26 Jason Merrill <jason@redhat.com>
108 * parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.
110 2022-01-26 Jason Merrill <jason@redhat.com>
113 * pt.cc (tsubst_aggr_type): Call tsubst for alias template
116 2022-01-25 Patrick Palka <ppalka@redhat.com>
120 * decl2.cc (mark_used): Don't consider maybe_instantiate_noexcept
121 on a deleted function.
123 2022-01-25 Jason Merrill <jason@redhat.com>
126 * call.cc (build_over_call): Use cp_build_indirect_ref.
128 2022-01-24 Patrick Palka <ppalka@redhat.com>
131 * pt.cc (make_auto_1): Use -1 as a placeholder default argument
134 2022-01-24 Patrick Palka <ppalka@redhat.com>
137 * typeck.cc (build_class_member_access_expr): Extend
138 unary_complex_lvalue result adjustment to preserve all
139 rvalues, not just xvalues.
141 2022-01-23 Will Wray <wjwray@gmail.com>
144 * decl.cc (reshape_init_r): Only call has_designator_check when
145 first_initializer_p or for the inner constructor element.
146 (cp_complete_array_type): Call reshape_init on braced-init-list.
148 2022-01-23 Jason Merrill <jason@redhat.com>
151 * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing
152 has set DECL_INITIAL on a TARGET_EXPR slot.
153 * tree.cc (is_local_temp): Don't check DECL_CONTEXT.
155 2022-01-23 Jason Merrill <jason@redhat.com>
158 * cp-tree.h (build_implicit_conv_flags): Declare.
159 * call.cc (build_implicit_conv_flags): Split out from...
160 (perform_implicit_conversion_flags): ...here.
161 * decl.cc (check_initializer): Use it.
162 * pt.cc (tsubst_copy_and_build): Remove TARGET_EXPR handling.
163 * semantics.cc (finish_compound_literal): Don't treat
164 scalar values like CONSTRUCTORs.
166 2022-01-21 Jason Merrill <jason@redhat.com>
168 * semantics.cc (find_failing_clause): Return expr if not
170 (finish_static_assert): Show constant values in failing
173 2022-01-21 Jason Merrill <jason@redhat.com>
177 * init.cc (build_new_1): Only pull out TARGET_EXPR_INITIAL if
178 alloc_expr is a TARGET_EXPR.
180 2022-01-21 Marek Polacek <polacek@redhat.com>
183 * tree.cc (fixup_deferred_exception_variants): Remove duplicate
184 variants after parsing the exception specifications.
186 2022-01-21 Jason Merrill <jason@redhat.com>
190 * class.cc (end_of_class): Use base_binfo.
192 2022-01-20 Jason Merrill <jason@redhat.com>
195 * decl.cc (reshape_init_class): Reject designator for a member of
198 2022-01-20 Patrick Palka <ppalka@redhat.com>
202 * pt.cc (keep_template_parm): Punt on a level 0 template parm.
203 (tsubst_decl) <case VAR_DECL>: Remove !CHECKING_P safeguard.
204 (tsubst) <case TEMPLATE_TYPE_PARM>: Handle CTAD placeholders
206 (make_auto_1): Add defaulted 'level' parameter.
207 (make_template_placeholder): Pass 0 as 'level' to make_auto_1.
209 2022-01-20 Patrick Palka <ppalka@redhat.com>
211 * decl.cc (grokdeclarator): Diagnose a CTAD placeholder as
212 function return type even when !funcdecl_p.
214 2022-01-20 Martin Liska <mliska@suse.cz>
217 * error.cc (dump_aggr_type): Partially disable the warning.
219 2022-01-20 Jason Merrill <jason@redhat.com>
222 * parser.cc (cp_parser_template_name): Use dependent_scope_p.
224 2022-01-19 David Malcolm <dmalcolm@redhat.com>
226 * cp-lang.cc (selftest::run_cp_tests): Update calls for .c to .cc
228 * cp-tree.h (cp_pt_c_tests): Rename to...
229 (cp_pt_cc_tests): ...this.
230 (cp_tree_c_tests): Rename to...
231 (cp_tree_cc_tests): ...this.
232 * pt.cc (cp_pt_c_tests): Rename to...
233 (cp_pt_cc_tests): ...this.
234 * tree.cc (cp_tree_c_tests): Rename to...
235 (cp_tree_cc_tests): ...this.
237 2022-01-19 Jason Merrill <jason@redhat.com>
239 * parser.cc (saved_token_sentinel::rollback): Use
240 cp_lexer_previous_token.
242 2022-01-18 Jakub Jelinek <jakub@redhat.com>
245 * constexpr.cc (cxx_eval_outermost_constant_expr): If t is a
246 TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
247 than get_target_expr_sfinae with tf_no_cleanup, and don't set
250 2022-01-18 Jason Merrill <jason@redhat.com>
251 Jakub Jelinek <jakub@redhat.com>
254 * parser.cc (saved_token_sentinel::rollback): Call
255 cp_lexer_set_source_position.
256 (~saved_token_sentinel): Call rollback.
258 2022-01-18 Patrick Palka <ppalka@redhat.com>
261 * pt.cc (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
262 that we return false for DEPENDENT_OPERATOR_TYPE too.
264 2022-01-17 Martin Liska <mliska@suse.cz>
266 * Make-lang.in: Rename .c names to .cc.
267 * config-lang.in: Likewise.
268 * constexpr.cc (cxx_eval_constant_expression): Likewise.
269 * coroutines.cc (morph_fn_to_coro): Likewise.
270 * cp-gimplify.cc (cp_gimplify_expr): Likewise.
271 * cp-lang.cc (struct lang_hooks): Likewise.
272 (get_template_argument_pack_elems_folded): Likewise.
273 * cp-objcp-common.cc (cp_tree_size): Likewise.
274 (cp_unit_size_without_reusable_padding): Likewise.
275 (pop_file_scope): Likewise.
276 (cp_pushdecl): Likewise.
277 * cp-objcp-common.h (GCC_CP_OBJCP_COMMON): Likewise.
278 (cxx_simulate_record_decl): Likewise.
279 * cp-tree.h (struct named_label_entry): Likewise.
280 (current_function_return_value): Likewise.
281 (more_aggr_init_expr_args_p): Likewise.
282 (get_function_version_dispatcher): Likewise.
283 (common_enclosing_class): Likewise.
284 (strip_fnptr_conv): Likewise.
285 (current_decl_namespace): Likewise.
286 (do_aggregate_paren_init): Likewise.
287 (cp_check_const_attributes): Likewise.
288 (qualified_name_lookup_error): Likewise.
289 (generic_targs_for): Likewise.
290 (mark_exp_read): Likewise.
291 (is_global_friend): Likewise.
292 (maybe_reject_flexarray_init): Likewise.
293 (module_token_lang): Likewise.
294 (handle_module_option): Likewise.
295 (literal_integer_zerop): Likewise.
296 (build_extra_args): Likewise.
297 (build_if_nonnull): Likewise.
298 (maybe_check_overriding_exception_spec): Likewise.
299 (finish_omp_target_clauses): Likewise.
300 (maybe_warn_zero_as_null_pointer_constant): Likewise.
301 (cxx_print_error_function): Likewise.
302 (decl_in_std_namespace_p): Likewise.
303 (merge_exception_specifiers): Likewise.
304 (mangle_module_global_init): Likewise.
305 (cxx_block_may_fallthru): Likewise.
306 (fold_builtin_source_location): Likewise.
307 (enum cp_oracle_request): Likewise.
308 (subsumes): Likewise.
309 (cp_finish_injected_record_type): Likewise.
310 (vtv_build_vtable_verify_fndecl): Likewise.
311 (cp_tree_c_finish_parsing): Likewise.
312 * cvt.cc (diagnose_ref_binding): Likewise.
313 (convert_to_void): Likewise.
314 (convert_force): Likewise.
315 (type_promotes_to): Likewise.
316 * decl.cc (make_unbound_class_template_raw): Likewise.
317 (cxx_init_decl_processing): Likewise.
318 (check_class_member_definition_namespace): Likewise.
319 (cxx_maybe_build_cleanup): Likewise.
320 * decl2.cc (maybe_emit_vtables): Likewise.
321 * error.cc (dump_function_name): Likewise.
322 * init.cc (is_class_type): Likewise.
323 (build_new_1): Likewise.
324 * lang-specs.h: Likewise.
325 * method.cc (make_alias_for_thunk): Likewise.
326 * module.cc (specialization_add): Likewise.
327 (module_state::read_cluster): Likewise.
328 * name-lookup.cc (check_extern_c_conflict): Likewise.
329 * name-lookup.h (struct cxx_binding): Likewise.
330 * parser.cc (cp_parser_identifier): Likewise.
331 * parser.h (struct cp_parser): Likewise.
332 * pt.cc (has_value_dependent_address): Likewise.
333 (push_tinst_level_loc): Likewise.
334 * semantics.cc (finish_omp_clauses): Likewise.
335 (finish_omp_atomic): Likewise.
336 * tree.cc (cp_save_expr): Likewise.
337 (cp_free_lang_data): Likewise.
338 * typeck.cc (cp_common_type): Likewise.
339 (strip_array_domain): Likewise.
340 (rationalize_conditional_expr): Likewise.
341 (check_return_expr): Likewise.
342 * vtable-class-hierarchy.cc: Likewise.
344 2022-01-17 Martin Liska <mliska@suse.cz>
346 * call.c: Moved to...
348 * class.c: Moved to...
350 * constexpr.c: Moved to...
351 * constexpr.cc: ...here.
352 * cp-gimplify.c: Moved to...
353 * cp-gimplify.cc: ...here.
354 * cp-lang.c: Moved to...
355 * cp-lang.cc: ...here.
356 * cp-objcp-common.c: Moved to...
357 * cp-objcp-common.cc: ...here.
358 * cp-ubsan.c: Moved to...
359 * cp-ubsan.cc: ...here.
362 * cxx-pretty-print.c: Moved to...
363 * cxx-pretty-print.cc: ...here.
364 * decl.c: Moved to...
366 * decl2.c: Moved to...
368 * dump.c: Moved to...
370 * error.c: Moved to...
372 * except.c: Moved to...
373 * except.cc: ...here.
374 * expr.c: Moved to...
376 * friend.c: Moved to...
377 * friend.cc: ...here.
378 * g++spec.c: Moved to...
379 * g++spec.cc: ...here.
380 * init.c: Moved to...
382 * lambda.c: Moved to...
383 * lambda.cc: ...here.
386 * mangle.c: Moved to...
387 * mangle.cc: ...here.
388 * method.c: Moved to...
389 * method.cc: ...here.
390 * name-lookup.c: Moved to...
391 * name-lookup.cc: ...here.
392 * optimize.c: Moved to...
393 * optimize.cc: ...here.
394 * parser.c: Moved to...
395 * parser.cc: ...here.
398 * ptree.c: Moved to...
400 * rtti.c: Moved to...
402 * search.c: Moved to...
403 * search.cc: ...here.
404 * semantics.c: Moved to...
405 * semantics.cc: ...here.
406 * tree.c: Moved to...
408 * typeck.c: Moved to...
409 * typeck.cc: ...here.
410 * typeck2.c: Moved to...
411 * typeck2.cc: ...here.
412 * vtable-class-hierarchy.c: Moved to...
413 * vtable-class-hierarchy.cc: ...here.
415 2022-01-17 Jakub Jelinek <jakub@redhat.com>
418 * cp-gimplify.c (cp_genericize_target_expr): Set DECL_CONTEXT of
419 TARGET_EXPR_SLOT to current_function_decl if it was NULL.
421 2022-01-17 Andrew Stubbs <ams@codesourcery.com>
423 * parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.
425 2022-01-14 Chung-Lin Tang <cltang@codesourcery.com>
428 * semantics.c (finish_omp_clauses): Also continue peeling off of
429 outer node for ARRAY_REFs.
431 2022-01-14 Jakub Jelinek <jakub@redhat.com>
434 * cp-objcp-common.c (cxx_block_may_fallthru) <case IF_STMT>: For
435 IF_STMT_CONSTEXPR_P with constant false or true condition only
436 check if the taken clause may fall through.
437 * cp-gimplify.c (genericize_if_stmt): For consteval if, revert
438 to r12-5638^ behavior if then_ block can't fall through. For
439 constexpr if, revert to r12-5638^ behavior.
441 2022-01-13 Anthony Sharp <anthonysharp15@gmail.com>
442 Jason Merrill <jason@redhat.com>
445 * parser.c (cp_parser_id_expression): Handle
446 -Wmissing-template-keyword.
447 (struct saved_token_sentinel): Add modes to control what happens
449 (cp_parser_statement): Adjust.
450 (cp_parser_skip_entire_template_parameter_list): New function that
451 skips an entire template parameter list.
452 (cp_parser_require_end_of_template_parameter_list): Rename old
453 cp_parser_skip_to_end_of_template_parameter_list.
454 (cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
455 called from one of the above two functions.
456 (cp_parser_lambda_declarator_opt)
457 (cp_parser_explicit_template_declaration)
458 (cp_parser_enclosed_template_argument_list): Adjust.
460 2022-01-12 Jakub Jelinek <jakub@redhat.com>
461 Jason Merrill <jason@redhat.com>
464 * tree.c (move): If expr is xvalue_p, just return expr without
467 2022-01-11 Jakub Jelinek <jakub@redhat.com>
470 * class.c (build_vfn_ref): Build OBJ_TYPE_REF with INTEGER_CST
471 OBJ_TYPE_REF_TOKEN with type equal to OBJ_TYPE_REF_OBJECT type.
472 * error.c (resolve_virtual_fun_from_obj_type_ref): Use type of
473 OBJ_TYPE_REF_TOKEN rather than type of OBJ_TYPE_REF_OBJECT as
476 2022-01-11 Patrick Palka <ppalka@redhat.com>
479 * call.c (build_new_method_call): Consider dependent bases only
480 if 'this' is available.
482 2022-01-11 Olivier Hainque <hainque@adacore.com>
484 * decl.c (cxx_init_decl_processing): Move code possibly
485 altering flag_weak before code testing it.
487 2022-01-10 Patrick Palka <ppalka@redhat.com>
490 * constexpr.c (cxx_fold_indirect_ref): Split out object/offset
491 canonicalization step into a local lambda. Strengthen it to
492 absorb more components at position 0. Use it before both calls
493 to cxx_fold_indirect_ref_1.
495 2022-01-10 Patrick Palka <ppalka@redhat.com>
498 * call.c (cand_parms_match): Skip over 'this' when given one
499 static and one non-static member function.
501 2022-01-10 Jakub Jelinek <jakub@redhat.com>
504 * semantics.c (expand_or_defer_fn): For immediate functions, set
505 node->body_removed to true and clear analyzed, definition and
507 * decl2.c (c_parse_final_cleanups): Ignore immediate functions for
510 2022-01-08 Jakub Jelinek <jakub@redhat.com>
513 * constexpr.c (cxx_maybe_fold_addr_pointer_plus): New function.
514 (cxx_eval_binary_expression): Use it.
516 2022-01-08 Jason Merrill <jason@redhat.com>
519 * init.c (build_vec_init): Remove assert.
520 * tree.c (build_vec_init_expr): Likewise.
522 2022-01-08 Jason Merrill <jason@redhat.com>
525 * call.c (build_op_delete_call): Ignore destroying delete
528 2022-01-07 Jason Merrill <jason@redhat.com>
531 * init.c (build_new_1): Also build pointer cleanup if
533 * cp-tree.h (TYPE_GETS_VEC_DELETE): New.
535 2022-01-07 Jason Merrill <jason@redhat.com>
539 * cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling.
541 2022-01-07 Jason Merrill <jason@redhat.com>
544 * init.c (perform_target_ctor): Select destructor by in_chrg.
546 2022-01-07 Jason Merrill <jason@redhat.com>
549 * except.c (in_nested_catch): New.
550 (expand_end_catch_block): Check it.
552 2022-01-07 Jason Merrill <jason@redhat.com>
556 * except.c (maybe_splice_retval_cleanup): Check
557 current_binding_level.
558 * semantics.c (do_poplevel): Call it here.
559 * parser.c (cp_parser_compound_statement): Not here.
561 2022-01-07 Jason Merrill <jason@redhat.com>
564 * decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
565 cleanups from set_up_extended_ref_temp.
566 (wrap_temporary_cleanups): Ignore array cleanups.
567 (initialize_local_var): Don't check for array here.
568 * cp-tree.h (BIND_EXPR_VEC_DTOR): New.
569 * init.c (build_vec_delete_1): Set it.
571 2022-01-07 Jason Merrill <jason@redhat.com>
574 * init.c (build_vec_delete_1): Handle throwing dtor.
575 (build_vec_init): Tell it we're in a cleanup already.
577 2022-01-07 Jason Merrill <jason@redhat.com>
579 * typeck2.c (split_nonconstant_init_1): Don't cleanup the last elt.
580 (split_nonconstant_init): Adjust.
582 2022-01-07 Jason Merrill <jason@redhat.com>
586 * constexpr.c (replace_decl): Rename from replace_result_decl.
587 * cp-tree.h (replace_decl): Declare it.
588 * cp-gimplify.c (cp_gimplify_init_expr): Call it.
589 (cp_gimplify_expr): Don't handle VEC_INIT_EXPR.
590 (cp_genericize_init, cp_genericize_init_expr)
591 (cp_genericize_target_expr): New.
592 (cp_fold_r): Call them.
593 * tree.c (build_array_copy): Add a TARGET_EXPR.
594 * typeck2.c (digest_init_r): Look through a TARGET_EXPR.
596 2022-01-07 Jason Merrill <jason@redhat.com>
599 * decl.c (initialize_local_var): Fix comment.
600 * init.c (build_new_1): Do stabilize array init.
601 (build_vec_init): Use TARGET_EXPR for cleanup. Initialization
602 of an element from an explicit initializer is not a
604 * tree.c (expand_vec_init_expr): Pass flags through.
605 * typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
606 (split_nonconstant_init): Handle array cleanups.
609 2022-01-07 Jason Merrill <jason@redhat.com>
612 * decl.c (check_initializer): Remove obsolete comment.
613 (wrap_cleanups_r): Don't wrap CLEANUP_EH_ONLY.
614 (initialize_local_var): Change assert to test.
615 * typeck2.c (maybe_push_temp_cleanup): New.
616 (split_nonconstant_init_1): Use it.
617 (split_nonconstant_init): Clear cleanup flags.
619 2022-01-07 Jason Merrill <jason@redhat.com>
622 * typeck2.c (PICFLAG_VEC_INIT): New.
623 (process_init_constructor_array): Set it.
624 (process_init_constructor): Handle it.
625 (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
626 * init.c (build_vec_init): Likewise.
627 * cp-gimplify.c (cp_gimplify_expr): Factor out...
628 * tree.c (expand_vec_init_expr): ...this function.
629 (build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P.
630 (build_vec_init_expr): Likewise.
631 * constexpr.c (cxx_eval_vec_init): Likewise.
632 (reduced_constant_expression_p): Check arrays before C++20.
633 * cp-tree.h (expand_vec_init_expr): Declare.
635 2022-01-07 Jason Merrill <jason@redhat.com>
637 * init.c (build_new_1): Remove preevaluation code.
639 2022-01-05 Nathan Sidwell <nathan@acm.org>
641 * pt.c (instantiate_class_template_1): Process attribute((used)) set
644 2022-01-05 Nathan Sidwell <nathan@acm.org>
646 * init.c (build_new_1): Check complain before alignment warning.
648 2022-01-04 Jason Merrill <jason@redhat.com>
650 * cp-tree.h (class releasing_vec): Add begin/end fns.
652 2022-01-04 Jason Merrill <jason@redhat.com>
654 * init.c: Include -*- C++ -*- on first line.
656 2022-01-03 Marek Polacek <polacek@redhat.com>
659 * parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
662 2022-01-03 Marek Polacek <polacek@redhat.com>
664 * parser.c (make_char_string_pack): Add a cast to const unsigned
667 2022-01-03 Jakub Jelinek <jakub@redhat.com>
670 * rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
671 to DECL_TINFO_P VAR_DECLs.
673 2022-01-02 Jason Merrill <jason@redhat.com>
675 * init.c (build_vec_init): Append the decrement to elt_init.
677 2022-01-02 Jason Merrill <jason@redhat.com>
679 * decl.c (wrap_cleanups_r): Don't wrap if noexcept.
682 Copyright (C) 2022 Free Software Foundation, Inc.
684 Copying and distribution of this file, with or without modification,
685 are permitted in any medium without royalty provided the copyright
686 notice and this notice are preserved.