1 2022-05-12 Patrick Palka <ppalka@redhat.com>
3 * cp-tree.h (TMPL_ARGS_LEVEL): Assert LEVEL is 1 when
4 TMPL_ARGS_HAVE_MULTIPLE_LEVELS is false.
5 * pt.cc (try_class_unification): Correctly copy multidimensional
6 targs. Free the copy of targs.
7 (unify_pack_expansion): Fix level comparison.
9 2022-05-12 Nathan Sidwell <nathan@acm.org>
11 * parser.cc (cp_parser_linkage_specification): Implement
12 global module attachment semantics.
14 2022-05-12 Jakub Jelinek <jakub@redhat.com>
16 * lex.cc (init_reswords): Register omp_all_memory as keyword
18 * parser.cc (cp_parser_primary_expression): Diagnose uses of
19 omp_all_memory in postfix expressions.
20 (cp_parser_omp_var_list_no_open): Handle omp_all_memory in depend
22 * semantics.cc (finish_omp_clauses): Handle omp_all_memory
23 keyword in depend clause as null_pointer_node, diagnose invalid
25 * pt.cc (tsubst_omp_clause_decl): Pass through omp_all_memory.
27 2022-05-11 Patrick Palka <ppalka@redhat.com>
29 * constraint.cc (tsubst_parameter_mapping): Convert loop over
30 TREE_VEC into a range-based for loop using tree_vec_range.
31 * pt.cc (iterative_hash_template_arg): Likewise.
32 (template_parms_level_to_args): Likewise.
33 (deducible_template_args): Likewise.
34 (check_undeduced_parms): Likewise.
35 (dependent_type_p_r): Likewise.
36 (value_dependent_expression_p) <case NONTYPE_ARGUMENT_PACK>:
38 (dependent_template_arg_p): Likewise.
39 * tree.cc (cp_walk_subtrees) <case NONTYPE_ARGUMENT_PACK>:
42 2022-05-11 Jason Merrill <jason@redhat.com>
45 * cp-tree.h (TMPL_ARGS_DEPTH): 0 for null args.
46 * parser.cc (cp_parser_enclosed_template_argument_list):
47 Use 0-length TREE_VEC for <>.
49 2022-05-11 Jason Merrill <jason@redhat.com>
52 * typeck.cc (check_return_expr): Don't mess with ctor return value
53 while parsing a template.
55 2022-05-11 Nathan Sidwell <nathan@acm.org>
57 * cp-tree.h (DECL_MODULE_ATTACH_P): New.
58 (struct lang_decl_base): Add module_attach_p flag.
59 * decl.cc (duplicate_decls): Rework module redeclaration
61 * module.cc (trees_out::lang_decl_bools): Write attach flag.
62 (trees_in::lang_decl_bools): ... and read it back.
63 (trees_out::decl_value): Rework module attachment handling.
64 (trees_in::decl_value): Rename local var to reflect meaning.
65 (trees_in::key_mergeable): Likewise.
66 (get_originating_module): Use DECL_MODULE_ATTACH_P. No need
67 to special-case mangling.
68 (module_may_redeclare): Reimplement.
69 (set_originating_module): Deal with attachment.
70 * name-lookup.cc (maybe_record_mergeable_decl): Deal with
72 (mergeable_namespace_slots): Likewise.
73 (do_nonmember_using_decl): Likewise.
74 * name-lookup.h (mergeable_namespace_slots): Adjust parm
76 * ptree.cc (cxx_print_decl): Adjust purview & attach printing.
78 2022-05-11 Martin Liska <mliska@suse.cz>
81 * lang-specs.h: Use Separate syntax.
83 2022-05-10 Patrick Palka <ppalka@redhat.com>
85 * coroutines.cc (instantiate_coro_traits): Adjust accordingly.
86 * cp-tree.def: Remove mention of SET_PACK_EXPANSION_PATTERN.
87 * cp-tree.h (SET_PACK_EXPANSION_PATTERN): Remove.
88 (SET_ARGUMENT_PACK_ARGS): Remove.
89 * module.cc (trees_in::tree_node): Adjust accordingly.
90 * parser.cc (make_char_string_pack): Likewise.
91 (make_string_pack): Likewise.
92 * pt.cc (make_pack_expansion): Likewise.
93 (template_parm_to_arg): Likewise.
94 (coerce_template_parameter_pack): Likewise.
95 (extract_fnparm_pack): Likewise.
96 (extract_locals_r): Likewise.
97 (make_argument_pack): Likewise.
98 (tsubst_argument_pack): Likewise.
99 (lookup_init_capture_pack): Likewise.
100 (type_unification_real): Likewise.
101 (unify_pack_expansion): Likewise.
102 (tsubst_initializer_list): Likewise.
104 2022-05-10 Patrick Palka <ppalka@redhat.com>
106 * cp-tree.h (PACK_EXPANSION_CHECK): Define.
107 (PACK_EXPANSION_PATTERN): Use PACK_EXPANSION_CHECK.
108 (SET_PACK_EXPANSION_PATTERN): Likewise.
109 (PACK_EXPANSION_PARAMETER_PACKS): Likewise.
110 (PACK_EXPANSION_EXTRA_ARGS): Likewise.
111 (PACK_EXPANSION_LOCAL_P): Likewise.
112 (PACK_EXPANSION_SIZEOF_P): Likewise.
113 (PACK_EXPANSION_AUTO_P): Likewise.
114 (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): Likewise.
115 (ARGUMENT_PACK_CHECK): Define.
116 (ARGUMENT_PACK_ARGS): Use ARGUMENT_PACK_CHECK.
117 (SET_ARGUMENT_PACK_ARGS): Likewise.
118 * parser.cc (cp_parser_sizeof_pack): Check for error_mark_node
119 before setting PACK_EXPANSION_SIZEOF_P.
121 2022-05-10 Nathan Sidwell <nathan@acm.org>
123 * cp-tree.h (enum module_kind_bits): Disambiguate purview,
124 attach, named module vs header-unit.
125 (global_purview_p, not_module_p): Delete.
126 (named_module_p): New.
127 (header_module_p, module_purview_p): Adjust.
128 (module_attach_p, named_module_purview_p): New.
129 * decl.cc (duplicate_decls): Adjust.
130 * module.cc (declare_module, preprocessed_module): Adjust.
131 * name-lookup.cc (init_global_partition): Adjust.
132 (get_fixed_binding_slot, pushdecl): Adjust.
133 * parser.cc (cp_parser_module_declaration): Adjust.
134 (cp_parser_import_declaration, cp_parser_declaration): Adjust.
136 2022-05-10 Jason Merrill <jason@redhat.com>
139 * decl.cc (maybe_return_this): Replace...
140 (finish_constructor_body, finish_destructor_body): ...these.
141 (finish_function_body): Call it.
142 * optimize.cc (build_delete_destructor_body): Call it.
143 * cp-tree.h (maybe_return_this): Declare.
145 2022-05-09 Marek Polacek <polacek@redhat.com>
148 * parser.cc (cp_parser_statement): Constify the in_compound parameter.
149 Create a modifiable copy. Allow labels at the end of compound
152 2022-05-09 Patrick Palka <ppalka@redhat.com>
155 * call.cc (field_in_pset): Adjust after next_initializable_field
157 (build_aggr_conv): Likewise.
158 (convert_like_internal): Likewise.
159 (type_has_extended_temps): Likewise.
160 * class.cc (default_init_uninitialized_part): Likewise.
161 (finish_struct): Likewise.
162 * constexpr.cc (cx_check_missing_mem_inits): Likewise.
163 (reduced_constant_expression_p): Use next_subobject_field
165 * cp-gimplify.cc (get_source_location_impl_type): Adjust after
166 next_initializable_field renaming.
167 (fold_builtin_source_location): Likewise.
168 * cp-tree.h (next_initializable_field): Rename to ...
169 (next_aggregate_field): ... this.
170 (next_subobject_field): Declare.
171 * decl.cc (next_aggregate_field): Renamed from ...
172 (next_initializable_field): ... this. Skip over vptr fields
174 (next_subobject_field): Define.
175 (reshape_init_class): Adjust after next_initializable_field
177 * init.cc (build_value_init_noctor): Likewise.
178 (emit_mem_initializers): Likewise.
179 * lambda.cc (build_capture_proxy): Likewise.
180 * method.cc (build_comparison_op): Likewise.
181 * pt.cc (maybe_aggr_guide): Likewise.
182 * tree.cc (structural_type_p): Likewise.
183 * typeck2.cc (split_nonconstant_init_1): Likewise.
184 (digest_init_r): Likewise.
186 2022-05-09 Nathan Sidwell <nathan@acm.org>
188 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Renamed from
189 DECL_MODULE_ATTACHMENTS_P.
190 (struct lane_decl_base): Rename module_attached_p to
191 module_keyed_decls_p.
192 (maybe_key_decl): Renamed from maybe_attach_decl.
193 * lambda.cc (record_lambda_scope): Adjust.
194 * lex.cc (cxx_dup_lang_specific_decl): Adjust.
195 * module.cc (keyed_map_t, keyed_table): Renamed from attached_map_t,
197 (enum merge_kind): Rename MK_attached to MK_keyed.
198 (trees_out::lang_decl_bools): Adjust.
199 (trees_in::lang_decl_bools): Adjust.
200 (trees_in::decl_value): Adjust.
201 (trees_out::get_merge_kind): Adjust.
202 (trees_out::key_mergeable): Adjust.
203 (trees_in::key_mergeable): Adjust.
204 (maybe_key_decl): Rename from maybe_attach_decl.
205 (direct_import): Adjust.
206 (fini_modules): Adjust.
208 2022-05-09 Martin Liska <mliska@suse.cz>
210 * cp-gimplify.cc (cp_genericize_r): Use {,UN}LIKELY
212 * parser.cc (cp_finalize_omp_declare_simd): Likewise.
213 (cp_finalize_oacc_routine): Likewise.
215 2022-05-07 Marek Polacek <polacek@redhat.com>
219 * tree.cc (maybe_adjust_arg_pos_for_attribute): New.
221 2022-05-06 Jason Merrill <jason@redhat.com>
223 * error.cc (decl_to_string): Add show_color parameter.
224 (subst_to_string): Likewise.
225 (cp_printer): Pass it.
226 (type_to_string): Set pp_show_color.
227 (dump_function_name): Use "fnname" color.
228 (dump_template_bindings): Use "targs" color.
229 (struct colorize_guard): New.
230 (reinit_cxx_pp): Clear pp_show_color.
232 2022-05-06 Jason Merrill <jason@redhat.com>
236 * constexpr.cc (cxx_eval_store_expression): Reorganize empty base
239 2022-05-05 Marek Polacek <polacek@redhat.com>
242 * parser.cc (cp_parser_parameter_declaration_clause): Maintain
243 a vector of parameters that haven't been pushed yet. Push them at the
244 end of a valid parameter-declaration-clause.
245 (cp_parser_parameter_declaration_list): Take a new auto_vec parameter.
246 Do not pushdecl while parsing tentatively when pushdecl-ing a parameter
247 would result in a hard error.
248 (cp_parser_cache_defarg): Adjust the call to
249 cp_parser_parameter_declaration_list.
251 2022-05-05 Richard Biener <rguenther@suse.de>
253 * module.cc (trees_in::core_vals): Remove separate allocation
256 2022-05-04 Jason Merrill <jason@redhat.com>
259 * pt.cc (maybe_dependent_member_ref): Handle types.
260 (tsubst, tsubst_copy): Use it.
261 (tsubst_aggr_type, instantiate_alias_template): Don't handle
264 2022-05-04 Patrick Palka <ppalka@redhat.com>
267 * pt.cc (maybe_aggr_guide): Set processing_template_decl when
268 partially instantiating the guide's parameter list.
270 2022-05-04 Marek Polacek <polacek@redhat.com>
273 * parser.cc (cp_parser_init_declarator): Properly handle a series of
274 operator() calls, they are not part of an init-declarator.
276 2022-05-04 Jason Merrill <jason@redhat.com>
278 * decl.cc (reshape_init): Shortcut already-reshaped init.
279 (reshape_init_class): Assert not getting one here.
281 2022-05-04 Jason Merrill <jason@redhat.com>
283 * error.cc (cp_print_error_function): Use %qD.
284 (function_category): Use %qD.
286 2022-05-04 Marek Polacek <polacek@redhat.com>
289 * parser.cc (cp_parser_next_token_ends_template_argument_p): Don't
290 return true for CPP_GREATER_EQ.
292 2022-05-04 Jason Merrill <jason@redhat.com>
294 * cp-tree.h (struct language_function): Remove x_cdtor_label.
295 (cdtor_label, LABEL_DECL_CDTOR): Remove.
296 * constexpr.cc (returns): Don't check LABEL_DECL_CDTOR.
297 (cxx_eval_constant_expression): Don't call returns.
298 * decl.cc (check_goto): Don't check cdtor_label.
299 (start_preparsed_function): And don't set it.
300 (finish_constructor_body, finish_destructor_body): Remove.
301 (finish_function_body): Don't call them.
302 * typeck.cc (check_return_expr): Handle cdtor_returns_this here.
303 * semantics.cc (finish_return_stmt): Not here.
305 2022-05-04 Jakub Jelinek <jakub@redhat.com>
307 * lambda.cc: Include decl.h.
308 (maybe_add_lambda_conv_op): Temporarily override deprecated_state to
309 UNAVAILABLE_DEPRECATED_SUPPRESS.
311 2022-05-03 Patrick Palka <ppalka@redhat.com>
314 * cp-tree.h (finish_non_static_data_member): Add defaulted
316 * pt.cc (tsubst_copy_and_build): Pass complain to
317 finish_non_static_data_member.
318 * semantics.cc (finish_non_static_data_member): Respect complain
320 (finish_qualified_id_expr): Pass complain to
321 finish_non_static_data_member.
323 2022-05-02 Jason Merrill <jason@redhat.com>
325 * pt.cc (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Copy location.
326 (do_auto_deduction): Use expr location.
328 2022-05-02 Jason Merrill <jason@redhat.com>
330 * class.cc (maybe_note_name_used_in_class): Note in all enclosing
331 classes. Remember location of use.
332 (note_name_declared_in_class): Adjust.
334 2022-05-02 Marek Polacek <polacek@redhat.com>
336 * cp-tree.h (uses_template_parms): Adjust declaration.
337 * pt.cc (uses_template_parms): Return bool. Use a RAII sentinel.
339 2022-05-02 Richard Biener <rguenther@suse.de>
341 * constexpr.cc (fold_simple_1): Use CASE_CONVERT.
342 * cp-gimplify.cc (cp_fold): Likewise.
343 * pt.cc (tsubst_copy): Likewise.
345 2022-04-29 Jason Merrill <jason@redhat.com>
349 * friend.cc (do_friend): Call check_explicit_specialization here.
350 * decl.cc (grokdeclarator): Not here.
351 * decl2.cc (check_classfn): Or here.
353 2022-04-29 Jason Merrill <jason@redhat.com>
356 * cp-tree.h (enum tsubst_flags): Add tf_dguide.
357 * pt.cc (tsubst_aggr_type): Check it.
358 (tsubst_baselink, tsubst_copy): Check it.
359 (maybe_dependent_member_ref): Check it.
360 (instantiate_alias_template): Handle it.
361 (build_deduction_guide): Set it.
363 2022-04-29 Jason Merrill <jason@redhat.com>
366 * lambda.cc (type_deducible_expression_p): Allow more types.
368 2022-04-29 Jason Merrill <jason@redhat.com>
370 * decl.cc (cp_finish_decl): Only consider auto for vars.
372 2022-04-29 Marek Polacek <polacek@redhat.com>
375 * parser.cc (cp_parser_enum_specifier): Warn about empty unnamed enum
376 only when it's followed by a semicolon.
378 2022-04-29 Jason Merrill <jason@redhat.com>
381 * decl.cc (cp_finish_decl): Check completeness of deduced type.
383 2022-04-29 Jason Merrill <jason@redhat.com>
386 * error.cc (dump_decl) [USING_DECL]: Respect flags.
388 2022-04-29 Jason Merrill <jason@redhat.com>
390 * error.cc (dump_decl): Check TFF_UNQUALIFIED_NAME.
392 2022-04-29 Jakub Jelinek <jakub@redhat.com>
395 * parser.cc (cp_parser_template_argument): Treat >= like C++98 >>
396 after a type id by setting maybe_type_id and aborting tentative
398 (cp_parser_enclosed_template_argument_list): Handle
399 CPP_GREATER_EQ like misspelled CPP_GREATER CPP_RQ and
400 CPP_RSHIFT_EQ like misspelled CPP_GREATER CPP_GREATER_EQ
401 or CPP_RSHIFT CPP_EQ or CPP_GREATER CPP_GREATER CPP_EQ.
402 (cp_parser_next_token_ends_template_argument_p): Return true
403 also for CPP_GREATER_EQ and CPP_RSHIFT_EQ.
405 2022-04-29 Iain Sandoe <iain@sandoe.co.uk>
408 * coroutines.cc (register_local_var_uses): Allow promotion of unnamed
409 temporaries to coroutine frame copies.
411 2022-04-29 Jason Merrill <jason@redhat.com>
413 * semantics.cc (check_trait_type): Don't check completeness
414 of element type of array of unknown bound.
416 2022-04-29 Jason Merrill <jason@redhat.com>
420 * rtti.cc (get_tinfo_decl_direct): Don't complete_type.
421 (emit_tinfo_decl): Update tdesc type if needed.
423 2022-04-29 Zhao Wei Liew <zhaoweiliew@gmail.com>
426 * call.cc (extract_call_expr): Return a NULL_TREE on failure
427 instead of asserting.
428 (build_new_method_call): Suppress -Wparentheses diagnostic for
430 * semantics.cc (is_assignment_op_expr_p): Add function to check
431 if an expression is a call to an op= operator expression.
432 (maybe_convert_cond): Handle the case of a op= operator expression
433 for the -Wparentheses diagnostic.
435 2022-04-28 Patrick Palka <ppalka@redhat.com>
438 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Treat
439 DEPENDENT_OPERATOR_TYPE like an empty type.
441 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
444 * coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
445 non-target expression inputs.
447 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
450 * coroutines.cc (coro_promise_type_found_p): Account for possible
451 mutliple overloads of the promise return_value() method.
453 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
456 * coroutines.cc (maybe_promote_temps): Ensure generated temporaries
457 are added to the bind expr.
458 (add_var_to_bind): Fix local var naming to use portable punctuation.
459 (register_local_var_uses): Do not add synthetic names to unnamed
462 2022-04-28 Nathan Sidwell <nathan@acm.org>
463 Iain Sandoe <iain@sandoe.co.uk>
466 * coroutines.cc (finish_co_await_expr): Do not process non-dependent
467 coroutine expressions at template definition time.
468 (finish_co_yield_expr): Likewise.
469 (finish_co_return_stmt): Likewise.
471 2022-04-28 Marek Polacek <polacek@redhat.com>
474 * parser.cc (cp_parser_class_specifier_1): Accept :: after a class
477 2022-04-27 Jason Merrill <jason@redhat.com>
479 * tree.cc (strip_typedefs): Add default argument comments.
481 2022-04-27 Marek Polacek <polacek@redhat.com>
484 * pt.cc (uses_template_parms): Return false for any NAMESPACE_DECL.
486 2022-04-26 Jason Merrill <jason@redhat.com>
489 * pt.cc (gen_elem_of_pack_expansion_instantiation): Clear
490 TEMPLATE_TYPE_PARAMETER_PACK on auto.
492 2022-04-26 Patrick Palka <ppalka@redhat.com>
495 * semantics.cc (finish_decltype_type): Pass tf_decltype to
496 instantiate_non_dependent_expr_sfinae.
498 2022-04-26 Jason Merrill <jason@redhat.com>
501 * pt.cc (check_for_bare_parameter_packs): Check for lambda
502 function parameter pack.
504 2022-04-26 Patrick Palka <ppalka@redhat.com>
508 * pt.cc (process_partial_specialization): Downgrade "partial
509 specialization isn't more specialized" diagnostic from permerror
510 to an on-by-default pedwarn.
511 (unify) <case TEMPLATE_PARM_INDEX>: When substituting into the
512 NTTP type a second time, use the original type not the
515 2022-04-25 Marek Polacek <polacek@redhat.com>
518 * typeck.cc (build_x_shufflevector): Use
519 instantiation_dependent_expression_p except for the first two
522 2022-04-21 Marek Polacek <polacek@redhat.com>
524 * constexpr.cc (cxx_eval_logical_expression): Remove unused
526 (cxx_eval_constant_expression) <case TRUTH_ANDIF_EXPR>,
527 <case TRUTH_OR_EXPR>: Adjust calls to cxx_eval_logical_expression.
529 2022-04-21 Marek Polacek <polacek@redhat.com>
532 * constexpr.cc (cxx_eval_logical_expression): Always pass false for lval
533 to cxx_eval_constant_expression.
535 2022-04-20 Ed Catmur <ed@catmur.uk>
538 * call.cc (compare_ics): When comparing list-initialization
539 sequences, do not return early.
541 2022-04-19 Jakub Jelinek <jakub@redhat.com>
544 * typeck2.cc (process_init_constructor_array,
545 process_init_constructor_record, process_init_constructor_union): Move
546 CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag from CONSTRUCTOR elements to the
547 containing CONSTRUCTOR.
549 2022-04-15 Marek Polacek <polacek@redhat.com>
552 * parser.cc (cp_parser_placeholder_type_specifier): Return
553 error_mark_node when trying to build up a constrained parameter in
556 2022-04-15 Jason Merrill <jason@redhat.com>
559 * decl.cc (grokdeclarator): Drop typedef used with 'unsigned'.
561 2022-04-15 Jason Merrill <jason@redhat.com>
564 * error.cc (dump_expr): Handle USING_DECL.
565 [VIEW_CONVERT_EXPR]: Just look through location wrapper.
567 2022-04-14 Jason Merrill <jason@redhat.com>
570 * constexpr.cc (maybe_save_constexpr_fundef): Don't do extra
571 checks for defaulted ctors.
573 2022-04-14 Jason Merrill <jason@redhat.com>
576 * lambda.cc (type_deducible_expression_p): New.
577 (lambda_capture_field_type): Check it.
579 2022-04-14 Jason Merrill <jason@redhat.com>
582 * pt.cc (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.
584 2022-04-14 Jason Merrill <jason@redhat.com>
587 * name-lookup.cc (dependent_local_decl_p): New.
588 * cp-tree.h (dependent_local_decl_p): Declare.
589 * semantics.cc (finish_call_expr): Use it.
590 * pt.cc (tsubst_arg_types): Also substitute default args
593 2022-04-14 Jason Merrill <jason@redhat.com>
596 * pt.cc (tsubst_baselink): Also check dependent optype.
598 2022-04-14 Jason Merrill <jason@redhat.com>
601 * decl.cc (cp_finish_decl): Don't pass decl to push_cleanup.
602 * init.cc (perform_member_init): Likewise.
603 * semantics.cc (push_cleanup): Adjust comment.
605 2022-04-13 Jason Merrill <jason@redhat.com>
609 * constexpr.cc (cxx_eval_store_expression): Build a CONSTRUCTOR
610 as needed in empty base handling.
612 2022-04-13 Jakub Jelinek <jakub@redhat.com>
615 * decl2.cc (cp_check_const_attributes): For aligned attribute
616 pass manifestly_const_eval=true to fold_non_dependent_expr.
618 2022-04-13 Marek Polacek <polacek@redhat.com>
621 * call.cc (direct_reference_binding): strip_top_quals when creating
624 2022-04-12 Jason Merrill <jason@redhat.com>
627 * decl.cc (decls_match): Compare versions even if not recording.
628 (duplicate_decls): Propagate attributes to alias.
629 * decl2.cc (find_last_decl): Give up if versioned.
631 2022-04-12 Jason Merrill <jason@redhat.com>
634 * init.cc (build_new_1): Check array_p for alignment.
636 2022-04-12 Patrick Palka <ppalka@redhat.com>
639 * pt.cc (build_extra_args): Call preserve_args.
641 2022-04-12 Jason Merrill <jason@redhat.com>
644 * decl.cc (check_initializer): Check TREE_SIDE_EFFECTS.
646 2022-04-12 Jason Merrill <jason@redhat.com>
650 * class.cc (finish_struct): Always using op=.
652 2022-04-11 Jason Merrill <jason@redhat.com>
655 * call.cc (build_operator_new_call): Just look in ::.
657 2022-04-11 Alexandre Oliva <oliva@adacore.com>
659 * constexpr.cc (cxx_eval_call_expression): Disregard dtor
662 2022-04-11 Alexandre Oliva <oliva@adacore.com>
664 * semantics.cc (set_cleanup_locs): Propagate locus to call
665 wrapped in cast-to-void.
667 2022-04-11 Jason Merrill <jason@redhat.com>
670 * init.cc (warn_placement_new_too_small): Check deref.
672 2022-04-09 Jason Merrill <jason@redhat.com>
676 * tree.cc (build_vec_init_elt): Do {}-init for aggregates.
677 * constexpr.cc (cxx_eval_vec_init): Only treat {} as value-init
678 for non-aggregate types.
679 (build_vec_init_expr): Also check constancy of explicit
680 initializer elements.
682 2022-04-09 Jason Merrill <jason@redhat.com>
686 * name-lookup.cc (set_decl_namespace): Set
687 DECL_IMPLICIT_INSTANTIATION if no non-template match.
688 * pt.cc (check_explicit_specialization): Check it.
689 * decl2.cc (check_classfn): Call it.
691 2022-04-07 Patrick Palka <ppalka@redhat.com>
694 * name-lookup.cc (name_lookup::using_queue): Change to an
695 auto_vec (with 16 elements of internal storage).
696 (name_lookup::queue_namespace): Change return type to void,
697 take queue parameter by reference and adjust function body
699 (name_lookup::do_queue_usings): Inline into ...
700 (name_lookup::queue_usings): ... here. As in queue_namespace.
701 (name_lookup::search_unqualified): Don't make queue static,
702 remove length variable, and adjust function body accordingly.
704 2022-04-07 Jakub Jelinek <jakub@redhat.com>
706 PR tree-optimization/102586
707 * cp-objcp-common.h (cp_classtype_as_base): Declare.
708 (LANG_HOOKS_CLASSTYPE_AS_BASE): Redefine.
709 * cp-objcp-common.cc (cp_classtype_as_base): New function.
711 2022-04-07 Jason Merrill <jason@redhat.com>
714 * decl.cc (grokdeclarator): Reject conversion with trailing return
717 2022-04-07 Jason Merrill <jason@redhat.com>
720 * lambda.cc (lambda_expr_this_capture): Check all enclosing
721 lambdas for completeness.
723 2022-04-07 Jason Merrill <jason@redhat.com>
726 * typeck2.cc (store_init_value): Allow TREE_HAS_CONSTRUCTOR for
729 2022-04-06 Jakub Jelinek <jakub@redhat.com>
732 * decl2.cc (splice_template_attributes): Return NULL if *p is
734 (cplus_decl_attributes): Return early if attributes is
735 error_mark_node. Don't check that later.
737 2022-04-06 Patrick Palka <ppalka@redhat.com>
740 * pt.cc (do_class_deduction): Check complain before attempting
741 to issue a -Wctad-maybe-unsupported warning.
743 2022-04-06 Jason Merrill <jason@redhat.com>
746 * init.cc (build_vec_init): Use a reference for the result.
748 2022-04-06 Jason Merrill <jason@redhat.com>
751 * name-lookup.cc (check_local_shadow): Use -Wshadow=local
752 if exactly one of 'old' and 'decl' is a type.
754 2022-04-05 Jason Merrill <jason@redhat.com>
758 * pt.cc (do_class_deduction): Pedwarn for renaming alias in C++17.
760 2022-04-05 Jason Merrill <jason@redhat.com>
763 * name-lookup.h (struct cp_binding_level): Add requires_expression
765 * parser.cc (cp_parser_requires_expression): Set it.
766 (synthesize_implicit_template_parm): Check it.
768 2022-04-04 Jason Merrill <jason@redhat.com>
771 * decl.cc (duplicate_decls): Copy DECL_FRIEND_CONTEXT.
773 2022-04-04 Jason Merrill <jason@redhat.com>
777 * pt.cc (get_underlying_template): Compare default template args.
779 2022-04-03 Benno Evers <benno.evers@tenzir.com>
780 Iain Sandoe <iain@sandoe.co.uk>
783 * coroutines.cc (morph_fn_to_coro): Reset
784 current_binding_level->blocks.
786 2022-04-01 Jason Merrill <jason@redhat.com>
789 2022-03-31 Jason Merrill <jason@redhat.com>
792 * parser.cc (cp_parser_early_parsing_nsdmi): New.
793 (cp_parser_member_declaration): Call it.
795 2022-04-01 Jason Merrill <jason@redhat.com>
798 2022-03-24 Jason Merrill <jason@redhat.com>
801 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
802 * class.cc (type_has_default_ctor_to_be_synthesized): New.
803 (type_has_non_user_provided_default_constructor_1): Support it.
804 (type_has_non_user_provided_default_constructor): Now a wrapper.
805 * method.cc (complain_about_unparsed_dmi): New.
806 (constructible_expr): Call it.
808 2022-04-01 Patrick Palka <ppalka@redhat.com>
811 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Drop cv-quals from
812 the argument type of an NTTP before deducing from it.
814 2022-03-31 Jason Merrill <jason@redhat.com>
817 * parser.cc (cp_parser_early_parsing_nsdmi): New.
818 (cp_parser_member_declaration): Call it.
820 2022-03-30 Patrick Palka <ppalka@redhat.com>
823 * constraint.cc (diagnose_trait_expr): Handle all remaining
824 traits appropriately. Remove default case.
826 2022-03-30 Marek Polacek <polacek@redhat.com>
830 * init.cc (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor.
832 2022-03-30 Jakub Jelinek <jakub@redhat.com>
835 * pt.cc (tsubst_omp_clause_decl): When handling iterators, set
836 DECL_CONTEXT of the iterator var to current_function_decl and
839 2022-03-30 Jakub Jelinek <jakub@redhat.com>
842 * parser.cc (cp_parser_template_introduction): If member_p, temporarily
843 clear parser->colon_corrects_to_scope_p around tentative parsing of
844 nested name specifier.
846 2022-03-28 Jason Merrill <jason@redhat.com>
848 * pt.cc (determine_specialization): Add comment.
850 2022-03-28 Patrick Palka <ppalka@redhat.com>
853 * pt.cc (finish_concept_definition): Check that a concept is
854 declared with exactly one template parameter list.
856 2022-03-28 Patrick Palka <ppalka@redhat.com>
859 * constraint.cc (maybe_substitute_reqs_for): Don't assume
860 DECL_TEMPLATE_INFO is available.
862 2022-03-28 Jason Merrill <jason@redhat.com>
867 * pt.cc (complex_alias_template_r): walk_tree callback, replacing
868 uses_all_template_parms_r, complex_pack_expansion_r.
869 (complex_alias_template_p): Adjust.
870 * tree.cc (strip_typedefs): Revert r12-7710 change.
872 2022-03-28 Jason Merrill <jason@redhat.com>
875 * init.cc (build_new_1): Include cookie in alignment. Omit
876 constexpr wrapper from alloc_call.
878 2022-03-28 Jason Merrill <jason@redhat.com>
881 * name-lookup.cc (push_local_extern_decl_alias): Call
882 determine_visibility.
884 2022-03-28 Jason Merrill <jason@redhat.com>
887 * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting
888 a type template reference.
890 2022-03-28 Jason Merrill <jason@redhat.com>
893 * pt.cc (value_dependent_expression_p): Check
894 has_value_dependent_address for conversion to reference.
896 2022-03-28 Jason Merrill <jason@redhat.com>
899 * pt.cc (tsubst_qualified_id): Handle getting SCOPE_REF from
901 (instantiation_dependent_scope_ref_p): Check dependent_scope_p.
903 2022-03-28 Jason Merrill <jason@redhat.com>
906 * call.cc (make_base_init_ok): Call make_used.
908 2022-03-28 Jason Merrill <jason@redhat.com>
911 * mangle.cc (write_expression): Don't write a union designator when
914 2022-03-28 Jason Merrill <jason@redhat.com>
918 * tree.cc (strip_typedefs): Use build_distinct_type_copy.
920 2022-03-26 Patrick Palka <ppalka@redhat.com>
923 * constexpr.cc (potential_constant_expression_1) <case IF_STMT>:
924 Clarify error message when a if-stmt is non-constant because its
925 branches are non-constant.
927 2022-03-26 Patrick Palka <ppalka@redhat.com>
930 * call.cc (add_builtin_candidate) <case MEMBER_REF>: Test
931 CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
933 2022-03-26 Jakub Jelinek <jakub@redhat.com>
935 * parser.cc (cp_parser_postfix_expression)
936 <case RID_BILTIN_CONVERTVECTOR, case RID_BUILTIN_BIT_CAST>: Don't
937 return cp_build_{vec,convert,bit_cast} result right away, instead
938 set postfix_expression to it and break.
940 2022-03-25 Marek Polacek <polacek@redhat.com>
943 * typeck.cc (cxx_sizeof_or_alignof_type): Diagnose alignof(void).
944 (cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with
947 2022-03-24 Marek Polacek <polacek@redhat.com>
950 * decl.cc (check_initializer): Don't call build_aggr_init in
953 2022-03-24 Jason Merrill <jason@redhat.com>
956 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
957 * class.cc (type_has_default_ctor_to_be_synthesized): New.
958 (type_has_non_user_provided_default_constructor_1): Support it.
959 (type_has_non_user_provided_default_constructor): Now a wrapper.
960 * method.cc (complain_about_unparsed_dmi): New.
961 (constructible_expr): Call it.
963 2022-03-24 Marek Polacek <polacek@redhat.com>
966 * typeck2.cc (massage_init_elt): Avoid folding CONSTRUCTORs.
968 2022-03-24 Patrick Palka <ppalka@redhat.com>
971 * call.cc (build_over_call): Use cxx_constant_value_sfinae
972 instead of cxx_constant_value to evaluate a consteval call.
973 * constexpr.cc (cxx_constant_value_sfinae): Add decl parameter
974 and pass it to cxx_eval_outermost_constant_expr.
975 * cp-tree.h (cxx_constant_value_sfinae): Add decl parameter.
976 * pt.cc (fold_targs_r): Pass NULL_TREE as decl parameter to
977 cxx_constant_value_sfinae.
979 2022-03-24 Jakub Jelinek <jakub@redhat.com>
982 * constexpr.cc (cxx_eval_constant_expression): Don't diagnose passing
983 through extern thread_local declarations. Change wording from
984 declaration to definition.
985 (potential_constant_expression_1): Don't diagnose extern thread_local
986 declarations. Change wording from declared to defined.
987 * decl.cc (start_decl): Likewise.
989 2022-03-23 Jason Merrill <jason@redhat.com>
992 * decl.cc (reshape_single_init): New.
993 (reshape_init_class): Use it.
995 2022-03-23 Jason Merrill <jason@redhat.com>
998 * name-lookup.cc (lookup_using_decl): Check that scope is
999 a dependent type before looking for dependent using.
1001 2022-03-23 Jason Merrill <jason@redhat.com>
1004 * name-lookup.cc (lookup_using_decl): Set DECL_DEPENDENT_P if lookup
1005 finds a dependent using.
1007 2022-03-21 Jason Merrill <jason@redhat.com>
1010 * init.cc (build_vec_init): Check for vla element type.
1012 2022-03-21 Jason Merrill <jason@redhat.com>
1018 * decl.cc (reshape_init_class): Avoid looking for designator
1020 (reshape_init_r): Keep looking for designator.
1022 2022-03-21 Jason Merrill <jason@redhat.com>
1025 * decl.cc (reshape_init_class): Back out of anon struct
1026 if a designator doesn't match.
1028 2022-03-18 Jason Merrill <jason@redhat.com>
1032 * class.cc (add_method): Avoid adding the same used function twice.
1033 (handle_using_decl): Don't add_method.
1034 (finish_struct): Don't using op= if we have one already.
1035 (maybe_push_used_methods): New.
1036 * semantics.cc (finish_member_declaration): Call it.
1037 * name-lookup.cc (diagnose_name_conflict): No longer static.
1038 (push_class_level_binding): Revert 92918 patch, limit
1040 * cp-tree.h: Adjust.
1042 2022-03-18 Jakub Jelinek <jakub@redhat.com>
1045 * init.cc (build_new_constexpr_heap_type): Remove FULL_SIZE
1046 argument and its handling, instead add ITYPE2 argument. Only
1047 support COOKIE_SIZE != NULL.
1048 (build_new_1): If size is 0, change it to 0 * outer_nelts if
1049 outer_nelts is non-NULL. Pass type rather than elt_type to
1050 maybe_wrap_new_for_constexpr.
1051 * constexpr.cc (build_new_constexpr_heap_type): New function.
1052 (cxx_eval_constant_expression) <case CONVERT_EXPR>:
1053 If elt_size is zero sized type, try to recover outer_nelts from
1054 the size argument to operator new/new[] and pass that as
1055 arg_size to build_new_constexpr_heap_type. Pass ctx,
1056 non_constant_p and overflow_p to that call too.
1058 2022-03-18 Marek Polacek <polacek@redhat.com>
1061 * tree.cc (strip_typedefs): Don't strip an alias template when
1062 doing so would result in losing a parameter pack.
1064 2022-03-16 Patrick Palka <ppalka@redhat.com>
1066 * search.cc (lookup_member): Simplify by handling all values
1067 of protect together in the ambiguous case. Don't modify protect.
1069 2022-03-16 Patrick Palka <ppalka@redhat.com>
1072 * cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls to
1073 std::move/forward and other cast-like functions into simple
1076 2022-03-15 Patrick Palka <ppalka@redhat.com>
1079 * search.cc (lookup_field_info::errstr): Remove this data
1081 (lookup_field_r): Don't set errstr.
1082 (lookup_member): Check ambiguity before checking access.
1083 Simplify accordingly after errstr removal. Exit early upon
1084 error or empty result.
1086 2022-03-15 Jakub Jelinek <jakub@redhat.com>
1089 * parser.cc (cp_parser_skip_to_pragma_eol): Don't purge any tokens.
1091 2022-03-14 Jakub Jelinek <jakub@redhat.com>
1093 PR tree-optimization/102586
1094 * call.cc (build_cxx_call): Diagnose __builtin_clear_padding where
1095 first argument's type is pointer to non-trivially-copyable type unless
1096 it is address of a variable or parameter.
1098 2022-03-12 Patrick Palka <ppalka@redhat.com>
1101 * cp-tree.h (tsubst_flags::tf_tst_ok): New flag.
1102 * decl.cc (make_typename_type): Allow a typename-specifier to
1103 resolve to a template when tf_tst_ok, in which case return
1104 a CTAD placeholder for the template.
1105 * pt.cc (tsubst_decl) <case VAR_DECL>: Set tf_tst_ok when
1106 substituting the type.
1107 (tsubst): Clear tf_tst_ok and remember if it was set.
1108 <case TYPENAME_TYPE>: Pass tf_tst_ok to make_typename_type
1110 (tsubst_copy) <case CAST_EXPR>: Set tf_tst_ok when substituting
1112 (tsubst_copy_and_build) <case CAST_EXPR>: Likewise.
1113 <case CONSTRUCTOR>: Likewise.
1115 2022-03-12 Patrick Palka <ppalka@redhat.com>
1118 * call.cc (missing_conversion_p): Define.
1119 (add_candidates): Use it.
1120 * pt.cc (check_non_deducible_conversion): Change type of strict
1121 parameter to unification_kind_t and directly test for DEDUCE_CALL.
1123 2022-03-12 Patrick Palka <ppalka@redhat.com>
1126 * constraint.cc (normalize_atom): Set
1127 ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P appropriately.
1128 (get_mapped_args): Make static, adjust parameters. Always
1129 return a vector whose depth corresponds to the template depth of
1130 the context of the atomic constraint expression. Micro-optimize
1131 by passing false as exact to safe_grow_cleared and by collapsing
1132 a multi-level depth-one argument vector.
1133 (satisfy_atom): Adjust call to get_mapped_args and
1134 diagnose_atomic_constraint.
1135 (diagnose_atomic_constraint): Replace map parameter with an args
1137 * cp-tree.h (ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P): Define.
1138 (get_mapped_args): Remove declaration.
1140 2022-03-12 Patrick Palka <ppalka@redhat.com>
1141 Jason Merrill <jason@redhat.com>
1144 * constexpr.cc (mark_non_constant): Define, split out from ...
1145 (cxx_eval_outermost_constant_expr): ... here.
1146 (maybe_constant_value): Use it.
1148 2022-03-12 Patrick Palka <ppalka@redhat.com>
1150 * semantics.cc (finish_unary_fold_expr): Use input_location
1151 instead of UNKNOWN_LOCATION.
1152 (finish_binary_fold_expr): Likewise.
1154 2022-03-12 Thomas Schwinge <thomas@codesourcery.com>
1157 * semantics.cc (handle_omp_array_sections_1)
1158 (cp_oacc_check_attachments): Call 'user_omp_clause_code_name'
1159 instead of 'c_omp_map_clause_name'.
1161 2022-03-10 Marek Polacek <polacek@redhat.com>
1164 * parser.cc (cp_parser_template_name): Repeat lookup of
1167 2022-03-10 Marek Polacek <polacek@redhat.com>
1170 * semantics.cc (finish_compound_literal): Disallow auto{x} for
1171 is_constrained_auto.
1172 * typeck2.cc (build_functional_cast_1): Likewise.
1174 2022-03-10 Marek Polacek <polacek@redhat.com>
1177 * decl.cc (grokdeclarator): Check FUNC_OR_METHOD_TYPE_P before giving
1180 2022-03-10 Jakub Jelinek <jakub@redhat.com>
1183 * decl.cc (grok_op_properties): Allow variadic operator[] for
1186 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
1189 * decl.cc (finish_enum_value_list): If VALUE isn't an INTEGER_CST
1190 consider it to be zero (i.e. treat it like error_mark_node).
1191 (build_enumerator): Likewise, if PREV_VALUE isn't an INTEGER_CST,
1192 set VALUE to error_mark_node.
1194 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
1197 * parser.cc (cp_parser_late_parsing_for_member): Confirm the token
1198 stream hasn't been purged before processing DECL_PENDING_INLINE.
1200 2022-03-09 Patrick Palka <ppalka@redhat.com>
1203 * except.cc (build_noexcept_spec): Strengthen dependence check
1204 to instantiation_dependent_expression_p.
1205 * parser.cc (cp_parser_parenthesized_expression_list_elt):
1206 Remove fold_expr_p parameter, and don't call
1207 instantiate_non_dependent_expr.
1208 (cp_parser_parenthesized_expression_list): Adjust accordingly.
1209 * pt.cc (expand_integer_pack): Strengthen dependence check
1210 to instantiation_dependent_expression_p.
1211 (instantiate_non_dependent_expr_internal): Adjust comment.
1212 (instantiate_non_dependent_expr_sfinae): Likewise. Drop
1213 the potentially-constant check, and relax and turn the
1214 dependence check into a checking assert.
1215 (instantiate_non_dependent_or_null): Adjust comment.
1216 * semantics.cc (finish_decltype_type): Keep
1217 processing_template_decl cleared after calling
1218 instantiate_non_dependent_expr_sfinae.
1220 2022-03-09 Patrick Palka <ppalka@redhat.com>
1224 * cp-tree.h (is_copy_initialization): Declare.
1225 * decl.cc (cp_finish_decl): Set LOOKUP_ONLYCONVERTING
1226 when is_copy_initialization is true.
1227 * init.cc (build_aggr_init): Split out copy-initialization
1229 (is_copy_initialization): ... here.
1230 * pt.cc (instantiate_decl): Pass 0 instead of
1231 LOOKUP_ONLYCONVERTING as flags to cp_finish_decl.
1233 2022-03-09 Patrick Palka <ppalka@redhat.com>
1236 * cp-tree.h (merge_default_template_args): Declare.
1237 * decl.cc (merge_default_template_args): Define, factored out
1238 from redeclare_class_template.
1239 (duplicate_decls): Use it when merging member function template
1240 and free function declarations.
1241 * pt.cc (redeclare_class_template): Factor out default argument
1242 merging logic into merge_default_template_args. Improve location
1243 of a note when there's a template parameter kind mismatch.
1245 2022-03-09 Jakub Jelinek <jakub@redhat.com>
1248 * constexpr.cc (cxx_eval_check_shift_p): Use TYPE_OVERFLOW_WRAPS
1249 instead of TYPE_UNSIGNED.
1250 * typeck.cc (cp_build_binary_op): Don't emit
1251 -Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
1253 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
1256 * decl.cc (start_decl): Defend against prefix_attributes being
1259 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
1262 * parser.cc (synthesize_implicit_template_parm): Check that
1263 TREE_VALUE (new_parm) isn't error_mark_node before setting its
1266 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
1269 * parser.cc (cp_parser_linkage_specification): Treat the case where
1270 linkage is error_mark_node as "invalid linkage-specification".
1272 2022-03-08 Marek Polacek <polacek@redhat.com>
1275 * pt.cc (convert_nontype_argument): Recompute
1276 value_dependent_expression_p after build_converted_constant_expr.
1278 2022-03-08 Marek Polacek <polacek@redhat.com>
1280 * decl2.cc (is_late_template_attribute): Do not defer attribute
1282 * pt.cc (tsubst_enum): Set TREE_UNAVAILABLE.
1284 2022-03-08 Jakub Jelinek <jakub@redhat.com>
1287 * search.cc (lookup_field_fuzzy_info::fuzzy_lookup_field): Ignore
1288 identifiers with space at the end.
1290 2022-03-07 Jason Merrill <jason@redhat.com>
1293 * decl2.cc (mark_single_function): Look through parens and location
1295 * typeck.cc (cp_build_addr_expr_1): Not here.
1297 2022-03-07 Jakub Jelinek <jakub@redhat.com>
1299 * parser.cc (cp_parser_omp_clause_map): Add missing space in string
1302 2022-03-07 Jakub Jelinek <jakub@redhat.com>
1304 * cvt.cc: Fix up duplicated word issue in a comment.
1306 * module.cc: Likewise.
1307 * coroutines.cc: Likewise.
1309 2022-03-04 Nathan Sidwell <nathan@acm.org>
1311 * mangle.cc (is_std_substitution): Check global module.
1312 (is_std_substitution_char): Return bool.
1314 2022-03-04 Nathan Sidwell <nathan@acm.org>
1316 * cp-tree.h (mangle_identifier): Replace with ...
1317 (mangle_module_component): ... this.
1318 * mangle.cc (dump_substitution_candidates): Adjust.
1319 (add_substitution): Likewise.
1320 (find_substitution): Likewise.
1321 (unmangled_name_p): Likewise.
1322 (mangle_module_substitution): Reimplement.
1323 (mangle_module_component): New.
1324 (write_module, maybe_write_module): Adjust.
1325 (write_name): Drop modules here.
1326 (write_unqualified): Do them here instead.
1327 (mangle_global_init): Adjust.
1328 * module.cc (module_state::mangle): Adjust.
1329 (mangle_module): Likewise.
1330 (get_originating_module): Adjust.
1332 2022-02-28 Marek Polacek <polacek@redhat.com>
1335 * cp-tree.h (build_enumerator): Adjust.
1336 * decl.cc (finish_enum): Make it return the new decl.
1337 * pt.cc (tsubst_enum): Propagate TREE_DEPRECATED and TREE_UNAVAILABLE.
1339 2022-02-28 Marek Polacek <polacek@redhat.com>
1342 * decl2.cc (is_late_template_attribute): Cope with a decl without
1345 2022-02-27 Jason Merrill <jason@redhat.com>
1348 * typeck.cc (cp_build_addr_expr_1): Also
1349 maybe_undo_parenthesized_ref.
1351 2022-02-24 Martin Liska <mliska@suse.cz>
1353 * pt.cc (defarg_insts_for): Use braces for subobject.
1355 2022-02-18 Patrick Palka <ppalka@redhat.com>
1358 * pt.cc (maybe_instantiate_noexcept): For non-static member
1359 functions, set current_class_ptr/ref to the specialized 'this'
1362 2022-02-17 Jason Merrill <jason@redhat.com>
1365 * pt.cc (mark_decl_instantiated): Don't clear DECL_COMDAT.
1367 2022-02-17 Jason Merrill <jason@redhat.com>
1370 * decl2.cc (mark_single_function): New.
1371 * cp-tree.h: Declare it.
1372 * typeck.cc (cp_build_addr_expr_1): mark_used when making a PMF.
1373 * semantics.cc (finish_qualified_id_expr): Not here.
1374 (finish_id_expression_1): Or here.
1375 (finish_decltype_type): Call mark_single_function.
1376 * cvt.cc (convert_to_void): And here.
1377 * pt.cc (convert_nontype_argument): And here.
1378 * init.cc (build_offset_ref): Adjust assert.
1380 2022-02-17 Patrick Palka <ppalka@redhat.com>
1383 * semantics.cc (finish_compound_literal): Don't perform
1384 non-dependent expr folding before calling check_narrowing.
1386 2022-02-16 Patrick Palka <ppalka@redhat.com>
1389 * constexpr.cc (potential_constant_expression_1)
1390 <case NON_DEPENDENT_EXPR>: Return false instead of recursing.
1391 Assert tf_error isn't set.
1393 2022-02-15 Jason Merrill <jason@redhat.com>
1397 * pt.cc (coerce_template_template_parms): Take full parms.
1398 Avoid adding too much of outer_args.
1399 (coerce_template_template_parm): Adjust.
1400 (template_template_parm_bindings_ok_p): Adjust.
1401 (convert_template_argument): Adjust.
1403 2022-02-14 Jakub Jelinek <jakub@redhat.com>
1406 * constexpr.cc (potential_constant_expression_1) <case GOTO_EXPR>:
1407 Don't punt if returns (target).
1409 2022-02-11 Jakub Jelinek <jakub@redhat.com>
1412 * constexpr.cc (cxx_eval_internal_function) <case IFN_VEC_CONVERT>:
1413 Only return fold_const_call result if it is non-NULL. Otherwise
1414 fall through into the default: case to return t, set *non_constant_p
1415 and emit diagnostics if needed.
1417 2022-02-10 Jason Merrill <jason@redhat.com>
1419 * module.cc (depset::hash::add_specializations): Use
1422 2022-02-10 Tobias Burnus <tobias@codesourcery.com>
1425 * decl2.cc (cp_omp_mappable_type_1): Remove check for virtual
1426 members as those are permitted since OpenMP 5.0.
1428 2022-02-10 Patrick Palka <ppalka@redhat.com>
1430 * pt.cc (filter_memfn_lookup): Handle dependent USING_DECL
1433 2022-02-10 Marcel Vollweiler <marcel@codesourcery.com>
1435 * parser.cc (cp_parser_omp_clause_name): Parse 'has_device_addr' clause.
1436 (cp_parser_omp_var_list_no_open): Handle array sections.
1437 (cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
1439 (cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK.
1440 * semantics.cc (handle_omp_array_sections): Handle clause restrictions.
1441 (finish_omp_clauses): Handle array sections.
1443 2022-02-09 Patrick Palka <ppalka@redhat.com>
1446 * call.cc (build_new_method_call): When a non-dependent call
1447 resolves to a specialization of a member template, always build
1448 the pruned overload set using the member template, not the
1450 * pt.cc (filter_memfn_lookup): New parameter newtype. Simplify
1451 and correct how members from the new lookup set are matched to
1452 those from the old one.
1453 (tsubst_baselink): Pass binfo_type as newtype to
1454 filter_memfn_lookup.
1456 2022-02-09 Jason Merrill <jason@redhat.com>
1459 * module.cc (trees_out::core_vals): Stream explicit specifier.
1460 (trees_in::core_vals): Likewise.
1461 * pt.cc (store_explicit_specifier): No longer static.
1462 (tsubst_function_decl): Clear DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
1463 * cp-tree.h (lookup_explicit_specifier): Declare.
1465 2022-02-09 Jason Merrill <jason@redhat.com>
1468 * typeck2.cc (split_nonconstant_init_1): Push cleanups for
1469 preceding members with constant initialization.
1470 (maybe_push_temp_cleanup): Do nothing if -fno-exceptions.
1472 2022-02-08 Jakub Jelinek <jakub@redhat.com>
1475 * name-lookup.cc (check_local_shadow): When diagnosing shadowing
1476 of a member or global declaration, add warning suppression for
1477 the decl and don't warn again on it.
1479 2022-02-08 Jakub Jelinek <jakub@redhat.com>
1482 * constexpr.cc (cxx_eval_constant_expression): Don't assert DECL_EXPRs
1483 of TREE_STATIC vars may only appear in -std=c++23.
1485 2022-02-08 Patrick Palka <ppalka@redhat.com>
1488 * pt.cc (uses_deducible_template_parms): Consider the
1489 noexcept-spec of a function type.
1491 2022-02-08 Patrick Palka <ppalka@redhat.com>
1494 * constraint.cc (satisfaction_value): Relax assert to accept
1497 2022-02-08 Patrick Palka <ppalka@redhat.com>
1500 * pt.cc (preserve_args): New function.
1501 (tsubst_lambda_expr): Use it when setting LAMBDA_EXPR_REGEN_INFO.
1503 2022-02-08 Patrick Palka <ppalka@redhat.com>
1506 * constraint.cc (satisfy_declaration_constraints): Use
1507 lambda_regenerating_args instead.
1508 * cp-tree.h (lambda_regenerating_args): Declare.
1509 * pt.cc (lambda_regenerating_args): Define, split out from
1510 satisfy_declaration_constraints.
1511 (do_auto_deduction): Use lambda_regenerating_args to obtain the
1512 full set of outer template arguments for satisfaction when
1515 2022-02-06 Patrick Palka <ppalka@redhat.com>
1518 * decl2.cc (mark_used): Directly synthesize a DECL_MAYBE_DELETED
1519 fn by calling maybe_synthesize_method instead of relying on
1520 maybe_instantiate_noexcept. Move call to m_i_n after the
1521 DECL_DELETED_FN handling.
1522 * pt.cc (maybe_instantiate_noexcept): Restrict DECL_MAYBE_DELETED
1523 fn synthesis to only those with an implicit noexcept-spec, and
1524 return !DECL_DELETED_FN instead of !DECL_MAYBE_DELETED afterwards.
1526 2022-02-06 Jakub Jelinek <jakub@redhat.com>
1530 * constexpr.cc (cxx_eval_binary_expression): Temporarily set
1531 folding_cxx_constexpr.
1533 2022-02-05 Jason Merrill <jason@redhat.com>
1537 * cp-tree.h (get_vec_init_expr): New.
1538 (target_expr_needs_replace): New.
1539 * cp-gimplify.cc (cp_gimplify_init_expr): Use it.
1540 (struct cp_fold_data): New.
1541 (cp_fold_r): Only genericize inits at end of fn.
1542 (cp_fold_function): Here.
1543 (cp_fully_fold_init): Not here.
1544 * init.cc (build_vec_init): Use get_vec_init_expr.
1545 * tree.cc (build_vec_init_expr): Likewise.
1546 * typeck2.cc (split_nonconstant_init_1): Likewise.
1547 (process_init_constructor): Wrap VEC_INIT_EXPR in
1550 2022-02-05 Jason Merrill <jason@redhat.com>
1552 * pt.cc (iterative_hash_template_arg): Add comment.
1554 2022-02-03 Patrick Palka <ppalka@redhat.com>
1557 * pt.cc (value_dependent_noexcept_spec_p): New predicate split
1559 (dependent_type_p_r): ... here.
1560 (instantiation_dependent_r): Use value_dependent_noexcept_spec_p
1561 to consider dependence of a noexcept-spec before C++17.
1562 * tree.cc (fixup_deferred_exception_variants): Clear
1563 TYPE_DEPENDENT_P_VALID.
1565 2022-02-03 Jason Merrill <jason@redhat.com>
1568 * decl.cc (maybe_deduce_size_from_array_init): Give up
1569 on type-dependent init.
1570 (cp_complete_array_type): Only call reshape_init for character
1573 2022-02-01 Jason Merrill <jason@redhat.com>
1576 * pt.cc (defarg_inst): Use tree_vec_map_cache_hasher.
1577 (defarg_insts_for): New.
1578 (tsubst_default_argument): Adjust.
1580 2022-01-31 Marek Polacek <polacek@redhat.com>
1584 * decl.cc (create_array_type_for_decl): Use template_placeholder_p.
1585 Sorry on a variable-length array of auto.
1587 2022-01-31 Marek Polacek <polacek@redhat.com>
1590 * class.cc (finish_struct): Don't allow union initializer_list.
1592 2022-01-31 Patrick Palka <ppalka@redhat.com>
1595 * pt.cc (ctor_deduction_guides_for): Correct computation of
1598 2022-01-31 Patrick Palka <ppalka@redhat.com>
1601 * pt.cc (for_each_template_parm_r) <case CONSTRUCTOR>: Clear
1602 walk_subtrees if !include_nondeduced_p. Simplify given that
1603 cp_walk_subtrees already walks TYPE_PTRMEMFUNC_FN_TYPE_RAW.
1605 2022-01-28 Patrick Palka <ppalka@redhat.com>
1606 Jason Merrill <jason@redhat.com>
1609 * typeck.cc (build_ptrmemfunc): Cast a nullptr constant to the
1610 unqualified pointer type not the qualified one.
1612 2022-01-28 Patrick Palka <ppalka@redhat.com>
1615 * decl.cc (cp_finish_decl): Pass the template arguments of a
1616 variable template specialization or a templated static data
1617 member to do_auto_deduction when the auto is constrained.
1619 2022-01-28 Jason Merrill <jason@redhat.com>
1624 * parser.cc (cp_parser_enumerator_definition): Sorry on parameter
1626 (cp_parser_class_head): And in class attributes.
1627 * pt.cc (check_for_bare_parameter_packs): Sorry instead of error
1630 2022-01-27 Jason Merrill <jason@redhat.com>
1634 * decl2.cc (save_template_attributes): Take late attrs as parm.
1635 (cplus_decl_attributes): Call it after decl_attributes,
1636 splice_template_attributes before.
1638 2022-01-27 Patrick Palka <ppalka@redhat.com>
1641 * call.cc (build_over_call): For a non-dependent member call,
1642 build up a CALL_EXPR using a COMPONENT_REF callee, as in
1643 build_new_method_call.
1644 * pt.cc (build_non_dependent_expr): Don't wrap PARM_DECL either.
1645 * tree.cc (build_min_non_dep_op_overload): Adjust accordingly
1646 after the build_over_call change.
1648 2022-01-27 Patrick Palka <ppalka@redhat.com>
1652 * parser.cc (cp_parser_class_head): Update 'type' with the result
1653 of maybe_process_partial_specialization in the
1654 nested_name_specifier branch. Refactor nearby code to accomodate
1655 that maybe_process_partial_specialization returns a _TYPE, not a
1656 TYPE_DECL, and eliminate local variable 'class_type' in passing.
1658 2022-01-27 Marek Polacek <polacek@redhat.com>
1661 * decl.cc (create_array_type_for_decl): Reject forming an array of
1662 placeholder for a deduced class type.
1664 2022-01-26 Jason Merrill <jason@redhat.com>
1668 * semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
1670 2022-01-26 Jakub Jelinek <jakub@redhat.com>
1673 * constexpr.cc (init_subob_ctx): For vector ctors containing
1674 vector elements, ensure appending to the same ctor instead of
1675 creating another one.
1677 2022-01-26 Marek Polacek <polacek@redhat.com>
1680 * decl.cc (finish_constructor_body): Suppress -Wuse-after-free.
1681 (finish_destructor_body): Likewise.
1682 * optimize.cc (build_delete_destructor_body): Likewise.
1684 2022-01-26 Jason Merrill <jason@redhat.com>
1687 * parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.
1689 2022-01-26 Jason Merrill <jason@redhat.com>
1692 * pt.cc (tsubst_aggr_type): Call tsubst for alias template
1695 2022-01-25 Patrick Palka <ppalka@redhat.com>
1699 * decl2.cc (mark_used): Don't consider maybe_instantiate_noexcept
1700 on a deleted function.
1702 2022-01-25 Jason Merrill <jason@redhat.com>
1705 * call.cc (build_over_call): Use cp_build_indirect_ref.
1707 2022-01-24 Patrick Palka <ppalka@redhat.com>
1710 * pt.cc (make_auto_1): Use -1 as a placeholder default argument
1713 2022-01-24 Patrick Palka <ppalka@redhat.com>
1716 * typeck.cc (build_class_member_access_expr): Extend
1717 unary_complex_lvalue result adjustment to preserve all
1718 rvalues, not just xvalues.
1720 2022-01-23 Will Wray <wjwray@gmail.com>
1723 * decl.cc (reshape_init_r): Only call has_designator_check when
1724 first_initializer_p or for the inner constructor element.
1725 (cp_complete_array_type): Call reshape_init on braced-init-list.
1727 2022-01-23 Jason Merrill <jason@redhat.com>
1730 * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing
1731 has set DECL_INITIAL on a TARGET_EXPR slot.
1732 * tree.cc (is_local_temp): Don't check DECL_CONTEXT.
1734 2022-01-23 Jason Merrill <jason@redhat.com>
1737 * cp-tree.h (build_implicit_conv_flags): Declare.
1738 * call.cc (build_implicit_conv_flags): Split out from...
1739 (perform_implicit_conversion_flags): ...here.
1740 * decl.cc (check_initializer): Use it.
1741 * pt.cc (tsubst_copy_and_build): Remove TARGET_EXPR handling.
1742 * semantics.cc (finish_compound_literal): Don't treat
1743 scalar values like CONSTRUCTORs.
1745 2022-01-21 Jason Merrill <jason@redhat.com>
1747 * semantics.cc (find_failing_clause): Return expr if not
1749 (finish_static_assert): Show constant values in failing
1752 2022-01-21 Jason Merrill <jason@redhat.com>
1756 * init.cc (build_new_1): Only pull out TARGET_EXPR_INITIAL if
1757 alloc_expr is a TARGET_EXPR.
1759 2022-01-21 Marek Polacek <polacek@redhat.com>
1762 * tree.cc (fixup_deferred_exception_variants): Remove duplicate
1763 variants after parsing the exception specifications.
1765 2022-01-21 Jason Merrill <jason@redhat.com>
1769 * class.cc (end_of_class): Use base_binfo.
1771 2022-01-20 Jason Merrill <jason@redhat.com>
1774 * decl.cc (reshape_init_class): Reject designator for a member of
1777 2022-01-20 Patrick Palka <ppalka@redhat.com>
1781 * pt.cc (keep_template_parm): Punt on a level 0 template parm.
1782 (tsubst_decl) <case VAR_DECL>: Remove !CHECKING_P safeguard.
1783 (tsubst) <case TEMPLATE_TYPE_PARM>: Handle CTAD placeholders
1785 (make_auto_1): Add defaulted 'level' parameter.
1786 (make_template_placeholder): Pass 0 as 'level' to make_auto_1.
1788 2022-01-20 Patrick Palka <ppalka@redhat.com>
1790 * decl.cc (grokdeclarator): Diagnose a CTAD placeholder as
1791 function return type even when !funcdecl_p.
1793 2022-01-20 Martin Liska <mliska@suse.cz>
1796 * error.cc (dump_aggr_type): Partially disable the warning.
1798 2022-01-20 Jason Merrill <jason@redhat.com>
1801 * parser.cc (cp_parser_template_name): Use dependent_scope_p.
1803 2022-01-19 David Malcolm <dmalcolm@redhat.com>
1805 * cp-lang.cc (selftest::run_cp_tests): Update calls for .c to .cc
1807 * cp-tree.h (cp_pt_c_tests): Rename to...
1808 (cp_pt_cc_tests): ...this.
1809 (cp_tree_c_tests): Rename to...
1810 (cp_tree_cc_tests): ...this.
1811 * pt.cc (cp_pt_c_tests): Rename to...
1812 (cp_pt_cc_tests): ...this.
1813 * tree.cc (cp_tree_c_tests): Rename to...
1814 (cp_tree_cc_tests): ...this.
1816 2022-01-19 Jason Merrill <jason@redhat.com>
1818 * parser.cc (saved_token_sentinel::rollback): Use
1819 cp_lexer_previous_token.
1821 2022-01-18 Jakub Jelinek <jakub@redhat.com>
1824 * constexpr.cc (cxx_eval_outermost_constant_expr): If t is a
1825 TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
1826 than get_target_expr_sfinae with tf_no_cleanup, and don't set
1829 2022-01-18 Jason Merrill <jason@redhat.com>
1830 Jakub Jelinek <jakub@redhat.com>
1833 * parser.cc (saved_token_sentinel::rollback): Call
1834 cp_lexer_set_source_position.
1835 (~saved_token_sentinel): Call rollback.
1837 2022-01-18 Patrick Palka <ppalka@redhat.com>
1840 * pt.cc (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
1841 that we return false for DEPENDENT_OPERATOR_TYPE too.
1843 2022-01-17 Martin Liska <mliska@suse.cz>
1845 * Make-lang.in: Rename .c names to .cc.
1846 * config-lang.in: Likewise.
1847 * constexpr.cc (cxx_eval_constant_expression): Likewise.
1848 * coroutines.cc (morph_fn_to_coro): Likewise.
1849 * cp-gimplify.cc (cp_gimplify_expr): Likewise.
1850 * cp-lang.cc (struct lang_hooks): Likewise.
1851 (get_template_argument_pack_elems_folded): Likewise.
1852 * cp-objcp-common.cc (cp_tree_size): Likewise.
1853 (cp_unit_size_without_reusable_padding): Likewise.
1854 (pop_file_scope): Likewise.
1855 (cp_pushdecl): Likewise.
1856 * cp-objcp-common.h (GCC_CP_OBJCP_COMMON): Likewise.
1857 (cxx_simulate_record_decl): Likewise.
1858 * cp-tree.h (struct named_label_entry): Likewise.
1859 (current_function_return_value): Likewise.
1860 (more_aggr_init_expr_args_p): Likewise.
1861 (get_function_version_dispatcher): Likewise.
1862 (common_enclosing_class): Likewise.
1863 (strip_fnptr_conv): Likewise.
1864 (current_decl_namespace): Likewise.
1865 (do_aggregate_paren_init): Likewise.
1866 (cp_check_const_attributes): Likewise.
1867 (qualified_name_lookup_error): Likewise.
1868 (generic_targs_for): Likewise.
1869 (mark_exp_read): Likewise.
1870 (is_global_friend): Likewise.
1871 (maybe_reject_flexarray_init): Likewise.
1872 (module_token_lang): Likewise.
1873 (handle_module_option): Likewise.
1874 (literal_integer_zerop): Likewise.
1875 (build_extra_args): Likewise.
1876 (build_if_nonnull): Likewise.
1877 (maybe_check_overriding_exception_spec): Likewise.
1878 (finish_omp_target_clauses): Likewise.
1879 (maybe_warn_zero_as_null_pointer_constant): Likewise.
1880 (cxx_print_error_function): Likewise.
1881 (decl_in_std_namespace_p): Likewise.
1882 (merge_exception_specifiers): Likewise.
1883 (mangle_module_global_init): Likewise.
1884 (cxx_block_may_fallthru): Likewise.
1885 (fold_builtin_source_location): Likewise.
1886 (enum cp_oracle_request): Likewise.
1887 (subsumes): Likewise.
1888 (cp_finish_injected_record_type): Likewise.
1889 (vtv_build_vtable_verify_fndecl): Likewise.
1890 (cp_tree_c_finish_parsing): Likewise.
1891 * cvt.cc (diagnose_ref_binding): Likewise.
1892 (convert_to_void): Likewise.
1893 (convert_force): Likewise.
1894 (type_promotes_to): Likewise.
1895 * decl.cc (make_unbound_class_template_raw): Likewise.
1896 (cxx_init_decl_processing): Likewise.
1897 (check_class_member_definition_namespace): Likewise.
1898 (cxx_maybe_build_cleanup): Likewise.
1899 * decl2.cc (maybe_emit_vtables): Likewise.
1900 * error.cc (dump_function_name): Likewise.
1901 * init.cc (is_class_type): Likewise.
1902 (build_new_1): Likewise.
1903 * lang-specs.h: Likewise.
1904 * method.cc (make_alias_for_thunk): Likewise.
1905 * module.cc (specialization_add): Likewise.
1906 (module_state::read_cluster): Likewise.
1907 * name-lookup.cc (check_extern_c_conflict): Likewise.
1908 * name-lookup.h (struct cxx_binding): Likewise.
1909 * parser.cc (cp_parser_identifier): Likewise.
1910 * parser.h (struct cp_parser): Likewise.
1911 * pt.cc (has_value_dependent_address): Likewise.
1912 (push_tinst_level_loc): Likewise.
1913 * semantics.cc (finish_omp_clauses): Likewise.
1914 (finish_omp_atomic): Likewise.
1915 * tree.cc (cp_save_expr): Likewise.
1916 (cp_free_lang_data): Likewise.
1917 * typeck.cc (cp_common_type): Likewise.
1918 (strip_array_domain): Likewise.
1919 (rationalize_conditional_expr): Likewise.
1920 (check_return_expr): Likewise.
1921 * vtable-class-hierarchy.cc: Likewise.
1923 2022-01-17 Martin Liska <mliska@suse.cz>
1925 * call.c: Moved to...
1927 * class.c: Moved to...
1928 * class.cc: ...here.
1929 * constexpr.c: Moved to...
1930 * constexpr.cc: ...here.
1931 * cp-gimplify.c: Moved to...
1932 * cp-gimplify.cc: ...here.
1933 * cp-lang.c: Moved to...
1934 * cp-lang.cc: ...here.
1935 * cp-objcp-common.c: Moved to...
1936 * cp-objcp-common.cc: ...here.
1937 * cp-ubsan.c: Moved to...
1938 * cp-ubsan.cc: ...here.
1939 * cvt.c: Moved to...
1941 * cxx-pretty-print.c: Moved to...
1942 * cxx-pretty-print.cc: ...here.
1943 * decl.c: Moved to...
1945 * decl2.c: Moved to...
1946 * decl2.cc: ...here.
1947 * dump.c: Moved to...
1949 * error.c: Moved to...
1950 * error.cc: ...here.
1951 * except.c: Moved to...
1952 * except.cc: ...here.
1953 * expr.c: Moved to...
1955 * friend.c: Moved to...
1956 * friend.cc: ...here.
1957 * g++spec.c: Moved to...
1958 * g++spec.cc: ...here.
1959 * init.c: Moved to...
1961 * lambda.c: Moved to...
1962 * lambda.cc: ...here.
1963 * lex.c: Moved to...
1965 * mangle.c: Moved to...
1966 * mangle.cc: ...here.
1967 * method.c: Moved to...
1968 * method.cc: ...here.
1969 * name-lookup.c: Moved to...
1970 * name-lookup.cc: ...here.
1971 * optimize.c: Moved to...
1972 * optimize.cc: ...here.
1973 * parser.c: Moved to...
1974 * parser.cc: ...here.
1977 * ptree.c: Moved to...
1978 * ptree.cc: ...here.
1979 * rtti.c: Moved to...
1981 * search.c: Moved to...
1982 * search.cc: ...here.
1983 * semantics.c: Moved to...
1984 * semantics.cc: ...here.
1985 * tree.c: Moved to...
1987 * typeck.c: Moved to...
1988 * typeck.cc: ...here.
1989 * typeck2.c: Moved to...
1990 * typeck2.cc: ...here.
1991 * vtable-class-hierarchy.c: Moved to...
1992 * vtable-class-hierarchy.cc: ...here.
1994 2022-01-17 Jakub Jelinek <jakub@redhat.com>
1997 * cp-gimplify.c (cp_genericize_target_expr): Set DECL_CONTEXT of
1998 TARGET_EXPR_SLOT to current_function_decl if it was NULL.
2000 2022-01-17 Andrew Stubbs <ams@codesourcery.com>
2002 * parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.
2004 2022-01-14 Chung-Lin Tang <cltang@codesourcery.com>
2007 * semantics.c (finish_omp_clauses): Also continue peeling off of
2008 outer node for ARRAY_REFs.
2010 2022-01-14 Jakub Jelinek <jakub@redhat.com>
2013 * cp-objcp-common.c (cxx_block_may_fallthru) <case IF_STMT>: For
2014 IF_STMT_CONSTEXPR_P with constant false or true condition only
2015 check if the taken clause may fall through.
2016 * cp-gimplify.c (genericize_if_stmt): For consteval if, revert
2017 to r12-5638^ behavior if then_ block can't fall through. For
2018 constexpr if, revert to r12-5638^ behavior.
2020 2022-01-13 Anthony Sharp <anthonysharp15@gmail.com>
2021 Jason Merrill <jason@redhat.com>
2024 * parser.c (cp_parser_id_expression): Handle
2025 -Wmissing-template-keyword.
2026 (struct saved_token_sentinel): Add modes to control what happens
2028 (cp_parser_statement): Adjust.
2029 (cp_parser_skip_entire_template_parameter_list): New function that
2030 skips an entire template parameter list.
2031 (cp_parser_require_end_of_template_parameter_list): Rename old
2032 cp_parser_skip_to_end_of_template_parameter_list.
2033 (cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
2034 called from one of the above two functions.
2035 (cp_parser_lambda_declarator_opt)
2036 (cp_parser_explicit_template_declaration)
2037 (cp_parser_enclosed_template_argument_list): Adjust.
2039 2022-01-12 Jakub Jelinek <jakub@redhat.com>
2040 Jason Merrill <jason@redhat.com>
2043 * tree.c (move): If expr is xvalue_p, just return expr without
2046 2022-01-11 Jakub Jelinek <jakub@redhat.com>
2049 * class.c (build_vfn_ref): Build OBJ_TYPE_REF with INTEGER_CST
2050 OBJ_TYPE_REF_TOKEN with type equal to OBJ_TYPE_REF_OBJECT type.
2051 * error.c (resolve_virtual_fun_from_obj_type_ref): Use type of
2052 OBJ_TYPE_REF_TOKEN rather than type of OBJ_TYPE_REF_OBJECT as
2055 2022-01-11 Patrick Palka <ppalka@redhat.com>
2058 * call.c (build_new_method_call): Consider dependent bases only
2059 if 'this' is available.
2061 2022-01-11 Olivier Hainque <hainque@adacore.com>
2063 * decl.c (cxx_init_decl_processing): Move code possibly
2064 altering flag_weak before code testing it.
2066 2022-01-10 Patrick Palka <ppalka@redhat.com>
2069 * constexpr.c (cxx_fold_indirect_ref): Split out object/offset
2070 canonicalization step into a local lambda. Strengthen it to
2071 absorb more components at position 0. Use it before both calls
2072 to cxx_fold_indirect_ref_1.
2074 2022-01-10 Patrick Palka <ppalka@redhat.com>
2077 * call.c (cand_parms_match): Skip over 'this' when given one
2078 static and one non-static member function.
2080 2022-01-10 Jakub Jelinek <jakub@redhat.com>
2083 * semantics.c (expand_or_defer_fn): For immediate functions, set
2084 node->body_removed to true and clear analyzed, definition and
2086 * decl2.c (c_parse_final_cleanups): Ignore immediate functions for
2089 2022-01-08 Jakub Jelinek <jakub@redhat.com>
2092 * constexpr.c (cxx_maybe_fold_addr_pointer_plus): New function.
2093 (cxx_eval_binary_expression): Use it.
2095 2022-01-08 Jason Merrill <jason@redhat.com>
2098 * init.c (build_vec_init): Remove assert.
2099 * tree.c (build_vec_init_expr): Likewise.
2101 2022-01-08 Jason Merrill <jason@redhat.com>
2104 * call.c (build_op_delete_call): Ignore destroying delete
2107 2022-01-07 Jason Merrill <jason@redhat.com>
2110 * init.c (build_new_1): Also build pointer cleanup if
2112 * cp-tree.h (TYPE_GETS_VEC_DELETE): New.
2114 2022-01-07 Jason Merrill <jason@redhat.com>
2118 * cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling.
2120 2022-01-07 Jason Merrill <jason@redhat.com>
2123 * init.c (perform_target_ctor): Select destructor by in_chrg.
2125 2022-01-07 Jason Merrill <jason@redhat.com>
2128 * except.c (in_nested_catch): New.
2129 (expand_end_catch_block): Check it.
2131 2022-01-07 Jason Merrill <jason@redhat.com>
2135 * except.c (maybe_splice_retval_cleanup): Check
2136 current_binding_level.
2137 * semantics.c (do_poplevel): Call it here.
2138 * parser.c (cp_parser_compound_statement): Not here.
2140 2022-01-07 Jason Merrill <jason@redhat.com>
2143 * decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
2144 cleanups from set_up_extended_ref_temp.
2145 (wrap_temporary_cleanups): Ignore array cleanups.
2146 (initialize_local_var): Don't check for array here.
2147 * cp-tree.h (BIND_EXPR_VEC_DTOR): New.
2148 * init.c (build_vec_delete_1): Set it.
2150 2022-01-07 Jason Merrill <jason@redhat.com>
2153 * init.c (build_vec_delete_1): Handle throwing dtor.
2154 (build_vec_init): Tell it we're in a cleanup already.
2156 2022-01-07 Jason Merrill <jason@redhat.com>
2158 * typeck2.c (split_nonconstant_init_1): Don't cleanup the last elt.
2159 (split_nonconstant_init): Adjust.
2161 2022-01-07 Jason Merrill <jason@redhat.com>
2165 * constexpr.c (replace_decl): Rename from replace_result_decl.
2166 * cp-tree.h (replace_decl): Declare it.
2167 * cp-gimplify.c (cp_gimplify_init_expr): Call it.
2168 (cp_gimplify_expr): Don't handle VEC_INIT_EXPR.
2169 (cp_genericize_init, cp_genericize_init_expr)
2170 (cp_genericize_target_expr): New.
2171 (cp_fold_r): Call them.
2172 * tree.c (build_array_copy): Add a TARGET_EXPR.
2173 * typeck2.c (digest_init_r): Look through a TARGET_EXPR.
2175 2022-01-07 Jason Merrill <jason@redhat.com>
2178 * decl.c (initialize_local_var): Fix comment.
2179 * init.c (build_new_1): Do stabilize array init.
2180 (build_vec_init): Use TARGET_EXPR for cleanup. Initialization
2181 of an element from an explicit initializer is not a
2183 * tree.c (expand_vec_init_expr): Pass flags through.
2184 * typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
2185 (split_nonconstant_init): Handle array cleanups.
2186 * cp-tree.h: Adjust.
2188 2022-01-07 Jason Merrill <jason@redhat.com>
2191 * decl.c (check_initializer): Remove obsolete comment.
2192 (wrap_cleanups_r): Don't wrap CLEANUP_EH_ONLY.
2193 (initialize_local_var): Change assert to test.
2194 * typeck2.c (maybe_push_temp_cleanup): New.
2195 (split_nonconstant_init_1): Use it.
2196 (split_nonconstant_init): Clear cleanup flags.
2198 2022-01-07 Jason Merrill <jason@redhat.com>
2201 * typeck2.c (PICFLAG_VEC_INIT): New.
2202 (process_init_constructor_array): Set it.
2203 (process_init_constructor): Handle it.
2204 (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
2205 * init.c (build_vec_init): Likewise.
2206 * cp-gimplify.c (cp_gimplify_expr): Factor out...
2207 * tree.c (expand_vec_init_expr): ...this function.
2208 (build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P.
2209 (build_vec_init_expr): Likewise.
2210 * constexpr.c (cxx_eval_vec_init): Likewise.
2211 (reduced_constant_expression_p): Check arrays before C++20.
2212 * cp-tree.h (expand_vec_init_expr): Declare.
2214 2022-01-07 Jason Merrill <jason@redhat.com>
2216 * init.c (build_new_1): Remove preevaluation code.
2218 2022-01-05 Nathan Sidwell <nathan@acm.org>
2220 * pt.c (instantiate_class_template_1): Process attribute((used)) set
2223 2022-01-05 Nathan Sidwell <nathan@acm.org>
2225 * init.c (build_new_1): Check complain before alignment warning.
2227 2022-01-04 Jason Merrill <jason@redhat.com>
2229 * cp-tree.h (class releasing_vec): Add begin/end fns.
2231 2022-01-04 Jason Merrill <jason@redhat.com>
2233 * init.c: Include -*- C++ -*- on first line.
2235 2022-01-03 Marek Polacek <polacek@redhat.com>
2238 * parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
2241 2022-01-03 Marek Polacek <polacek@redhat.com>
2243 * parser.c (make_char_string_pack): Add a cast to const unsigned
2246 2022-01-03 Jakub Jelinek <jakub@redhat.com>
2249 * rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
2250 to DECL_TINFO_P VAR_DECLs.
2252 2022-01-02 Jason Merrill <jason@redhat.com>
2254 * init.c (build_vec_init): Append the decrement to elt_init.
2256 2022-01-02 Jason Merrill <jason@redhat.com>
2258 * decl.c (wrap_cleanups_r): Don't wrap if noexcept.
2261 Copyright (C) 2022 Free Software Foundation, Inc.
2263 Copying and distribution of this file, with or without modification,
2264 are permitted in any medium without royalty provided the copyright
2265 notice and this notice are preserved.