1 2022-07-01 Lewis Hyatt <lhyatt@gmail.com>
3 * parser.cc (cp_token_is_module_directive): New function
4 refactoring common code.
5 (cp_parser_skip_to_closing_parenthesis_1): Use the new function.
6 (cp_parser_skip_to_end_of_statement): Likewise.
7 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
8 (cp_parser_declaration): Likewise.
10 2022-07-01 Marek Polacek <polacek@redhat.com>
13 * constexpr.cc (cxx_eval_conditional_expression): Strip TARGET_EXPRs.
15 2022-07-01 Tobias Burnus <tobias@codesourcery.com>
17 * parser.cc (cp_parser_omp_target_enter_data,
18 cp_parser_omp_target_exit_data): Accept tofrom
19 map-type modifier but use 'to' / 'from' internally.
21 2022-07-01 Marek Polacek <polacek@redhat.com>
24 * parser.cc (cp_lexer_get_preprocessor_token): Also warn about
25 RID_ALIGNOF, RID_ALIGNAS, RID_THREAD.
27 2022-07-01 Jason Merrill <jason@redhat.com>
30 * call.cc (resolve_args): Use complain.
32 2022-07-01 Jason Merrill <jason@redhat.com>
34 * parser.cc (missing_template_diag): Split out...
35 (cp_parser_id_expression): ...from here.
37 2022-07-01 Jason Merrill <jason@redhat.com>
40 * parser.cc (missing_template_diag): Factor out...
41 (cp_parser_id_expression): ...from here.
42 (cp_parser_lookup_name): Don't look in dependent object_type.
44 2022-06-30 Nathan Sidwell <nathan@acm.org>
46 * module.cc (module_state::write_define): Drop located param.
47 (module_state::read_define): Likewise.
48 (module_state::prepare_macros): New, broken out of ...
49 (module_state::write_macros): ... here. Adjust.
50 (module_state::write_begin): Adjust.
52 2022-06-29 Nathan Sidwell <nathan@acm.org>
54 * module.cc (macro_info, macro_traits, macro_table,
55 macro_remap): Rename to ...
56 (macro_loc_info, macro_loc_traits, macro_loc_table,
57 macro_loc_remap): ... these. Update all uses.
58 (module_state::write_prepare_maps): Remove unneeded macro checking.
59 (module_state::write_begin): Free macro_loc_remap.
61 2022-06-27 Sergei Trofimovich <siarheit@google.com>
64 * mapper-client.cc: Include <memory> via "system.h".
65 * mapper-resolver.cc: Ditto.
68 2022-06-27 David Malcolm <dmalcolm@redhat.com>
70 * cxx-pretty-print.h: Add "final" and "override" to various vfunc
71 implementations, removing redundant "virtual" as appropriate.
72 * module.cc: Likewise.
74 2022-06-24 Jason Merrill <jason@redhat.com>
78 * class.cc (warn_hidden): Handle -Woverloaded-virtual=1.
80 2022-06-24 Alexandre Oliva <oliva@adacore.com>
82 * g++spec.cc (lang_specific_driver): Implement -nostdlib++.
84 2022-06-23 Jason Merrill <jason@redhat.com>
87 * call.cc (build_aggr_conv): Don't depend on
88 CONSTRUCTOR_IS_DESIGNATED_INIT.
90 2022-06-23 Jason Merrill <jason@redhat.com>
93 * decl.cc (reshape_init_array_1): Set
94 CONSTRUCTOR_IS_DESIGNATED_INIT here.
95 (reshape_init_class): And here.
96 (reshape_init): Not here.
98 2022-06-23 Patrick Palka <ppalka@redhat.com>
101 * expr.cc (fold_for_warn): Don't fold when in an unevaluated
104 2022-06-23 Patrick Palka <ppalka@redhat.com>
107 * pt.cc (lookup_template_class): After calling complete_type for
108 the substituted context, check the table again iff the type was
109 previously incomplete and complete_type made it complete.
111 2022-06-23 Jason Merrill <jason@redhat.com>
114 * pt.cc (dependent_operand_p): Split out from...
115 (tsubst_copy_and_build): ...here.
116 (tsubst_expr) [IF_STMT]: Use it.
117 * semantics.cc (finish_if_stmt_cond): Keep the pre-conversion
118 condition in the template tree.
120 2022-06-23 Jason Merrill <jason@redhat.com>
123 * pt.cc (tsubst_copy_and_build): Also suppress -Waddress for
124 comparison of dependent operands.
126 2022-06-23 Nathan Sidwell <nathan@acm.org>
128 * module.cc (struct macro_info): New.
129 (struct macro_traits): New.
130 (macro_remap, macro_table): New globals.
131 (depset::hash::find_dependencies): Note namespace location.
132 (module_for_macro_loc): Adjust.
133 (module_state::note_location): New.
134 (module_state::Write_location): Note location when not
135 streaming. Adjust macro location streaming.
136 (module_state::read_location): Adjust macro location
138 (module_state::write_init_maps): New.
139 (module_state::write_prepare_maps): Reimplement macro map
141 (module_state::write_macro_maps): Reimplement.
142 (module_state::read_macro_maps): Likewise.
143 (module_state::write_begin): Adjust.
145 2022-06-23 Jason Merrill <jason@redhat.com>
147 * pt.cc (type_unification_real): An auto tparm can't
148 be affected by other deductions.
150 2022-06-23 Jason Merrill <jason@redhat.com>
153 * pt.cc (type_dependent_expression_p): Look through BASELINK.
155 2022-06-22 Jason Merrill <jason@redhat.com>
158 * name-lookup.cc (outer_binding): Strip BASELINK.
160 2022-06-22 Nathan Sidwell <nathan@acm.org>
162 * module.cc (struct duplicate_hash): Remove.
163 (duplicate_hash_map): Adjust.
165 2022-06-22 Jason Merrill <jason@redhat.com>
168 * constexpr.cc (cxx_eval_builtin_function_call): Handle
169 unreachable/trap earlier.
170 * cp-gimplify.cc (cp_maybe_instrument_return): Use
171 build_builtin_unreachable.
173 2022-06-18 Jakub Jelinek <jakub@redhat.com>
175 * cp-ubsan.cc (cp_ubsan_instrument_vptr_p): Use
176 flag_sanitize_trap & SANITIZE_VPTR instead of
177 flag_sanitize_undefined_trap_on_error.
179 2022-06-17 Jakub Jelinek <jakub@redhat.com>
182 * typeck.cc (build_x_shufflevector): Use fold_non_dependent_expr
183 instead of maybe_constant_value.
185 2022-06-16 Nathan Sidwell <nathan@acm.org>
187 * decl2.cc (finish_objects): Add startp parameter, adjust.
188 (generate_ctor_or_dtor_function): Detect empty fn, and don't
189 generate unnecessary code. Remove objc startup here ...
190 (c_parse_final_cleanyps): ... do it here.
192 2022-06-16 Martin Liska <mliska@suse.cz>
194 * decl2.cc (struct priority_map_traits): Remove unused param.
196 2022-06-15 Nathan Sidwell <nathan@acm.org>
198 * module.cc (module_state::write_readme): Use less confusing
199 importable unit names.
201 2022-06-14 Nathan Sidwell <nathan@acm.org>
203 * cp-tree.h (fini_modules): Add has_inits parm.
204 * decl2.cc (c_parse_final_cleanups): Check for
205 inits, adjust fini_modules flags.
206 * module.cc (module_state): Rename call_init_p to
208 (module_state::write_config): Write active_init.
209 (module_state::read_config): Read it.
210 (module_determine_import_inits): Clear active_init_p
212 (late_finish_module): Add has_init parm. Record it.
213 (fini_modules): Adjust.
215 2022-06-13 Nathan Sidwell <nathan@acm.org>
217 * module.cc (module_state::write): Separate to ...
218 (module_state::write_begin, module_state::write_end): ...
220 (module_state::write_readme): Drop extensions parameter.
221 (struct module_processing_cookie): Add more fields.
222 (finish_module_processing): Adjust state writing call.
223 (late_finish_module): Call write_end.
225 2022-06-10 Patrick Palka <ppalka@redhat.com>
228 * decl.cc (typename_hasher::hash): Add extra overloads.
229 Use iterative_hash_object instead of htab_hash_pointer.
230 Hash TYPENAME_TYPE_FULLNAME instead of TYPE_IDENTIFIER.
231 (build_typename_type): Use typename_hasher::hash.
232 * pt.cc (spec_hasher::hash): Add two-parameter overload.
233 Set comparing_specializations around the call to
235 (iterative_hash_template_arg) <case TYPENAME_TYPE>:
236 When comparing_specializations, hash the TYPE_CONTEXT
237 and TYPENAME_TYPE_FULLNAME.
238 (tsubst_function_decl): Use spec_hasher::hash instead of
240 (tsubst_template_decl): Likewise.
241 (tsubst_decl): Likewise.
243 2022-06-10 Patrick Palka <ppalka@redhat.com>
245 * pt.cc (instantiate_template): Don't substitute the context
246 of the most general template if that of the partially
247 instantiated template is already non-dependent.
249 2022-06-10 Patrick Palka <ppalka@redhat.com>
251 * pt.cc (lookup_template_class): Remove dead stores to
252 context parameter. Don't substitute the context of the
253 most general template if that of the partially instantiated
254 template is already non-dependent. Check the specializations
255 table again after completing the context of a nested dependent
257 (tsubst_aggr_type) <case RECORD_TYPE>: Don't substitute
258 TYPE_CONTEXT or pass it to lookup_template_class.
259 (tsubst_decl) <case TYPE_DECL, case TYPE_DECL>: Avoid substituting
260 the TREE_TYPE for DECL_SELF_REFERENCE_P. Avoid template argument
261 substitution or coercion in some cases.
263 2022-06-10 Nathan Sidwell <nathan@acm.org>
265 * cp-tree.h (fini_modules): Add some parameters.
266 (finish_module_processing): Return an opaque pointer.
267 * decl2.cc (c_parse_final_cleanups): Propagate a cookie from
268 finish_module_processing to fini_modules.
269 * module.cc (struct module_processing_cookie): New.
270 (finish_module_processing): Return a heap-allocated cookie.
271 (late_finish_module): New. Finish out the module writing.
272 (fini_modules): Adjust.
274 2022-06-10 Nathan Sidwell <nathan@acm.org>
276 * cp-tree.h (module_has_import_init): Rename to ...
277 (module_determined_import_inits): ... here.
278 * decl2.cc (start_objects): Do not handle module initializers
280 (c_parse_final_cleanups): Generate a separate module
281 initializer calling function and add it to the list. Shrink
283 * module.cc (num_init_calls_needed): Delete.
284 (module_has_import_init): Rename to ...
285 (module_determined_import_inits): ... here. Do the
287 (finish_module_processing): ... rather than here.
288 (module_add_import_initializers): Reformat.
290 2022-06-09 Jakub Jelinek <jakub@redhat.com>
293 * constexpr.cc (cxx_eval_bit_field_ref): For BIT_FIELD_REF with
294 non-integral result type use fold_ternary too like for BIT_FIELD_REFs
295 from VECTOR_CST. If fold_ternary returns NULL, diagnose non-constant
296 expression, set *non_constant_p and return t, instead of returning
299 2022-06-09 Nathan Sidwell <nathan@acm.org>
301 * cp-tree.h (module_initializer_kind): Replace with ...
302 (module_global_init_needed, module_has_import_inits): ...
304 * decl2.cc (start_objects): Add has_body parm. Reorganize
305 module initializer creation.
306 (generate_ctor_or_dtor_function): Adjust.
307 (c_parse_final_cleanups): Adjust.
308 (vtv_start_verification_constructor_init_function): Adjust.
309 * module.cc (module_initializer_kind): Replace with ...
310 (module_global_init_needed, module_has_import_inits): ...
313 2022-06-08 Jason Merrill <jason@redhat.com>
316 * decl.cc (duplicate_decls): Change non-templated friend
318 * pt.cc (tsubst_function_decl): Don't set DECL_TEMPLATE_INFO
319 on non-templated friends.
320 (tsubst_friend_function): Adjust.
322 2022-06-08 Jason Merrill <jason@redhat.com>
326 * decl.cc (duplicate_decls): Avoid copying template info
327 from non-templated friend even if newdecl isn't a definition.
328 Correct handling of DECL_UNIQUE_FRIEND_P on templates.
329 * pt.cc (non_templated_friend_p): New.
330 * cp-tree.h (non_templated_friend_p): Declare it.
332 2022-06-08 Nathan Sidwell <nathan@acm.org>
334 * decl2.cc (struct priority_info_s, priority_info): Delete.
335 (priority_map_traits, priority_map_t): New.
336 (static_init_fini_fns): New.
337 (INITIALIZE_P_IDENTIFIER, PRIORITY_IDENTIFIER): Delete.
338 (initialize_p_decl, priority_decl): Delete.
339 (ssdf_decls, priority_info_map): Delete.
340 (start_static_storage_duration_function): Rename to ...
341 (start_partial_init_fini_fn): ... here. Create a void arg fn.
342 Add it to the slot in the appropriate static_init_fini_fns
344 (finish_static_storage_duration_function): Rename to ...
345 (finish_partial_init_fini_fn): ... here.
346 (get_priority_info): Delete.
347 (one_static_initialization_or_destruction): Assert not
349 (do_static_initialization_or_destruction): Rename to ...
350 (emit_partial_init_fini_fn) ... here. Start & finish the fn.
351 Simply init/fini each var.
352 (partition_vars_for_init_fini): Partition vars according to
353 priority and add to init and/or fini list.
354 (generate_ctor_or_dtor_function): Start and finish the function.
355 Do santitizer calls here.
356 (generate_ctor_and_dtor_functions_for_priority): Delete.
357 (c_parse_final_cleanups): Reimplement global init/fini
360 2022-06-07 Jakub Jelinek <jakub@redhat.com>
362 * parser.cc (cp_parser_omp_clause_linear): Parse OpenMP 5.2
363 style linear clause modifiers. Set
364 OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER flag on the clauses when
365 old style modifiers are used.
366 * semantics.cc (finish_omp_clauses): Only reject linear clause
367 with val modifier on simd or for if the old style modifiers are
370 2022-06-07 Roger Sayle <roger@nextmovesoftware.com>
373 * decl.cc (start_enum): When emitting a "must be integral" error,
374 set ENUM_UNDERLYING_TYPE to integer_type_node, to avoid an ICE
375 downstream in build_enumeration.
377 2022-06-06 Patrick Palka <ppalka@redhat.com>
381 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Look through an
382 ADDR_EXPR callee when calling mark_used.
384 2022-06-04 Marek Polacek <polacek@redhat.com>
388 * parser.cc (cp_parser_attributes_opt): Accept GNU attributes
389 followed by [[]] attributes and vice versa.
391 2022-06-03 Patrick Palka <ppalka@redhat.com>
394 * typeck.cc (cp_build_binary_op): Don't fold operands
395 when c_inhibit_evaluation_warnings.
397 2022-06-03 Jason Merrill <jason@redhat.com>
400 * decl.cc (duplicate_decls): Don't copy DECL_TEMPLATE_INFO
401 from a hidden friend.
403 2022-06-03 Patrick Palka <ppalka@redhat.com>
406 * tree.cc (maybe_dummy_object): When returning a dummy
407 object, respect the cv-quals of 'this' if available.
409 2022-06-03 Patrick Palka <ppalka@redhat.com>
412 * pt.cc (determine_specialization): Compare overall constraints
413 not just the trailing constraints.
414 (tsubst_each_template_parm_constraints): Define.
415 (tsubst_friend_function): Use it.
416 (tsubst_friend_class): Use it.
417 (tsubst_template_parm): Don't substitute TEMPLATE_PARM_CONSTRAINTS.
419 2022-06-03 Patrick Palka <ppalka@redhat.com>
422 * pt.cc (for_each_template_parm_r) <case FUNCTION_DECL, VAR_DECL>:
423 Don't walk DECL_CONTEXT.
424 <case PARM_DECL>: Likewise. Walk TREE_TYPE.
425 <case CONST_DECL>: Simplify.
426 (any_template_parm_r) <case PARM_DECL>: Don't walk TREE_TYPE.
428 2022-06-02 Marek Polacek <polacek@redhat.com>
430 * constexpr.cc (potential_constant_expression_1): Treat
431 {,VEC_}NEW_EXPR and {,VEC_}DELETE_EXPRas potentially constant in C++20.
433 2022-06-02 Marek Polacek <polacek@redhat.com>
436 * pt.cc (value_dependent_expression_p): Handle {,VEC_}NEW_EXPR
439 2022-06-02 David Malcolm <dmalcolm@redhat.com>
441 * cp-lang.cc (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
442 (cp_get_sarif_source_language): New.
444 2022-06-02 Jason Merrill <jason@redhat.com>
447 * constexpr.cc (init_subob_ctx): Clear ctx->ctor for empty subob.
448 (cxx_eval_store_expression): Likewise.
449 (cxx_eval_bare_aggregate): Handle null ctx->ctor.
451 2022-06-02 Jason Merrill <jason@redhat.com>
454 * constexpr.cc (cxx_eval_bare_aggregate): Always call
457 2022-06-01 Jason Merrill <jason@redhat.com>
460 * parser.cc (cp_parser_postfix_dot_deref_expression): Use typeof
461 if the expression has auto type.
463 2022-06-01 Jason Merrill <jason@redhat.com>
466 * call.cc (resolve_args): Call mark_single_function here.
467 * pt.cc (unify_one_argument): Not here.
469 2022-06-01 Nathan Sidwell <nathan@acm.org>
471 * decl2.cc (fix_temporary_vars_context_r): Use data argument
473 (one_static_initialization_or_destruction): Adjust tree walk
474 call. Refactor guard generation.
476 2022-06-01 Nathan Sidwell <nathan@acm.org>
478 * decl2.cc (ssdf_decl): Delete global.
479 (start_static_storage_duration_function): Use some RAII.
480 (do_static_initialization_or_destruction): Likewise.
481 (c_parse_final_cleanups): Likewise. Avoid rechecking 'vars'.
483 2022-06-01 Nathan Sidwell <nathan@acm.org>
485 * decl2.cc (start_objects): Replace 'method_type' parameter
486 with 'initp' boolean, rename and retype 'priority' parameter.
487 (finish_objects): Likewise. Do not expand here.
488 (one_static_initialization_or_destruction): Move 'initp'
490 (do_static_initialization_or_destruction): Likewise.
491 (generate_ctor_or_dtor_function): Rename 'initp' parameter.
492 Adjust start_objects/finish_obects calls and expand here.
493 (generate_ctor_and_dtor_functions_for_priority): Adjust calls.
494 (c_parse_final_cleanups): Likewise.
495 (vtv_start_verification_constructor_init): Adjust.
496 (vtv_finish_verification_constructor_init): Use finish_objects.
498 2022-05-31 Patrick Palka <ppalka@redhat.com>
501 * call.cc (build_over_call): Use z_candidate::conversion_path
502 and ::access_path instead of TYPE_BINFO when building the
503 BASELINK for the templated form.
505 2022-05-31 Patrick Palka <ppalka@redhat.com>
507 * parser.cc: Use auto_timevar instead of timevar_push/pop.
508 Remove wrapper functions.
511 2022-05-31 Patrick Palka <ppalka@redhat.com>
513 * cp-tree.h (cp_build_qualified_type_real): Rename to ...
514 (cp_build_qualified_type): ... this. Give its last parameter
515 a default argument. Remove macro of the same name.
516 * decl.cc (grokdeclarator): Adjust accordingly.
517 * pt.cc (tsubst_aggr_type): Likewise.
518 (rebuild_function_or_method_type): Likewise.
520 (maybe_dependent_member_ref): Likewise.
522 * tree.cc (cp_build_qualified_type_real): Rename to ...
523 (cp_build_qualified_type): ... this. Adjust accordingly.
525 2022-05-31 Jason Merrill <jason@redhat.com>
527 * Make-lang.in (c++.tags): Just look at *.cc.
529 2022-05-31 Patrick Palka <ppalka@redhat.com>
531 * cp-tree.h (comp_template_args): Change return type to bool.
532 * pt.cc (comp_template_args): Document default arguments.
533 Change return type to bool and adjust returns accordingly.
535 2022-05-31 Patrick Palka <ppalka@redhat.com>
537 * decl.cc (grokvardecl): Use current_template_constraints.
538 (grokdeclarator): Likewise.
539 (xref_tag): Likewise.
540 * semantics.cc (finish_template_template_parm): Likewise.
542 2022-05-31 Jakub Jelinek <jakub@redhat.com>
544 * parser.cc (OMP_SCOPE_CLAUSE_MASK): Add firstprivate and allocate
547 2022-05-30 Marek Polacek <polacek@redhat.com>
550 * pt.cc (type_dependent_expression_p): Assert !TYPE_P.
551 * semantics.cc (finish_id_expression_1): Handle UNBOUND_CLASS_TEMPLATE
554 2022-05-28 Jakub Jelinek <jakub@redhat.com>
556 * parser.cc (handle_omp_declare_target_clause): If OMP_CLAUSE_LINK was
557 seen first, use "%<to%>" or "%<enter%>" depending on
558 OMP_CLAUSE_ENTER_TO of the current clause, otherwise use
559 "%<to%> or %<enter%>" wording.
561 2022-05-28 Jason Merrill <jason@redhat.com>
564 * pt.cc (tsubst_lambda_expr): Don't let a namespace-scope lambda
565 instantiate into a class-scope lambda.
567 2022-05-27 Marek Polacek <polacek@redhat.com>
570 * parser.cc (class_decl_loc_t::add): Check CLASS_TYPE_P.
572 2022-05-27 Jakub Jelinek <jakub@redhat.com>
574 * parser.cc (cp_parser_omp_clause_name): Parse enter clause.
575 (cp_parser_omp_all_clauses): For to clause on declare target, use
576 OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of
577 OMP_CLAUSE_TO_DECLARE clause. Handle PRAGMA_OMP_CLAUSE_ENTER.
578 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause.
579 (cp_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of
580 OMP_CLAUSE_TO_DECLARE.
581 * semantics.cc (finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead
582 of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause
583 name in diagnostics instead of
584 omp_clause_code_name[OMP_CLAUSE_CODE (c)].
586 2022-05-26 Marek Polacek <polacek@redhat.com>
589 * typeck.cc (warn_for_null_address): Improve the warning when
590 the POINTER_PLUS_EXPR's base is of reference type.
592 2022-05-26 Patrick Palka <ppalka@redhat.com>
595 * decl.cc (shadow_tag): Use the return value of
596 maybe_process_partial_specialization.
597 * parser.cc (cp_parser_single_declaration): Call shadow_tag
598 before associate_classtype_constraints.
599 * pt.cc (maybe_new_partial_specialization): Change return type
600 to bool. Take 'type' argument by mutable reference. Set 'type'
601 to point to the correct constrained specialization when
603 (maybe_process_partial_specialization): Adjust accordingly.
605 2022-05-25 Marek Polacek <polacek@redhat.com>
608 * cp-tree.h (attr_chainon): Declare.
609 * decl.cc (start_decl): Use attr_chainon.
610 (grokdeclarator): Likewise.
611 * parser.cc (cp_parser_statement): No longer static.
613 2022-05-25 Jason Merrill <jason@redhat.com>
616 * pt.cc (build_template_decl): Add assert.
617 (tsubst_function_decl): Don't return a template.
619 2022-05-25 Jason Merrill <jason@redhat.com>
622 * decl2.cc (mark_used): Copy type from fn to BASELINK.
623 * pt.cc (unify_one_argument): Call mark_single_function.
625 2022-05-25 Jason Merrill <jason@redhat.com>
627 * constexpr.cc (cxx_eval_call_expression): Check for
628 heap vars in the result.
630 2022-05-25 Jason Merrill <jason@redhat.com>
632 * constexpr.cc (maybe_constant_init_1): Only pass false for
633 strict when initializing a variable of static duration.
635 2022-05-25 Marek Polacek <polacek@redhat.com>
638 * typeck2.cc (potential_prvalue_result_of): New.
639 (replace_placeholders_for_class_temp_r): New.
640 (digest_nsdmi_init): Call it.
642 2022-05-24 Jason Merrill <jason@redhat.com>
644 * constexpr.cc (cxx_fold_indirect_ref): Add default arg.
645 (cxx_eval_call_expression): Call it.
646 (cxx_fold_indirect_ref_1): Handle null empty_base.
648 2022-05-24 Jason Merrill <jason@redhat.com>
650 * constexpr.cc (enum value_cat): New. Change all 'lval' parameters
651 from int to value_cat. Change most false to vc_prvalue, most true
652 to vc_glvalue, cases where the return value is ignored to
654 (cxx_eval_statement_list): Only vc_prvalue for stmt-expr result.
655 (cxx_eval_store_expression): Only build _REF for vc_glvalue.
656 (cxx_eval_array_reference, cxx_eval_component_reference)
657 (cxx_eval_indirect_ref, cxx_eval_constant_expression): Likewise.
659 2022-05-24 Jason Merrill <jason@redhat.com>
662 * constexpr.cc (cxx_eval_store_expression): Adjust assert.
663 Use initialized_type.
665 2022-05-24 Patrick Palka <ppalka@redhat.com>
667 * cp-tree.h (any_template_arguments_need_structural_equality_p):
669 * pt.cc (struct ctp_hasher): Define.
671 (canonical_type_parameter): Use it.
672 (process_template_parm): Set TYPE_CANONICAL for
673 TEMPLATE_TEMPLATE_PARM too.
674 (lookup_template_class_1): Remove now outdated comment for the
675 any_template_arguments_need_structural_equality_p test.
676 (tsubst) <case TEMPLATE_TEMPLATE_PARM, etc>: Don't specifically
677 clear TYPE_CANONICAL for ttps. Set TYPE_CANONICAL on the
678 substituted type later.
679 (any_template_arguments_need_structural_equality_p): Return
680 true for any_targ_node. Don't return true just because a
681 template argument uses structural equality. Add comment for
682 the PARM_DECL special case.
683 (rewrite_template_parm): Set TYPE_CANONICAL on the rewritten
685 * tree.cc (bind_template_template_parm): Set TYPE_CANONICAL
687 * typeck.cc (structural_comptypes) [check_alias]: Increment
688 processing_template_decl before checking
689 dependent_alias_template_spec_p.
691 2022-05-24 Jakub Jelinek <jakub@redhat.com>
694 * parser.cc (OMP_TASKWAIT_CLAUSE_MASK): Add nowait clause.
696 2022-05-20 David Malcolm <dmalcolm@redhat.com>
698 * cxx-pretty-print.h: Replace uses of "FINAL" and "OVERRIDE" with
699 "final" and "override".
700 * error.cc: Likewise.
702 2022-05-18 Marek Polacek <polacek@redhat.com>
705 * call.cc (maybe_warn_class_memaccess): Avoid % by zero.
707 2022-05-17 Jason Merrill <jason@redhat.com>
710 * decl.cc (check_initializer): Use build_cplus_new in case of
713 2022-05-17 Jakub Jelinek <jakub@redhat.com>
715 * parser.cc (cp_parser_omp_clause_depend): Parse
716 inoutset depend-kind.
717 (cp_parser_omp_depobj): Likewise.
718 * cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle
719 OMP_CLAUSE_DEPEND_INOUTSET.
721 2022-05-16 Martin Liska <mliska@suse.cz>
723 * module.cc (depset::entity_kind_name): Use ARRAY_SIZE.
724 * name-lookup.cc (get_std_name_hint): Likewise.
725 * parser.cc (cp_parser_new): Likewise.
727 2022-05-16 Marcel Vollweiler <marcel@codesourcery.com>
729 * pt.cc (tsubst_omp_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR.
730 * semantics.cc (finish_omp_clauses): Added template decl processing.
732 2022-05-15 Jason Merrill <jason@redhat.com>
736 * friend.cc (is_friend): Hidden friends count as members.
737 * search.cc (friend_accessible_p): Likewise.
739 2022-05-15 Jason Merrill <jason@redhat.com>
741 * parser.cc (cp_parser_template_name): Look through
744 2022-05-15 Jason Merrill <jason@redhat.com>
749 * init.cc (build_value_init): Handle class in template.
751 2022-05-13 Nathan Sidwell <nathan@acm.org>
753 * mangle.cc (maybe_write_module): Check external linkage.
755 2022-05-13 Richard Biener <rguenther@suse.de>
757 * constexpr.cc: Remove gimple-fold.h include.
759 2022-05-12 Patrick Palka <ppalka@redhat.com>
761 * cp-tree.h (TMPL_ARGS_LEVEL): Assert LEVEL is 1 when
762 TMPL_ARGS_HAVE_MULTIPLE_LEVELS is false.
763 * pt.cc (try_class_unification): Correctly copy multidimensional
764 targs. Free the copy of targs.
765 (unify_pack_expansion): Fix level comparison.
767 2022-05-12 Nathan Sidwell <nathan@acm.org>
769 * parser.cc (cp_parser_linkage_specification): Implement
770 global module attachment semantics.
772 2022-05-12 Jakub Jelinek <jakub@redhat.com>
774 * lex.cc (init_reswords): Register omp_all_memory as keyword
776 * parser.cc (cp_parser_primary_expression): Diagnose uses of
777 omp_all_memory in postfix expressions.
778 (cp_parser_omp_var_list_no_open): Handle omp_all_memory in depend
780 * semantics.cc (finish_omp_clauses): Handle omp_all_memory
781 keyword in depend clause as null_pointer_node, diagnose invalid
783 * pt.cc (tsubst_omp_clause_decl): Pass through omp_all_memory.
785 2022-05-11 Patrick Palka <ppalka@redhat.com>
787 * constraint.cc (tsubst_parameter_mapping): Convert loop over
788 TREE_VEC into a range-based for loop using tree_vec_range.
789 * pt.cc (iterative_hash_template_arg): Likewise.
790 (template_parms_level_to_args): Likewise.
791 (deducible_template_args): Likewise.
792 (check_undeduced_parms): Likewise.
793 (dependent_type_p_r): Likewise.
794 (value_dependent_expression_p) <case NONTYPE_ARGUMENT_PACK>:
796 (dependent_template_arg_p): Likewise.
797 * tree.cc (cp_walk_subtrees) <case NONTYPE_ARGUMENT_PACK>:
800 2022-05-11 Jason Merrill <jason@redhat.com>
803 * cp-tree.h (TMPL_ARGS_DEPTH): 0 for null args.
804 * parser.cc (cp_parser_enclosed_template_argument_list):
805 Use 0-length TREE_VEC for <>.
807 2022-05-11 Jason Merrill <jason@redhat.com>
810 * typeck.cc (check_return_expr): Don't mess with ctor return value
811 while parsing a template.
813 2022-05-11 Nathan Sidwell <nathan@acm.org>
815 * cp-tree.h (DECL_MODULE_ATTACH_P): New.
816 (struct lang_decl_base): Add module_attach_p flag.
817 * decl.cc (duplicate_decls): Rework module redeclaration
819 * module.cc (trees_out::lang_decl_bools): Write attach flag.
820 (trees_in::lang_decl_bools): ... and read it back.
821 (trees_out::decl_value): Rework module attachment handling.
822 (trees_in::decl_value): Rename local var to reflect meaning.
823 (trees_in::key_mergeable): Likewise.
824 (get_originating_module): Use DECL_MODULE_ATTACH_P. No need
825 to special-case mangling.
826 (module_may_redeclare): Reimplement.
827 (set_originating_module): Deal with attachment.
828 * name-lookup.cc (maybe_record_mergeable_decl): Deal with
830 (mergeable_namespace_slots): Likewise.
831 (do_nonmember_using_decl): Likewise.
832 * name-lookup.h (mergeable_namespace_slots): Adjust parm
834 * ptree.cc (cxx_print_decl): Adjust purview & attach printing.
836 2022-05-11 Martin Liska <mliska@suse.cz>
839 * lang-specs.h: Use Separate syntax.
841 2022-05-10 Patrick Palka <ppalka@redhat.com>
843 * coroutines.cc (instantiate_coro_traits): Adjust accordingly.
844 * cp-tree.def: Remove mention of SET_PACK_EXPANSION_PATTERN.
845 * cp-tree.h (SET_PACK_EXPANSION_PATTERN): Remove.
846 (SET_ARGUMENT_PACK_ARGS): Remove.
847 * module.cc (trees_in::tree_node): Adjust accordingly.
848 * parser.cc (make_char_string_pack): Likewise.
849 (make_string_pack): Likewise.
850 * pt.cc (make_pack_expansion): Likewise.
851 (template_parm_to_arg): Likewise.
852 (coerce_template_parameter_pack): Likewise.
853 (extract_fnparm_pack): Likewise.
854 (extract_locals_r): Likewise.
855 (make_argument_pack): Likewise.
856 (tsubst_argument_pack): Likewise.
857 (lookup_init_capture_pack): Likewise.
858 (type_unification_real): Likewise.
859 (unify_pack_expansion): Likewise.
860 (tsubst_initializer_list): Likewise.
862 2022-05-10 Patrick Palka <ppalka@redhat.com>
864 * cp-tree.h (PACK_EXPANSION_CHECK): Define.
865 (PACK_EXPANSION_PATTERN): Use PACK_EXPANSION_CHECK.
866 (SET_PACK_EXPANSION_PATTERN): Likewise.
867 (PACK_EXPANSION_PARAMETER_PACKS): Likewise.
868 (PACK_EXPANSION_EXTRA_ARGS): Likewise.
869 (PACK_EXPANSION_LOCAL_P): Likewise.
870 (PACK_EXPANSION_SIZEOF_P): Likewise.
871 (PACK_EXPANSION_AUTO_P): Likewise.
872 (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): Likewise.
873 (ARGUMENT_PACK_CHECK): Define.
874 (ARGUMENT_PACK_ARGS): Use ARGUMENT_PACK_CHECK.
875 (SET_ARGUMENT_PACK_ARGS): Likewise.
876 * parser.cc (cp_parser_sizeof_pack): Check for error_mark_node
877 before setting PACK_EXPANSION_SIZEOF_P.
879 2022-05-10 Nathan Sidwell <nathan@acm.org>
881 * cp-tree.h (enum module_kind_bits): Disambiguate purview,
882 attach, named module vs header-unit.
883 (global_purview_p, not_module_p): Delete.
884 (named_module_p): New.
885 (header_module_p, module_purview_p): Adjust.
886 (module_attach_p, named_module_purview_p): New.
887 * decl.cc (duplicate_decls): Adjust.
888 * module.cc (declare_module, preprocessed_module): Adjust.
889 * name-lookup.cc (init_global_partition): Adjust.
890 (get_fixed_binding_slot, pushdecl): Adjust.
891 * parser.cc (cp_parser_module_declaration): Adjust.
892 (cp_parser_import_declaration, cp_parser_declaration): Adjust.
894 2022-05-10 Jason Merrill <jason@redhat.com>
897 * decl.cc (maybe_return_this): Replace...
898 (finish_constructor_body, finish_destructor_body): ...these.
899 (finish_function_body): Call it.
900 * optimize.cc (build_delete_destructor_body): Call it.
901 * cp-tree.h (maybe_return_this): Declare.
903 2022-05-09 Marek Polacek <polacek@redhat.com>
906 * parser.cc (cp_parser_statement): Constify the in_compound parameter.
907 Create a modifiable copy. Allow labels at the end of compound
910 2022-05-09 Patrick Palka <ppalka@redhat.com>
913 * call.cc (field_in_pset): Adjust after next_initializable_field
915 (build_aggr_conv): Likewise.
916 (convert_like_internal): Likewise.
917 (type_has_extended_temps): Likewise.
918 * class.cc (default_init_uninitialized_part): Likewise.
919 (finish_struct): Likewise.
920 * constexpr.cc (cx_check_missing_mem_inits): Likewise.
921 (reduced_constant_expression_p): Use next_subobject_field
923 * cp-gimplify.cc (get_source_location_impl_type): Adjust after
924 next_initializable_field renaming.
925 (fold_builtin_source_location): Likewise.
926 * cp-tree.h (next_initializable_field): Rename to ...
927 (next_aggregate_field): ... this.
928 (next_subobject_field): Declare.
929 * decl.cc (next_aggregate_field): Renamed from ...
930 (next_initializable_field): ... this. Skip over vptr fields
932 (next_subobject_field): Define.
933 (reshape_init_class): Adjust after next_initializable_field
935 * init.cc (build_value_init_noctor): Likewise.
936 (emit_mem_initializers): Likewise.
937 * lambda.cc (build_capture_proxy): Likewise.
938 * method.cc (build_comparison_op): Likewise.
939 * pt.cc (maybe_aggr_guide): Likewise.
940 * tree.cc (structural_type_p): Likewise.
941 * typeck2.cc (split_nonconstant_init_1): Likewise.
942 (digest_init_r): Likewise.
944 2022-05-09 Nathan Sidwell <nathan@acm.org>
946 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Renamed from
947 DECL_MODULE_ATTACHMENTS_P.
948 (struct lane_decl_base): Rename module_attached_p to
949 module_keyed_decls_p.
950 (maybe_key_decl): Renamed from maybe_attach_decl.
951 * lambda.cc (record_lambda_scope): Adjust.
952 * lex.cc (cxx_dup_lang_specific_decl): Adjust.
953 * module.cc (keyed_map_t, keyed_table): Renamed from attached_map_t,
955 (enum merge_kind): Rename MK_attached to MK_keyed.
956 (trees_out::lang_decl_bools): Adjust.
957 (trees_in::lang_decl_bools): Adjust.
958 (trees_in::decl_value): Adjust.
959 (trees_out::get_merge_kind): Adjust.
960 (trees_out::key_mergeable): Adjust.
961 (trees_in::key_mergeable): Adjust.
962 (maybe_key_decl): Rename from maybe_attach_decl.
963 (direct_import): Adjust.
964 (fini_modules): Adjust.
966 2022-05-09 Martin Liska <mliska@suse.cz>
968 * cp-gimplify.cc (cp_genericize_r): Use {,UN}LIKELY
970 * parser.cc (cp_finalize_omp_declare_simd): Likewise.
971 (cp_finalize_oacc_routine): Likewise.
973 2022-05-07 Marek Polacek <polacek@redhat.com>
977 * tree.cc (maybe_adjust_arg_pos_for_attribute): New.
979 2022-05-06 Jason Merrill <jason@redhat.com>
981 * error.cc (decl_to_string): Add show_color parameter.
982 (subst_to_string): Likewise.
983 (cp_printer): Pass it.
984 (type_to_string): Set pp_show_color.
985 (dump_function_name): Use "fnname" color.
986 (dump_template_bindings): Use "targs" color.
987 (struct colorize_guard): New.
988 (reinit_cxx_pp): Clear pp_show_color.
990 2022-05-06 Jason Merrill <jason@redhat.com>
994 * constexpr.cc (cxx_eval_store_expression): Reorganize empty base
997 2022-05-05 Marek Polacek <polacek@redhat.com>
1000 * parser.cc (cp_parser_parameter_declaration_clause): Maintain
1001 a vector of parameters that haven't been pushed yet. Push them at the
1002 end of a valid parameter-declaration-clause.
1003 (cp_parser_parameter_declaration_list): Take a new auto_vec parameter.
1004 Do not pushdecl while parsing tentatively when pushdecl-ing a parameter
1005 would result in a hard error.
1006 (cp_parser_cache_defarg): Adjust the call to
1007 cp_parser_parameter_declaration_list.
1009 2022-05-05 Richard Biener <rguenther@suse.de>
1011 * module.cc (trees_in::core_vals): Remove separate allocation
1014 2022-05-04 Jason Merrill <jason@redhat.com>
1017 * pt.cc (maybe_dependent_member_ref): Handle types.
1018 (tsubst, tsubst_copy): Use it.
1019 (tsubst_aggr_type, instantiate_alias_template): Don't handle
1022 2022-05-04 Patrick Palka <ppalka@redhat.com>
1025 * pt.cc (maybe_aggr_guide): Set processing_template_decl when
1026 partially instantiating the guide's parameter list.
1028 2022-05-04 Marek Polacek <polacek@redhat.com>
1031 * parser.cc (cp_parser_init_declarator): Properly handle a series of
1032 operator() calls, they are not part of an init-declarator.
1034 2022-05-04 Jason Merrill <jason@redhat.com>
1036 * decl.cc (reshape_init): Shortcut already-reshaped init.
1037 (reshape_init_class): Assert not getting one here.
1039 2022-05-04 Jason Merrill <jason@redhat.com>
1041 * error.cc (cp_print_error_function): Use %qD.
1042 (function_category): Use %qD.
1044 2022-05-04 Marek Polacek <polacek@redhat.com>
1047 * parser.cc (cp_parser_next_token_ends_template_argument_p): Don't
1048 return true for CPP_GREATER_EQ.
1050 2022-05-04 Jason Merrill <jason@redhat.com>
1052 * cp-tree.h (struct language_function): Remove x_cdtor_label.
1053 (cdtor_label, LABEL_DECL_CDTOR): Remove.
1054 * constexpr.cc (returns): Don't check LABEL_DECL_CDTOR.
1055 (cxx_eval_constant_expression): Don't call returns.
1056 * decl.cc (check_goto): Don't check cdtor_label.
1057 (start_preparsed_function): And don't set it.
1058 (finish_constructor_body, finish_destructor_body): Remove.
1059 (finish_function_body): Don't call them.
1060 * typeck.cc (check_return_expr): Handle cdtor_returns_this here.
1061 * semantics.cc (finish_return_stmt): Not here.
1063 2022-05-04 Jakub Jelinek <jakub@redhat.com>
1065 * lambda.cc: Include decl.h.
1066 (maybe_add_lambda_conv_op): Temporarily override deprecated_state to
1067 UNAVAILABLE_DEPRECATED_SUPPRESS.
1069 2022-05-03 Patrick Palka <ppalka@redhat.com>
1072 * cp-tree.h (finish_non_static_data_member): Add defaulted
1074 * pt.cc (tsubst_copy_and_build): Pass complain to
1075 finish_non_static_data_member.
1076 * semantics.cc (finish_non_static_data_member): Respect complain
1078 (finish_qualified_id_expr): Pass complain to
1079 finish_non_static_data_member.
1081 2022-05-02 Jason Merrill <jason@redhat.com>
1083 * pt.cc (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Copy location.
1084 (do_auto_deduction): Use expr location.
1086 2022-05-02 Jason Merrill <jason@redhat.com>
1088 * class.cc (maybe_note_name_used_in_class): Note in all enclosing
1089 classes. Remember location of use.
1090 (note_name_declared_in_class): Adjust.
1092 2022-05-02 Marek Polacek <polacek@redhat.com>
1094 * cp-tree.h (uses_template_parms): Adjust declaration.
1095 * pt.cc (uses_template_parms): Return bool. Use a RAII sentinel.
1097 2022-05-02 Richard Biener <rguenther@suse.de>
1099 * constexpr.cc (fold_simple_1): Use CASE_CONVERT.
1100 * cp-gimplify.cc (cp_fold): Likewise.
1101 * pt.cc (tsubst_copy): Likewise.
1103 2022-04-29 Jason Merrill <jason@redhat.com>
1107 * friend.cc (do_friend): Call check_explicit_specialization here.
1108 * decl.cc (grokdeclarator): Not here.
1109 * decl2.cc (check_classfn): Or here.
1111 2022-04-29 Jason Merrill <jason@redhat.com>
1114 * cp-tree.h (enum tsubst_flags): Add tf_dguide.
1115 * pt.cc (tsubst_aggr_type): Check it.
1116 (tsubst_baselink, tsubst_copy): Check it.
1117 (maybe_dependent_member_ref): Check it.
1118 (instantiate_alias_template): Handle it.
1119 (build_deduction_guide): Set it.
1121 2022-04-29 Jason Merrill <jason@redhat.com>
1124 * lambda.cc (type_deducible_expression_p): Allow more types.
1126 2022-04-29 Jason Merrill <jason@redhat.com>
1128 * decl.cc (cp_finish_decl): Only consider auto for vars.
1130 2022-04-29 Marek Polacek <polacek@redhat.com>
1133 * parser.cc (cp_parser_enum_specifier): Warn about empty unnamed enum
1134 only when it's followed by a semicolon.
1136 2022-04-29 Jason Merrill <jason@redhat.com>
1139 * decl.cc (cp_finish_decl): Check completeness of deduced type.
1141 2022-04-29 Jason Merrill <jason@redhat.com>
1144 * error.cc (dump_decl) [USING_DECL]: Respect flags.
1146 2022-04-29 Jason Merrill <jason@redhat.com>
1148 * error.cc (dump_decl): Check TFF_UNQUALIFIED_NAME.
1150 2022-04-29 Jakub Jelinek <jakub@redhat.com>
1153 * parser.cc (cp_parser_template_argument): Treat >= like C++98 >>
1154 after a type id by setting maybe_type_id and aborting tentative
1156 (cp_parser_enclosed_template_argument_list): Handle
1157 CPP_GREATER_EQ like misspelled CPP_GREATER CPP_RQ and
1158 CPP_RSHIFT_EQ like misspelled CPP_GREATER CPP_GREATER_EQ
1159 or CPP_RSHIFT CPP_EQ or CPP_GREATER CPP_GREATER CPP_EQ.
1160 (cp_parser_next_token_ends_template_argument_p): Return true
1161 also for CPP_GREATER_EQ and CPP_RSHIFT_EQ.
1163 2022-04-29 Iain Sandoe <iain@sandoe.co.uk>
1166 * coroutines.cc (register_local_var_uses): Allow promotion of unnamed
1167 temporaries to coroutine frame copies.
1169 2022-04-29 Jason Merrill <jason@redhat.com>
1171 * semantics.cc (check_trait_type): Don't check completeness
1172 of element type of array of unknown bound.
1174 2022-04-29 Jason Merrill <jason@redhat.com>
1178 * rtti.cc (get_tinfo_decl_direct): Don't complete_type.
1179 (emit_tinfo_decl): Update tdesc type if needed.
1181 2022-04-29 Zhao Wei Liew <zhaoweiliew@gmail.com>
1184 * call.cc (extract_call_expr): Return a NULL_TREE on failure
1185 instead of asserting.
1186 (build_new_method_call): Suppress -Wparentheses diagnostic for
1188 * semantics.cc (is_assignment_op_expr_p): Add function to check
1189 if an expression is a call to an op= operator expression.
1190 (maybe_convert_cond): Handle the case of a op= operator expression
1191 for the -Wparentheses diagnostic.
1193 2022-04-28 Patrick Palka <ppalka@redhat.com>
1196 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Treat
1197 DEPENDENT_OPERATOR_TYPE like an empty type.
1199 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
1202 * coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
1203 non-target expression inputs.
1205 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
1208 * coroutines.cc (coro_promise_type_found_p): Account for possible
1209 mutliple overloads of the promise return_value() method.
1211 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
1214 * coroutines.cc (maybe_promote_temps): Ensure generated temporaries
1215 are added to the bind expr.
1216 (add_var_to_bind): Fix local var naming to use portable punctuation.
1217 (register_local_var_uses): Do not add synthetic names to unnamed
1220 2022-04-28 Nathan Sidwell <nathan@acm.org>
1221 Iain Sandoe <iain@sandoe.co.uk>
1224 * coroutines.cc (finish_co_await_expr): Do not process non-dependent
1225 coroutine expressions at template definition time.
1226 (finish_co_yield_expr): Likewise.
1227 (finish_co_return_stmt): Likewise.
1229 2022-04-28 Marek Polacek <polacek@redhat.com>
1232 * parser.cc (cp_parser_class_specifier_1): Accept :: after a class
1235 2022-04-27 Jason Merrill <jason@redhat.com>
1237 * tree.cc (strip_typedefs): Add default argument comments.
1239 2022-04-27 Marek Polacek <polacek@redhat.com>
1242 * pt.cc (uses_template_parms): Return false for any NAMESPACE_DECL.
1244 2022-04-26 Jason Merrill <jason@redhat.com>
1247 * pt.cc (gen_elem_of_pack_expansion_instantiation): Clear
1248 TEMPLATE_TYPE_PARAMETER_PACK on auto.
1250 2022-04-26 Patrick Palka <ppalka@redhat.com>
1253 * semantics.cc (finish_decltype_type): Pass tf_decltype to
1254 instantiate_non_dependent_expr_sfinae.
1256 2022-04-26 Jason Merrill <jason@redhat.com>
1259 * pt.cc (check_for_bare_parameter_packs): Check for lambda
1260 function parameter pack.
1262 2022-04-26 Patrick Palka <ppalka@redhat.com>
1266 * pt.cc (process_partial_specialization): Downgrade "partial
1267 specialization isn't more specialized" diagnostic from permerror
1268 to an on-by-default pedwarn.
1269 (unify) <case TEMPLATE_PARM_INDEX>: When substituting into the
1270 NTTP type a second time, use the original type not the
1273 2022-04-25 Marek Polacek <polacek@redhat.com>
1276 * typeck.cc (build_x_shufflevector): Use
1277 instantiation_dependent_expression_p except for the first two
1280 2022-04-21 Marek Polacek <polacek@redhat.com>
1282 * constexpr.cc (cxx_eval_logical_expression): Remove unused
1284 (cxx_eval_constant_expression) <case TRUTH_ANDIF_EXPR>,
1285 <case TRUTH_OR_EXPR>: Adjust calls to cxx_eval_logical_expression.
1287 2022-04-21 Marek Polacek <polacek@redhat.com>
1290 * constexpr.cc (cxx_eval_logical_expression): Always pass false for lval
1291 to cxx_eval_constant_expression.
1293 2022-04-20 Ed Catmur <ed@catmur.uk>
1296 * call.cc (compare_ics): When comparing list-initialization
1297 sequences, do not return early.
1299 2022-04-19 Jakub Jelinek <jakub@redhat.com>
1302 * typeck2.cc (process_init_constructor_array,
1303 process_init_constructor_record, process_init_constructor_union): Move
1304 CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag from CONSTRUCTOR elements to the
1305 containing CONSTRUCTOR.
1307 2022-04-15 Marek Polacek <polacek@redhat.com>
1310 * parser.cc (cp_parser_placeholder_type_specifier): Return
1311 error_mark_node when trying to build up a constrained parameter in
1314 2022-04-15 Jason Merrill <jason@redhat.com>
1317 * decl.cc (grokdeclarator): Drop typedef used with 'unsigned'.
1319 2022-04-15 Jason Merrill <jason@redhat.com>
1322 * error.cc (dump_expr): Handle USING_DECL.
1323 [VIEW_CONVERT_EXPR]: Just look through location wrapper.
1325 2022-04-14 Jason Merrill <jason@redhat.com>
1328 * constexpr.cc (maybe_save_constexpr_fundef): Don't do extra
1329 checks for defaulted ctors.
1331 2022-04-14 Jason Merrill <jason@redhat.com>
1334 * lambda.cc (type_deducible_expression_p): New.
1335 (lambda_capture_field_type): Check it.
1337 2022-04-14 Jason Merrill <jason@redhat.com>
1340 * pt.cc (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.
1342 2022-04-14 Jason Merrill <jason@redhat.com>
1345 * name-lookup.cc (dependent_local_decl_p): New.
1346 * cp-tree.h (dependent_local_decl_p): Declare.
1347 * semantics.cc (finish_call_expr): Use it.
1348 * pt.cc (tsubst_arg_types): Also substitute default args
1351 2022-04-14 Jason Merrill <jason@redhat.com>
1354 * pt.cc (tsubst_baselink): Also check dependent optype.
1356 2022-04-14 Jason Merrill <jason@redhat.com>
1359 * decl.cc (cp_finish_decl): Don't pass decl to push_cleanup.
1360 * init.cc (perform_member_init): Likewise.
1361 * semantics.cc (push_cleanup): Adjust comment.
1363 2022-04-13 Jason Merrill <jason@redhat.com>
1367 * constexpr.cc (cxx_eval_store_expression): Build a CONSTRUCTOR
1368 as needed in empty base handling.
1370 2022-04-13 Jakub Jelinek <jakub@redhat.com>
1373 * decl2.cc (cp_check_const_attributes): For aligned attribute
1374 pass manifestly_const_eval=true to fold_non_dependent_expr.
1376 2022-04-13 Marek Polacek <polacek@redhat.com>
1379 * call.cc (direct_reference_binding): strip_top_quals when creating
1382 2022-04-12 Jason Merrill <jason@redhat.com>
1385 * decl.cc (decls_match): Compare versions even if not recording.
1386 (duplicate_decls): Propagate attributes to alias.
1387 * decl2.cc (find_last_decl): Give up if versioned.
1389 2022-04-12 Jason Merrill <jason@redhat.com>
1392 * init.cc (build_new_1): Check array_p for alignment.
1394 2022-04-12 Patrick Palka <ppalka@redhat.com>
1397 * pt.cc (build_extra_args): Call preserve_args.
1399 2022-04-12 Jason Merrill <jason@redhat.com>
1402 * decl.cc (check_initializer): Check TREE_SIDE_EFFECTS.
1404 2022-04-12 Jason Merrill <jason@redhat.com>
1408 * class.cc (finish_struct): Always using op=.
1410 2022-04-11 Jason Merrill <jason@redhat.com>
1413 * call.cc (build_operator_new_call): Just look in ::.
1415 2022-04-11 Alexandre Oliva <oliva@adacore.com>
1417 * constexpr.cc (cxx_eval_call_expression): Disregard dtor
1420 2022-04-11 Alexandre Oliva <oliva@adacore.com>
1422 * semantics.cc (set_cleanup_locs): Propagate locus to call
1423 wrapped in cast-to-void.
1425 2022-04-11 Jason Merrill <jason@redhat.com>
1428 * init.cc (warn_placement_new_too_small): Check deref.
1430 2022-04-09 Jason Merrill <jason@redhat.com>
1434 * tree.cc (build_vec_init_elt): Do {}-init for aggregates.
1435 * constexpr.cc (cxx_eval_vec_init): Only treat {} as value-init
1436 for non-aggregate types.
1437 (build_vec_init_expr): Also check constancy of explicit
1438 initializer elements.
1440 2022-04-09 Jason Merrill <jason@redhat.com>
1444 * name-lookup.cc (set_decl_namespace): Set
1445 DECL_IMPLICIT_INSTANTIATION if no non-template match.
1446 * pt.cc (check_explicit_specialization): Check it.
1447 * decl2.cc (check_classfn): Call it.
1449 2022-04-07 Patrick Palka <ppalka@redhat.com>
1452 * name-lookup.cc (name_lookup::using_queue): Change to an
1453 auto_vec (with 16 elements of internal storage).
1454 (name_lookup::queue_namespace): Change return type to void,
1455 take queue parameter by reference and adjust function body
1457 (name_lookup::do_queue_usings): Inline into ...
1458 (name_lookup::queue_usings): ... here. As in queue_namespace.
1459 (name_lookup::search_unqualified): Don't make queue static,
1460 remove length variable, and adjust function body accordingly.
1462 2022-04-07 Jakub Jelinek <jakub@redhat.com>
1464 PR tree-optimization/102586
1465 * cp-objcp-common.h (cp_classtype_as_base): Declare.
1466 (LANG_HOOKS_CLASSTYPE_AS_BASE): Redefine.
1467 * cp-objcp-common.cc (cp_classtype_as_base): New function.
1469 2022-04-07 Jason Merrill <jason@redhat.com>
1472 * decl.cc (grokdeclarator): Reject conversion with trailing return
1475 2022-04-07 Jason Merrill <jason@redhat.com>
1478 * lambda.cc (lambda_expr_this_capture): Check all enclosing
1479 lambdas for completeness.
1481 2022-04-07 Jason Merrill <jason@redhat.com>
1484 * typeck2.cc (store_init_value): Allow TREE_HAS_CONSTRUCTOR for
1487 2022-04-06 Jakub Jelinek <jakub@redhat.com>
1490 * decl2.cc (splice_template_attributes): Return NULL if *p is
1492 (cplus_decl_attributes): Return early if attributes is
1493 error_mark_node. Don't check that later.
1495 2022-04-06 Patrick Palka <ppalka@redhat.com>
1498 * pt.cc (do_class_deduction): Check complain before attempting
1499 to issue a -Wctad-maybe-unsupported warning.
1501 2022-04-06 Jason Merrill <jason@redhat.com>
1504 * init.cc (build_vec_init): Use a reference for the result.
1506 2022-04-06 Jason Merrill <jason@redhat.com>
1509 * name-lookup.cc (check_local_shadow): Use -Wshadow=local
1510 if exactly one of 'old' and 'decl' is a type.
1512 2022-04-05 Jason Merrill <jason@redhat.com>
1516 * pt.cc (do_class_deduction): Pedwarn for renaming alias in C++17.
1518 2022-04-05 Jason Merrill <jason@redhat.com>
1521 * name-lookup.h (struct cp_binding_level): Add requires_expression
1523 * parser.cc (cp_parser_requires_expression): Set it.
1524 (synthesize_implicit_template_parm): Check it.
1526 2022-04-04 Jason Merrill <jason@redhat.com>
1529 * decl.cc (duplicate_decls): Copy DECL_FRIEND_CONTEXT.
1531 2022-04-04 Jason Merrill <jason@redhat.com>
1535 * pt.cc (get_underlying_template): Compare default template args.
1537 2022-04-03 Benno Evers <benno.evers@tenzir.com>
1538 Iain Sandoe <iain@sandoe.co.uk>
1541 * coroutines.cc (morph_fn_to_coro): Reset
1542 current_binding_level->blocks.
1544 2022-04-01 Jason Merrill <jason@redhat.com>
1547 2022-03-31 Jason Merrill <jason@redhat.com>
1550 * parser.cc (cp_parser_early_parsing_nsdmi): New.
1551 (cp_parser_member_declaration): Call it.
1553 2022-04-01 Jason Merrill <jason@redhat.com>
1556 2022-03-24 Jason Merrill <jason@redhat.com>
1559 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
1560 * class.cc (type_has_default_ctor_to_be_synthesized): New.
1561 (type_has_non_user_provided_default_constructor_1): Support it.
1562 (type_has_non_user_provided_default_constructor): Now a wrapper.
1563 * method.cc (complain_about_unparsed_dmi): New.
1564 (constructible_expr): Call it.
1566 2022-04-01 Patrick Palka <ppalka@redhat.com>
1569 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Drop cv-quals from
1570 the argument type of an NTTP before deducing from it.
1572 2022-03-31 Jason Merrill <jason@redhat.com>
1575 * parser.cc (cp_parser_early_parsing_nsdmi): New.
1576 (cp_parser_member_declaration): Call it.
1578 2022-03-30 Patrick Palka <ppalka@redhat.com>
1581 * constraint.cc (diagnose_trait_expr): Handle all remaining
1582 traits appropriately. Remove default case.
1584 2022-03-30 Marek Polacek <polacek@redhat.com>
1588 * init.cc (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor.
1590 2022-03-30 Jakub Jelinek <jakub@redhat.com>
1593 * pt.cc (tsubst_omp_clause_decl): When handling iterators, set
1594 DECL_CONTEXT of the iterator var to current_function_decl and
1597 2022-03-30 Jakub Jelinek <jakub@redhat.com>
1600 * parser.cc (cp_parser_template_introduction): If member_p, temporarily
1601 clear parser->colon_corrects_to_scope_p around tentative parsing of
1602 nested name specifier.
1604 2022-03-28 Jason Merrill <jason@redhat.com>
1606 * pt.cc (determine_specialization): Add comment.
1608 2022-03-28 Patrick Palka <ppalka@redhat.com>
1611 * pt.cc (finish_concept_definition): Check that a concept is
1612 declared with exactly one template parameter list.
1614 2022-03-28 Patrick Palka <ppalka@redhat.com>
1617 * constraint.cc (maybe_substitute_reqs_for): Don't assume
1618 DECL_TEMPLATE_INFO is available.
1620 2022-03-28 Jason Merrill <jason@redhat.com>
1625 * pt.cc (complex_alias_template_r): walk_tree callback, replacing
1626 uses_all_template_parms_r, complex_pack_expansion_r.
1627 (complex_alias_template_p): Adjust.
1628 * tree.cc (strip_typedefs): Revert r12-7710 change.
1630 2022-03-28 Jason Merrill <jason@redhat.com>
1633 * init.cc (build_new_1): Include cookie in alignment. Omit
1634 constexpr wrapper from alloc_call.
1636 2022-03-28 Jason Merrill <jason@redhat.com>
1639 * name-lookup.cc (push_local_extern_decl_alias): Call
1640 determine_visibility.
1642 2022-03-28 Jason Merrill <jason@redhat.com>
1645 * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting
1646 a type template reference.
1648 2022-03-28 Jason Merrill <jason@redhat.com>
1651 * pt.cc (value_dependent_expression_p): Check
1652 has_value_dependent_address for conversion to reference.
1654 2022-03-28 Jason Merrill <jason@redhat.com>
1657 * pt.cc (tsubst_qualified_id): Handle getting SCOPE_REF from
1659 (instantiation_dependent_scope_ref_p): Check dependent_scope_p.
1661 2022-03-28 Jason Merrill <jason@redhat.com>
1664 * call.cc (make_base_init_ok): Call make_used.
1666 2022-03-28 Jason Merrill <jason@redhat.com>
1669 * mangle.cc (write_expression): Don't write a union designator when
1672 2022-03-28 Jason Merrill <jason@redhat.com>
1676 * tree.cc (strip_typedefs): Use build_distinct_type_copy.
1678 2022-03-26 Patrick Palka <ppalka@redhat.com>
1681 * constexpr.cc (potential_constant_expression_1) <case IF_STMT>:
1682 Clarify error message when a if-stmt is non-constant because its
1683 branches are non-constant.
1685 2022-03-26 Patrick Palka <ppalka@redhat.com>
1688 * call.cc (add_builtin_candidate) <case MEMBER_REF>: Test
1689 CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
1691 2022-03-26 Jakub Jelinek <jakub@redhat.com>
1693 * parser.cc (cp_parser_postfix_expression)
1694 <case RID_BILTIN_CONVERTVECTOR, case RID_BUILTIN_BIT_CAST>: Don't
1695 return cp_build_{vec,convert,bit_cast} result right away, instead
1696 set postfix_expression to it and break.
1698 2022-03-25 Marek Polacek <polacek@redhat.com>
1701 * typeck.cc (cxx_sizeof_or_alignof_type): Diagnose alignof(void).
1702 (cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with
1705 2022-03-24 Marek Polacek <polacek@redhat.com>
1708 * decl.cc (check_initializer): Don't call build_aggr_init in
1711 2022-03-24 Jason Merrill <jason@redhat.com>
1714 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
1715 * class.cc (type_has_default_ctor_to_be_synthesized): New.
1716 (type_has_non_user_provided_default_constructor_1): Support it.
1717 (type_has_non_user_provided_default_constructor): Now a wrapper.
1718 * method.cc (complain_about_unparsed_dmi): New.
1719 (constructible_expr): Call it.
1721 2022-03-24 Marek Polacek <polacek@redhat.com>
1724 * typeck2.cc (massage_init_elt): Avoid folding CONSTRUCTORs.
1726 2022-03-24 Patrick Palka <ppalka@redhat.com>
1729 * call.cc (build_over_call): Use cxx_constant_value_sfinae
1730 instead of cxx_constant_value to evaluate a consteval call.
1731 * constexpr.cc (cxx_constant_value_sfinae): Add decl parameter
1732 and pass it to cxx_eval_outermost_constant_expr.
1733 * cp-tree.h (cxx_constant_value_sfinae): Add decl parameter.
1734 * pt.cc (fold_targs_r): Pass NULL_TREE as decl parameter to
1735 cxx_constant_value_sfinae.
1737 2022-03-24 Jakub Jelinek <jakub@redhat.com>
1740 * constexpr.cc (cxx_eval_constant_expression): Don't diagnose passing
1741 through extern thread_local declarations. Change wording from
1742 declaration to definition.
1743 (potential_constant_expression_1): Don't diagnose extern thread_local
1744 declarations. Change wording from declared to defined.
1745 * decl.cc (start_decl): Likewise.
1747 2022-03-23 Jason Merrill <jason@redhat.com>
1750 * decl.cc (reshape_single_init): New.
1751 (reshape_init_class): Use it.
1753 2022-03-23 Jason Merrill <jason@redhat.com>
1756 * name-lookup.cc (lookup_using_decl): Check that scope is
1757 a dependent type before looking for dependent using.
1759 2022-03-23 Jason Merrill <jason@redhat.com>
1762 * name-lookup.cc (lookup_using_decl): Set DECL_DEPENDENT_P if lookup
1763 finds a dependent using.
1765 2022-03-21 Jason Merrill <jason@redhat.com>
1768 * init.cc (build_vec_init): Check for vla element type.
1770 2022-03-21 Jason Merrill <jason@redhat.com>
1776 * decl.cc (reshape_init_class): Avoid looking for designator
1778 (reshape_init_r): Keep looking for designator.
1780 2022-03-21 Jason Merrill <jason@redhat.com>
1783 * decl.cc (reshape_init_class): Back out of anon struct
1784 if a designator doesn't match.
1786 2022-03-18 Jason Merrill <jason@redhat.com>
1790 * class.cc (add_method): Avoid adding the same used function twice.
1791 (handle_using_decl): Don't add_method.
1792 (finish_struct): Don't using op= if we have one already.
1793 (maybe_push_used_methods): New.
1794 * semantics.cc (finish_member_declaration): Call it.
1795 * name-lookup.cc (diagnose_name_conflict): No longer static.
1796 (push_class_level_binding): Revert 92918 patch, limit
1798 * cp-tree.h: Adjust.
1800 2022-03-18 Jakub Jelinek <jakub@redhat.com>
1803 * init.cc (build_new_constexpr_heap_type): Remove FULL_SIZE
1804 argument and its handling, instead add ITYPE2 argument. Only
1805 support COOKIE_SIZE != NULL.
1806 (build_new_1): If size is 0, change it to 0 * outer_nelts if
1807 outer_nelts is non-NULL. Pass type rather than elt_type to
1808 maybe_wrap_new_for_constexpr.
1809 * constexpr.cc (build_new_constexpr_heap_type): New function.
1810 (cxx_eval_constant_expression) <case CONVERT_EXPR>:
1811 If elt_size is zero sized type, try to recover outer_nelts from
1812 the size argument to operator new/new[] and pass that as
1813 arg_size to build_new_constexpr_heap_type. Pass ctx,
1814 non_constant_p and overflow_p to that call too.
1816 2022-03-18 Marek Polacek <polacek@redhat.com>
1819 * tree.cc (strip_typedefs): Don't strip an alias template when
1820 doing so would result in losing a parameter pack.
1822 2022-03-16 Patrick Palka <ppalka@redhat.com>
1824 * search.cc (lookup_member): Simplify by handling all values
1825 of protect together in the ambiguous case. Don't modify protect.
1827 2022-03-16 Patrick Palka <ppalka@redhat.com>
1830 * cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls to
1831 std::move/forward and other cast-like functions into simple
1834 2022-03-15 Patrick Palka <ppalka@redhat.com>
1837 * search.cc (lookup_field_info::errstr): Remove this data
1839 (lookup_field_r): Don't set errstr.
1840 (lookup_member): Check ambiguity before checking access.
1841 Simplify accordingly after errstr removal. Exit early upon
1842 error or empty result.
1844 2022-03-15 Jakub Jelinek <jakub@redhat.com>
1847 * parser.cc (cp_parser_skip_to_pragma_eol): Don't purge any tokens.
1849 2022-03-14 Jakub Jelinek <jakub@redhat.com>
1851 PR tree-optimization/102586
1852 * call.cc (build_cxx_call): Diagnose __builtin_clear_padding where
1853 first argument's type is pointer to non-trivially-copyable type unless
1854 it is address of a variable or parameter.
1856 2022-03-12 Patrick Palka <ppalka@redhat.com>
1859 * cp-tree.h (tsubst_flags::tf_tst_ok): New flag.
1860 * decl.cc (make_typename_type): Allow a typename-specifier to
1861 resolve to a template when tf_tst_ok, in which case return
1862 a CTAD placeholder for the template.
1863 * pt.cc (tsubst_decl) <case VAR_DECL>: Set tf_tst_ok when
1864 substituting the type.
1865 (tsubst): Clear tf_tst_ok and remember if it was set.
1866 <case TYPENAME_TYPE>: Pass tf_tst_ok to make_typename_type
1868 (tsubst_copy) <case CAST_EXPR>: Set tf_tst_ok when substituting
1870 (tsubst_copy_and_build) <case CAST_EXPR>: Likewise.
1871 <case CONSTRUCTOR>: Likewise.
1873 2022-03-12 Patrick Palka <ppalka@redhat.com>
1876 * call.cc (missing_conversion_p): Define.
1877 (add_candidates): Use it.
1878 * pt.cc (check_non_deducible_conversion): Change type of strict
1879 parameter to unification_kind_t and directly test for DEDUCE_CALL.
1881 2022-03-12 Patrick Palka <ppalka@redhat.com>
1884 * constraint.cc (normalize_atom): Set
1885 ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P appropriately.
1886 (get_mapped_args): Make static, adjust parameters. Always
1887 return a vector whose depth corresponds to the template depth of
1888 the context of the atomic constraint expression. Micro-optimize
1889 by passing false as exact to safe_grow_cleared and by collapsing
1890 a multi-level depth-one argument vector.
1891 (satisfy_atom): Adjust call to get_mapped_args and
1892 diagnose_atomic_constraint.
1893 (diagnose_atomic_constraint): Replace map parameter with an args
1895 * cp-tree.h (ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P): Define.
1896 (get_mapped_args): Remove declaration.
1898 2022-03-12 Patrick Palka <ppalka@redhat.com>
1899 Jason Merrill <jason@redhat.com>
1902 * constexpr.cc (mark_non_constant): Define, split out from ...
1903 (cxx_eval_outermost_constant_expr): ... here.
1904 (maybe_constant_value): Use it.
1906 2022-03-12 Patrick Palka <ppalka@redhat.com>
1908 * semantics.cc (finish_unary_fold_expr): Use input_location
1909 instead of UNKNOWN_LOCATION.
1910 (finish_binary_fold_expr): Likewise.
1912 2022-03-12 Thomas Schwinge <thomas@codesourcery.com>
1915 * semantics.cc (handle_omp_array_sections_1)
1916 (cp_oacc_check_attachments): Call 'user_omp_clause_code_name'
1917 instead of 'c_omp_map_clause_name'.
1919 2022-03-10 Marek Polacek <polacek@redhat.com>
1922 * parser.cc (cp_parser_template_name): Repeat lookup of
1925 2022-03-10 Marek Polacek <polacek@redhat.com>
1928 * semantics.cc (finish_compound_literal): Disallow auto{x} for
1929 is_constrained_auto.
1930 * typeck2.cc (build_functional_cast_1): Likewise.
1932 2022-03-10 Marek Polacek <polacek@redhat.com>
1935 * decl.cc (grokdeclarator): Check FUNC_OR_METHOD_TYPE_P before giving
1938 2022-03-10 Jakub Jelinek <jakub@redhat.com>
1941 * decl.cc (grok_op_properties): Allow variadic operator[] for
1944 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
1947 * decl.cc (finish_enum_value_list): If VALUE isn't an INTEGER_CST
1948 consider it to be zero (i.e. treat it like error_mark_node).
1949 (build_enumerator): Likewise, if PREV_VALUE isn't an INTEGER_CST,
1950 set VALUE to error_mark_node.
1952 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
1955 * parser.cc (cp_parser_late_parsing_for_member): Confirm the token
1956 stream hasn't been purged before processing DECL_PENDING_INLINE.
1958 2022-03-09 Patrick Palka <ppalka@redhat.com>
1961 * except.cc (build_noexcept_spec): Strengthen dependence check
1962 to instantiation_dependent_expression_p.
1963 * parser.cc (cp_parser_parenthesized_expression_list_elt):
1964 Remove fold_expr_p parameter, and don't call
1965 instantiate_non_dependent_expr.
1966 (cp_parser_parenthesized_expression_list): Adjust accordingly.
1967 * pt.cc (expand_integer_pack): Strengthen dependence check
1968 to instantiation_dependent_expression_p.
1969 (instantiate_non_dependent_expr_internal): Adjust comment.
1970 (instantiate_non_dependent_expr_sfinae): Likewise. Drop
1971 the potentially-constant check, and relax and turn the
1972 dependence check into a checking assert.
1973 (instantiate_non_dependent_or_null): Adjust comment.
1974 * semantics.cc (finish_decltype_type): Keep
1975 processing_template_decl cleared after calling
1976 instantiate_non_dependent_expr_sfinae.
1978 2022-03-09 Patrick Palka <ppalka@redhat.com>
1982 * cp-tree.h (is_copy_initialization): Declare.
1983 * decl.cc (cp_finish_decl): Set LOOKUP_ONLYCONVERTING
1984 when is_copy_initialization is true.
1985 * init.cc (build_aggr_init): Split out copy-initialization
1987 (is_copy_initialization): ... here.
1988 * pt.cc (instantiate_decl): Pass 0 instead of
1989 LOOKUP_ONLYCONVERTING as flags to cp_finish_decl.
1991 2022-03-09 Patrick Palka <ppalka@redhat.com>
1994 * cp-tree.h (merge_default_template_args): Declare.
1995 * decl.cc (merge_default_template_args): Define, factored out
1996 from redeclare_class_template.
1997 (duplicate_decls): Use it when merging member function template
1998 and free function declarations.
1999 * pt.cc (redeclare_class_template): Factor out default argument
2000 merging logic into merge_default_template_args. Improve location
2001 of a note when there's a template parameter kind mismatch.
2003 2022-03-09 Jakub Jelinek <jakub@redhat.com>
2006 * constexpr.cc (cxx_eval_check_shift_p): Use TYPE_OVERFLOW_WRAPS
2007 instead of TYPE_UNSIGNED.
2008 * typeck.cc (cp_build_binary_op): Don't emit
2009 -Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
2011 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
2014 * decl.cc (start_decl): Defend against prefix_attributes being
2017 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
2020 * parser.cc (synthesize_implicit_template_parm): Check that
2021 TREE_VALUE (new_parm) isn't error_mark_node before setting its
2024 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
2027 * parser.cc (cp_parser_linkage_specification): Treat the case where
2028 linkage is error_mark_node as "invalid linkage-specification".
2030 2022-03-08 Marek Polacek <polacek@redhat.com>
2033 * pt.cc (convert_nontype_argument): Recompute
2034 value_dependent_expression_p after build_converted_constant_expr.
2036 2022-03-08 Marek Polacek <polacek@redhat.com>
2038 * decl2.cc (is_late_template_attribute): Do not defer attribute
2040 * pt.cc (tsubst_enum): Set TREE_UNAVAILABLE.
2042 2022-03-08 Jakub Jelinek <jakub@redhat.com>
2045 * search.cc (lookup_field_fuzzy_info::fuzzy_lookup_field): Ignore
2046 identifiers with space at the end.
2048 2022-03-07 Jason Merrill <jason@redhat.com>
2051 * decl2.cc (mark_single_function): Look through parens and location
2053 * typeck.cc (cp_build_addr_expr_1): Not here.
2055 2022-03-07 Jakub Jelinek <jakub@redhat.com>
2057 * parser.cc (cp_parser_omp_clause_map): Add missing space in string
2060 2022-03-07 Jakub Jelinek <jakub@redhat.com>
2062 * cvt.cc: Fix up duplicated word issue in a comment.
2064 * module.cc: Likewise.
2065 * coroutines.cc: Likewise.
2067 2022-03-04 Nathan Sidwell <nathan@acm.org>
2069 * mangle.cc (is_std_substitution): Check global module.
2070 (is_std_substitution_char): Return bool.
2072 2022-03-04 Nathan Sidwell <nathan@acm.org>
2074 * cp-tree.h (mangle_identifier): Replace with ...
2075 (mangle_module_component): ... this.
2076 * mangle.cc (dump_substitution_candidates): Adjust.
2077 (add_substitution): Likewise.
2078 (find_substitution): Likewise.
2079 (unmangled_name_p): Likewise.
2080 (mangle_module_substitution): Reimplement.
2081 (mangle_module_component): New.
2082 (write_module, maybe_write_module): Adjust.
2083 (write_name): Drop modules here.
2084 (write_unqualified): Do them here instead.
2085 (mangle_global_init): Adjust.
2086 * module.cc (module_state::mangle): Adjust.
2087 (mangle_module): Likewise.
2088 (get_originating_module): Adjust.
2090 2022-02-28 Marek Polacek <polacek@redhat.com>
2093 * cp-tree.h (build_enumerator): Adjust.
2094 * decl.cc (finish_enum): Make it return the new decl.
2095 * pt.cc (tsubst_enum): Propagate TREE_DEPRECATED and TREE_UNAVAILABLE.
2097 2022-02-28 Marek Polacek <polacek@redhat.com>
2100 * decl2.cc (is_late_template_attribute): Cope with a decl without
2103 2022-02-27 Jason Merrill <jason@redhat.com>
2106 * typeck.cc (cp_build_addr_expr_1): Also
2107 maybe_undo_parenthesized_ref.
2109 2022-02-24 Martin Liska <mliska@suse.cz>
2111 * pt.cc (defarg_insts_for): Use braces for subobject.
2113 2022-02-18 Patrick Palka <ppalka@redhat.com>
2116 * pt.cc (maybe_instantiate_noexcept): For non-static member
2117 functions, set current_class_ptr/ref to the specialized 'this'
2120 2022-02-17 Jason Merrill <jason@redhat.com>
2123 * pt.cc (mark_decl_instantiated): Don't clear DECL_COMDAT.
2125 2022-02-17 Jason Merrill <jason@redhat.com>
2128 * decl2.cc (mark_single_function): New.
2129 * cp-tree.h: Declare it.
2130 * typeck.cc (cp_build_addr_expr_1): mark_used when making a PMF.
2131 * semantics.cc (finish_qualified_id_expr): Not here.
2132 (finish_id_expression_1): Or here.
2133 (finish_decltype_type): Call mark_single_function.
2134 * cvt.cc (convert_to_void): And here.
2135 * pt.cc (convert_nontype_argument): And here.
2136 * init.cc (build_offset_ref): Adjust assert.
2138 2022-02-17 Patrick Palka <ppalka@redhat.com>
2141 * semantics.cc (finish_compound_literal): Don't perform
2142 non-dependent expr folding before calling check_narrowing.
2144 2022-02-16 Patrick Palka <ppalka@redhat.com>
2147 * constexpr.cc (potential_constant_expression_1)
2148 <case NON_DEPENDENT_EXPR>: Return false instead of recursing.
2149 Assert tf_error isn't set.
2151 2022-02-15 Jason Merrill <jason@redhat.com>
2155 * pt.cc (coerce_template_template_parms): Take full parms.
2156 Avoid adding too much of outer_args.
2157 (coerce_template_template_parm): Adjust.
2158 (template_template_parm_bindings_ok_p): Adjust.
2159 (convert_template_argument): Adjust.
2161 2022-02-14 Jakub Jelinek <jakub@redhat.com>
2164 * constexpr.cc (potential_constant_expression_1) <case GOTO_EXPR>:
2165 Don't punt if returns (target).
2167 2022-02-11 Jakub Jelinek <jakub@redhat.com>
2170 * constexpr.cc (cxx_eval_internal_function) <case IFN_VEC_CONVERT>:
2171 Only return fold_const_call result if it is non-NULL. Otherwise
2172 fall through into the default: case to return t, set *non_constant_p
2173 and emit diagnostics if needed.
2175 2022-02-10 Jason Merrill <jason@redhat.com>
2177 * module.cc (depset::hash::add_specializations): Use
2180 2022-02-10 Tobias Burnus <tobias@codesourcery.com>
2183 * decl2.cc (cp_omp_mappable_type_1): Remove check for virtual
2184 members as those are permitted since OpenMP 5.0.
2186 2022-02-10 Patrick Palka <ppalka@redhat.com>
2188 * pt.cc (filter_memfn_lookup): Handle dependent USING_DECL
2191 2022-02-10 Marcel Vollweiler <marcel@codesourcery.com>
2193 * parser.cc (cp_parser_omp_clause_name): Parse 'has_device_addr' clause.
2194 (cp_parser_omp_var_list_no_open): Handle array sections.
2195 (cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
2197 (cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK.
2198 * semantics.cc (handle_omp_array_sections): Handle clause restrictions.
2199 (finish_omp_clauses): Handle array sections.
2201 2022-02-09 Patrick Palka <ppalka@redhat.com>
2204 * call.cc (build_new_method_call): When a non-dependent call
2205 resolves to a specialization of a member template, always build
2206 the pruned overload set using the member template, not the
2208 * pt.cc (filter_memfn_lookup): New parameter newtype. Simplify
2209 and correct how members from the new lookup set are matched to
2210 those from the old one.
2211 (tsubst_baselink): Pass binfo_type as newtype to
2212 filter_memfn_lookup.
2214 2022-02-09 Jason Merrill <jason@redhat.com>
2217 * module.cc (trees_out::core_vals): Stream explicit specifier.
2218 (trees_in::core_vals): Likewise.
2219 * pt.cc (store_explicit_specifier): No longer static.
2220 (tsubst_function_decl): Clear DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
2221 * cp-tree.h (lookup_explicit_specifier): Declare.
2223 2022-02-09 Jason Merrill <jason@redhat.com>
2226 * typeck2.cc (split_nonconstant_init_1): Push cleanups for
2227 preceding members with constant initialization.
2228 (maybe_push_temp_cleanup): Do nothing if -fno-exceptions.
2230 2022-02-08 Jakub Jelinek <jakub@redhat.com>
2233 * name-lookup.cc (check_local_shadow): When diagnosing shadowing
2234 of a member or global declaration, add warning suppression for
2235 the decl and don't warn again on it.
2237 2022-02-08 Jakub Jelinek <jakub@redhat.com>
2240 * constexpr.cc (cxx_eval_constant_expression): Don't assert DECL_EXPRs
2241 of TREE_STATIC vars may only appear in -std=c++23.
2243 2022-02-08 Patrick Palka <ppalka@redhat.com>
2246 * pt.cc (uses_deducible_template_parms): Consider the
2247 noexcept-spec of a function type.
2249 2022-02-08 Patrick Palka <ppalka@redhat.com>
2252 * constraint.cc (satisfaction_value): Relax assert to accept
2255 2022-02-08 Patrick Palka <ppalka@redhat.com>
2258 * pt.cc (preserve_args): New function.
2259 (tsubst_lambda_expr): Use it when setting LAMBDA_EXPR_REGEN_INFO.
2261 2022-02-08 Patrick Palka <ppalka@redhat.com>
2264 * constraint.cc (satisfy_declaration_constraints): Use
2265 lambda_regenerating_args instead.
2266 * cp-tree.h (lambda_regenerating_args): Declare.
2267 * pt.cc (lambda_regenerating_args): Define, split out from
2268 satisfy_declaration_constraints.
2269 (do_auto_deduction): Use lambda_regenerating_args to obtain the
2270 full set of outer template arguments for satisfaction when
2273 2022-02-06 Patrick Palka <ppalka@redhat.com>
2276 * decl2.cc (mark_used): Directly synthesize a DECL_MAYBE_DELETED
2277 fn by calling maybe_synthesize_method instead of relying on
2278 maybe_instantiate_noexcept. Move call to m_i_n after the
2279 DECL_DELETED_FN handling.
2280 * pt.cc (maybe_instantiate_noexcept): Restrict DECL_MAYBE_DELETED
2281 fn synthesis to only those with an implicit noexcept-spec, and
2282 return !DECL_DELETED_FN instead of !DECL_MAYBE_DELETED afterwards.
2284 2022-02-06 Jakub Jelinek <jakub@redhat.com>
2288 * constexpr.cc (cxx_eval_binary_expression): Temporarily set
2289 folding_cxx_constexpr.
2291 2022-02-05 Jason Merrill <jason@redhat.com>
2295 * cp-tree.h (get_vec_init_expr): New.
2296 (target_expr_needs_replace): New.
2297 * cp-gimplify.cc (cp_gimplify_init_expr): Use it.
2298 (struct cp_fold_data): New.
2299 (cp_fold_r): Only genericize inits at end of fn.
2300 (cp_fold_function): Here.
2301 (cp_fully_fold_init): Not here.
2302 * init.cc (build_vec_init): Use get_vec_init_expr.
2303 * tree.cc (build_vec_init_expr): Likewise.
2304 * typeck2.cc (split_nonconstant_init_1): Likewise.
2305 (process_init_constructor): Wrap VEC_INIT_EXPR in
2308 2022-02-05 Jason Merrill <jason@redhat.com>
2310 * pt.cc (iterative_hash_template_arg): Add comment.
2312 2022-02-03 Patrick Palka <ppalka@redhat.com>
2315 * pt.cc (value_dependent_noexcept_spec_p): New predicate split
2317 (dependent_type_p_r): ... here.
2318 (instantiation_dependent_r): Use value_dependent_noexcept_spec_p
2319 to consider dependence of a noexcept-spec before C++17.
2320 * tree.cc (fixup_deferred_exception_variants): Clear
2321 TYPE_DEPENDENT_P_VALID.
2323 2022-02-03 Jason Merrill <jason@redhat.com>
2326 * decl.cc (maybe_deduce_size_from_array_init): Give up
2327 on type-dependent init.
2328 (cp_complete_array_type): Only call reshape_init for character
2331 2022-02-01 Jason Merrill <jason@redhat.com>
2334 * pt.cc (defarg_inst): Use tree_vec_map_cache_hasher.
2335 (defarg_insts_for): New.
2336 (tsubst_default_argument): Adjust.
2338 2022-01-31 Marek Polacek <polacek@redhat.com>
2342 * decl.cc (create_array_type_for_decl): Use template_placeholder_p.
2343 Sorry on a variable-length array of auto.
2345 2022-01-31 Marek Polacek <polacek@redhat.com>
2348 * class.cc (finish_struct): Don't allow union initializer_list.
2350 2022-01-31 Patrick Palka <ppalka@redhat.com>
2353 * pt.cc (ctor_deduction_guides_for): Correct computation of
2356 2022-01-31 Patrick Palka <ppalka@redhat.com>
2359 * pt.cc (for_each_template_parm_r) <case CONSTRUCTOR>: Clear
2360 walk_subtrees if !include_nondeduced_p. Simplify given that
2361 cp_walk_subtrees already walks TYPE_PTRMEMFUNC_FN_TYPE_RAW.
2363 2022-01-28 Patrick Palka <ppalka@redhat.com>
2364 Jason Merrill <jason@redhat.com>
2367 * typeck.cc (build_ptrmemfunc): Cast a nullptr constant to the
2368 unqualified pointer type not the qualified one.
2370 2022-01-28 Patrick Palka <ppalka@redhat.com>
2373 * decl.cc (cp_finish_decl): Pass the template arguments of a
2374 variable template specialization or a templated static data
2375 member to do_auto_deduction when the auto is constrained.
2377 2022-01-28 Jason Merrill <jason@redhat.com>
2382 * parser.cc (cp_parser_enumerator_definition): Sorry on parameter
2384 (cp_parser_class_head): And in class attributes.
2385 * pt.cc (check_for_bare_parameter_packs): Sorry instead of error
2388 2022-01-27 Jason Merrill <jason@redhat.com>
2392 * decl2.cc (save_template_attributes): Take late attrs as parm.
2393 (cplus_decl_attributes): Call it after decl_attributes,
2394 splice_template_attributes before.
2396 2022-01-27 Patrick Palka <ppalka@redhat.com>
2399 * call.cc (build_over_call): For a non-dependent member call,
2400 build up a CALL_EXPR using a COMPONENT_REF callee, as in
2401 build_new_method_call.
2402 * pt.cc (build_non_dependent_expr): Don't wrap PARM_DECL either.
2403 * tree.cc (build_min_non_dep_op_overload): Adjust accordingly
2404 after the build_over_call change.
2406 2022-01-27 Patrick Palka <ppalka@redhat.com>
2410 * parser.cc (cp_parser_class_head): Update 'type' with the result
2411 of maybe_process_partial_specialization in the
2412 nested_name_specifier branch. Refactor nearby code to accomodate
2413 that maybe_process_partial_specialization returns a _TYPE, not a
2414 TYPE_DECL, and eliminate local variable 'class_type' in passing.
2416 2022-01-27 Marek Polacek <polacek@redhat.com>
2419 * decl.cc (create_array_type_for_decl): Reject forming an array of
2420 placeholder for a deduced class type.
2422 2022-01-26 Jason Merrill <jason@redhat.com>
2426 * semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
2428 2022-01-26 Jakub Jelinek <jakub@redhat.com>
2431 * constexpr.cc (init_subob_ctx): For vector ctors containing
2432 vector elements, ensure appending to the same ctor instead of
2433 creating another one.
2435 2022-01-26 Marek Polacek <polacek@redhat.com>
2438 * decl.cc (finish_constructor_body): Suppress -Wuse-after-free.
2439 (finish_destructor_body): Likewise.
2440 * optimize.cc (build_delete_destructor_body): Likewise.
2442 2022-01-26 Jason Merrill <jason@redhat.com>
2445 * parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.
2447 2022-01-26 Jason Merrill <jason@redhat.com>
2450 * pt.cc (tsubst_aggr_type): Call tsubst for alias template
2453 2022-01-25 Patrick Palka <ppalka@redhat.com>
2457 * decl2.cc (mark_used): Don't consider maybe_instantiate_noexcept
2458 on a deleted function.
2460 2022-01-25 Jason Merrill <jason@redhat.com>
2463 * call.cc (build_over_call): Use cp_build_indirect_ref.
2465 2022-01-24 Patrick Palka <ppalka@redhat.com>
2468 * pt.cc (make_auto_1): Use -1 as a placeholder default argument
2471 2022-01-24 Patrick Palka <ppalka@redhat.com>
2474 * typeck.cc (build_class_member_access_expr): Extend
2475 unary_complex_lvalue result adjustment to preserve all
2476 rvalues, not just xvalues.
2478 2022-01-23 Will Wray <wjwray@gmail.com>
2481 * decl.cc (reshape_init_r): Only call has_designator_check when
2482 first_initializer_p or for the inner constructor element.
2483 (cp_complete_array_type): Call reshape_init on braced-init-list.
2485 2022-01-23 Jason Merrill <jason@redhat.com>
2488 * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing
2489 has set DECL_INITIAL on a TARGET_EXPR slot.
2490 * tree.cc (is_local_temp): Don't check DECL_CONTEXT.
2492 2022-01-23 Jason Merrill <jason@redhat.com>
2495 * cp-tree.h (build_implicit_conv_flags): Declare.
2496 * call.cc (build_implicit_conv_flags): Split out from...
2497 (perform_implicit_conversion_flags): ...here.
2498 * decl.cc (check_initializer): Use it.
2499 * pt.cc (tsubst_copy_and_build): Remove TARGET_EXPR handling.
2500 * semantics.cc (finish_compound_literal): Don't treat
2501 scalar values like CONSTRUCTORs.
2503 2022-01-21 Jason Merrill <jason@redhat.com>
2505 * semantics.cc (find_failing_clause): Return expr if not
2507 (finish_static_assert): Show constant values in failing
2510 2022-01-21 Jason Merrill <jason@redhat.com>
2514 * init.cc (build_new_1): Only pull out TARGET_EXPR_INITIAL if
2515 alloc_expr is a TARGET_EXPR.
2517 2022-01-21 Marek Polacek <polacek@redhat.com>
2520 * tree.cc (fixup_deferred_exception_variants): Remove duplicate
2521 variants after parsing the exception specifications.
2523 2022-01-21 Jason Merrill <jason@redhat.com>
2527 * class.cc (end_of_class): Use base_binfo.
2529 2022-01-20 Jason Merrill <jason@redhat.com>
2532 * decl.cc (reshape_init_class): Reject designator for a member of
2535 2022-01-20 Patrick Palka <ppalka@redhat.com>
2539 * pt.cc (keep_template_parm): Punt on a level 0 template parm.
2540 (tsubst_decl) <case VAR_DECL>: Remove !CHECKING_P safeguard.
2541 (tsubst) <case TEMPLATE_TYPE_PARM>: Handle CTAD placeholders
2543 (make_auto_1): Add defaulted 'level' parameter.
2544 (make_template_placeholder): Pass 0 as 'level' to make_auto_1.
2546 2022-01-20 Patrick Palka <ppalka@redhat.com>
2548 * decl.cc (grokdeclarator): Diagnose a CTAD placeholder as
2549 function return type even when !funcdecl_p.
2551 2022-01-20 Martin Liska <mliska@suse.cz>
2554 * error.cc (dump_aggr_type): Partially disable the warning.
2556 2022-01-20 Jason Merrill <jason@redhat.com>
2559 * parser.cc (cp_parser_template_name): Use dependent_scope_p.
2561 2022-01-19 David Malcolm <dmalcolm@redhat.com>
2563 * cp-lang.cc (selftest::run_cp_tests): Update calls for .c to .cc
2565 * cp-tree.h (cp_pt_c_tests): Rename to...
2566 (cp_pt_cc_tests): ...this.
2567 (cp_tree_c_tests): Rename to...
2568 (cp_tree_cc_tests): ...this.
2569 * pt.cc (cp_pt_c_tests): Rename to...
2570 (cp_pt_cc_tests): ...this.
2571 * tree.cc (cp_tree_c_tests): Rename to...
2572 (cp_tree_cc_tests): ...this.
2574 2022-01-19 Jason Merrill <jason@redhat.com>
2576 * parser.cc (saved_token_sentinel::rollback): Use
2577 cp_lexer_previous_token.
2579 2022-01-18 Jakub Jelinek <jakub@redhat.com>
2582 * constexpr.cc (cxx_eval_outermost_constant_expr): If t is a
2583 TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
2584 than get_target_expr_sfinae with tf_no_cleanup, and don't set
2587 2022-01-18 Jason Merrill <jason@redhat.com>
2588 Jakub Jelinek <jakub@redhat.com>
2591 * parser.cc (saved_token_sentinel::rollback): Call
2592 cp_lexer_set_source_position.
2593 (~saved_token_sentinel): Call rollback.
2595 2022-01-18 Patrick Palka <ppalka@redhat.com>
2598 * pt.cc (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
2599 that we return false for DEPENDENT_OPERATOR_TYPE too.
2601 2022-01-17 Martin Liska <mliska@suse.cz>
2603 * Make-lang.in: Rename .c names to .cc.
2604 * config-lang.in: Likewise.
2605 * constexpr.cc (cxx_eval_constant_expression): Likewise.
2606 * coroutines.cc (morph_fn_to_coro): Likewise.
2607 * cp-gimplify.cc (cp_gimplify_expr): Likewise.
2608 * cp-lang.cc (struct lang_hooks): Likewise.
2609 (get_template_argument_pack_elems_folded): Likewise.
2610 * cp-objcp-common.cc (cp_tree_size): Likewise.
2611 (cp_unit_size_without_reusable_padding): Likewise.
2612 (pop_file_scope): Likewise.
2613 (cp_pushdecl): Likewise.
2614 * cp-objcp-common.h (GCC_CP_OBJCP_COMMON): Likewise.
2615 (cxx_simulate_record_decl): Likewise.
2616 * cp-tree.h (struct named_label_entry): Likewise.
2617 (current_function_return_value): Likewise.
2618 (more_aggr_init_expr_args_p): Likewise.
2619 (get_function_version_dispatcher): Likewise.
2620 (common_enclosing_class): Likewise.
2621 (strip_fnptr_conv): Likewise.
2622 (current_decl_namespace): Likewise.
2623 (do_aggregate_paren_init): Likewise.
2624 (cp_check_const_attributes): Likewise.
2625 (qualified_name_lookup_error): Likewise.
2626 (generic_targs_for): Likewise.
2627 (mark_exp_read): Likewise.
2628 (is_global_friend): Likewise.
2629 (maybe_reject_flexarray_init): Likewise.
2630 (module_token_lang): Likewise.
2631 (handle_module_option): Likewise.
2632 (literal_integer_zerop): Likewise.
2633 (build_extra_args): Likewise.
2634 (build_if_nonnull): Likewise.
2635 (maybe_check_overriding_exception_spec): Likewise.
2636 (finish_omp_target_clauses): Likewise.
2637 (maybe_warn_zero_as_null_pointer_constant): Likewise.
2638 (cxx_print_error_function): Likewise.
2639 (decl_in_std_namespace_p): Likewise.
2640 (merge_exception_specifiers): Likewise.
2641 (mangle_module_global_init): Likewise.
2642 (cxx_block_may_fallthru): Likewise.
2643 (fold_builtin_source_location): Likewise.
2644 (enum cp_oracle_request): Likewise.
2645 (subsumes): Likewise.
2646 (cp_finish_injected_record_type): Likewise.
2647 (vtv_build_vtable_verify_fndecl): Likewise.
2648 (cp_tree_c_finish_parsing): Likewise.
2649 * cvt.cc (diagnose_ref_binding): Likewise.
2650 (convert_to_void): Likewise.
2651 (convert_force): Likewise.
2652 (type_promotes_to): Likewise.
2653 * decl.cc (make_unbound_class_template_raw): Likewise.
2654 (cxx_init_decl_processing): Likewise.
2655 (check_class_member_definition_namespace): Likewise.
2656 (cxx_maybe_build_cleanup): Likewise.
2657 * decl2.cc (maybe_emit_vtables): Likewise.
2658 * error.cc (dump_function_name): Likewise.
2659 * init.cc (is_class_type): Likewise.
2660 (build_new_1): Likewise.
2661 * lang-specs.h: Likewise.
2662 * method.cc (make_alias_for_thunk): Likewise.
2663 * module.cc (specialization_add): Likewise.
2664 (module_state::read_cluster): Likewise.
2665 * name-lookup.cc (check_extern_c_conflict): Likewise.
2666 * name-lookup.h (struct cxx_binding): Likewise.
2667 * parser.cc (cp_parser_identifier): Likewise.
2668 * parser.h (struct cp_parser): Likewise.
2669 * pt.cc (has_value_dependent_address): Likewise.
2670 (push_tinst_level_loc): Likewise.
2671 * semantics.cc (finish_omp_clauses): Likewise.
2672 (finish_omp_atomic): Likewise.
2673 * tree.cc (cp_save_expr): Likewise.
2674 (cp_free_lang_data): Likewise.
2675 * typeck.cc (cp_common_type): Likewise.
2676 (strip_array_domain): Likewise.
2677 (rationalize_conditional_expr): Likewise.
2678 (check_return_expr): Likewise.
2679 * vtable-class-hierarchy.cc: Likewise.
2681 2022-01-17 Martin Liska <mliska@suse.cz>
2683 * call.c: Moved to...
2685 * class.c: Moved to...
2686 * class.cc: ...here.
2687 * constexpr.c: Moved to...
2688 * constexpr.cc: ...here.
2689 * cp-gimplify.c: Moved to...
2690 * cp-gimplify.cc: ...here.
2691 * cp-lang.c: Moved to...
2692 * cp-lang.cc: ...here.
2693 * cp-objcp-common.c: Moved to...
2694 * cp-objcp-common.cc: ...here.
2695 * cp-ubsan.c: Moved to...
2696 * cp-ubsan.cc: ...here.
2697 * cvt.c: Moved to...
2699 * cxx-pretty-print.c: Moved to...
2700 * cxx-pretty-print.cc: ...here.
2701 * decl.c: Moved to...
2703 * decl2.c: Moved to...
2704 * decl2.cc: ...here.
2705 * dump.c: Moved to...
2707 * error.c: Moved to...
2708 * error.cc: ...here.
2709 * except.c: Moved to...
2710 * except.cc: ...here.
2711 * expr.c: Moved to...
2713 * friend.c: Moved to...
2714 * friend.cc: ...here.
2715 * g++spec.c: Moved to...
2716 * g++spec.cc: ...here.
2717 * init.c: Moved to...
2719 * lambda.c: Moved to...
2720 * lambda.cc: ...here.
2721 * lex.c: Moved to...
2723 * mangle.c: Moved to...
2724 * mangle.cc: ...here.
2725 * method.c: Moved to...
2726 * method.cc: ...here.
2727 * name-lookup.c: Moved to...
2728 * name-lookup.cc: ...here.
2729 * optimize.c: Moved to...
2730 * optimize.cc: ...here.
2731 * parser.c: Moved to...
2732 * parser.cc: ...here.
2735 * ptree.c: Moved to...
2736 * ptree.cc: ...here.
2737 * rtti.c: Moved to...
2739 * search.c: Moved to...
2740 * search.cc: ...here.
2741 * semantics.c: Moved to...
2742 * semantics.cc: ...here.
2743 * tree.c: Moved to...
2745 * typeck.c: Moved to...
2746 * typeck.cc: ...here.
2747 * typeck2.c: Moved to...
2748 * typeck2.cc: ...here.
2749 * vtable-class-hierarchy.c: Moved to...
2750 * vtable-class-hierarchy.cc: ...here.
2752 2022-01-17 Jakub Jelinek <jakub@redhat.com>
2755 * cp-gimplify.c (cp_genericize_target_expr): Set DECL_CONTEXT of
2756 TARGET_EXPR_SLOT to current_function_decl if it was NULL.
2758 2022-01-17 Andrew Stubbs <ams@codesourcery.com>
2760 * parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.
2762 2022-01-14 Chung-Lin Tang <cltang@codesourcery.com>
2765 * semantics.c (finish_omp_clauses): Also continue peeling off of
2766 outer node for ARRAY_REFs.
2768 2022-01-14 Jakub Jelinek <jakub@redhat.com>
2771 * cp-objcp-common.c (cxx_block_may_fallthru) <case IF_STMT>: For
2772 IF_STMT_CONSTEXPR_P with constant false or true condition only
2773 check if the taken clause may fall through.
2774 * cp-gimplify.c (genericize_if_stmt): For consteval if, revert
2775 to r12-5638^ behavior if then_ block can't fall through. For
2776 constexpr if, revert to r12-5638^ behavior.
2778 2022-01-13 Anthony Sharp <anthonysharp15@gmail.com>
2779 Jason Merrill <jason@redhat.com>
2782 * parser.c (cp_parser_id_expression): Handle
2783 -Wmissing-template-keyword.
2784 (struct saved_token_sentinel): Add modes to control what happens
2786 (cp_parser_statement): Adjust.
2787 (cp_parser_skip_entire_template_parameter_list): New function that
2788 skips an entire template parameter list.
2789 (cp_parser_require_end_of_template_parameter_list): Rename old
2790 cp_parser_skip_to_end_of_template_parameter_list.
2791 (cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
2792 called from one of the above two functions.
2793 (cp_parser_lambda_declarator_opt)
2794 (cp_parser_explicit_template_declaration)
2795 (cp_parser_enclosed_template_argument_list): Adjust.
2797 2022-01-12 Jakub Jelinek <jakub@redhat.com>
2798 Jason Merrill <jason@redhat.com>
2801 * tree.c (move): If expr is xvalue_p, just return expr without
2804 2022-01-11 Jakub Jelinek <jakub@redhat.com>
2807 * class.c (build_vfn_ref): Build OBJ_TYPE_REF with INTEGER_CST
2808 OBJ_TYPE_REF_TOKEN with type equal to OBJ_TYPE_REF_OBJECT type.
2809 * error.c (resolve_virtual_fun_from_obj_type_ref): Use type of
2810 OBJ_TYPE_REF_TOKEN rather than type of OBJ_TYPE_REF_OBJECT as
2813 2022-01-11 Patrick Palka <ppalka@redhat.com>
2816 * call.c (build_new_method_call): Consider dependent bases only
2817 if 'this' is available.
2819 2022-01-11 Olivier Hainque <hainque@adacore.com>
2821 * decl.c (cxx_init_decl_processing): Move code possibly
2822 altering flag_weak before code testing it.
2824 2022-01-10 Patrick Palka <ppalka@redhat.com>
2827 * constexpr.c (cxx_fold_indirect_ref): Split out object/offset
2828 canonicalization step into a local lambda. Strengthen it to
2829 absorb more components at position 0. Use it before both calls
2830 to cxx_fold_indirect_ref_1.
2832 2022-01-10 Patrick Palka <ppalka@redhat.com>
2835 * call.c (cand_parms_match): Skip over 'this' when given one
2836 static and one non-static member function.
2838 2022-01-10 Jakub Jelinek <jakub@redhat.com>
2841 * semantics.c (expand_or_defer_fn): For immediate functions, set
2842 node->body_removed to true and clear analyzed, definition and
2844 * decl2.c (c_parse_final_cleanups): Ignore immediate functions for
2847 2022-01-08 Jakub Jelinek <jakub@redhat.com>
2850 * constexpr.c (cxx_maybe_fold_addr_pointer_plus): New function.
2851 (cxx_eval_binary_expression): Use it.
2853 2022-01-08 Jason Merrill <jason@redhat.com>
2856 * init.c (build_vec_init): Remove assert.
2857 * tree.c (build_vec_init_expr): Likewise.
2859 2022-01-08 Jason Merrill <jason@redhat.com>
2862 * call.c (build_op_delete_call): Ignore destroying delete
2865 2022-01-07 Jason Merrill <jason@redhat.com>
2868 * init.c (build_new_1): Also build pointer cleanup if
2870 * cp-tree.h (TYPE_GETS_VEC_DELETE): New.
2872 2022-01-07 Jason Merrill <jason@redhat.com>
2876 * cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling.
2878 2022-01-07 Jason Merrill <jason@redhat.com>
2881 * init.c (perform_target_ctor): Select destructor by in_chrg.
2883 2022-01-07 Jason Merrill <jason@redhat.com>
2886 * except.c (in_nested_catch): New.
2887 (expand_end_catch_block): Check it.
2889 2022-01-07 Jason Merrill <jason@redhat.com>
2893 * except.c (maybe_splice_retval_cleanup): Check
2894 current_binding_level.
2895 * semantics.c (do_poplevel): Call it here.
2896 * parser.c (cp_parser_compound_statement): Not here.
2898 2022-01-07 Jason Merrill <jason@redhat.com>
2901 * decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
2902 cleanups from set_up_extended_ref_temp.
2903 (wrap_temporary_cleanups): Ignore array cleanups.
2904 (initialize_local_var): Don't check for array here.
2905 * cp-tree.h (BIND_EXPR_VEC_DTOR): New.
2906 * init.c (build_vec_delete_1): Set it.
2908 2022-01-07 Jason Merrill <jason@redhat.com>
2911 * init.c (build_vec_delete_1): Handle throwing dtor.
2912 (build_vec_init): Tell it we're in a cleanup already.
2914 2022-01-07 Jason Merrill <jason@redhat.com>
2916 * typeck2.c (split_nonconstant_init_1): Don't cleanup the last elt.
2917 (split_nonconstant_init): Adjust.
2919 2022-01-07 Jason Merrill <jason@redhat.com>
2923 * constexpr.c (replace_decl): Rename from replace_result_decl.
2924 * cp-tree.h (replace_decl): Declare it.
2925 * cp-gimplify.c (cp_gimplify_init_expr): Call it.
2926 (cp_gimplify_expr): Don't handle VEC_INIT_EXPR.
2927 (cp_genericize_init, cp_genericize_init_expr)
2928 (cp_genericize_target_expr): New.
2929 (cp_fold_r): Call them.
2930 * tree.c (build_array_copy): Add a TARGET_EXPR.
2931 * typeck2.c (digest_init_r): Look through a TARGET_EXPR.
2933 2022-01-07 Jason Merrill <jason@redhat.com>
2936 * decl.c (initialize_local_var): Fix comment.
2937 * init.c (build_new_1): Do stabilize array init.
2938 (build_vec_init): Use TARGET_EXPR for cleanup. Initialization
2939 of an element from an explicit initializer is not a
2941 * tree.c (expand_vec_init_expr): Pass flags through.
2942 * typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
2943 (split_nonconstant_init): Handle array cleanups.
2944 * cp-tree.h: Adjust.
2946 2022-01-07 Jason Merrill <jason@redhat.com>
2949 * decl.c (check_initializer): Remove obsolete comment.
2950 (wrap_cleanups_r): Don't wrap CLEANUP_EH_ONLY.
2951 (initialize_local_var): Change assert to test.
2952 * typeck2.c (maybe_push_temp_cleanup): New.
2953 (split_nonconstant_init_1): Use it.
2954 (split_nonconstant_init): Clear cleanup flags.
2956 2022-01-07 Jason Merrill <jason@redhat.com>
2959 * typeck2.c (PICFLAG_VEC_INIT): New.
2960 (process_init_constructor_array): Set it.
2961 (process_init_constructor): Handle it.
2962 (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
2963 * init.c (build_vec_init): Likewise.
2964 * cp-gimplify.c (cp_gimplify_expr): Factor out...
2965 * tree.c (expand_vec_init_expr): ...this function.
2966 (build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P.
2967 (build_vec_init_expr): Likewise.
2968 * constexpr.c (cxx_eval_vec_init): Likewise.
2969 (reduced_constant_expression_p): Check arrays before C++20.
2970 * cp-tree.h (expand_vec_init_expr): Declare.
2972 2022-01-07 Jason Merrill <jason@redhat.com>
2974 * init.c (build_new_1): Remove preevaluation code.
2976 2022-01-05 Nathan Sidwell <nathan@acm.org>
2978 * pt.c (instantiate_class_template_1): Process attribute((used)) set
2981 2022-01-05 Nathan Sidwell <nathan@acm.org>
2983 * init.c (build_new_1): Check complain before alignment warning.
2985 2022-01-04 Jason Merrill <jason@redhat.com>
2987 * cp-tree.h (class releasing_vec): Add begin/end fns.
2989 2022-01-04 Jason Merrill <jason@redhat.com>
2991 * init.c: Include -*- C++ -*- on first line.
2993 2022-01-03 Marek Polacek <polacek@redhat.com>
2996 * parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
2999 2022-01-03 Marek Polacek <polacek@redhat.com>
3001 * parser.c (make_char_string_pack): Add a cast to const unsigned
3004 2022-01-03 Jakub Jelinek <jakub@redhat.com>
3007 * rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
3008 to DECL_TINFO_P VAR_DECLs.
3010 2022-01-02 Jason Merrill <jason@redhat.com>
3012 * init.c (build_vec_init): Append the decrement to elt_init.
3014 2022-01-02 Jason Merrill <jason@redhat.com>
3016 * decl.c (wrap_cleanups_r): Don't wrap if noexcept.
3019 Copyright (C) 2022 Free Software Foundation, Inc.
3021 Copying and distribution of this file, with or without modification,
3022 are permitted in any medium without royalty provided the copyright
3023 notice and this notice are preserved.