1 2022-05-18 Marek Polacek <polacek@redhat.com>
4 * call.cc (maybe_warn_class_memaccess): Avoid % by zero.
6 2022-05-17 Jason Merrill <jason@redhat.com>
9 * decl.cc (check_initializer): Use build_cplus_new in case of
12 2022-05-17 Jakub Jelinek <jakub@redhat.com>
14 * parser.cc (cp_parser_omp_clause_depend): Parse
16 (cp_parser_omp_depobj): Likewise.
17 * cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle
18 OMP_CLAUSE_DEPEND_INOUTSET.
20 2022-05-16 Martin Liska <mliska@suse.cz>
22 * module.cc (depset::entity_kind_name): Use ARRAY_SIZE.
23 * name-lookup.cc (get_std_name_hint): Likewise.
24 * parser.cc (cp_parser_new): Likewise.
26 2022-05-16 Marcel Vollweiler <marcel@codesourcery.com>
28 * pt.cc (tsubst_omp_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR.
29 * semantics.cc (finish_omp_clauses): Added template decl processing.
31 2022-05-15 Jason Merrill <jason@redhat.com>
35 * friend.cc (is_friend): Hidden friends count as members.
36 * search.cc (friend_accessible_p): Likewise.
38 2022-05-15 Jason Merrill <jason@redhat.com>
40 * parser.cc (cp_parser_template_name): Look through
43 2022-05-15 Jason Merrill <jason@redhat.com>
48 * init.cc (build_value_init): Handle class in template.
50 2022-05-13 Nathan Sidwell <nathan@acm.org>
52 * mangle.cc (maybe_write_module): Check external linkage.
54 2022-05-13 Richard Biener <rguenther@suse.de>
56 * constexpr.cc: Remove gimple-fold.h include.
58 2022-05-12 Patrick Palka <ppalka@redhat.com>
60 * cp-tree.h (TMPL_ARGS_LEVEL): Assert LEVEL is 1 when
61 TMPL_ARGS_HAVE_MULTIPLE_LEVELS is false.
62 * pt.cc (try_class_unification): Correctly copy multidimensional
63 targs. Free the copy of targs.
64 (unify_pack_expansion): Fix level comparison.
66 2022-05-12 Nathan Sidwell <nathan@acm.org>
68 * parser.cc (cp_parser_linkage_specification): Implement
69 global module attachment semantics.
71 2022-05-12 Jakub Jelinek <jakub@redhat.com>
73 * lex.cc (init_reswords): Register omp_all_memory as keyword
75 * parser.cc (cp_parser_primary_expression): Diagnose uses of
76 omp_all_memory in postfix expressions.
77 (cp_parser_omp_var_list_no_open): Handle omp_all_memory in depend
79 * semantics.cc (finish_omp_clauses): Handle omp_all_memory
80 keyword in depend clause as null_pointer_node, diagnose invalid
82 * pt.cc (tsubst_omp_clause_decl): Pass through omp_all_memory.
84 2022-05-11 Patrick Palka <ppalka@redhat.com>
86 * constraint.cc (tsubst_parameter_mapping): Convert loop over
87 TREE_VEC into a range-based for loop using tree_vec_range.
88 * pt.cc (iterative_hash_template_arg): Likewise.
89 (template_parms_level_to_args): Likewise.
90 (deducible_template_args): Likewise.
91 (check_undeduced_parms): Likewise.
92 (dependent_type_p_r): Likewise.
93 (value_dependent_expression_p) <case NONTYPE_ARGUMENT_PACK>:
95 (dependent_template_arg_p): Likewise.
96 * tree.cc (cp_walk_subtrees) <case NONTYPE_ARGUMENT_PACK>:
99 2022-05-11 Jason Merrill <jason@redhat.com>
102 * cp-tree.h (TMPL_ARGS_DEPTH): 0 for null args.
103 * parser.cc (cp_parser_enclosed_template_argument_list):
104 Use 0-length TREE_VEC for <>.
106 2022-05-11 Jason Merrill <jason@redhat.com>
109 * typeck.cc (check_return_expr): Don't mess with ctor return value
110 while parsing a template.
112 2022-05-11 Nathan Sidwell <nathan@acm.org>
114 * cp-tree.h (DECL_MODULE_ATTACH_P): New.
115 (struct lang_decl_base): Add module_attach_p flag.
116 * decl.cc (duplicate_decls): Rework module redeclaration
118 * module.cc (trees_out::lang_decl_bools): Write attach flag.
119 (trees_in::lang_decl_bools): ... and read it back.
120 (trees_out::decl_value): Rework module attachment handling.
121 (trees_in::decl_value): Rename local var to reflect meaning.
122 (trees_in::key_mergeable): Likewise.
123 (get_originating_module): Use DECL_MODULE_ATTACH_P. No need
124 to special-case mangling.
125 (module_may_redeclare): Reimplement.
126 (set_originating_module): Deal with attachment.
127 * name-lookup.cc (maybe_record_mergeable_decl): Deal with
129 (mergeable_namespace_slots): Likewise.
130 (do_nonmember_using_decl): Likewise.
131 * name-lookup.h (mergeable_namespace_slots): Adjust parm
133 * ptree.cc (cxx_print_decl): Adjust purview & attach printing.
135 2022-05-11 Martin Liska <mliska@suse.cz>
138 * lang-specs.h: Use Separate syntax.
140 2022-05-10 Patrick Palka <ppalka@redhat.com>
142 * coroutines.cc (instantiate_coro_traits): Adjust accordingly.
143 * cp-tree.def: Remove mention of SET_PACK_EXPANSION_PATTERN.
144 * cp-tree.h (SET_PACK_EXPANSION_PATTERN): Remove.
145 (SET_ARGUMENT_PACK_ARGS): Remove.
146 * module.cc (trees_in::tree_node): Adjust accordingly.
147 * parser.cc (make_char_string_pack): Likewise.
148 (make_string_pack): Likewise.
149 * pt.cc (make_pack_expansion): Likewise.
150 (template_parm_to_arg): Likewise.
151 (coerce_template_parameter_pack): Likewise.
152 (extract_fnparm_pack): Likewise.
153 (extract_locals_r): Likewise.
154 (make_argument_pack): Likewise.
155 (tsubst_argument_pack): Likewise.
156 (lookup_init_capture_pack): Likewise.
157 (type_unification_real): Likewise.
158 (unify_pack_expansion): Likewise.
159 (tsubst_initializer_list): Likewise.
161 2022-05-10 Patrick Palka <ppalka@redhat.com>
163 * cp-tree.h (PACK_EXPANSION_CHECK): Define.
164 (PACK_EXPANSION_PATTERN): Use PACK_EXPANSION_CHECK.
165 (SET_PACK_EXPANSION_PATTERN): Likewise.
166 (PACK_EXPANSION_PARAMETER_PACKS): Likewise.
167 (PACK_EXPANSION_EXTRA_ARGS): Likewise.
168 (PACK_EXPANSION_LOCAL_P): Likewise.
169 (PACK_EXPANSION_SIZEOF_P): Likewise.
170 (PACK_EXPANSION_AUTO_P): Likewise.
171 (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): Likewise.
172 (ARGUMENT_PACK_CHECK): Define.
173 (ARGUMENT_PACK_ARGS): Use ARGUMENT_PACK_CHECK.
174 (SET_ARGUMENT_PACK_ARGS): Likewise.
175 * parser.cc (cp_parser_sizeof_pack): Check for error_mark_node
176 before setting PACK_EXPANSION_SIZEOF_P.
178 2022-05-10 Nathan Sidwell <nathan@acm.org>
180 * cp-tree.h (enum module_kind_bits): Disambiguate purview,
181 attach, named module vs header-unit.
182 (global_purview_p, not_module_p): Delete.
183 (named_module_p): New.
184 (header_module_p, module_purview_p): Adjust.
185 (module_attach_p, named_module_purview_p): New.
186 * decl.cc (duplicate_decls): Adjust.
187 * module.cc (declare_module, preprocessed_module): Adjust.
188 * name-lookup.cc (init_global_partition): Adjust.
189 (get_fixed_binding_slot, pushdecl): Adjust.
190 * parser.cc (cp_parser_module_declaration): Adjust.
191 (cp_parser_import_declaration, cp_parser_declaration): Adjust.
193 2022-05-10 Jason Merrill <jason@redhat.com>
196 * decl.cc (maybe_return_this): Replace...
197 (finish_constructor_body, finish_destructor_body): ...these.
198 (finish_function_body): Call it.
199 * optimize.cc (build_delete_destructor_body): Call it.
200 * cp-tree.h (maybe_return_this): Declare.
202 2022-05-09 Marek Polacek <polacek@redhat.com>
205 * parser.cc (cp_parser_statement): Constify the in_compound parameter.
206 Create a modifiable copy. Allow labels at the end of compound
209 2022-05-09 Patrick Palka <ppalka@redhat.com>
212 * call.cc (field_in_pset): Adjust after next_initializable_field
214 (build_aggr_conv): Likewise.
215 (convert_like_internal): Likewise.
216 (type_has_extended_temps): Likewise.
217 * class.cc (default_init_uninitialized_part): Likewise.
218 (finish_struct): Likewise.
219 * constexpr.cc (cx_check_missing_mem_inits): Likewise.
220 (reduced_constant_expression_p): Use next_subobject_field
222 * cp-gimplify.cc (get_source_location_impl_type): Adjust after
223 next_initializable_field renaming.
224 (fold_builtin_source_location): Likewise.
225 * cp-tree.h (next_initializable_field): Rename to ...
226 (next_aggregate_field): ... this.
227 (next_subobject_field): Declare.
228 * decl.cc (next_aggregate_field): Renamed from ...
229 (next_initializable_field): ... this. Skip over vptr fields
231 (next_subobject_field): Define.
232 (reshape_init_class): Adjust after next_initializable_field
234 * init.cc (build_value_init_noctor): Likewise.
235 (emit_mem_initializers): Likewise.
236 * lambda.cc (build_capture_proxy): Likewise.
237 * method.cc (build_comparison_op): Likewise.
238 * pt.cc (maybe_aggr_guide): Likewise.
239 * tree.cc (structural_type_p): Likewise.
240 * typeck2.cc (split_nonconstant_init_1): Likewise.
241 (digest_init_r): Likewise.
243 2022-05-09 Nathan Sidwell <nathan@acm.org>
245 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Renamed from
246 DECL_MODULE_ATTACHMENTS_P.
247 (struct lane_decl_base): Rename module_attached_p to
248 module_keyed_decls_p.
249 (maybe_key_decl): Renamed from maybe_attach_decl.
250 * lambda.cc (record_lambda_scope): Adjust.
251 * lex.cc (cxx_dup_lang_specific_decl): Adjust.
252 * module.cc (keyed_map_t, keyed_table): Renamed from attached_map_t,
254 (enum merge_kind): Rename MK_attached to MK_keyed.
255 (trees_out::lang_decl_bools): Adjust.
256 (trees_in::lang_decl_bools): Adjust.
257 (trees_in::decl_value): Adjust.
258 (trees_out::get_merge_kind): Adjust.
259 (trees_out::key_mergeable): Adjust.
260 (trees_in::key_mergeable): Adjust.
261 (maybe_key_decl): Rename from maybe_attach_decl.
262 (direct_import): Adjust.
263 (fini_modules): Adjust.
265 2022-05-09 Martin Liska <mliska@suse.cz>
267 * cp-gimplify.cc (cp_genericize_r): Use {,UN}LIKELY
269 * parser.cc (cp_finalize_omp_declare_simd): Likewise.
270 (cp_finalize_oacc_routine): Likewise.
272 2022-05-07 Marek Polacek <polacek@redhat.com>
276 * tree.cc (maybe_adjust_arg_pos_for_attribute): New.
278 2022-05-06 Jason Merrill <jason@redhat.com>
280 * error.cc (decl_to_string): Add show_color parameter.
281 (subst_to_string): Likewise.
282 (cp_printer): Pass it.
283 (type_to_string): Set pp_show_color.
284 (dump_function_name): Use "fnname" color.
285 (dump_template_bindings): Use "targs" color.
286 (struct colorize_guard): New.
287 (reinit_cxx_pp): Clear pp_show_color.
289 2022-05-06 Jason Merrill <jason@redhat.com>
293 * constexpr.cc (cxx_eval_store_expression): Reorganize empty base
296 2022-05-05 Marek Polacek <polacek@redhat.com>
299 * parser.cc (cp_parser_parameter_declaration_clause): Maintain
300 a vector of parameters that haven't been pushed yet. Push them at the
301 end of a valid parameter-declaration-clause.
302 (cp_parser_parameter_declaration_list): Take a new auto_vec parameter.
303 Do not pushdecl while parsing tentatively when pushdecl-ing a parameter
304 would result in a hard error.
305 (cp_parser_cache_defarg): Adjust the call to
306 cp_parser_parameter_declaration_list.
308 2022-05-05 Richard Biener <rguenther@suse.de>
310 * module.cc (trees_in::core_vals): Remove separate allocation
313 2022-05-04 Jason Merrill <jason@redhat.com>
316 * pt.cc (maybe_dependent_member_ref): Handle types.
317 (tsubst, tsubst_copy): Use it.
318 (tsubst_aggr_type, instantiate_alias_template): Don't handle
321 2022-05-04 Patrick Palka <ppalka@redhat.com>
324 * pt.cc (maybe_aggr_guide): Set processing_template_decl when
325 partially instantiating the guide's parameter list.
327 2022-05-04 Marek Polacek <polacek@redhat.com>
330 * parser.cc (cp_parser_init_declarator): Properly handle a series of
331 operator() calls, they are not part of an init-declarator.
333 2022-05-04 Jason Merrill <jason@redhat.com>
335 * decl.cc (reshape_init): Shortcut already-reshaped init.
336 (reshape_init_class): Assert not getting one here.
338 2022-05-04 Jason Merrill <jason@redhat.com>
340 * error.cc (cp_print_error_function): Use %qD.
341 (function_category): Use %qD.
343 2022-05-04 Marek Polacek <polacek@redhat.com>
346 * parser.cc (cp_parser_next_token_ends_template_argument_p): Don't
347 return true for CPP_GREATER_EQ.
349 2022-05-04 Jason Merrill <jason@redhat.com>
351 * cp-tree.h (struct language_function): Remove x_cdtor_label.
352 (cdtor_label, LABEL_DECL_CDTOR): Remove.
353 * constexpr.cc (returns): Don't check LABEL_DECL_CDTOR.
354 (cxx_eval_constant_expression): Don't call returns.
355 * decl.cc (check_goto): Don't check cdtor_label.
356 (start_preparsed_function): And don't set it.
357 (finish_constructor_body, finish_destructor_body): Remove.
358 (finish_function_body): Don't call them.
359 * typeck.cc (check_return_expr): Handle cdtor_returns_this here.
360 * semantics.cc (finish_return_stmt): Not here.
362 2022-05-04 Jakub Jelinek <jakub@redhat.com>
364 * lambda.cc: Include decl.h.
365 (maybe_add_lambda_conv_op): Temporarily override deprecated_state to
366 UNAVAILABLE_DEPRECATED_SUPPRESS.
368 2022-05-03 Patrick Palka <ppalka@redhat.com>
371 * cp-tree.h (finish_non_static_data_member): Add defaulted
373 * pt.cc (tsubst_copy_and_build): Pass complain to
374 finish_non_static_data_member.
375 * semantics.cc (finish_non_static_data_member): Respect complain
377 (finish_qualified_id_expr): Pass complain to
378 finish_non_static_data_member.
380 2022-05-02 Jason Merrill <jason@redhat.com>
382 * pt.cc (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Copy location.
383 (do_auto_deduction): Use expr location.
385 2022-05-02 Jason Merrill <jason@redhat.com>
387 * class.cc (maybe_note_name_used_in_class): Note in all enclosing
388 classes. Remember location of use.
389 (note_name_declared_in_class): Adjust.
391 2022-05-02 Marek Polacek <polacek@redhat.com>
393 * cp-tree.h (uses_template_parms): Adjust declaration.
394 * pt.cc (uses_template_parms): Return bool. Use a RAII sentinel.
396 2022-05-02 Richard Biener <rguenther@suse.de>
398 * constexpr.cc (fold_simple_1): Use CASE_CONVERT.
399 * cp-gimplify.cc (cp_fold): Likewise.
400 * pt.cc (tsubst_copy): Likewise.
402 2022-04-29 Jason Merrill <jason@redhat.com>
406 * friend.cc (do_friend): Call check_explicit_specialization here.
407 * decl.cc (grokdeclarator): Not here.
408 * decl2.cc (check_classfn): Or here.
410 2022-04-29 Jason Merrill <jason@redhat.com>
413 * cp-tree.h (enum tsubst_flags): Add tf_dguide.
414 * pt.cc (tsubst_aggr_type): Check it.
415 (tsubst_baselink, tsubst_copy): Check it.
416 (maybe_dependent_member_ref): Check it.
417 (instantiate_alias_template): Handle it.
418 (build_deduction_guide): Set it.
420 2022-04-29 Jason Merrill <jason@redhat.com>
423 * lambda.cc (type_deducible_expression_p): Allow more types.
425 2022-04-29 Jason Merrill <jason@redhat.com>
427 * decl.cc (cp_finish_decl): Only consider auto for vars.
429 2022-04-29 Marek Polacek <polacek@redhat.com>
432 * parser.cc (cp_parser_enum_specifier): Warn about empty unnamed enum
433 only when it's followed by a semicolon.
435 2022-04-29 Jason Merrill <jason@redhat.com>
438 * decl.cc (cp_finish_decl): Check completeness of deduced type.
440 2022-04-29 Jason Merrill <jason@redhat.com>
443 * error.cc (dump_decl) [USING_DECL]: Respect flags.
445 2022-04-29 Jason Merrill <jason@redhat.com>
447 * error.cc (dump_decl): Check TFF_UNQUALIFIED_NAME.
449 2022-04-29 Jakub Jelinek <jakub@redhat.com>
452 * parser.cc (cp_parser_template_argument): Treat >= like C++98 >>
453 after a type id by setting maybe_type_id and aborting tentative
455 (cp_parser_enclosed_template_argument_list): Handle
456 CPP_GREATER_EQ like misspelled CPP_GREATER CPP_RQ and
457 CPP_RSHIFT_EQ like misspelled CPP_GREATER CPP_GREATER_EQ
458 or CPP_RSHIFT CPP_EQ or CPP_GREATER CPP_GREATER CPP_EQ.
459 (cp_parser_next_token_ends_template_argument_p): Return true
460 also for CPP_GREATER_EQ and CPP_RSHIFT_EQ.
462 2022-04-29 Iain Sandoe <iain@sandoe.co.uk>
465 * coroutines.cc (register_local_var_uses): Allow promotion of unnamed
466 temporaries to coroutine frame copies.
468 2022-04-29 Jason Merrill <jason@redhat.com>
470 * semantics.cc (check_trait_type): Don't check completeness
471 of element type of array of unknown bound.
473 2022-04-29 Jason Merrill <jason@redhat.com>
477 * rtti.cc (get_tinfo_decl_direct): Don't complete_type.
478 (emit_tinfo_decl): Update tdesc type if needed.
480 2022-04-29 Zhao Wei Liew <zhaoweiliew@gmail.com>
483 * call.cc (extract_call_expr): Return a NULL_TREE on failure
484 instead of asserting.
485 (build_new_method_call): Suppress -Wparentheses diagnostic for
487 * semantics.cc (is_assignment_op_expr_p): Add function to check
488 if an expression is a call to an op= operator expression.
489 (maybe_convert_cond): Handle the case of a op= operator expression
490 for the -Wparentheses diagnostic.
492 2022-04-28 Patrick Palka <ppalka@redhat.com>
495 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Treat
496 DEPENDENT_OPERATOR_TYPE like an empty type.
498 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
501 * coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
502 non-target expression inputs.
504 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
507 * coroutines.cc (coro_promise_type_found_p): Account for possible
508 mutliple overloads of the promise return_value() method.
510 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
513 * coroutines.cc (maybe_promote_temps): Ensure generated temporaries
514 are added to the bind expr.
515 (add_var_to_bind): Fix local var naming to use portable punctuation.
516 (register_local_var_uses): Do not add synthetic names to unnamed
519 2022-04-28 Nathan Sidwell <nathan@acm.org>
520 Iain Sandoe <iain@sandoe.co.uk>
523 * coroutines.cc (finish_co_await_expr): Do not process non-dependent
524 coroutine expressions at template definition time.
525 (finish_co_yield_expr): Likewise.
526 (finish_co_return_stmt): Likewise.
528 2022-04-28 Marek Polacek <polacek@redhat.com>
531 * parser.cc (cp_parser_class_specifier_1): Accept :: after a class
534 2022-04-27 Jason Merrill <jason@redhat.com>
536 * tree.cc (strip_typedefs): Add default argument comments.
538 2022-04-27 Marek Polacek <polacek@redhat.com>
541 * pt.cc (uses_template_parms): Return false for any NAMESPACE_DECL.
543 2022-04-26 Jason Merrill <jason@redhat.com>
546 * pt.cc (gen_elem_of_pack_expansion_instantiation): Clear
547 TEMPLATE_TYPE_PARAMETER_PACK on auto.
549 2022-04-26 Patrick Palka <ppalka@redhat.com>
552 * semantics.cc (finish_decltype_type): Pass tf_decltype to
553 instantiate_non_dependent_expr_sfinae.
555 2022-04-26 Jason Merrill <jason@redhat.com>
558 * pt.cc (check_for_bare_parameter_packs): Check for lambda
559 function parameter pack.
561 2022-04-26 Patrick Palka <ppalka@redhat.com>
565 * pt.cc (process_partial_specialization): Downgrade "partial
566 specialization isn't more specialized" diagnostic from permerror
567 to an on-by-default pedwarn.
568 (unify) <case TEMPLATE_PARM_INDEX>: When substituting into the
569 NTTP type a second time, use the original type not the
572 2022-04-25 Marek Polacek <polacek@redhat.com>
575 * typeck.cc (build_x_shufflevector): Use
576 instantiation_dependent_expression_p except for the first two
579 2022-04-21 Marek Polacek <polacek@redhat.com>
581 * constexpr.cc (cxx_eval_logical_expression): Remove unused
583 (cxx_eval_constant_expression) <case TRUTH_ANDIF_EXPR>,
584 <case TRUTH_OR_EXPR>: Adjust calls to cxx_eval_logical_expression.
586 2022-04-21 Marek Polacek <polacek@redhat.com>
589 * constexpr.cc (cxx_eval_logical_expression): Always pass false for lval
590 to cxx_eval_constant_expression.
592 2022-04-20 Ed Catmur <ed@catmur.uk>
595 * call.cc (compare_ics): When comparing list-initialization
596 sequences, do not return early.
598 2022-04-19 Jakub Jelinek <jakub@redhat.com>
601 * typeck2.cc (process_init_constructor_array,
602 process_init_constructor_record, process_init_constructor_union): Move
603 CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag from CONSTRUCTOR elements to the
604 containing CONSTRUCTOR.
606 2022-04-15 Marek Polacek <polacek@redhat.com>
609 * parser.cc (cp_parser_placeholder_type_specifier): Return
610 error_mark_node when trying to build up a constrained parameter in
613 2022-04-15 Jason Merrill <jason@redhat.com>
616 * decl.cc (grokdeclarator): Drop typedef used with 'unsigned'.
618 2022-04-15 Jason Merrill <jason@redhat.com>
621 * error.cc (dump_expr): Handle USING_DECL.
622 [VIEW_CONVERT_EXPR]: Just look through location wrapper.
624 2022-04-14 Jason Merrill <jason@redhat.com>
627 * constexpr.cc (maybe_save_constexpr_fundef): Don't do extra
628 checks for defaulted ctors.
630 2022-04-14 Jason Merrill <jason@redhat.com>
633 * lambda.cc (type_deducible_expression_p): New.
634 (lambda_capture_field_type): Check it.
636 2022-04-14 Jason Merrill <jason@redhat.com>
639 * pt.cc (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.
641 2022-04-14 Jason Merrill <jason@redhat.com>
644 * name-lookup.cc (dependent_local_decl_p): New.
645 * cp-tree.h (dependent_local_decl_p): Declare.
646 * semantics.cc (finish_call_expr): Use it.
647 * pt.cc (tsubst_arg_types): Also substitute default args
650 2022-04-14 Jason Merrill <jason@redhat.com>
653 * pt.cc (tsubst_baselink): Also check dependent optype.
655 2022-04-14 Jason Merrill <jason@redhat.com>
658 * decl.cc (cp_finish_decl): Don't pass decl to push_cleanup.
659 * init.cc (perform_member_init): Likewise.
660 * semantics.cc (push_cleanup): Adjust comment.
662 2022-04-13 Jason Merrill <jason@redhat.com>
666 * constexpr.cc (cxx_eval_store_expression): Build a CONSTRUCTOR
667 as needed in empty base handling.
669 2022-04-13 Jakub Jelinek <jakub@redhat.com>
672 * decl2.cc (cp_check_const_attributes): For aligned attribute
673 pass manifestly_const_eval=true to fold_non_dependent_expr.
675 2022-04-13 Marek Polacek <polacek@redhat.com>
678 * call.cc (direct_reference_binding): strip_top_quals when creating
681 2022-04-12 Jason Merrill <jason@redhat.com>
684 * decl.cc (decls_match): Compare versions even if not recording.
685 (duplicate_decls): Propagate attributes to alias.
686 * decl2.cc (find_last_decl): Give up if versioned.
688 2022-04-12 Jason Merrill <jason@redhat.com>
691 * init.cc (build_new_1): Check array_p for alignment.
693 2022-04-12 Patrick Palka <ppalka@redhat.com>
696 * pt.cc (build_extra_args): Call preserve_args.
698 2022-04-12 Jason Merrill <jason@redhat.com>
701 * decl.cc (check_initializer): Check TREE_SIDE_EFFECTS.
703 2022-04-12 Jason Merrill <jason@redhat.com>
707 * class.cc (finish_struct): Always using op=.
709 2022-04-11 Jason Merrill <jason@redhat.com>
712 * call.cc (build_operator_new_call): Just look in ::.
714 2022-04-11 Alexandre Oliva <oliva@adacore.com>
716 * constexpr.cc (cxx_eval_call_expression): Disregard dtor
719 2022-04-11 Alexandre Oliva <oliva@adacore.com>
721 * semantics.cc (set_cleanup_locs): Propagate locus to call
722 wrapped in cast-to-void.
724 2022-04-11 Jason Merrill <jason@redhat.com>
727 * init.cc (warn_placement_new_too_small): Check deref.
729 2022-04-09 Jason Merrill <jason@redhat.com>
733 * tree.cc (build_vec_init_elt): Do {}-init for aggregates.
734 * constexpr.cc (cxx_eval_vec_init): Only treat {} as value-init
735 for non-aggregate types.
736 (build_vec_init_expr): Also check constancy of explicit
737 initializer elements.
739 2022-04-09 Jason Merrill <jason@redhat.com>
743 * name-lookup.cc (set_decl_namespace): Set
744 DECL_IMPLICIT_INSTANTIATION if no non-template match.
745 * pt.cc (check_explicit_specialization): Check it.
746 * decl2.cc (check_classfn): Call it.
748 2022-04-07 Patrick Palka <ppalka@redhat.com>
751 * name-lookup.cc (name_lookup::using_queue): Change to an
752 auto_vec (with 16 elements of internal storage).
753 (name_lookup::queue_namespace): Change return type to void,
754 take queue parameter by reference and adjust function body
756 (name_lookup::do_queue_usings): Inline into ...
757 (name_lookup::queue_usings): ... here. As in queue_namespace.
758 (name_lookup::search_unqualified): Don't make queue static,
759 remove length variable, and adjust function body accordingly.
761 2022-04-07 Jakub Jelinek <jakub@redhat.com>
763 PR tree-optimization/102586
764 * cp-objcp-common.h (cp_classtype_as_base): Declare.
765 (LANG_HOOKS_CLASSTYPE_AS_BASE): Redefine.
766 * cp-objcp-common.cc (cp_classtype_as_base): New function.
768 2022-04-07 Jason Merrill <jason@redhat.com>
771 * decl.cc (grokdeclarator): Reject conversion with trailing return
774 2022-04-07 Jason Merrill <jason@redhat.com>
777 * lambda.cc (lambda_expr_this_capture): Check all enclosing
778 lambdas for completeness.
780 2022-04-07 Jason Merrill <jason@redhat.com>
783 * typeck2.cc (store_init_value): Allow TREE_HAS_CONSTRUCTOR for
786 2022-04-06 Jakub Jelinek <jakub@redhat.com>
789 * decl2.cc (splice_template_attributes): Return NULL if *p is
791 (cplus_decl_attributes): Return early if attributes is
792 error_mark_node. Don't check that later.
794 2022-04-06 Patrick Palka <ppalka@redhat.com>
797 * pt.cc (do_class_deduction): Check complain before attempting
798 to issue a -Wctad-maybe-unsupported warning.
800 2022-04-06 Jason Merrill <jason@redhat.com>
803 * init.cc (build_vec_init): Use a reference for the result.
805 2022-04-06 Jason Merrill <jason@redhat.com>
808 * name-lookup.cc (check_local_shadow): Use -Wshadow=local
809 if exactly one of 'old' and 'decl' is a type.
811 2022-04-05 Jason Merrill <jason@redhat.com>
815 * pt.cc (do_class_deduction): Pedwarn for renaming alias in C++17.
817 2022-04-05 Jason Merrill <jason@redhat.com>
820 * name-lookup.h (struct cp_binding_level): Add requires_expression
822 * parser.cc (cp_parser_requires_expression): Set it.
823 (synthesize_implicit_template_parm): Check it.
825 2022-04-04 Jason Merrill <jason@redhat.com>
828 * decl.cc (duplicate_decls): Copy DECL_FRIEND_CONTEXT.
830 2022-04-04 Jason Merrill <jason@redhat.com>
834 * pt.cc (get_underlying_template): Compare default template args.
836 2022-04-03 Benno Evers <benno.evers@tenzir.com>
837 Iain Sandoe <iain@sandoe.co.uk>
840 * coroutines.cc (morph_fn_to_coro): Reset
841 current_binding_level->blocks.
843 2022-04-01 Jason Merrill <jason@redhat.com>
846 2022-03-31 Jason Merrill <jason@redhat.com>
849 * parser.cc (cp_parser_early_parsing_nsdmi): New.
850 (cp_parser_member_declaration): Call it.
852 2022-04-01 Jason Merrill <jason@redhat.com>
855 2022-03-24 Jason Merrill <jason@redhat.com>
858 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
859 * class.cc (type_has_default_ctor_to_be_synthesized): New.
860 (type_has_non_user_provided_default_constructor_1): Support it.
861 (type_has_non_user_provided_default_constructor): Now a wrapper.
862 * method.cc (complain_about_unparsed_dmi): New.
863 (constructible_expr): Call it.
865 2022-04-01 Patrick Palka <ppalka@redhat.com>
868 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Drop cv-quals from
869 the argument type of an NTTP before deducing from it.
871 2022-03-31 Jason Merrill <jason@redhat.com>
874 * parser.cc (cp_parser_early_parsing_nsdmi): New.
875 (cp_parser_member_declaration): Call it.
877 2022-03-30 Patrick Palka <ppalka@redhat.com>
880 * constraint.cc (diagnose_trait_expr): Handle all remaining
881 traits appropriately. Remove default case.
883 2022-03-30 Marek Polacek <polacek@redhat.com>
887 * init.cc (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor.
889 2022-03-30 Jakub Jelinek <jakub@redhat.com>
892 * pt.cc (tsubst_omp_clause_decl): When handling iterators, set
893 DECL_CONTEXT of the iterator var to current_function_decl and
896 2022-03-30 Jakub Jelinek <jakub@redhat.com>
899 * parser.cc (cp_parser_template_introduction): If member_p, temporarily
900 clear parser->colon_corrects_to_scope_p around tentative parsing of
901 nested name specifier.
903 2022-03-28 Jason Merrill <jason@redhat.com>
905 * pt.cc (determine_specialization): Add comment.
907 2022-03-28 Patrick Palka <ppalka@redhat.com>
910 * pt.cc (finish_concept_definition): Check that a concept is
911 declared with exactly one template parameter list.
913 2022-03-28 Patrick Palka <ppalka@redhat.com>
916 * constraint.cc (maybe_substitute_reqs_for): Don't assume
917 DECL_TEMPLATE_INFO is available.
919 2022-03-28 Jason Merrill <jason@redhat.com>
924 * pt.cc (complex_alias_template_r): walk_tree callback, replacing
925 uses_all_template_parms_r, complex_pack_expansion_r.
926 (complex_alias_template_p): Adjust.
927 * tree.cc (strip_typedefs): Revert r12-7710 change.
929 2022-03-28 Jason Merrill <jason@redhat.com>
932 * init.cc (build_new_1): Include cookie in alignment. Omit
933 constexpr wrapper from alloc_call.
935 2022-03-28 Jason Merrill <jason@redhat.com>
938 * name-lookup.cc (push_local_extern_decl_alias): Call
939 determine_visibility.
941 2022-03-28 Jason Merrill <jason@redhat.com>
944 * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting
945 a type template reference.
947 2022-03-28 Jason Merrill <jason@redhat.com>
950 * pt.cc (value_dependent_expression_p): Check
951 has_value_dependent_address for conversion to reference.
953 2022-03-28 Jason Merrill <jason@redhat.com>
956 * pt.cc (tsubst_qualified_id): Handle getting SCOPE_REF from
958 (instantiation_dependent_scope_ref_p): Check dependent_scope_p.
960 2022-03-28 Jason Merrill <jason@redhat.com>
963 * call.cc (make_base_init_ok): Call make_used.
965 2022-03-28 Jason Merrill <jason@redhat.com>
968 * mangle.cc (write_expression): Don't write a union designator when
971 2022-03-28 Jason Merrill <jason@redhat.com>
975 * tree.cc (strip_typedefs): Use build_distinct_type_copy.
977 2022-03-26 Patrick Palka <ppalka@redhat.com>
980 * constexpr.cc (potential_constant_expression_1) <case IF_STMT>:
981 Clarify error message when a if-stmt is non-constant because its
982 branches are non-constant.
984 2022-03-26 Patrick Palka <ppalka@redhat.com>
987 * call.cc (add_builtin_candidate) <case MEMBER_REF>: Test
988 CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
990 2022-03-26 Jakub Jelinek <jakub@redhat.com>
992 * parser.cc (cp_parser_postfix_expression)
993 <case RID_BILTIN_CONVERTVECTOR, case RID_BUILTIN_BIT_CAST>: Don't
994 return cp_build_{vec,convert,bit_cast} result right away, instead
995 set postfix_expression to it and break.
997 2022-03-25 Marek Polacek <polacek@redhat.com>
1000 * typeck.cc (cxx_sizeof_or_alignof_type): Diagnose alignof(void).
1001 (cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with
1004 2022-03-24 Marek Polacek <polacek@redhat.com>
1007 * decl.cc (check_initializer): Don't call build_aggr_init in
1010 2022-03-24 Jason Merrill <jason@redhat.com>
1013 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
1014 * class.cc (type_has_default_ctor_to_be_synthesized): New.
1015 (type_has_non_user_provided_default_constructor_1): Support it.
1016 (type_has_non_user_provided_default_constructor): Now a wrapper.
1017 * method.cc (complain_about_unparsed_dmi): New.
1018 (constructible_expr): Call it.
1020 2022-03-24 Marek Polacek <polacek@redhat.com>
1023 * typeck2.cc (massage_init_elt): Avoid folding CONSTRUCTORs.
1025 2022-03-24 Patrick Palka <ppalka@redhat.com>
1028 * call.cc (build_over_call): Use cxx_constant_value_sfinae
1029 instead of cxx_constant_value to evaluate a consteval call.
1030 * constexpr.cc (cxx_constant_value_sfinae): Add decl parameter
1031 and pass it to cxx_eval_outermost_constant_expr.
1032 * cp-tree.h (cxx_constant_value_sfinae): Add decl parameter.
1033 * pt.cc (fold_targs_r): Pass NULL_TREE as decl parameter to
1034 cxx_constant_value_sfinae.
1036 2022-03-24 Jakub Jelinek <jakub@redhat.com>
1039 * constexpr.cc (cxx_eval_constant_expression): Don't diagnose passing
1040 through extern thread_local declarations. Change wording from
1041 declaration to definition.
1042 (potential_constant_expression_1): Don't diagnose extern thread_local
1043 declarations. Change wording from declared to defined.
1044 * decl.cc (start_decl): Likewise.
1046 2022-03-23 Jason Merrill <jason@redhat.com>
1049 * decl.cc (reshape_single_init): New.
1050 (reshape_init_class): Use it.
1052 2022-03-23 Jason Merrill <jason@redhat.com>
1055 * name-lookup.cc (lookup_using_decl): Check that scope is
1056 a dependent type before looking for dependent using.
1058 2022-03-23 Jason Merrill <jason@redhat.com>
1061 * name-lookup.cc (lookup_using_decl): Set DECL_DEPENDENT_P if lookup
1062 finds a dependent using.
1064 2022-03-21 Jason Merrill <jason@redhat.com>
1067 * init.cc (build_vec_init): Check for vla element type.
1069 2022-03-21 Jason Merrill <jason@redhat.com>
1075 * decl.cc (reshape_init_class): Avoid looking for designator
1077 (reshape_init_r): Keep looking for designator.
1079 2022-03-21 Jason Merrill <jason@redhat.com>
1082 * decl.cc (reshape_init_class): Back out of anon struct
1083 if a designator doesn't match.
1085 2022-03-18 Jason Merrill <jason@redhat.com>
1089 * class.cc (add_method): Avoid adding the same used function twice.
1090 (handle_using_decl): Don't add_method.
1091 (finish_struct): Don't using op= if we have one already.
1092 (maybe_push_used_methods): New.
1093 * semantics.cc (finish_member_declaration): Call it.
1094 * name-lookup.cc (diagnose_name_conflict): No longer static.
1095 (push_class_level_binding): Revert 92918 patch, limit
1097 * cp-tree.h: Adjust.
1099 2022-03-18 Jakub Jelinek <jakub@redhat.com>
1102 * init.cc (build_new_constexpr_heap_type): Remove FULL_SIZE
1103 argument and its handling, instead add ITYPE2 argument. Only
1104 support COOKIE_SIZE != NULL.
1105 (build_new_1): If size is 0, change it to 0 * outer_nelts if
1106 outer_nelts is non-NULL. Pass type rather than elt_type to
1107 maybe_wrap_new_for_constexpr.
1108 * constexpr.cc (build_new_constexpr_heap_type): New function.
1109 (cxx_eval_constant_expression) <case CONVERT_EXPR>:
1110 If elt_size is zero sized type, try to recover outer_nelts from
1111 the size argument to operator new/new[] and pass that as
1112 arg_size to build_new_constexpr_heap_type. Pass ctx,
1113 non_constant_p and overflow_p to that call too.
1115 2022-03-18 Marek Polacek <polacek@redhat.com>
1118 * tree.cc (strip_typedefs): Don't strip an alias template when
1119 doing so would result in losing a parameter pack.
1121 2022-03-16 Patrick Palka <ppalka@redhat.com>
1123 * search.cc (lookup_member): Simplify by handling all values
1124 of protect together in the ambiguous case. Don't modify protect.
1126 2022-03-16 Patrick Palka <ppalka@redhat.com>
1129 * cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls to
1130 std::move/forward and other cast-like functions into simple
1133 2022-03-15 Patrick Palka <ppalka@redhat.com>
1136 * search.cc (lookup_field_info::errstr): Remove this data
1138 (lookup_field_r): Don't set errstr.
1139 (lookup_member): Check ambiguity before checking access.
1140 Simplify accordingly after errstr removal. Exit early upon
1141 error or empty result.
1143 2022-03-15 Jakub Jelinek <jakub@redhat.com>
1146 * parser.cc (cp_parser_skip_to_pragma_eol): Don't purge any tokens.
1148 2022-03-14 Jakub Jelinek <jakub@redhat.com>
1150 PR tree-optimization/102586
1151 * call.cc (build_cxx_call): Diagnose __builtin_clear_padding where
1152 first argument's type is pointer to non-trivially-copyable type unless
1153 it is address of a variable or parameter.
1155 2022-03-12 Patrick Palka <ppalka@redhat.com>
1158 * cp-tree.h (tsubst_flags::tf_tst_ok): New flag.
1159 * decl.cc (make_typename_type): Allow a typename-specifier to
1160 resolve to a template when tf_tst_ok, in which case return
1161 a CTAD placeholder for the template.
1162 * pt.cc (tsubst_decl) <case VAR_DECL>: Set tf_tst_ok when
1163 substituting the type.
1164 (tsubst): Clear tf_tst_ok and remember if it was set.
1165 <case TYPENAME_TYPE>: Pass tf_tst_ok to make_typename_type
1167 (tsubst_copy) <case CAST_EXPR>: Set tf_tst_ok when substituting
1169 (tsubst_copy_and_build) <case CAST_EXPR>: Likewise.
1170 <case CONSTRUCTOR>: Likewise.
1172 2022-03-12 Patrick Palka <ppalka@redhat.com>
1175 * call.cc (missing_conversion_p): Define.
1176 (add_candidates): Use it.
1177 * pt.cc (check_non_deducible_conversion): Change type of strict
1178 parameter to unification_kind_t and directly test for DEDUCE_CALL.
1180 2022-03-12 Patrick Palka <ppalka@redhat.com>
1183 * constraint.cc (normalize_atom): Set
1184 ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P appropriately.
1185 (get_mapped_args): Make static, adjust parameters. Always
1186 return a vector whose depth corresponds to the template depth of
1187 the context of the atomic constraint expression. Micro-optimize
1188 by passing false as exact to safe_grow_cleared and by collapsing
1189 a multi-level depth-one argument vector.
1190 (satisfy_atom): Adjust call to get_mapped_args and
1191 diagnose_atomic_constraint.
1192 (diagnose_atomic_constraint): Replace map parameter with an args
1194 * cp-tree.h (ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P): Define.
1195 (get_mapped_args): Remove declaration.
1197 2022-03-12 Patrick Palka <ppalka@redhat.com>
1198 Jason Merrill <jason@redhat.com>
1201 * constexpr.cc (mark_non_constant): Define, split out from ...
1202 (cxx_eval_outermost_constant_expr): ... here.
1203 (maybe_constant_value): Use it.
1205 2022-03-12 Patrick Palka <ppalka@redhat.com>
1207 * semantics.cc (finish_unary_fold_expr): Use input_location
1208 instead of UNKNOWN_LOCATION.
1209 (finish_binary_fold_expr): Likewise.
1211 2022-03-12 Thomas Schwinge <thomas@codesourcery.com>
1214 * semantics.cc (handle_omp_array_sections_1)
1215 (cp_oacc_check_attachments): Call 'user_omp_clause_code_name'
1216 instead of 'c_omp_map_clause_name'.
1218 2022-03-10 Marek Polacek <polacek@redhat.com>
1221 * parser.cc (cp_parser_template_name): Repeat lookup of
1224 2022-03-10 Marek Polacek <polacek@redhat.com>
1227 * semantics.cc (finish_compound_literal): Disallow auto{x} for
1228 is_constrained_auto.
1229 * typeck2.cc (build_functional_cast_1): Likewise.
1231 2022-03-10 Marek Polacek <polacek@redhat.com>
1234 * decl.cc (grokdeclarator): Check FUNC_OR_METHOD_TYPE_P before giving
1237 2022-03-10 Jakub Jelinek <jakub@redhat.com>
1240 * decl.cc (grok_op_properties): Allow variadic operator[] for
1243 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
1246 * decl.cc (finish_enum_value_list): If VALUE isn't an INTEGER_CST
1247 consider it to be zero (i.e. treat it like error_mark_node).
1248 (build_enumerator): Likewise, if PREV_VALUE isn't an INTEGER_CST,
1249 set VALUE to error_mark_node.
1251 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
1254 * parser.cc (cp_parser_late_parsing_for_member): Confirm the token
1255 stream hasn't been purged before processing DECL_PENDING_INLINE.
1257 2022-03-09 Patrick Palka <ppalka@redhat.com>
1260 * except.cc (build_noexcept_spec): Strengthen dependence check
1261 to instantiation_dependent_expression_p.
1262 * parser.cc (cp_parser_parenthesized_expression_list_elt):
1263 Remove fold_expr_p parameter, and don't call
1264 instantiate_non_dependent_expr.
1265 (cp_parser_parenthesized_expression_list): Adjust accordingly.
1266 * pt.cc (expand_integer_pack): Strengthen dependence check
1267 to instantiation_dependent_expression_p.
1268 (instantiate_non_dependent_expr_internal): Adjust comment.
1269 (instantiate_non_dependent_expr_sfinae): Likewise. Drop
1270 the potentially-constant check, and relax and turn the
1271 dependence check into a checking assert.
1272 (instantiate_non_dependent_or_null): Adjust comment.
1273 * semantics.cc (finish_decltype_type): Keep
1274 processing_template_decl cleared after calling
1275 instantiate_non_dependent_expr_sfinae.
1277 2022-03-09 Patrick Palka <ppalka@redhat.com>
1281 * cp-tree.h (is_copy_initialization): Declare.
1282 * decl.cc (cp_finish_decl): Set LOOKUP_ONLYCONVERTING
1283 when is_copy_initialization is true.
1284 * init.cc (build_aggr_init): Split out copy-initialization
1286 (is_copy_initialization): ... here.
1287 * pt.cc (instantiate_decl): Pass 0 instead of
1288 LOOKUP_ONLYCONVERTING as flags to cp_finish_decl.
1290 2022-03-09 Patrick Palka <ppalka@redhat.com>
1293 * cp-tree.h (merge_default_template_args): Declare.
1294 * decl.cc (merge_default_template_args): Define, factored out
1295 from redeclare_class_template.
1296 (duplicate_decls): Use it when merging member function template
1297 and free function declarations.
1298 * pt.cc (redeclare_class_template): Factor out default argument
1299 merging logic into merge_default_template_args. Improve location
1300 of a note when there's a template parameter kind mismatch.
1302 2022-03-09 Jakub Jelinek <jakub@redhat.com>
1305 * constexpr.cc (cxx_eval_check_shift_p): Use TYPE_OVERFLOW_WRAPS
1306 instead of TYPE_UNSIGNED.
1307 * typeck.cc (cp_build_binary_op): Don't emit
1308 -Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
1310 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
1313 * decl.cc (start_decl): Defend against prefix_attributes being
1316 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
1319 * parser.cc (synthesize_implicit_template_parm): Check that
1320 TREE_VALUE (new_parm) isn't error_mark_node before setting its
1323 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
1326 * parser.cc (cp_parser_linkage_specification): Treat the case where
1327 linkage is error_mark_node as "invalid linkage-specification".
1329 2022-03-08 Marek Polacek <polacek@redhat.com>
1332 * pt.cc (convert_nontype_argument): Recompute
1333 value_dependent_expression_p after build_converted_constant_expr.
1335 2022-03-08 Marek Polacek <polacek@redhat.com>
1337 * decl2.cc (is_late_template_attribute): Do not defer attribute
1339 * pt.cc (tsubst_enum): Set TREE_UNAVAILABLE.
1341 2022-03-08 Jakub Jelinek <jakub@redhat.com>
1344 * search.cc (lookup_field_fuzzy_info::fuzzy_lookup_field): Ignore
1345 identifiers with space at the end.
1347 2022-03-07 Jason Merrill <jason@redhat.com>
1350 * decl2.cc (mark_single_function): Look through parens and location
1352 * typeck.cc (cp_build_addr_expr_1): Not here.
1354 2022-03-07 Jakub Jelinek <jakub@redhat.com>
1356 * parser.cc (cp_parser_omp_clause_map): Add missing space in string
1359 2022-03-07 Jakub Jelinek <jakub@redhat.com>
1361 * cvt.cc: Fix up duplicated word issue in a comment.
1363 * module.cc: Likewise.
1364 * coroutines.cc: Likewise.
1366 2022-03-04 Nathan Sidwell <nathan@acm.org>
1368 * mangle.cc (is_std_substitution): Check global module.
1369 (is_std_substitution_char): Return bool.
1371 2022-03-04 Nathan Sidwell <nathan@acm.org>
1373 * cp-tree.h (mangle_identifier): Replace with ...
1374 (mangle_module_component): ... this.
1375 * mangle.cc (dump_substitution_candidates): Adjust.
1376 (add_substitution): Likewise.
1377 (find_substitution): Likewise.
1378 (unmangled_name_p): Likewise.
1379 (mangle_module_substitution): Reimplement.
1380 (mangle_module_component): New.
1381 (write_module, maybe_write_module): Adjust.
1382 (write_name): Drop modules here.
1383 (write_unqualified): Do them here instead.
1384 (mangle_global_init): Adjust.
1385 * module.cc (module_state::mangle): Adjust.
1386 (mangle_module): Likewise.
1387 (get_originating_module): Adjust.
1389 2022-02-28 Marek Polacek <polacek@redhat.com>
1392 * cp-tree.h (build_enumerator): Adjust.
1393 * decl.cc (finish_enum): Make it return the new decl.
1394 * pt.cc (tsubst_enum): Propagate TREE_DEPRECATED and TREE_UNAVAILABLE.
1396 2022-02-28 Marek Polacek <polacek@redhat.com>
1399 * decl2.cc (is_late_template_attribute): Cope with a decl without
1402 2022-02-27 Jason Merrill <jason@redhat.com>
1405 * typeck.cc (cp_build_addr_expr_1): Also
1406 maybe_undo_parenthesized_ref.
1408 2022-02-24 Martin Liska <mliska@suse.cz>
1410 * pt.cc (defarg_insts_for): Use braces for subobject.
1412 2022-02-18 Patrick Palka <ppalka@redhat.com>
1415 * pt.cc (maybe_instantiate_noexcept): For non-static member
1416 functions, set current_class_ptr/ref to the specialized 'this'
1419 2022-02-17 Jason Merrill <jason@redhat.com>
1422 * pt.cc (mark_decl_instantiated): Don't clear DECL_COMDAT.
1424 2022-02-17 Jason Merrill <jason@redhat.com>
1427 * decl2.cc (mark_single_function): New.
1428 * cp-tree.h: Declare it.
1429 * typeck.cc (cp_build_addr_expr_1): mark_used when making a PMF.
1430 * semantics.cc (finish_qualified_id_expr): Not here.
1431 (finish_id_expression_1): Or here.
1432 (finish_decltype_type): Call mark_single_function.
1433 * cvt.cc (convert_to_void): And here.
1434 * pt.cc (convert_nontype_argument): And here.
1435 * init.cc (build_offset_ref): Adjust assert.
1437 2022-02-17 Patrick Palka <ppalka@redhat.com>
1440 * semantics.cc (finish_compound_literal): Don't perform
1441 non-dependent expr folding before calling check_narrowing.
1443 2022-02-16 Patrick Palka <ppalka@redhat.com>
1446 * constexpr.cc (potential_constant_expression_1)
1447 <case NON_DEPENDENT_EXPR>: Return false instead of recursing.
1448 Assert tf_error isn't set.
1450 2022-02-15 Jason Merrill <jason@redhat.com>
1454 * pt.cc (coerce_template_template_parms): Take full parms.
1455 Avoid adding too much of outer_args.
1456 (coerce_template_template_parm): Adjust.
1457 (template_template_parm_bindings_ok_p): Adjust.
1458 (convert_template_argument): Adjust.
1460 2022-02-14 Jakub Jelinek <jakub@redhat.com>
1463 * constexpr.cc (potential_constant_expression_1) <case GOTO_EXPR>:
1464 Don't punt if returns (target).
1466 2022-02-11 Jakub Jelinek <jakub@redhat.com>
1469 * constexpr.cc (cxx_eval_internal_function) <case IFN_VEC_CONVERT>:
1470 Only return fold_const_call result if it is non-NULL. Otherwise
1471 fall through into the default: case to return t, set *non_constant_p
1472 and emit diagnostics if needed.
1474 2022-02-10 Jason Merrill <jason@redhat.com>
1476 * module.cc (depset::hash::add_specializations): Use
1479 2022-02-10 Tobias Burnus <tobias@codesourcery.com>
1482 * decl2.cc (cp_omp_mappable_type_1): Remove check for virtual
1483 members as those are permitted since OpenMP 5.0.
1485 2022-02-10 Patrick Palka <ppalka@redhat.com>
1487 * pt.cc (filter_memfn_lookup): Handle dependent USING_DECL
1490 2022-02-10 Marcel Vollweiler <marcel@codesourcery.com>
1492 * parser.cc (cp_parser_omp_clause_name): Parse 'has_device_addr' clause.
1493 (cp_parser_omp_var_list_no_open): Handle array sections.
1494 (cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
1496 (cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK.
1497 * semantics.cc (handle_omp_array_sections): Handle clause restrictions.
1498 (finish_omp_clauses): Handle array sections.
1500 2022-02-09 Patrick Palka <ppalka@redhat.com>
1503 * call.cc (build_new_method_call): When a non-dependent call
1504 resolves to a specialization of a member template, always build
1505 the pruned overload set using the member template, not the
1507 * pt.cc (filter_memfn_lookup): New parameter newtype. Simplify
1508 and correct how members from the new lookup set are matched to
1509 those from the old one.
1510 (tsubst_baselink): Pass binfo_type as newtype to
1511 filter_memfn_lookup.
1513 2022-02-09 Jason Merrill <jason@redhat.com>
1516 * module.cc (trees_out::core_vals): Stream explicit specifier.
1517 (trees_in::core_vals): Likewise.
1518 * pt.cc (store_explicit_specifier): No longer static.
1519 (tsubst_function_decl): Clear DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
1520 * cp-tree.h (lookup_explicit_specifier): Declare.
1522 2022-02-09 Jason Merrill <jason@redhat.com>
1525 * typeck2.cc (split_nonconstant_init_1): Push cleanups for
1526 preceding members with constant initialization.
1527 (maybe_push_temp_cleanup): Do nothing if -fno-exceptions.
1529 2022-02-08 Jakub Jelinek <jakub@redhat.com>
1532 * name-lookup.cc (check_local_shadow): When diagnosing shadowing
1533 of a member or global declaration, add warning suppression for
1534 the decl and don't warn again on it.
1536 2022-02-08 Jakub Jelinek <jakub@redhat.com>
1539 * constexpr.cc (cxx_eval_constant_expression): Don't assert DECL_EXPRs
1540 of TREE_STATIC vars may only appear in -std=c++23.
1542 2022-02-08 Patrick Palka <ppalka@redhat.com>
1545 * pt.cc (uses_deducible_template_parms): Consider the
1546 noexcept-spec of a function type.
1548 2022-02-08 Patrick Palka <ppalka@redhat.com>
1551 * constraint.cc (satisfaction_value): Relax assert to accept
1554 2022-02-08 Patrick Palka <ppalka@redhat.com>
1557 * pt.cc (preserve_args): New function.
1558 (tsubst_lambda_expr): Use it when setting LAMBDA_EXPR_REGEN_INFO.
1560 2022-02-08 Patrick Palka <ppalka@redhat.com>
1563 * constraint.cc (satisfy_declaration_constraints): Use
1564 lambda_regenerating_args instead.
1565 * cp-tree.h (lambda_regenerating_args): Declare.
1566 * pt.cc (lambda_regenerating_args): Define, split out from
1567 satisfy_declaration_constraints.
1568 (do_auto_deduction): Use lambda_regenerating_args to obtain the
1569 full set of outer template arguments for satisfaction when
1572 2022-02-06 Patrick Palka <ppalka@redhat.com>
1575 * decl2.cc (mark_used): Directly synthesize a DECL_MAYBE_DELETED
1576 fn by calling maybe_synthesize_method instead of relying on
1577 maybe_instantiate_noexcept. Move call to m_i_n after the
1578 DECL_DELETED_FN handling.
1579 * pt.cc (maybe_instantiate_noexcept): Restrict DECL_MAYBE_DELETED
1580 fn synthesis to only those with an implicit noexcept-spec, and
1581 return !DECL_DELETED_FN instead of !DECL_MAYBE_DELETED afterwards.
1583 2022-02-06 Jakub Jelinek <jakub@redhat.com>
1587 * constexpr.cc (cxx_eval_binary_expression): Temporarily set
1588 folding_cxx_constexpr.
1590 2022-02-05 Jason Merrill <jason@redhat.com>
1594 * cp-tree.h (get_vec_init_expr): New.
1595 (target_expr_needs_replace): New.
1596 * cp-gimplify.cc (cp_gimplify_init_expr): Use it.
1597 (struct cp_fold_data): New.
1598 (cp_fold_r): Only genericize inits at end of fn.
1599 (cp_fold_function): Here.
1600 (cp_fully_fold_init): Not here.
1601 * init.cc (build_vec_init): Use get_vec_init_expr.
1602 * tree.cc (build_vec_init_expr): Likewise.
1603 * typeck2.cc (split_nonconstant_init_1): Likewise.
1604 (process_init_constructor): Wrap VEC_INIT_EXPR in
1607 2022-02-05 Jason Merrill <jason@redhat.com>
1609 * pt.cc (iterative_hash_template_arg): Add comment.
1611 2022-02-03 Patrick Palka <ppalka@redhat.com>
1614 * pt.cc (value_dependent_noexcept_spec_p): New predicate split
1616 (dependent_type_p_r): ... here.
1617 (instantiation_dependent_r): Use value_dependent_noexcept_spec_p
1618 to consider dependence of a noexcept-spec before C++17.
1619 * tree.cc (fixup_deferred_exception_variants): Clear
1620 TYPE_DEPENDENT_P_VALID.
1622 2022-02-03 Jason Merrill <jason@redhat.com>
1625 * decl.cc (maybe_deduce_size_from_array_init): Give up
1626 on type-dependent init.
1627 (cp_complete_array_type): Only call reshape_init for character
1630 2022-02-01 Jason Merrill <jason@redhat.com>
1633 * pt.cc (defarg_inst): Use tree_vec_map_cache_hasher.
1634 (defarg_insts_for): New.
1635 (tsubst_default_argument): Adjust.
1637 2022-01-31 Marek Polacek <polacek@redhat.com>
1641 * decl.cc (create_array_type_for_decl): Use template_placeholder_p.
1642 Sorry on a variable-length array of auto.
1644 2022-01-31 Marek Polacek <polacek@redhat.com>
1647 * class.cc (finish_struct): Don't allow union initializer_list.
1649 2022-01-31 Patrick Palka <ppalka@redhat.com>
1652 * pt.cc (ctor_deduction_guides_for): Correct computation of
1655 2022-01-31 Patrick Palka <ppalka@redhat.com>
1658 * pt.cc (for_each_template_parm_r) <case CONSTRUCTOR>: Clear
1659 walk_subtrees if !include_nondeduced_p. Simplify given that
1660 cp_walk_subtrees already walks TYPE_PTRMEMFUNC_FN_TYPE_RAW.
1662 2022-01-28 Patrick Palka <ppalka@redhat.com>
1663 Jason Merrill <jason@redhat.com>
1666 * typeck.cc (build_ptrmemfunc): Cast a nullptr constant to the
1667 unqualified pointer type not the qualified one.
1669 2022-01-28 Patrick Palka <ppalka@redhat.com>
1672 * decl.cc (cp_finish_decl): Pass the template arguments of a
1673 variable template specialization or a templated static data
1674 member to do_auto_deduction when the auto is constrained.
1676 2022-01-28 Jason Merrill <jason@redhat.com>
1681 * parser.cc (cp_parser_enumerator_definition): Sorry on parameter
1683 (cp_parser_class_head): And in class attributes.
1684 * pt.cc (check_for_bare_parameter_packs): Sorry instead of error
1687 2022-01-27 Jason Merrill <jason@redhat.com>
1691 * decl2.cc (save_template_attributes): Take late attrs as parm.
1692 (cplus_decl_attributes): Call it after decl_attributes,
1693 splice_template_attributes before.
1695 2022-01-27 Patrick Palka <ppalka@redhat.com>
1698 * call.cc (build_over_call): For a non-dependent member call,
1699 build up a CALL_EXPR using a COMPONENT_REF callee, as in
1700 build_new_method_call.
1701 * pt.cc (build_non_dependent_expr): Don't wrap PARM_DECL either.
1702 * tree.cc (build_min_non_dep_op_overload): Adjust accordingly
1703 after the build_over_call change.
1705 2022-01-27 Patrick Palka <ppalka@redhat.com>
1709 * parser.cc (cp_parser_class_head): Update 'type' with the result
1710 of maybe_process_partial_specialization in the
1711 nested_name_specifier branch. Refactor nearby code to accomodate
1712 that maybe_process_partial_specialization returns a _TYPE, not a
1713 TYPE_DECL, and eliminate local variable 'class_type' in passing.
1715 2022-01-27 Marek Polacek <polacek@redhat.com>
1718 * decl.cc (create_array_type_for_decl): Reject forming an array of
1719 placeholder for a deduced class type.
1721 2022-01-26 Jason Merrill <jason@redhat.com>
1725 * semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
1727 2022-01-26 Jakub Jelinek <jakub@redhat.com>
1730 * constexpr.cc (init_subob_ctx): For vector ctors containing
1731 vector elements, ensure appending to the same ctor instead of
1732 creating another one.
1734 2022-01-26 Marek Polacek <polacek@redhat.com>
1737 * decl.cc (finish_constructor_body): Suppress -Wuse-after-free.
1738 (finish_destructor_body): Likewise.
1739 * optimize.cc (build_delete_destructor_body): Likewise.
1741 2022-01-26 Jason Merrill <jason@redhat.com>
1744 * parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.
1746 2022-01-26 Jason Merrill <jason@redhat.com>
1749 * pt.cc (tsubst_aggr_type): Call tsubst for alias template
1752 2022-01-25 Patrick Palka <ppalka@redhat.com>
1756 * decl2.cc (mark_used): Don't consider maybe_instantiate_noexcept
1757 on a deleted function.
1759 2022-01-25 Jason Merrill <jason@redhat.com>
1762 * call.cc (build_over_call): Use cp_build_indirect_ref.
1764 2022-01-24 Patrick Palka <ppalka@redhat.com>
1767 * pt.cc (make_auto_1): Use -1 as a placeholder default argument
1770 2022-01-24 Patrick Palka <ppalka@redhat.com>
1773 * typeck.cc (build_class_member_access_expr): Extend
1774 unary_complex_lvalue result adjustment to preserve all
1775 rvalues, not just xvalues.
1777 2022-01-23 Will Wray <wjwray@gmail.com>
1780 * decl.cc (reshape_init_r): Only call has_designator_check when
1781 first_initializer_p or for the inner constructor element.
1782 (cp_complete_array_type): Call reshape_init on braced-init-list.
1784 2022-01-23 Jason Merrill <jason@redhat.com>
1787 * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing
1788 has set DECL_INITIAL on a TARGET_EXPR slot.
1789 * tree.cc (is_local_temp): Don't check DECL_CONTEXT.
1791 2022-01-23 Jason Merrill <jason@redhat.com>
1794 * cp-tree.h (build_implicit_conv_flags): Declare.
1795 * call.cc (build_implicit_conv_flags): Split out from...
1796 (perform_implicit_conversion_flags): ...here.
1797 * decl.cc (check_initializer): Use it.
1798 * pt.cc (tsubst_copy_and_build): Remove TARGET_EXPR handling.
1799 * semantics.cc (finish_compound_literal): Don't treat
1800 scalar values like CONSTRUCTORs.
1802 2022-01-21 Jason Merrill <jason@redhat.com>
1804 * semantics.cc (find_failing_clause): Return expr if not
1806 (finish_static_assert): Show constant values in failing
1809 2022-01-21 Jason Merrill <jason@redhat.com>
1813 * init.cc (build_new_1): Only pull out TARGET_EXPR_INITIAL if
1814 alloc_expr is a TARGET_EXPR.
1816 2022-01-21 Marek Polacek <polacek@redhat.com>
1819 * tree.cc (fixup_deferred_exception_variants): Remove duplicate
1820 variants after parsing the exception specifications.
1822 2022-01-21 Jason Merrill <jason@redhat.com>
1826 * class.cc (end_of_class): Use base_binfo.
1828 2022-01-20 Jason Merrill <jason@redhat.com>
1831 * decl.cc (reshape_init_class): Reject designator for a member of
1834 2022-01-20 Patrick Palka <ppalka@redhat.com>
1838 * pt.cc (keep_template_parm): Punt on a level 0 template parm.
1839 (tsubst_decl) <case VAR_DECL>: Remove !CHECKING_P safeguard.
1840 (tsubst) <case TEMPLATE_TYPE_PARM>: Handle CTAD placeholders
1842 (make_auto_1): Add defaulted 'level' parameter.
1843 (make_template_placeholder): Pass 0 as 'level' to make_auto_1.
1845 2022-01-20 Patrick Palka <ppalka@redhat.com>
1847 * decl.cc (grokdeclarator): Diagnose a CTAD placeholder as
1848 function return type even when !funcdecl_p.
1850 2022-01-20 Martin Liska <mliska@suse.cz>
1853 * error.cc (dump_aggr_type): Partially disable the warning.
1855 2022-01-20 Jason Merrill <jason@redhat.com>
1858 * parser.cc (cp_parser_template_name): Use dependent_scope_p.
1860 2022-01-19 David Malcolm <dmalcolm@redhat.com>
1862 * cp-lang.cc (selftest::run_cp_tests): Update calls for .c to .cc
1864 * cp-tree.h (cp_pt_c_tests): Rename to...
1865 (cp_pt_cc_tests): ...this.
1866 (cp_tree_c_tests): Rename to...
1867 (cp_tree_cc_tests): ...this.
1868 * pt.cc (cp_pt_c_tests): Rename to...
1869 (cp_pt_cc_tests): ...this.
1870 * tree.cc (cp_tree_c_tests): Rename to...
1871 (cp_tree_cc_tests): ...this.
1873 2022-01-19 Jason Merrill <jason@redhat.com>
1875 * parser.cc (saved_token_sentinel::rollback): Use
1876 cp_lexer_previous_token.
1878 2022-01-18 Jakub Jelinek <jakub@redhat.com>
1881 * constexpr.cc (cxx_eval_outermost_constant_expr): If t is a
1882 TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
1883 than get_target_expr_sfinae with tf_no_cleanup, and don't set
1886 2022-01-18 Jason Merrill <jason@redhat.com>
1887 Jakub Jelinek <jakub@redhat.com>
1890 * parser.cc (saved_token_sentinel::rollback): Call
1891 cp_lexer_set_source_position.
1892 (~saved_token_sentinel): Call rollback.
1894 2022-01-18 Patrick Palka <ppalka@redhat.com>
1897 * pt.cc (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
1898 that we return false for DEPENDENT_OPERATOR_TYPE too.
1900 2022-01-17 Martin Liska <mliska@suse.cz>
1902 * Make-lang.in: Rename .c names to .cc.
1903 * config-lang.in: Likewise.
1904 * constexpr.cc (cxx_eval_constant_expression): Likewise.
1905 * coroutines.cc (morph_fn_to_coro): Likewise.
1906 * cp-gimplify.cc (cp_gimplify_expr): Likewise.
1907 * cp-lang.cc (struct lang_hooks): Likewise.
1908 (get_template_argument_pack_elems_folded): Likewise.
1909 * cp-objcp-common.cc (cp_tree_size): Likewise.
1910 (cp_unit_size_without_reusable_padding): Likewise.
1911 (pop_file_scope): Likewise.
1912 (cp_pushdecl): Likewise.
1913 * cp-objcp-common.h (GCC_CP_OBJCP_COMMON): Likewise.
1914 (cxx_simulate_record_decl): Likewise.
1915 * cp-tree.h (struct named_label_entry): Likewise.
1916 (current_function_return_value): Likewise.
1917 (more_aggr_init_expr_args_p): Likewise.
1918 (get_function_version_dispatcher): Likewise.
1919 (common_enclosing_class): Likewise.
1920 (strip_fnptr_conv): Likewise.
1921 (current_decl_namespace): Likewise.
1922 (do_aggregate_paren_init): Likewise.
1923 (cp_check_const_attributes): Likewise.
1924 (qualified_name_lookup_error): Likewise.
1925 (generic_targs_for): Likewise.
1926 (mark_exp_read): Likewise.
1927 (is_global_friend): Likewise.
1928 (maybe_reject_flexarray_init): Likewise.
1929 (module_token_lang): Likewise.
1930 (handle_module_option): Likewise.
1931 (literal_integer_zerop): Likewise.
1932 (build_extra_args): Likewise.
1933 (build_if_nonnull): Likewise.
1934 (maybe_check_overriding_exception_spec): Likewise.
1935 (finish_omp_target_clauses): Likewise.
1936 (maybe_warn_zero_as_null_pointer_constant): Likewise.
1937 (cxx_print_error_function): Likewise.
1938 (decl_in_std_namespace_p): Likewise.
1939 (merge_exception_specifiers): Likewise.
1940 (mangle_module_global_init): Likewise.
1941 (cxx_block_may_fallthru): Likewise.
1942 (fold_builtin_source_location): Likewise.
1943 (enum cp_oracle_request): Likewise.
1944 (subsumes): Likewise.
1945 (cp_finish_injected_record_type): Likewise.
1946 (vtv_build_vtable_verify_fndecl): Likewise.
1947 (cp_tree_c_finish_parsing): Likewise.
1948 * cvt.cc (diagnose_ref_binding): Likewise.
1949 (convert_to_void): Likewise.
1950 (convert_force): Likewise.
1951 (type_promotes_to): Likewise.
1952 * decl.cc (make_unbound_class_template_raw): Likewise.
1953 (cxx_init_decl_processing): Likewise.
1954 (check_class_member_definition_namespace): Likewise.
1955 (cxx_maybe_build_cleanup): Likewise.
1956 * decl2.cc (maybe_emit_vtables): Likewise.
1957 * error.cc (dump_function_name): Likewise.
1958 * init.cc (is_class_type): Likewise.
1959 (build_new_1): Likewise.
1960 * lang-specs.h: Likewise.
1961 * method.cc (make_alias_for_thunk): Likewise.
1962 * module.cc (specialization_add): Likewise.
1963 (module_state::read_cluster): Likewise.
1964 * name-lookup.cc (check_extern_c_conflict): Likewise.
1965 * name-lookup.h (struct cxx_binding): Likewise.
1966 * parser.cc (cp_parser_identifier): Likewise.
1967 * parser.h (struct cp_parser): Likewise.
1968 * pt.cc (has_value_dependent_address): Likewise.
1969 (push_tinst_level_loc): Likewise.
1970 * semantics.cc (finish_omp_clauses): Likewise.
1971 (finish_omp_atomic): Likewise.
1972 * tree.cc (cp_save_expr): Likewise.
1973 (cp_free_lang_data): Likewise.
1974 * typeck.cc (cp_common_type): Likewise.
1975 (strip_array_domain): Likewise.
1976 (rationalize_conditional_expr): Likewise.
1977 (check_return_expr): Likewise.
1978 * vtable-class-hierarchy.cc: Likewise.
1980 2022-01-17 Martin Liska <mliska@suse.cz>
1982 * call.c: Moved to...
1984 * class.c: Moved to...
1985 * class.cc: ...here.
1986 * constexpr.c: Moved to...
1987 * constexpr.cc: ...here.
1988 * cp-gimplify.c: Moved to...
1989 * cp-gimplify.cc: ...here.
1990 * cp-lang.c: Moved to...
1991 * cp-lang.cc: ...here.
1992 * cp-objcp-common.c: Moved to...
1993 * cp-objcp-common.cc: ...here.
1994 * cp-ubsan.c: Moved to...
1995 * cp-ubsan.cc: ...here.
1996 * cvt.c: Moved to...
1998 * cxx-pretty-print.c: Moved to...
1999 * cxx-pretty-print.cc: ...here.
2000 * decl.c: Moved to...
2002 * decl2.c: Moved to...
2003 * decl2.cc: ...here.
2004 * dump.c: Moved to...
2006 * error.c: Moved to...
2007 * error.cc: ...here.
2008 * except.c: Moved to...
2009 * except.cc: ...here.
2010 * expr.c: Moved to...
2012 * friend.c: Moved to...
2013 * friend.cc: ...here.
2014 * g++spec.c: Moved to...
2015 * g++spec.cc: ...here.
2016 * init.c: Moved to...
2018 * lambda.c: Moved to...
2019 * lambda.cc: ...here.
2020 * lex.c: Moved to...
2022 * mangle.c: Moved to...
2023 * mangle.cc: ...here.
2024 * method.c: Moved to...
2025 * method.cc: ...here.
2026 * name-lookup.c: Moved to...
2027 * name-lookup.cc: ...here.
2028 * optimize.c: Moved to...
2029 * optimize.cc: ...here.
2030 * parser.c: Moved to...
2031 * parser.cc: ...here.
2034 * ptree.c: Moved to...
2035 * ptree.cc: ...here.
2036 * rtti.c: Moved to...
2038 * search.c: Moved to...
2039 * search.cc: ...here.
2040 * semantics.c: Moved to...
2041 * semantics.cc: ...here.
2042 * tree.c: Moved to...
2044 * typeck.c: Moved to...
2045 * typeck.cc: ...here.
2046 * typeck2.c: Moved to...
2047 * typeck2.cc: ...here.
2048 * vtable-class-hierarchy.c: Moved to...
2049 * vtable-class-hierarchy.cc: ...here.
2051 2022-01-17 Jakub Jelinek <jakub@redhat.com>
2054 * cp-gimplify.c (cp_genericize_target_expr): Set DECL_CONTEXT of
2055 TARGET_EXPR_SLOT to current_function_decl if it was NULL.
2057 2022-01-17 Andrew Stubbs <ams@codesourcery.com>
2059 * parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.
2061 2022-01-14 Chung-Lin Tang <cltang@codesourcery.com>
2064 * semantics.c (finish_omp_clauses): Also continue peeling off of
2065 outer node for ARRAY_REFs.
2067 2022-01-14 Jakub Jelinek <jakub@redhat.com>
2070 * cp-objcp-common.c (cxx_block_may_fallthru) <case IF_STMT>: For
2071 IF_STMT_CONSTEXPR_P with constant false or true condition only
2072 check if the taken clause may fall through.
2073 * cp-gimplify.c (genericize_if_stmt): For consteval if, revert
2074 to r12-5638^ behavior if then_ block can't fall through. For
2075 constexpr if, revert to r12-5638^ behavior.
2077 2022-01-13 Anthony Sharp <anthonysharp15@gmail.com>
2078 Jason Merrill <jason@redhat.com>
2081 * parser.c (cp_parser_id_expression): Handle
2082 -Wmissing-template-keyword.
2083 (struct saved_token_sentinel): Add modes to control what happens
2085 (cp_parser_statement): Adjust.
2086 (cp_parser_skip_entire_template_parameter_list): New function that
2087 skips an entire template parameter list.
2088 (cp_parser_require_end_of_template_parameter_list): Rename old
2089 cp_parser_skip_to_end_of_template_parameter_list.
2090 (cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
2091 called from one of the above two functions.
2092 (cp_parser_lambda_declarator_opt)
2093 (cp_parser_explicit_template_declaration)
2094 (cp_parser_enclosed_template_argument_list): Adjust.
2096 2022-01-12 Jakub Jelinek <jakub@redhat.com>
2097 Jason Merrill <jason@redhat.com>
2100 * tree.c (move): If expr is xvalue_p, just return expr without
2103 2022-01-11 Jakub Jelinek <jakub@redhat.com>
2106 * class.c (build_vfn_ref): Build OBJ_TYPE_REF with INTEGER_CST
2107 OBJ_TYPE_REF_TOKEN with type equal to OBJ_TYPE_REF_OBJECT type.
2108 * error.c (resolve_virtual_fun_from_obj_type_ref): Use type of
2109 OBJ_TYPE_REF_TOKEN rather than type of OBJ_TYPE_REF_OBJECT as
2112 2022-01-11 Patrick Palka <ppalka@redhat.com>
2115 * call.c (build_new_method_call): Consider dependent bases only
2116 if 'this' is available.
2118 2022-01-11 Olivier Hainque <hainque@adacore.com>
2120 * decl.c (cxx_init_decl_processing): Move code possibly
2121 altering flag_weak before code testing it.
2123 2022-01-10 Patrick Palka <ppalka@redhat.com>
2126 * constexpr.c (cxx_fold_indirect_ref): Split out object/offset
2127 canonicalization step into a local lambda. Strengthen it to
2128 absorb more components at position 0. Use it before both calls
2129 to cxx_fold_indirect_ref_1.
2131 2022-01-10 Patrick Palka <ppalka@redhat.com>
2134 * call.c (cand_parms_match): Skip over 'this' when given one
2135 static and one non-static member function.
2137 2022-01-10 Jakub Jelinek <jakub@redhat.com>
2140 * semantics.c (expand_or_defer_fn): For immediate functions, set
2141 node->body_removed to true and clear analyzed, definition and
2143 * decl2.c (c_parse_final_cleanups): Ignore immediate functions for
2146 2022-01-08 Jakub Jelinek <jakub@redhat.com>
2149 * constexpr.c (cxx_maybe_fold_addr_pointer_plus): New function.
2150 (cxx_eval_binary_expression): Use it.
2152 2022-01-08 Jason Merrill <jason@redhat.com>
2155 * init.c (build_vec_init): Remove assert.
2156 * tree.c (build_vec_init_expr): Likewise.
2158 2022-01-08 Jason Merrill <jason@redhat.com>
2161 * call.c (build_op_delete_call): Ignore destroying delete
2164 2022-01-07 Jason Merrill <jason@redhat.com>
2167 * init.c (build_new_1): Also build pointer cleanup if
2169 * cp-tree.h (TYPE_GETS_VEC_DELETE): New.
2171 2022-01-07 Jason Merrill <jason@redhat.com>
2175 * cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling.
2177 2022-01-07 Jason Merrill <jason@redhat.com>
2180 * init.c (perform_target_ctor): Select destructor by in_chrg.
2182 2022-01-07 Jason Merrill <jason@redhat.com>
2185 * except.c (in_nested_catch): New.
2186 (expand_end_catch_block): Check it.
2188 2022-01-07 Jason Merrill <jason@redhat.com>
2192 * except.c (maybe_splice_retval_cleanup): Check
2193 current_binding_level.
2194 * semantics.c (do_poplevel): Call it here.
2195 * parser.c (cp_parser_compound_statement): Not here.
2197 2022-01-07 Jason Merrill <jason@redhat.com>
2200 * decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
2201 cleanups from set_up_extended_ref_temp.
2202 (wrap_temporary_cleanups): Ignore array cleanups.
2203 (initialize_local_var): Don't check for array here.
2204 * cp-tree.h (BIND_EXPR_VEC_DTOR): New.
2205 * init.c (build_vec_delete_1): Set it.
2207 2022-01-07 Jason Merrill <jason@redhat.com>
2210 * init.c (build_vec_delete_1): Handle throwing dtor.
2211 (build_vec_init): Tell it we're in a cleanup already.
2213 2022-01-07 Jason Merrill <jason@redhat.com>
2215 * typeck2.c (split_nonconstant_init_1): Don't cleanup the last elt.
2216 (split_nonconstant_init): Adjust.
2218 2022-01-07 Jason Merrill <jason@redhat.com>
2222 * constexpr.c (replace_decl): Rename from replace_result_decl.
2223 * cp-tree.h (replace_decl): Declare it.
2224 * cp-gimplify.c (cp_gimplify_init_expr): Call it.
2225 (cp_gimplify_expr): Don't handle VEC_INIT_EXPR.
2226 (cp_genericize_init, cp_genericize_init_expr)
2227 (cp_genericize_target_expr): New.
2228 (cp_fold_r): Call them.
2229 * tree.c (build_array_copy): Add a TARGET_EXPR.
2230 * typeck2.c (digest_init_r): Look through a TARGET_EXPR.
2232 2022-01-07 Jason Merrill <jason@redhat.com>
2235 * decl.c (initialize_local_var): Fix comment.
2236 * init.c (build_new_1): Do stabilize array init.
2237 (build_vec_init): Use TARGET_EXPR for cleanup. Initialization
2238 of an element from an explicit initializer is not a
2240 * tree.c (expand_vec_init_expr): Pass flags through.
2241 * typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
2242 (split_nonconstant_init): Handle array cleanups.
2243 * cp-tree.h: Adjust.
2245 2022-01-07 Jason Merrill <jason@redhat.com>
2248 * decl.c (check_initializer): Remove obsolete comment.
2249 (wrap_cleanups_r): Don't wrap CLEANUP_EH_ONLY.
2250 (initialize_local_var): Change assert to test.
2251 * typeck2.c (maybe_push_temp_cleanup): New.
2252 (split_nonconstant_init_1): Use it.
2253 (split_nonconstant_init): Clear cleanup flags.
2255 2022-01-07 Jason Merrill <jason@redhat.com>
2258 * typeck2.c (PICFLAG_VEC_INIT): New.
2259 (process_init_constructor_array): Set it.
2260 (process_init_constructor): Handle it.
2261 (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
2262 * init.c (build_vec_init): Likewise.
2263 * cp-gimplify.c (cp_gimplify_expr): Factor out...
2264 * tree.c (expand_vec_init_expr): ...this function.
2265 (build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P.
2266 (build_vec_init_expr): Likewise.
2267 * constexpr.c (cxx_eval_vec_init): Likewise.
2268 (reduced_constant_expression_p): Check arrays before C++20.
2269 * cp-tree.h (expand_vec_init_expr): Declare.
2271 2022-01-07 Jason Merrill <jason@redhat.com>
2273 * init.c (build_new_1): Remove preevaluation code.
2275 2022-01-05 Nathan Sidwell <nathan@acm.org>
2277 * pt.c (instantiate_class_template_1): Process attribute((used)) set
2280 2022-01-05 Nathan Sidwell <nathan@acm.org>
2282 * init.c (build_new_1): Check complain before alignment warning.
2284 2022-01-04 Jason Merrill <jason@redhat.com>
2286 * cp-tree.h (class releasing_vec): Add begin/end fns.
2288 2022-01-04 Jason Merrill <jason@redhat.com>
2290 * init.c: Include -*- C++ -*- on first line.
2292 2022-01-03 Marek Polacek <polacek@redhat.com>
2295 * parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
2298 2022-01-03 Marek Polacek <polacek@redhat.com>
2300 * parser.c (make_char_string_pack): Add a cast to const unsigned
2303 2022-01-03 Jakub Jelinek <jakub@redhat.com>
2306 * rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
2307 to DECL_TINFO_P VAR_DECLs.
2309 2022-01-02 Jason Merrill <jason@redhat.com>
2311 * init.c (build_vec_init): Append the decrement to elt_init.
2313 2022-01-02 Jason Merrill <jason@redhat.com>
2315 * decl.c (wrap_cleanups_r): Don't wrap if noexcept.
2318 Copyright (C) 2022 Free Software Foundation, Inc.
2320 Copying and distribution of this file, with or without modification,
2321 are permitted in any medium without royalty provided the copyright
2322 notice and this notice are preserved.