1 2022-11-20 Patrick Palka <ppalka@redhat.com>
3 * constraint.cc (struct norm_entry): Define.
4 (struct norm_hasher): Define.
6 (normalize_concept_check): Add function comment. Cache the
7 the normal form of the substituted concept-id. Canonicalize
8 generic arguments as NULL_TREE. Don't coerce arguments unless
10 (normalize_concept_definition): Simplify. Use norm_cache
11 instead of normalized_map.
13 2022-11-20 Patrick Palka <ppalka@redhat.com>
15 * pt.cc (coerce_template_parms): Salvage part of the function
16 comment from c_innermost_t_p. Handle parms being a full
17 template parameter list.
18 (coerce_innermost_template_parms): Remove.
19 (lookup_template_class): Use c_t_p instead of c_innermost_t_p.
20 (finish_template_variable): Likewise.
21 (tsubst_decl): Likewise.
22 (instantiate_alias_template): Likewise.
24 2022-11-19 Jakub Jelinek <jakub@redhat.com>
26 * constexpr.cc (cxx_eval_constant_expression): Implement C++23
27 P2647R1 - Permitting static constexpr variables in constexpr functions.
28 Allow DECL_EXPRs of decl_constant_var_p static or thread_local vars.
29 (potential_constant_expression_1): Similarly, except use
30 decl_maybe_constant_var_p instead of decl_constant_var_p if
31 processing_template_decl.
33 2022-11-19 Jeff Chapman II <jchapman@lock3software.com>
34 Andrew Sutton <asutton@lock3software.com>
35 Andrew Marmaduke <amarmaduke@lock3software.com>
36 Michael Lopez <mlopez@lock3software.com>
37 Jason Merrill <jason@redhat.com>
39 * cp-tree.h (enum cp_tree_index): Add
40 CPTI_PSEUDO_CONTRACT_VIOLATION.
41 (pseudo_contract_violation_type): New macro.
42 (struct saved_scope): Add x_processing_contract_condition.
43 (processing_contract_condition): New macro.
44 (comparing_override_contracts): New variable decl.
45 (find_contract): New inline.
46 (set_decl_contracts): New inline.
47 (get_contract_semantic): New inline.
48 (set_contract_semantic): New inline.
49 * constexpr.cc (cxx_eval_assert): Split out from...
50 (cxx_eval_internal_function): ...here.
51 (cxx_eval_constant_expression): Use it for contracts.
52 (potential_constant_expression_1): Handle contracts.
53 * cp-gimplify.cc (cp_genericize_r): Handle contracts.
54 * cp-objcp-common.cc (cp_tree_size): Handle contracts.
55 (cp_common_init_ts): Handle contracts.
56 (cp_handle_option): Handle contracts.
57 * decl.cc (duplicate_decls): Handle contracts.
58 (check_tag_decl): Check for bogus contracts.
59 (start_decl): Check flag_contracts.
60 (grokfndecl): Call rebuild_postconditions.
61 (grokdeclarator): Handle contract attributes.
62 (start_preparsed_function): Call start_function_contracts.
63 (finish_function): Call finish_function_contracts.
64 * decl2.cc (cp_check_const_attributes): Skip contracts.
65 (comdat_linkage): Handle outlined contracts.
66 * error.cc (dump_type): Handle null TYPE_IDENTIFIER.
67 * g++spec.cc (EXPERIMENTAL): New macro.
68 (lang_specific_driver): Add -lstdc++exp if -fcontracts.
69 * mangle.cc (write_encoding): Handle outlined contracts.
70 * module.cc (trees_out::fn_parms_init): Handle outlined contracts.
71 (trees_in::fn_parms_init): Likewise.
72 (check_mergeable_decl): Likewise.
73 (module_state_config::get_dialect): Record -fcontracts.
74 * parser.h (struct cp_unparsed_functions_entry): Add contracts.
75 * parser.cc (unparsed_contracts): New macro.
76 (push_unparsed_function_queues): Adjust.
77 (contract_attribute_p): New.
78 (cp_parser_statement): Check contracts.
79 (cp_parser_decl_specifier_seq): Handle contracts.
80 (cp_parser_skip_to_closing_square_bracket): Split out...
81 (cp_parser_skip_up_to_closing_square_bracket): ...this fn.
82 (cp_parser_class_specifier): Do contract late parsing.
83 (cp_parser_class_head): Check contracts.
84 (cp_parser_contract_role): New.
85 (cp_parser_contract_mode_opt): New.
86 (find_error, contains_error_p): New.
87 (cp_parser_contract_attribute_spec): New.
88 (cp_parser_late_contract_condition): New.
89 (cp_parser_std_attribute_spec): Handle contracts.
90 (cp_parser_save_default_args): Also save contracts.
91 * pt.cc (register_parameter_specializations): No longer static.
92 (register_local_identity): New.
93 (check_explicit_specialization): Call remove_contract_attributes.
94 (tsubst_contract, tsubst_contract_attribute): New.
95 (tsubst_contract_attributes): New.
96 (tsubst_attribute): Add comment.
97 (tsubst_copy): Also allow parm when processing_contract_condition.
98 (tsubst_expr): Handle contracts.
99 (regenerate_decl_from_template): Handle contracts.
100 * search.cc (check_final_overrider): Compare contracts.
101 * semantics.cc (set_cleanup_locs): Skip POSTCONDITION_STMT.
102 (finish_non_static_data_member): Check contracts.
103 (finish_this_expr): Check contracts.
104 (process_outer_var_ref): Handle contracts.
105 (finish_id_expression_1): Handle contracts.
106 (apply_deduced_return_type): Adjust contracts.
107 * tree.cc (handle_contract_attribute): New.
108 (get_innermost_component, is_this_expression): New.
109 (comparing_this_references): New.
110 (equivalent_member_references): New.
111 (cp_tree_equal): Check it.
112 * typeck.cc (check_return_expr): Apply contracts.
113 * Make-lang.in: Add contracts.o.
114 * config-lang.in: Add contracts.cc.
115 * cp-tree.def (ASSERTION_STMT, PRECONDITION_STMT)
116 (POSTCONDITION_STMT): New.
117 * contracts.h: New file.
118 * contracts.cc: New file.
120 2022-11-18 Jakub Jelinek <jakub@redhat.com>
122 * decl.cc (grokdeclarator): Implement
123 CWG2635 - Constrained structured bindings. Emit a pedwarn on
124 constrained auto type. Add auto_diagnostic_group for error_at
125 and inform for non-auto type on structured bindings declaration.
127 2022-11-18 Marek Polacek <polacek@redhat.com>
130 * decl.cc (grokdeclarator): Check funcdecl_p before complaining
133 2022-11-16 Marek Polacek <polacek@redhat.com>
136 * constexpr.cc (constexpr_error): New function.
137 (is_valid_constexpr_fn): Use constexpr_error.
138 (maybe_save_constexpr_fundef): Call
139 require_potential_rvalue_constant_expression_fncheck rather than
140 require_potential_rvalue_constant_expression. Register the
141 function if -Wno-invalid-constexpr was specified.
142 (explain_invalid_constexpr_fn): Don't return early if a function marked
143 'constexpr' that isn't actually a constant expression was called.
144 (non_const_var_error): Add a bool parameter. Use constexpr_error.
145 (inline_asm_in_constexpr_error): Likewise.
146 (cxx_eval_constant_expression): Adjust calls to non_const_var_error
147 and inline_asm_in_constexpr_error.
148 (potential_constant_expression_1): Add a bool parameter. Use
150 (require_potential_rvalue_constant_expression_fncheck): New function.
151 * cp-tree.h (require_potential_rvalue_constant_expression_fncheck):
153 * method.cc (struct comp_info): Call
154 require_potential_rvalue_constant_expression_fncheck rather than
155 require_potential_rvalue_constant_expression.
157 2022-11-16 Jakub Jelinek <jakub@redhat.com>
159 * typeck.cc (next_common_initial_sequence): Return false members have
160 different DECL_ALIGN.
161 (layout_compatible_type_p): Don't test TYPE_ALIGN of ENUMERAL_TYPE
164 2022-11-16 Jakub Jelinek <jakub@redhat.com>
167 * call.cc (keep_unused_object_arg): New function.
168 (build_op_call): Use it.
169 (build_op_subscript): Likewise.
170 (build_new_op): Similarly for ARRAY_REF.
171 (build_new_method_call): Use it.
172 * decl.cc (grok_op_properties): For C++20 and earlier, if operator[]
173 is static member function, require exactly one parameter rather than
174 exactly two parameters.
176 2022-11-16 Jakub Jelinek <jakub@redhat.com>
178 * typeck.cc (cp_build_modify_expr): Implement CWG 2654
179 - Un-deprecation of compound volatile assignments. Remove
180 -Wvolatile warning about compound volatile assignments.
182 2022-11-16 Jakub Jelinek <jakub@redhat.com>
184 * cp-tree.def (CONCEPT_DECL): Move to c-common.def.
185 * cp-objcp-common.cc (cp_common_init_ts): Don't handle CONCEPT_DECL
187 * cp-tree.h (finish_concept_definition): Add ATTRS parameter.
188 * parser.cc (cp_parser_concept_definition): Parse attributes in
189 between identifier and =. Adjust finish_concept_definition
191 * pt.cc (finish_concept_definition): Add ATTRS parameter. Call
192 cplus_decl_attributes.
193 * constraint.cc (build_standard_check): If CONCEPT_DECL is
194 TREE_DEPRECATED, emit -Wdeprecated-declaration warnings.
196 2022-11-15 Marek Polacek <polacek@redhat.com>
199 * decl.cc (grokdeclarator): Only emit a -Wignored-qualifiers warning
202 2022-11-15 Patrick Palka <ppalka@redhat.com>
204 * constexpr.cc (potential_constant_expression_1)
205 <case *_CAST_EXPR>: Use
206 cast_valid_in_integral_constant_expression_p instead of
208 * constraint.cc (tsubst_valid_expression_requirement): Adjust
209 calls to tsubst_copy_and_build and tsubst_expr.
210 (tsubst_constraint): Likewise.
211 (satisfy_atom): Likewise.
212 (diagnose_trait_expr): Likewise.
213 * cp-tree.h (tsubst_copy_and_build): Remove i_c_e_p parameter.
214 (tsubst_expr): Likewise.
215 * init.cc (get_nsdmi): Adjust calls to tsubst_copy_and_build
217 * pt.cc (expand_integer_pack): Likewise.
218 (instantiate_non_dependent_expr_internal): Likewise.
219 (tsubst_friend_function): Likewise.
220 (tsubst_attribute): Likewise.
221 (instantiate_class_template): Likewise.
222 (tsubst_template_arg): Likewise.
223 (gen_elem_of_pack_expansion_instantiation): Likewise.
224 (tsubst_fold_expr_init): Likewise.
225 (tsubst_pack_expansion): Likewise.
226 (tsubst_default_argument): Likewise.
227 (tsubst_function_decl): Likewise.
228 (tsubst_decl): Likewise.
229 (tsubst_arg_types): Likewise.
230 (tsubst_exception_specification): Likewise.
232 (tsubst_init): Likewise.
233 (tsubst_copy): Likewise.
234 (tsubst_omp_clause_decl): Likewise.
235 (tsubst_omp_clauses): Likewise.
236 (tsubst_copy_asm_operands): Likewise.
237 (tsubst_omp_for_iterator): Likewise.
238 (tsubst_expr): Likewise. Remove i_c_e_p parameter.
239 (tsubst_omp_udr): Likewise.
240 (tsubst_non_call_postfix_expression): Likewise. Remove i_c_e_p parameter.
241 (tsubst_lambda_expr): Likewise.
242 (tsubst_copy_and_build_call_args): Likewise.
243 (tsubst_copy_and_build): Likewise. Remove i_c_e_p parameter.
244 <case IDENTIFIER_NODE>: Adjust call to finish_id_expression
245 following removal of i_c_e_p.
246 <case *_CAST_EXPR>: Remove C++98-specific cast validity check
248 (maybe_instantiate_noexcept): Adjust calls to
249 tsubst_copy_and_build and tsubst_expr.
250 (instantiate_body): Likewise.
251 (instantiate_decl): Likewise.
252 (tsubst_initializer_list): Likewise.
253 (tsubst_enum): Likewise.
255 2022-11-15 Patrick Palka <ppalka@redhat.com>
257 * cp-lang.cc (objcp_tsubst_copy_and_build): Remove
258 function_p parameter.
259 * cp-objcp-common.h (objcp_tsubst_copy_and_build):
261 * cp-tree.h (tsubst_copy_and_build): Likewise.
262 * init.cc (get_nsdmi): Adjust calls to tsubst_copy_and_build.
263 * pt.cc (expand_integer_pack): Likewise.
264 (instantiate_non_dependent_expr_internal): Likewise.
265 (tsubst_function_decl): Likewise.
266 (tsubst_arg_types): Likewise.
267 (tsubst_exception_specification): Likewise.
269 (tsubst_copy_asm_operands): Likewise.
270 (tsubst_expr): Likewise.
271 (tsubst_non_call_postfix_expression): Likewise.
272 (tsubst_lambda_expr): Likewise.
273 (tsubst_copy_and_build_call_args): Likewise.
274 (tsubst_copy_and_build): Remove function_p parameter
275 and adjust function comment. Adjust recursive calls.
276 <case CALL_EXPR>: Update outdated comment about when
277 we can see an IDENTIFIER_NODE callee with koenig_p=false.
278 (maybe_instantiate_noexcept): Adjust calls to
279 tsubst_copy_and_build.
281 2022-11-15 Jakub Jelinek <jakub@redhat.com>
283 * cp-tree.h (next_common_initial_seqence): Rename to ...
284 (next_common_initial_sequence): ... this.
285 * typeck.cc (next_common_initial_seqence): Rename to ...
286 (next_common_initial_sequence): ... this.
287 (layout_compatible_type_p): Call next_common_initial_sequence
288 rather than next_common_initial_seqence.
289 * semantics.cc (is_corresponding_member_aggr): Likewise.
291 2022-11-15 Jakub Jelinek <jakub@redhat.com>
293 * decl.cc (grok_op_properties): Implement C++23 P2589R1
294 - static operator[]. Handle operator[] similarly to operator()
295 - allow static member functions, but pedwarn on it for C++20 and
296 older. Unlike operator(), perform rest of checks on it though for
298 * call.cc (add_operator_candidates): For operator[] with class
299 typed first parameter, pass that parameter as first_arg and
300 an adjusted arglist without that parameter.
302 2022-11-15 Patrick Palka <ppalka@redhat.com>
305 * tree.cc (cxx_attribute_table): Don't conditionally exclude
306 the init_priority entry.
307 (handle_init_priority_attribute): Remove ATTRIBUTE_UNUSED.
308 Return error_mark_node if !SUPPORTS_INIT_PRIORITY.
310 2022-11-15 Marek Polacek <polacek@redhat.com>
312 * call.cc (maybe_warn_dangling_reference): Don't warn when initializing
313 a non-const lvalue reference.
315 2022-11-14 Jason Merrill <jason@redhat.com>
317 * pt.cc (tsubst_friend_function): Check satisfaction.
319 2022-11-14 Martin Liska <mliska@suse.cz>
322 2022-11-14 Martin Liska <mliska@suse.cz>
324 * Make-lang.in: Support Sphinx based documentation.
326 2022-11-14 Martin Liska <mliska@suse.cz>
329 2022-11-14 Martin Liska <mliska@suse.cz>
332 Support installation if sphinx-build is missing.
334 2022-11-10 Marek Polacek <polacek@redhat.com>
336 * call.cc (std_pair_ref_ref_p): New.
337 (do_warn_dangling_reference): Also warn when the function returns
338 std::pair<const T&, const T&>. Recurse into TARGET_EXPR_INITIAL.
339 (maybe_warn_dangling_reference): Don't return early if we're
340 initializing a std_pair_ref_ref_p.
342 2022-11-09 Jakub Jelinek <jakub@redhat.com>
344 * tree.cc (handle_carries_dependency_attribute): New function.
345 (std_attribute_table): Add carries_dependency attribute.
346 * parser.cc (cp_parser_check_std_attribute): Add carries_dependency
349 2022-11-09 Martin Liska <mliska@suse.cz>
352 Support installation if sphinx-build is missing.
354 2022-11-09 Martin Liska <mliska@suse.cz>
356 * Make-lang.in: Support Sphinx based documentation.
358 2022-11-09 Marek Polacek <polacek@redhat.com>
361 * semantics.cc (finish_call_expr): Suppress OPT_Wpessimizing_move.
362 * typeck.cc (maybe_warn_pessimizing_move): Check warn_redundant_move
363 and warning_suppressed_p. Adjust a message depending on return_p.
364 (check_return_expr): Don't suppress OPT_Wpessimizing_move here.
366 2022-11-08 Jason Merrill <jason@redhat.com>
367 Jakub Jelinek <jakub@redhat.com>
369 * cp-tree.h (fns_correspond): Declare.
370 * decl.cc (fns_correspond): New.
371 * call.cc (add_candidates): Look for op!= matching op==.
372 (joust): Complain about non-standard reversed tiebreaker.
373 (tourney): Fix champ_compared_to_predecessor logic.
374 (build_new_op): Don't complain about error_mark_node not having
376 * pt.cc (tsubst_copy_and_build): Don't try to be permissive
379 2022-11-06 Patrick Palka <ppalka@redhat.com>
381 * tree.cc (cxx_attribute_table): Include init_priority entry
382 only if SUPPORTS_INIT_PRIORITY.
383 (handle_init_priority_attribute): Add ATTRIBUTE_UNUSED. Assert
384 SUPPORTS_INIT_PRIORITY is true.
386 2022-11-04 Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
387 Yvan ROUX <yvan.roux@foss.st.com>
389 * mapper-client.cc: Use in-process client when networking is
392 2022-11-03 Marek Polacek <polacek@redhat.com>
395 * call.cc (do_warn_dangling_reference): Quash -Wdangling-reference
396 for member operator*.
398 2022-11-03 Patrick Palka <ppalka@redhat.com>
401 * constraint.cc (tsubst_requires_expr): Make sure we're not
402 deferring access checks.
404 2022-11-03 Jason Merrill <jason@redhat.com>
406 * parser.cc (cp_parser_template_declaration_after_parameters): Fix
407 concept parsing below C++20.
409 2022-11-03 Patrick Palka <ppalka@redhat.com>
412 * decl2.cc (mark_used): Don't defer synthesis of virtual
415 2022-11-01 Nathan Sidwell <nathan@acm.org>
417 * cp-tree.h (LAMBDA_EXPR_SCOPE_SIG_DISCRIMINATOR): New.
418 (struct tree_lambda_expr): Add discriminator_sig bitfield.
419 (recrd_lambda_scope_sig_discriminator): Declare.
420 * lambda.cc (struct lambda_sig_count): New.
421 (lambda_discriminator): Add signature vector.
422 (start_lambda_scope): Adjust.
423 (compare_lambda_template_head, compare_lambda_sig): New.
424 (record_lambda_scope_sig_discriminator): New.
425 * mangle.cc (write_closure_type): Use the scope-sig discriminator for
426 ABI >= 18. Emit abi mangling warning if needed.
427 * module.cc (trees_out::core_vals): Stream the new discriminator.
428 (trees_in::core_vals): Likewise.
429 * parser.cc (cp_parser_lambda_declarator_opt): Call
430 record_lambda_scope_sig_discriminator.
431 * pt.cc (tsubst_lambda_expr): Likewise.
433 2022-11-01 Nathan Sidwell <nathan@acm.org>
435 * cp-tree.h (LAMBDA_EXPR_DISCRIMINATOR): Rename to ...
436 (LAMBDA_EXPR_SCOPE_ONLY_DISCRIMINATOR): ... here.
437 (struct tree_lambda_expr): Make default_capture_mode &
438 discriminator_scope bitfields.
439 (record_null_lambda_scope) Delete.
440 (record_lambda_scope_discriminator): Declare.
441 * lambda.cc (struct lambda_discriminator): New struct.
442 (lambda_scope, lambda_scope_stack): Adjust types.
443 (lambda_count): Delete.
444 (struct tree_int): Delete.
445 (start_lambda_scope, finish_lambda_scope): Adjust.
446 (record_lambda_scope): Only record the scope.
447 (record_lambda_scope_discriminator): New.
448 * mangle.cc (write_closure_type_name): Adjust.
449 * module.cc (trees_out::core_vals): Likewise,
450 (trees_in::core_vals): Likewise.
451 * parser.cc (cp_parser_lambda_expression): Call
452 record_lambda_scope_discriminator.
453 * pt.cc (tsubst_lambda_expr): Adjust record_lambda_scope caling. Call
454 record_lambda_scope_discriminator. Commonize control flow on tsubsting
455 the operator function.
457 2022-11-01 Jason Merrill <jason@redhat.com>
459 * parser.cc (make_call_declarator): Add std_attrs parm.
460 (cp_parser_lambda_declarator_opt): Pass it.
461 (cp_parser_direct_declarator): Pass it.
463 2022-11-01 Jason Merrill <jason@redhat.com>
465 * decl.cc (finish_function): Set TREE_NOTHROW later in the function.
467 2022-11-01 Jason Merrill <jason@redhat.com>
469 * decl.cc (duplicate_decls): Reformat loop.
470 * parser.cc (cp_parser_member_declaration): Add newline.
471 * semantics.cc: Remove newline.
473 2022-10-28 Marek Polacek <polacek@redhat.com>
475 * call.cc (maybe_warn_dangling_reference): Enable the warning in
476 system headers if the decl isn't in a system header.
478 2022-10-28 Jason Merrill <jason@redhat.com>
480 * decl.cc (grokdeclarator): Call decl_attributes before do_friend.
482 2022-10-28 Jakub Jelinek <jakub@redhat.com>
484 * parser.cc (cp_parser_omp_all_clauses): Allow optional comma
485 before the first clause even in pragma syntax.
486 (cp_parser_omp_allocate, cp_parser_omp_atomic, cp_parser_omp_depobj,
487 cp_parser_omp_flush, cp_parser_omp_scan_loop_body,
488 cp_parser_omp_ordered, cp_parser_omp_assumption_clauses,
489 cp_finish_omp_declare_variant, cp_parser_omp_declare_target,
490 cp_parser_omp_declare_reduction_exprs, cp_parser_omp_requires,
491 cp_parser_omp_error): Likewise.
493 2022-10-28 Joseph Myers <joseph@codesourcery.com>
496 * cp-tree.h (ENUM_FIXED_UNDERLYING_TYPE_P, ENUM_UNDERLYING_TYPE):
497 Remove. Moved to c-common.h.
499 2022-10-27 Jakub Jelinek <jakub@redhat.com>
502 * name-lookup.cc (push_namespace): Call find_namespace_slot again
503 after pushdecl as the hash table might be expanded during pushdecl.
505 2022-10-27 Nathan Sidwell <nathan@acm.org>
507 * mangle.cc (write_closure_template_head): New.
508 (write_closure_type_name): Call it.
510 2022-10-27 Jakub Jelinek <jakub@redhat.com>
514 * typeck.cc (cp_build_binary_op): Don't compute semantic_result_type
515 if result_type is NULL.
517 2022-10-26 Marek Polacek <polacek@redhat.com>
520 * call.cc (expr_represents_temporary_p): New, factored out of...
521 (conv_binds_ref_to_temporary): ...here. Don't return false just
522 because a ck_base is missing. Use expr_represents_temporary_p.
523 (do_warn_dangling_reference): New.
524 (maybe_warn_dangling_reference): New.
525 (extend_ref_init_temps): Call maybe_warn_dangling_reference.
526 * cp-tree.h: Adjust comment.
527 * typeck.cc (check_return_expr): Suppress -Wdangling-reference
530 2022-10-25 Nathan Sidwell <nathan@acm.org>
532 * parser.cc (synthesize_implicit_template_parm): Fix thinko about
533 mark the new parm DECL_VIRTUAL_P. Avoid unneccessary tree_last call.
535 2022-10-25 Patrick Palka <ppalka@redhat.com>
537 * constraint.cc (resolve_function_concept_overload): Explicitly
538 pass complain=tf_none to coerce_template_parms.
539 (resolve_concept_check): Likewise.
540 (normalize_concept_check): Likewise.
541 * cp-tree.h (coerce_template_parms): Declare the main overload
542 and default its last parameter to true. Remove wrapper overloads.
543 * pt.cc (determine_specialization): Adjust calls to
544 coerce_template_parms and coerce_innermost_template_parms after
545 removing their last parameter.
546 (coerce_template_args_for_ttp): Likewise.
547 (coerce_ttp_args_for_tta): Likewise.
548 (coerce_template_template_parms): Likewise.
549 (coerce_template_parms): Remove use_default_args parameter and
550 adjust function comment. Document default argument. Remove
551 wrapper overloads. No longer static.
552 (coerce_innermost_template_parms): Remove use_default_args
553 parameter. Default require_all_args to true.
554 (lookup_template_class): As with determine_specialization.
555 (finish_template_variable): Likewise.
556 (tsubst_decl): Likewise.
557 (instantiate_alias_template): Likewise.
558 (fn_type_unification): Likewise.
559 (resolve_overloaded_unification): Likewise.
560 (resolve_nondeduced_context): Likewise.
561 (get_partial_spec_bindings): Likewise.
563 2022-10-25 Jason Merrill <jason@redhat.com>
565 * constexpr.cc (find_failing_clause_r): Re-add the call to
566 contextual_conv_bool.
568 2022-10-25 Patrick Palka <ppalka@redhat.com>
572 * module.cc (trees_out::core_vals): Stream TYPE_MAX_VALUE and
573 TYPE_MIN_VALUE of ENUMERAL_TYPE.
574 (trees_in::core_vals): Likewise.
575 (trees_out::write_enum_def): Don't stream them here.
576 (trees_in::read_enum_def): Likewise.
578 2022-10-25 Jason Merrill <jason@redhat.com>
580 * constexpr.cc (class constexpr_global_ctx): Add modifiable field,
581 get_value, get_value_ptr, put_value, remove_value, flush_modifiable
583 (class modifiable_tracker): New.
584 (cxx_eval_internal_function): Use it.
585 (diagnose_failing_condition): Strip CLEANUP_POINT_EXPR.
587 2022-10-25 Jason Merrill <jason@redhat.com>
589 * constexpr.cc (fold_operand): New function.
590 (find_failing_clause_r): Add const.
591 (find_failing_clause): Add const.
592 (diagnose_failing_condition): Add ctx parameter.
593 (cxx_eval_internal_function): Pass it.
594 * semantics.cc (diagnose_failing_condition): Move to constexpr.cc.
597 2022-10-24 Jason Merrill <jason@redhat.com>
599 * cp-gimplify.cc (fold_builtin_source_location)
600 * vtable-class-hierarchy.cc (register_all_pairs): Simplify calls to
601 build_string_literal.
602 (build_string_from_id): Remove.
604 2022-10-24 Marek Polacek <polacek@redhat.com>
607 * typeck.cc (treat_lvalue_as_rvalue_p): Check the return value of move.
609 2022-10-24 Jakub Jelinek <jakub@redhat.com>
612 * typeck.cc (cp_build_binary_op): Pass operands before excess precision
613 promotions to scalar_to_vector call.
615 2022-10-24 Jakub Jelinek <jakub@redhat.com>
618 * constexpr.cc (cxx_eval_increment_expression): For signed types
619 that promote to int, evaluate PLUS_EXPR or MINUS_EXPR in int type.
621 2022-10-24 Arsen Arsenović <arsen@aarsen.me>
623 * cp-tree.h (DECL_MAIN_P): Move most logic, besides the hosted
625 (DECL_MAIN_ANY_P): ... to here, so that it can be reused ...
626 (DECL_MAIN_FREESTANDING_P): ... here, with an additional
627 constraint on (hosted OR return type == int)
628 * decl.cc (finish_function): Use DECL_MAIN_FREESTANDING_P
629 instead of DECL_MAIN_P, to loosen the hosted requirement, but
630 check noreturn, before adding implicit returns.
632 2022-10-21 Jakub Jelinek <jakub@redhat.com>
635 * constexpr.cc (reduced_constant_expression_p) <case CONSTRUCTOR>:
636 Return false for VECTOR_TYPE CONSTRUCTORs even without
637 CONSTRUCTOR_NO_CLEARING set on them.
638 (cxx_eval_bare_aggregate): If constant but !changed, fold before
639 returning VECTOR_TYPE_P CONSTRUCTOR.
640 (cxx_eval_constant_expression) <case CONSTRUCTOR>: Don't fold
641 TREE_CONSTANT CONSTRUCTOR, just return it.
643 2022-10-21 Jakub Jelinek <jakub@redhat.com>
646 * semantics.cc (finish_compound_literal): For void{}, if
647 processing_template_decl return a COMPOUND_LITERAL_P
648 CONSTRUCTOR rather than void_node.
650 2022-10-20 Patrick Palka <ppalka@redhat.com>
652 * pt.cc (lookup_and_finish_template_variable): Don't
653 instantiate if the template's scope is dependent.
654 (tsubst_copy) <case TEMPLATE_DECL>: Pass entering_scope=true
655 when substituting the class scope.
657 2022-10-20 Patrick Palka <ppalka@redhat.com>
660 * module.cc (node_template_info): Handle CONCEPT_DECL.
662 2022-10-20 Jonathan Wakely <jwakely@redhat.com>
663 Ulrich Drepper <drepper@redhat.com>
665 * Make-lang.in: Add rules to generate std-name-hint.gperf. Adjust
666 rule to generate std-name-hint.h to allow chain rule.
667 * std-name-hint.h: Regenerated.
668 * std-name-hint.gperf: This file is now generated.
669 * cxxapi-data.csv: New file. CSV file with C++ API data.
670 * gen-cxxapi-file.py: New file. Generate std-name-hint.gperf
671 and module export source (in future).
673 2022-10-19 Marek Polacek <polacek@redhat.com>
676 * typeck.cc (maybe_warn_about_useless_cast): Don't warn when
677 a glvalue is cast to a non-reference type.
679 2022-10-18 Patrick Palka <ppalka@redhat.com>
682 * module.cc (trees_out::tpl_parms_fini): Don't assume default
683 template arguments must be trailing.
684 (trees_in::tpl_parms_fini): Likewise.
686 2022-10-18 Jakub Jelinek <jakub@redhat.com>
689 * cp-tree.h (build_assume_call): Declare.
690 * parser.cc (cp_parser_omp_assumption_clauses): Use build_assume_call.
691 * cp-gimplify.cc (build_assume_call): New function.
692 (process_stmt_assume_attribute): Use build_assume_call.
693 * pt.cc (tsubst_copy_and_build): Likewise.
695 2022-10-17 Patrick Palka <ppalka@redhat.com>
698 * module.cc (trees_out::write_function_def): Stream the
699 parms and result of the constexpr_fundef entry.
700 (trees_in::read_function_def): Likewise.
702 2022-10-14 Patrick Palka <ppalka@redhat.com>
705 * constexpr.cc (cxx_dynamic_cast_fn_p): Check for abi_node
706 instead of global_namespace.
707 * rtti.cc (build_dynamic_cast_1): Set DECL_CONTEXT and
708 DECL_SOURCE_LOCATION when building dynamic_cast_node. Push
709 it into the namespace.
711 2022-10-14 Jakub Jelinek <jakub@redhat.com>
713 * cp-tree.h (extended_float_type_p): Return true for
715 * typeck.cc (cp_compare_floating_point_conversion_ranks): Set
716 extended{1,2} if mv{1,2} is bfloat16_type_node. Adjust comment.
718 2022-10-14 Jakub Jelinek <jakub@redhat.com>
723 * cp-tree.h (cp_ep_convert_and_check): Remove.
724 * cvt.cc (cp_ep_convert_and_check): Remove.
725 * call.cc (build_conditional_expr): Use excess precision for ?: with
726 one arm floating and another integral. Don't convert first to
727 semantic result type from integral types.
728 (convert_like_internal): Don't call cp_ep_convert_and_check, instead
729 just strip EXCESS_PRECISION_EXPR before calling cp_convert_and_check
731 * typeck.cc (cp_build_binary_op): Set may_need_excess_precision
732 for comparisons or SPACESHIP_EXPR with at least one operand integral.
733 Don't compute semantic_result_type if build_type is non-NULL. Call
734 cp_convert_and_check instead of cp_ep_convert_and_check.
736 2022-10-14 Jakub Jelinek <jakub@redhat.com>
740 * parser.cc (cp_parser_primary_expression): Handle
741 EXCESS_PRECISION_EXPR with REAL_CST operand the same as REAL_CST.
742 * cvt.cc (cp_ep_convert_and_check): New function.
743 * call.cc (build_conditional_expr): Add excess precision support.
744 When type_after_usual_arithmetic_conversions returns error_mark_node,
745 use gcc_checking_assert that it is because of uncomparable floating
746 point ranks instead of checking all those conditions and make it
747 work also with complex types.
748 (convert_like_internal): Likewise. Add NESTED_P argument, pass true
749 to recursive calls to convert_like.
750 (convert_like): Add NESTED_P argument, pass it through to
751 convert_like_internal. For other overload pass false to it.
752 (convert_like_with_context): Pass false to NESTED_P.
753 (convert_arg_to_ellipsis): Add excess precision support.
754 (magic_varargs_p): For __builtin_is{finite,inf,inf_sign,nan,normal}
755 and __builtin_fpclassify return 2 instead of 1, document what it
757 (build_over_call): Don't handle former magic 2 which is no longer
758 used, instead for magic 1 remove EXCESS_PRECISION_EXPR.
759 (perform_direct_initialization_if_possible): Pass false to NESTED_P
760 convert_like argument.
761 * constexpr.cc (cxx_eval_constant_expression): Handle
762 EXCESS_PRECISION_EXPR.
763 (potential_constant_expression_1): Likewise.
764 * pt.cc (tsubst_copy, tsubst_copy_and_build): Likewise.
765 * cp-tree.h (cp_ep_convert_and_check): Declare.
766 * cp-gimplify.cc (cp_fold): Handle EXCESS_PRECISION_EXPR.
767 * typeck.cc (cp_common_type): For COMPLEX_TYPEs, return error_mark_node
768 if recursive call returned it.
769 (convert_arguments): For magic 1 remove EXCESS_PRECISION_EXPR.
770 (cp_build_binary_op): Add excess precision support. When
771 cp_common_type returns error_mark_node, use gcc_checking_assert that
772 it is because of uncomparable floating point ranks instead of checking
773 all those conditions and make it work also with complex types.
774 (cp_build_unary_op): Likewise.
775 (cp_build_compound_expr): Likewise.
776 (build_static_cast_1): Remove EXCESS_PRECISION_EXPR.
778 2022-10-13 Jason Merrill <jason@redhat.com>
780 * cp-tree.h: Fix whitespace.
781 * parser.h: Fix whitespace.
782 * decl.cc: Fix whitespace.
783 * parser.cc: Fix whitespace.
784 * pt.cc: Fix whitespace.
786 2022-10-13 Martin Liska <mliska@suse.cz>
788 * vtable-class-hierarchy.cc (vtv_generate_init_routine): Emit
789 an artificial variable that would be put into .preinit_array
792 2022-10-13 Marek Polacek <polacek@redhat.com>
795 * except.cc (maybe_splice_retval_cleanup): Check current_function_decl.
798 2022-10-12 Marek Polacek <polacek@redhat.com>
800 * call.cc (standard_conversion): Remove LOOKUP_PREFER_RVALUE code.
801 (reference_binding): Honor clk_implicit_rval even pre-C++20.
802 (implicit_conversion_1): Remove LOOKUP_PREFER_RVALUE code.
803 (build_user_type_conversion_1): Likewise.
804 (convert_like_internal): Likewise.
805 (build_over_call): Likewise.
806 * cp-tree.h (LOOKUP_PREFER_RVALUE): Remove.
807 (LOOKUP_NO_NARROWING): Adjust definition.
808 * except.cc (build_throw): Don't perform two overload resolutions.
809 * typeck.cc (maybe_warn_pessimizing_move): Don't use
810 LOOKUP_PREFER_RVALUE.
811 (check_return_expr): Don't perform two overload resolutions.
813 2022-10-12 Jason Merrill <jason@redhat.com>
816 * cp-tree.h (source_location_current_p): Remove.
817 * name-lookup.h (struct cp_binding_level): Remove
819 * call.cc (in_immediate_context): All default args
820 and DMI are potentially immediate context.
821 (immediate_invocation_p): Don't treat source_location specially.
822 (struct in_consteval_if_p_temp_override): Move to cp-tree.h.
823 * constexpr.cc (get_nth_callarg): Move to cp-tree.h.
824 * cp-gimplify.cc (cp_fold_r): Don't fold consteval.
825 * name-lookup.cc (begin_scope): Don't set immediate_fn_ctx_p.
826 * parser.cc (cp_parser_lambda_declarator_opt): Likewise.
827 (cp_parser_direct_declarator): Likewise.
828 * pt.cc (tsubst_default_argument): Open sk_function_parms level.
829 * tree.cc (source_location_current_p): Remove.
830 (bot_replace): Fold consteval here.
831 (break_out_target_exprs): Handle errors.
833 2022-10-11 Patrick Palka <ppalka@redhat.com>
836 * pt.cc (tsubst_friend_function): Propagate DECL_MODULE_PURVIEW_P
837 from the introduced namespace-scope function to the namespace.
839 2022-10-11 Patrick Palka <ppalka@redhat.com>
842 * module.cc (lazy_load_binding): Clear processing_template_decl.
843 (lazy_load_pendings): Likewise.
845 2022-10-10 Nathan Sidwell <nathan@acm.org>
847 * mangle.cc (write_prefix): Add VAR_DECL & FIELD_DECL to
848 substitution table under abi=18. Note possible mismatch.
850 2022-10-10 Marek Polacek <polacek@redhat.com>
853 * error.cc: Include "attribs.h".
854 (dump_type_prefix): Print only GNU attributes here.
855 (dump_type_suffix): Print standard attributes here.
857 2022-10-08 Jason Merrill <jason@redhat.com>
859 * cp-tree.h (TARGET_EXPR_ELIDING_P): New.
860 (unsafe_copy_elision_p, set_target_expr_eliding)
861 (cp_build_init_expr): Declare.
862 * call.cc (unsafe_copy_elision_p): No longer static.
863 (build_over_call, build_special_member_call)
864 (build_new_method_call): Use cp_build_init_expr.
865 * coroutines.cc (expand_one_await_expression)
866 (build_actor_fn, flatten_await_stmt, handle_nested_conditionals)
867 (await_statement_walker, morph_fn_to_coro): Use cp_build_init_expr.
868 * cp-gimplify.cc (cp_gimplify_init_expr)
869 (cp_gimplify_expr): Check TARGET_EXPR_ELIDING_P.
870 (cp_fold_r): Propagate it.
871 (cp_fold): Use cp_build_init_expr.
872 * decl.cc (check_initializer): Use cp_build_init_expr.
873 * except.cc (build_throw): Use cp_build_init_expr.
874 * init.cc (get_nsdmi): Call set_target_expr_eliding.
875 (perform_member_init, expand_default_init, expand_aggr_init_1)
876 (build_new_1, build_vec_init): Use cp_build_init_expr.
877 * method.cc (do_build_copy_constructor): Use cp_build_init_expr.
878 * semantics.cc (simplify_aggr_init_expr, finalize_nrv_r)
879 (finish_omp_reduction_clause): Use cp_build_init_expr.
880 * tree.cc (build_target_expr): Call set_target_expr_eliding.
881 (bot_manip): Copy TARGET_EXPR_ELIDING_P.
882 * typeck.cc (cp_build_modify_expr): Call set_target_expr_eliding.
883 (check_return_expr): Use cp_build_modify_expr.
884 * typeck2.cc (split_nonconstant_init_1)
885 (split_nonconstant_init): Use cp_build_init_expr.
886 (massage_init_elt): Call set_target_expr_eliding.
887 (process_init_constructor_record): Clear TARGET_EXPR_ELIDING_P on
889 (set_target_expr_eliding, cp_build_init_expr): New.
891 2022-10-07 Marek Polacek <polacek@redhat.com>
894 * call.cc (conv_binds_ref_to_temporary): New.
895 (ref_conv_binds_directly): Rename to...
896 (ref_conv_binds_to_temporary): ...this. Use
897 conv_binds_ref_to_temporary.
898 * cp-tree.h (ref_conv_binds_directly): Rename to...
899 (ref_conv_binds_to_temporary): ...this.
900 * method.cc (ref_xes_from_temporary): Use ref_conv_binds_to_temporary.
901 * parser.cc (warn_for_range_copy): Likewise.
903 2022-10-07 Qing Zhao <qing.zhao@oracle.com>
905 * module.cc (trees_out::core_bools): Stream out new bit
907 (trees_in::core_bools): Stream in new bit decl_not_flexarray.
909 2022-10-07 Patrick Palka <ppalka@redhat.com>
911 * module.cc (trees_out::mark_class_def): Guard against
912 DECL_BIT_FIELD_REPRESENTATIVE not being a decl.
914 2022-10-07 Jason Merrill <jason@redhat.com>
916 * init.cc (expand_default_init): Also push the INIT_EXPR inside a
919 2022-10-07 Patrick Palka <ppalka@redhat.com>
922 * module.cc (trees_out::core_bools): Don't override
923 DECL_EXTERNAL to true for static variables from an inline
926 2022-10-07 Martin Liska <mliska@suse.cz>
928 * module.cc (enum module_state_counts): Use array size.
929 * name-lookup.cc (class namespace_limit_reached): Likewise.
930 (class module_state): Move up in the file.
932 2022-10-07 Jakub Jelinek <jakub@redhat.com>
934 * parser.cc (cp_parser_check_std_attribute): Only do checks if
935 attribute is a standard attribute or in gnu namespace and only
936 lookup other attributes in those namespaces.
937 * cp-gimplify.cc (lookup_hotness_attribute): Adjust function comment.
938 Only return true for standard attribute or gnu namespace attribute.
939 (remove_hotness_attribute): Only remove hotness attributes when
940 they are standard or in gnu namespace, implement it in a single
941 loop rather than former 4 now 8 remove_attribute calls.
943 2022-10-06 Jason Merrill <jason@redhat.com>
945 * coroutines.cc (expand_one_await_expression): Change conversion
946 to VIEW_CONVERT_EXPR.
947 * cp-gimplify.cc (cp_genericize_r) [CONVERT_EXPR]: Add assert.
949 2022-10-06 Joseph Myers <joseph@codesourcery.com>
951 * lex.cc (init_reswords): Handle D_EXT11.
953 2022-10-06 Patrick Palka <ppalka@redhat.com>
955 * pt.cc (optimize_specialization_lookup_p): Remove.
956 (retrieve_specialization): Assume the above returns false
957 and simplify accordingly.
958 (register_specialization): Likewise.
960 2022-10-06 Jakub Jelinek <jakub@redhat.com>
962 * parser.cc (cp_parser_omp_assumption_clauses): Emit IFN_ASSUME
963 call for holds clause on assume construct.
965 2022-10-06 Jakub Jelinek <jakub@redhat.com>
968 * cp-tree.h (process_stmt_assume_attribute): Implement C++23
969 P1774R8 - Portable assumptions. Declare.
970 (diagnose_failing_condition): Declare.
971 (find_failing_clause): Likewise.
972 * parser.cc (assume_attr): New enumerator.
973 (cp_parser_parenthesized_expression_list): Handle assume_attr.
974 Remove identifier variable, for id_attr push the identifier into
975 expression_list right away instead of inserting it before all the
977 (cp_parser_conditional_expression): New function.
978 (cp_parser_constant_expression): Use it.
979 (cp_parser_statement): Handle assume attribute.
980 (cp_parser_expression_statement): Likewise.
981 (cp_parser_gnu_attribute_list): Use assume_attr for assume
983 (cp_parser_std_attribute): Likewise. Handle standard assume
984 attribute like gnu::assume.
985 * cp-gimplify.cc (process_stmt_assume_attribute): New function.
986 * constexpr.cc: Include fold-const.h.
987 (find_failing_clause_r, find_failing_clause): New functions,
988 moved from semantics.cc with ctx argument added and if non-NULL,
989 call cxx_eval_constant_expression rather than fold_non_dependent_expr.
990 (cxx_eval_internal_function): Handle IFN_ASSUME.
991 (potential_constant_expression_1): Likewise.
992 * pt.cc (tsubst_copy_and_build): Likewise.
993 * semantics.cc (diagnose_failing_condition): New function.
994 (find_failing_clause_r, find_failing_clause): Moved to constexpr.cc.
995 (finish_static_assert): Use it. Add auto_diagnostic_group.
997 2022-10-05 Jason Merrill <jason@redhat.com>
999 * tree.cc (lvalue_kind) [VIEW_CONVERT_EXPR]: Change prvalue to
1002 2022-10-04 Jason Merrill <jason@redhat.com>
1005 * cp-gimplify.cc (cp_genericize_init_expr): Use iloc_sentinel.
1006 (cp_genericize_target_expr): Likewise.
1008 2022-10-04 Patrick Palka <ppalka@redhat.com>
1011 * Make-lang.in (CP_PLUGIN_HEADERS): Add cp-trait.def.
1013 2022-10-04 Jakub Jelinek <jakub@redhat.com>
1015 * cp-tree.h (struct omp_declare_target_attr): Rename to ...
1016 (cp_omp_declare_target_attr): ... this. Add device_type member.
1017 (omp_begin_assumes_data): Rename to ...
1018 (cp_omp_begin_assumes_data): ... this.
1019 (struct saved_scope): Change types of omp_declare_target_attribute
1020 and omp_begin_assumes.
1021 * parser.cc (cp_parser_omp_clause_device_type): Uncomment
1022 check_no_duplicate_clause call.
1023 (cp_parser_omp_all_clauses): Fix up pasto, c_name for OMP_CLAUSE_LINK
1024 should be "link" rather than "to".
1025 (cp_parser_omp_declare_target): Adjust for omp_declare_target_attr
1026 to cp_omp_declare_target_attr changes, push -1 as device_type. Use
1027 error_at rather than warning_at for declare target with only
1028 device_type clauses.
1029 (OMP_BEGIN_DECLARE_TARGET_CLAUSE_MASK): Define.
1030 (cp_parser_omp_begin): Add begin declare target support. Adjust
1031 for omp_begin_assumes_data to cp_omp_begin_assumes_data change.
1032 (cp_parser_omp_end): Adjust for the
1033 omp_declare_target_attr to cp_omp_declare_target_attr and
1034 omp_begin_assumes_data to cp_omp_begin_assumes_data type changes,
1035 adjust diagnostics wording and simplify format strings for easier
1037 * semantics.cc (finish_translation_unit): Likewise.
1038 * decl2.cc (cplus_decl_attributes): If device_type was present on
1039 begin declare target, add "omp declare target host" and/or
1040 "omp declare target nohost" attributes.
1042 2022-10-03 Jakub Jelinek <jakub@redhat.com>
1044 * cp-tree.h (BCS_STMT_EXPR): New enumerator.
1045 * name-lookup.h (enum scope_kind): Add sk_stmt_expr.
1046 * name-lookup.cc (begin_scope): Handle sk_stmt_expr like sk_block.
1047 * semantics.cc (begin_compound_stmt): For BCS_STMT_EXPR use
1049 * parser.cc (cp_parser_statement_expr): Use BCS_STMT_EXPR instead of
1051 * decl.cc (struct named_label_entry): Add in_stmt_expr.
1052 (poplevel_named_label_1): Handle sk_stmt_expr.
1053 (check_previous_goto_1): Diagnose entering of statement expression.
1054 (check_goto): Likewise.
1056 2022-10-03 Patrick Palka <ppalka@redhat.com>
1058 * constraint.cc (diagnose_trait_expr): Use CPTK_IS_SAME instead
1060 * cp-trait.def (IS_SAME_AS): Rename to ...
1061 (IS_SAME): ... this.
1062 * pt.cc (alias_ctad_tweaks): Use CPTK_IS_SAME instead of
1064 * semantics.cc (trait_expr_value): Likewise.
1065 (finish_trait_expr): Likewise.
1067 2022-10-01 Patrick Palka <ppalka@redhat.com>
1069 * semantics.cc (trait_expr_value): Make cp_trait_kind switch
1070 statement exhaustive.
1071 (finish_trait_expr): Likewise.
1072 (finish_trait_type): Likewise.
1074 2022-10-01 Jason Merrill <jason@redhat.com>
1076 * init.cc (build_vec_init): Clear from_array for CONSTRUCTOR
1079 2022-10-01 Jason Merrill <jason@redhat.com>
1081 * cp-gimplify.cc (cp_genericize_init): Also convert the result of
1082 split_nonconstant_init to void.
1084 2022-09-30 Patrick Palka <ppalka@redhat.com>
1086 * constraint.cc (diagnose_trait_expr): Likewise.
1087 * cp-objcp-common.cc (names_builtin_p): Likewise.
1088 * cp-tree.h (enum cp_trait_kind): Likewise.
1089 * cxx-pretty-print.cc (pp_cxx_trait): Likewise.
1090 * parser.cc (cp_keyword_starts_decl_specifier_p): Likewise.
1091 (cp_parser_primary_expression): Likewise.
1092 (cp_parser_trait): Likewise.
1093 (cp_parser_simple_type_specifier): Likewise.
1094 * cp-trait.def: New file.
1096 2022-09-30 Jason Merrill <jason@redhat.com>
1098 * cp-gimplify.cc (cp_fold_r) [TARGET_EXPR]: Collapse
1099 TARGET_EXPR within TARGET_EXPR.
1100 * constexpr.cc (cxx_eval_outermost_constant_expr): Avoid
1101 adding redundant TARGET_EXPR.
1102 * cp-tree.h (target_expr_needs_replace): VEC_INIT_EXPR doesn't.
1104 2022-09-29 Patrick Palka <ppalka@redhat.com>
1107 * pt.cc (listify): Use lookup_qualified_name instead of
1108 get_namespace_binding.
1110 2022-09-29 Jason Merrill <jason@redhat.com>
1112 * class.cc (check_methods): Call constraints_satisfied_p.
1114 2022-09-29 Jason Merrill <jason@redhat.com>
1116 * constexpr.cc (potential_constant_expression_1): Look into
1117 DECL_INITIAL. Use location wrappers.
1119 2022-09-29 Jason Merrill <jason@redhat.com>
1122 * call.cc (build_conditional_expr): For a?:c extension, treat
1123 a reused class prvalue as an xvalue.
1125 2022-09-29 Jason Merrill <jason@redhat.com>
1127 * call.cc (build_conditional_expr): Set TARGET_EXPR_NO_ELIDE on the
1130 2022-09-29 Patrick Palka <ppalka@redhat.com>
1132 * constraint.cc (diagnose_trait_expr): Handle CPTK_REMOVE_CV,
1133 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
1134 * cp-objcp-common.cc (names_builtin_p): Likewise.
1135 * cp-tree.h (enum cp_trait_kind): Add CPTK_REMOVE_CV,
1136 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
1137 * cxx-pretty-print.cc (pp_cxx_trait): Handle CPTK_REMOVE_CV,
1138 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
1139 * parser.cc (cp_keyword_starts_decl_specifier_p): Return true
1140 for RID_REMOVE_CV, RID_REMOVE_REFERENCE and RID_REMOVE_CVREF.
1141 (cp_parser_trait): Handle RID_REMOVE_CV, RID_REMOVE_REFERENCE
1142 and RID_REMOVE_CVREF.
1143 (cp_parser_simple_type_specifier): Likewise.
1144 * semantics.cc (finish_trait_type): Likewise.
1146 2022-09-29 Patrick Palka <ppalka@redhat.com>
1148 * cp-objcp-common.cc (cp_common_init_ts): Replace
1149 UNDERLYING_TYPE with TRAIT_TYPE.
1150 * cp-tree.def (TRAIT_TYPE): Define.
1151 (UNDERLYING_TYPE): Remove.
1152 * cp-tree.h (TRAIT_TYPE_KIND_RAW): Define.
1153 (TRAIT_TYPE_KIND): Define.
1154 (TRAIT_TYPE_TYPE1): Define.
1155 (TRAIT_TYPE_TYPE2): Define.
1156 (WILDCARD_TYPE_P): Return true for TRAIT_TYPE.
1157 (finish_trait_type): Declare.
1158 * cxx-pretty-print.cc (cxx_pretty_printer::primary_expression):
1159 Adjust after renaming pp_cxx_trait_expression.
1160 (cxx_pretty_printer::simple_type_specifier) <case TRAIT_TYPE>:
1162 (cxx_pretty_printer::type_id): Replace UNDERLYING_TYPE with
1164 (pp_cxx_trait_expression): Rename to ...
1165 (pp_cxx_trait): ... this. Handle TRAIT_TYPE as well. Correct
1166 pretty printing of the trailing arguments.
1167 * cxx-pretty-print.h (pp_cxx_trait_expression): Rename to ...
1168 (pp_cxx_trait_type): ... this.
1169 * error.cc (dump_type) <case UNDERLYING_TYPE>: Remove.
1170 <case TRAIT_TYPE>: New.
1171 (dump_type_prefix): Replace UNDERLYING_WITH with TRAIT_TYPE.
1172 (dump_type_suffix): Likewise.
1173 * mangle.cc (write_type) <case UNDERLYING_TYPE>: Remove.
1174 <case TRAIT_TYPE>: New.
1175 * module.cc (trees_out::type_node) <case UNDERLYING_TYPE>:
1177 <case TRAIT_TYPE>: New.
1178 (trees_in::tree_node): Likewise.
1179 * parser.cc (cp_parser_primary_expression): Adjust after
1180 renaming cp_parser_trait_expr.
1181 (cp_parser_trait_expr): Rename to ...
1182 (cp_parser_trait): ... this. Call finish_trait_type for traits
1184 (cp_parser_simple_type_specifier): Adjust after renaming
1185 cp_parser_trait_expr.
1186 * pt.cc (for_each_template_parm_r) <case UNDERLYING_TYPE>:
1188 <case TRAIT_TYPE>: New.
1190 (unify): Replace UNDERLYING_TYPE with TRAIT_TYPE.
1191 (dependent_type_p_r): Likewise.
1192 * semantics.cc (finish_underlying_type): Don't return
1193 UNDERLYING_TYPE anymore when processing_template_decl.
1194 (finish_trait_type): Define.
1195 * tree.cc (strip_typedefs) <case UNDERLYING_TYPE>: Remove.
1196 <case TRAIT_TYPE>: New.
1197 (cp_walk_subtrees): Likewise.
1198 * typeck.cc (structural_comptypes): Likewise.
1200 2022-09-29 Nathan Sidwell <nathan@acm.org>
1203 * module.cc (enum tree_tag): Add tt_nttp_var.
1204 (trees_out::decl_node): Handle NTTP objects.
1205 (trees_in::tree_node): Handle tt_nttp_var.
1206 (depset::hash::add_binding_entry): Skip NTTP objects.
1208 2022-09-28 Eugene Rozenfeld <erozen@microsoft.com>
1210 * module.cc (write_location): Write discriminator.
1211 (read_location): Read discriminator.
1213 2022-09-28 Nathan Sidwell <nathan@acm.org>
1215 * cp-tree.h (DECL_NTTP_OBJECT_P): New.
1216 (template_parm_object_p): Delete.
1217 (build_template_parm_object): Declare.
1218 * cxx-pretty-print.cc (pp_cx_template_argument_list): Use DECL_NTTP_OBJECT_P.
1219 * error.cc (dump_simple_decl): Likewise.
1220 * mangle.cc (write_template_arg): Likewise.
1221 * pt.cc (template_parm_object_p): Delete.
1222 (create_template_parm_object): Separated out checking from ...
1223 (get_template_parm_object): ... this, new external entry point.
1225 2022-09-27 Marek Polacek <polacek@redhat.com>
1229 * call.cc (reference_binding): Check clk_implicit_rval in C++20 only.
1230 * cp-tree.h (unparenthesized_id_or_class_member_access_p): Declare.
1231 * pt.cc (unparenthesized_id_or_class_member_access_p): New function,
1233 (do_auto_deduction): ...here. Use it. In C++23, maybe call
1234 treat_lvalue_as_rvalue_p.
1235 * tree.cc (xvalue_p): Check & clk_rvalueref, not == clk_rvalueref.
1236 * typeck.cc (check_return_expr): Allow implicit move for functions
1237 returning a reference as well, or when the return value type is not
1240 2022-09-27 Marek Polacek <polacek@redhat.com>
1242 * constraint.cc (diagnose_trait_expr): Say "nothrow" without quotes
1243 rather than in quotes.
1245 2022-09-27 Jonathan Wakely <jwakely@redhat.com>
1248 * method.cc (is_convertible_helper): Use access check sentinel.
1250 2022-09-27 Jakub Jelinek <jakub@redhat.com>
1253 * cp-tree.h (LAMBDA_EXPR_STATIC_P): Implement C++23
1254 P1169R4 - static operator(). Define.
1255 * parser.cc (CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR): Document
1256 that it also allows static.
1257 (cp_parser_lambda_declarator_opt): Handle static lambda specifier.
1258 (cp_parser_decl_specifier_seq): Allow RID_STATIC for
1259 CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
1260 * decl.cc (grok_op_properties): If operator() isn't a method,
1261 use a different error wording, if it is static member function,
1262 allow it (for C++20 and older with a pedwarn unless it is
1263 a lambda function or template instantiation).
1264 * call.cc (joust): Don't ICE if one candidate is static member
1265 function and the other is an indirect call. If the parameter
1266 conversion on the other candidate is user defined conversion,
1267 ellipsis or bad conversion, make static member function candidate
1268 a winner for that parameter.
1269 * lambda.cc (maybe_add_lambda_conv_op): Handle static lambdas.
1270 * error.cc (dump_lambda_function): Print static for static lambdas.
1272 2022-09-27 Jakub Jelinek <jakub@redhat.com>
1274 * cp-tree.h (struct omp_begin_assumes_data): New type.
1275 (struct saved_scope): Add omp_begin_assumes member.
1276 * parser.cc: Include bitmap.h.
1277 (cp_parser_omp_assumption_clauses, cp_parser_omp_assume,
1278 cp_parser_omp_assumes, cp_parser_omp_begin): New functions.
1279 (cp_parser_omp_end_declare_target): Rename to ...
1280 (cp_parser_omp_end): ... this. Handle also end assumes.
1281 (cp_parser_omp_construct): Handle PRAGMA_OMP_ASSUME.
1282 (cp_parser_pragma): Handle PRAGMA_OMP_ASSUME, PRAGMA_OMP_ASSUMES
1283 and PRAGMA_OMP_BEGIN. Handle PRAGMA_OMP_END rather than
1284 PRAGMA_OMP_END_DECLARE_TARGET and call cp_parser_omp_end
1285 for it rather than cp_parser_omp_end_declare_target.
1286 * pt.cc (apply_late_template_attributes): Also temporarily clear
1288 * semantics.cc (finish_translation_unit): Also diagnose
1289 #pragma omp begin assumes without corresponding
1290 #pragma omp end assumes.
1292 2022-09-27 Jakub Jelinek <jakub@redhat.com>
1294 * parser.cc (cp_parser_lambda_declarator_opt): Don't diagnose
1295 conflicting specifiers here.
1296 (cp_storage_class_name): New variable.
1297 (cp_parser_decl_specifier_seq): When setting conflicting_specifiers_p
1298 for the first time, diagnose which exact specifiers conflict.
1299 (cp_parser_set_storage_class): Likewise. Move storage_class
1300 computation earlier.
1301 * decl.cc (grokdeclarator): Don't diagnose conflicting specifiers
1302 here, just return error_mark_node.
1304 2022-09-27 Jakub Jelinek <jakub@redhat.com>
1308 * cp-tree.h (cp_compare_floating_point_conversion_ranks): Implement
1309 P1467R9 - Extended floating-point types and standard names except
1310 for std::bfloat16_t for now. Declare.
1311 (extended_float_type_p): New inline function.
1312 * mangle.cc (write_builtin_type): Mangle float{16,32,64,128}_type_node
1313 as DF{16,32,64,128}_. Mangle float{32,64,128}x_type_node as
1314 DF{32,64,128}x. Remove FIXED_POINT_TYPE mangling that conflicts
1316 * typeck2.cc (check_narrowing): If one of ftype or type is extended
1317 floating-point type, compare floating-point conversion ranks.
1318 * parser.cc (cp_keyword_starts_decl_specifier_p): Handle
1320 (cp_parser_simple_type_specifier): Likewise and diagnose missing
1321 _Float<N> or _Float<N>x support if not supported by target.
1322 * typeck.cc (cp_compare_floating_point_conversion_ranks): New function.
1323 (cp_common_type): If both types are REAL_TYPE and one or both are
1324 extended floating-point types, select common type based on comparison
1325 of floating-point conversion ranks and subranks.
1326 (cp_build_binary_op): Diagnose operation with floating point arguments
1327 with unordered conversion ranks.
1328 * call.cc (standard_conversion): For floating-point conversion, if
1329 either from or to are extended floating-point types, set conv->bad_p
1330 for implicit conversion from larger to smaller conversion rank or
1331 with unordered conversion ranks.
1332 (convert_like_internal): Emit a pedwarn on such conversions.
1333 (build_conditional_expr): Diagnose operation with floating point
1334 arguments with unordered conversion ranks.
1335 (convert_arg_to_ellipsis): Don't promote extended floating-point types
1336 narrower than double to double.
1337 (compare_ics): Implement P1467R9 [over.ics.rank]/4 changes.
1339 2022-09-26 Marek Polacek <polacek@redhat.com>
1342 * typeck2.cc (array_string_literal_compatible_p): Allow
1343 initializing arrays of char or unsigned char by a UTF-8 string literal.
1345 2022-09-26 Marek Polacek <polacek@redhat.com>
1348 * method.cc (is_convertible_helper): New.
1349 (is_convertible): Use it.
1350 (is_nothrow_convertible): Likewise.
1352 2022-09-26 Patrick Palka <ppalka@redhat.com>
1355 * module.cc (trees_in::decl_value): In the MK_partial case for
1356 a variable template partial specialization, pass decl_p=true to
1357 add_mergeable_specialization, and set spec to the VAR_DECL not
1359 * pt.cc (add_mergeable_specialization): For a variable template
1360 partial specialization, set the TREE_TYPE of the new
1361 DECL_TEMPLATE_SPECIALIZATIONS node to the TREE_TYPE of the
1362 VAR_DECL not the VAR_DECL itself.
1364 2022-09-23 Marek Polacek <polacek@redhat.com>
1367 * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONVERTIBLE
1368 and CPTK_IS_NOTHROW_CONVERTIBLE.
1369 * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_CONVERTIBLE
1370 RID_IS_NOTHROW_CONVERTIBLE.
1371 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_CONVERTIBLE and
1372 CPTK_IS_NOTHROW_CONVERTIBLE.
1373 (is_convertible): Declare.
1374 (is_nothrow_convertible): Likewise.
1375 * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
1376 CPTK_IS_CONVERTIBLE and CPTK_IS_NOTHROW_CONVERTIBLE.
1377 * method.cc (is_convertible): New.
1378 (is_nothrow_convertible): Likewise.
1379 * parser.cc (cp_parser_primary_expression): Handle RID_IS_CONVERTIBLE
1380 and RID_IS_NOTHROW_CONVERTIBLE.
1381 (cp_parser_trait_expr): Likewise.
1382 * semantics.cc (trait_expr_value): Handle CPTK_IS_CONVERTIBLE and
1383 CPTK_IS_NOTHROW_CONVERTIBLE.
1384 (finish_trait_expr): Likewise.
1386 2022-09-23 Marek Polacek <polacek@redhat.com>
1389 * typeck2.cc (split_nonconstant_init_1): Check TYPE_P.
1391 2022-09-22 Patrick Palka <ppalka@redhat.com>
1394 * module.cc (trees_out::decl_value): Use get_template_info in
1395 the MK_partial case to handle both VAR_DECL and TYPE_DECL.
1396 (trees_out::key_mergeable): Likewise.
1397 (trees_in::key_mergeable): Likewise.
1398 (has_definition): Consider DECL_INITIAL of a partial variable
1399 template specialization.
1400 (depset::hash::make_dependency): Handle partial variable template
1401 specializations too.
1403 2022-09-20 Patrick Palka <ppalka@redhat.com>
1405 * decl.cc (cp_finish_decl): After updating the deduced type of a
1406 VAR_DECL, also update the corresponding TEMPLATE_DECL if there
1409 2022-09-20 Patrick Palka <ppalka@redhat.com>
1412 * module.cc (trees_out::type_node) <case TYPE_PACK_EXPANSION>:
1413 Stream PACK_EXPANSION_EXTRA_ARGS.
1414 (trees_in::tree_node) <case TYPE_PACK_EXPANSION>: Likewise.
1416 2022-09-17 Patrick Palka <ppalka@redhat.com>
1418 * module.cc (friend_from_decl_list): Don't consider
1419 CLASSTYPE_TEMPLATE_INFO for a TYPENAME_TYPE friend.
1420 (trees_in::read_class_def): Don't add to
1421 CLASSTYPE_BEFRIENDING_CLASSES for a TYPENAME_TYPE friend.
1423 2022-09-16 Patrick Palka <ppalka@redhat.com>
1426 * constexpr.cc (cxx_eval_component_reference): Check non_constant_p
1427 sooner. In C++14 or later, reject a DECL_MUTABLE_P member access
1428 only if CONSTRUCTOR_MUTABLE_POISION is also set.
1430 2022-09-16 Jason Merrill <jason@redhat.com>
1433 * parser.cc (cp_parser_omp_var_list_no_open): Pass the
1434 initial token location down.
1435 * semantics.cc (finish_omp_clauses): Check
1436 invalid_nonstatic_memfn_p.
1437 * typeck.cc (invalid_nonstatic_memfn_p): Handle null TREE_TYPE.
1439 2022-09-15 Richard Biener <rguenther@suse.de>
1441 * decl.cc (cxx_init_decl_processing): Inline last
1442 build_void_list_node call.
1443 (build_void_list_node): Remove.
1445 2022-09-14 Julian Brown <julian@codesourcery.com>
1447 * semantics.cc (finish_omp_clauses): Likewise.
1449 2022-09-13 Patrick Palka <ppalka@redhat.com>
1451 * cp-tree.h (mark_used): Remove single-parameter overload. Add
1452 default argument to the two-parameter overload.
1453 * decl2.cc (mark_used): Likewise.
1455 2022-09-13 Patrick Palka <ppalka@redhat.com>
1457 * cp-tree.h (cxx_constant_value): Define two-parameter version
1458 that omits the object parameter.
1459 * decl.cc (build_explicit_specifier): Omit NULL_TREE object
1460 argument to cxx_constant_value.
1461 * except.cc (build_noexcept_spec): Likewise.
1462 * pt.cc (expand_integer_pack): Likewise.
1463 (fold_targs_r): Likewise.
1464 * semantics.cc (finish_if_stmt_cond): Likewise.
1466 2022-09-13 Patrick Palka <ppalka@redhat.com>
1468 * decl.cc (build_explicit_specifier): Pass complain to
1470 * except.cc (build_noexcept_spec): Likewise.
1471 * pt.cc (expand_integer_pack): Likewise.
1472 (tsubst_function_decl): Propagate error_mark_node returned
1473 from build_explicit_specifier.
1475 2022-09-12 Patrick Palka <ppalka@redhat.com>
1477 * call.cc (build_conditional_expr): Adjust calls to
1478 '_sfinae'-suffixed functions.
1479 (build_temp): Likewise.
1480 (convert_like_internal): Likewise.
1481 (convert_arg_to_ellipsis): Likewise.
1482 (build_over_call): Likewise.
1483 (build_cxx_call): Likewise.
1484 (build_new_method_call): Likewise.
1485 * constexpr.cc (cxx_eval_outermost_constant_expr): Likewise.
1486 (cxx_constant_value_sfinae): Rename to ...
1487 (cxx_constant_value): ... this. Document its default arguments.
1488 (fold_non_dependent_expr): Adjust function comment.
1489 * cp-tree.h (instantiate_non_dependent_expr_sfinae): Rename to ...
1490 (instantiate_non_dependent_expr): ... this. Give its 'complain'
1491 parameter a default argument.
1492 (get_target_expr_sfinae, get_target_expr): Likewise.
1493 (require_complete_type_sfinae, require_complete_type): Likewise.
1494 (abstract_virtuals_error_sfinae, abstract_virtuals_error):
1496 (cxx_constant_value_sfinae, cxx_constant_value): Likewise.
1497 * cvt.cc (build_up_reference): Adjust calls to '_sfinae'-suffixed
1499 (ocp_convert): Likewise.
1500 * decl.cc (build_explicit_specifier): Likewise.
1501 * except.cc (build_noexcept_spec): Likewise.
1502 * init.cc (build_new_1): Likewise.
1503 * pt.cc (expand_integer_pack): Likewise.
1504 (instantiate_non_dependent_expr_internal): Adjust function
1506 (instantiate_non_dependent_expr): Rename to ...
1507 (instantiate_non_dependent_expr_sfinae): ... this. Document its
1509 (tsubst_init): Adjust calls to '_sfinae'-suffixed functions.
1510 (fold_targs_r): Likewise.
1511 * semantics.cc (finish_compound_literal): Likewise.
1512 (finish_decltype_type): Likewise.
1513 (cp_build_bit_cast): Likewise.
1514 * tree.cc (build_cplus_new): Likewise.
1515 (get_target_expr): Rename to ...
1516 (get_target_expr_sfinae): ... this. Document its default
1518 * typeck.cc (require_complete_type): Rename to ...
1519 (require_complete_type_sfinae): ... this. Document its default
1521 (cp_build_array_ref): Adjust calls to '_sfinae'-suffixed
1523 (convert_arguments): Likewise.
1524 (cp_build_binary_op): Likewise.
1525 (build_static_cast_1): Likewise.
1526 (cp_build_modify_expr): Likewise.
1527 (convert_for_initialization): Likewise.
1528 * typeck2.cc (abstract_virtuals_error): Rename to ...
1529 (abstract_virtuals_error_sfinae): ... this. Document its default
1531 (build_functional_cast_1): Adjust calls to '_sfinae'-suffixed
1534 2022-09-12 Patrick Palka <ppalka@redhat.com>
1537 * pt.cc (tsubst_template_args): Set cp_evaluated here.
1538 (tsubst_aggr_type): Not here.
1540 2022-09-12 Jason Merrill <jason@redhat.com>
1544 * decl.cc (cp_finish_decl): Call mark_single_function.
1546 2022-09-12 Jason Merrill <jason@redhat.com>
1549 * pt.cc (type_dependent_expression_p): Treat a compound
1550 literal of array-of-unknown-bound type like a variable.
1552 2022-09-12 Jason Merrill <jason@redhat.com>
1555 * lambda.cc (type_deducible_expression_p): Check
1556 array_of_unknown_bound_p.
1558 2022-09-12 Jonathan Wakely <jwakely@redhat.com>
1561 * decl2.cc (constrain_class_visibility): Adjust wording of
1562 -Wsubobject-linkage for cases where anonymous
1563 namespaces aren't used.
1564 * tree.cc (decl_anon_ns_mem_p): Now only true for actual anonymous
1565 namespace members, rename old semantics to...
1566 (decl_internal_context_p): ...this.
1567 * cp-tree.h, name-lookup.cc, pt.cc: Adjust.
1569 2022-09-08 Jonathan Wakely <jwakely@redhat.com>
1572 * class.cc (type_has_virtual_destructor): Return false for
1574 * semantics.cc (check_trait_type): Add KIND parameter to support
1575 different sets of requirements.
1576 (finish_trait_expr): Pass KIND argument for relevant traits.
1578 2022-09-08 Patrick Palka <ppalka@redhat.com>
1581 * decl2.cc (maybe_instantiate_decl): Adjust function comment.
1582 Check VAR_OR_FUNCTION_DECL_P. Pull out the disjunction into ...
1583 (mark_used): ... here, removing the decl_maybe_constant_var_p
1586 2022-09-07 Jason Merrill <jason@redhat.com>
1589 * decl.cc (grokdeclarator): Improve placeholder diagnostics.
1590 * parser.cc (cp_parser_type_id_1): Add fixit.
1592 2022-09-07 Arsen Arsenović <arsen@aarsen.me>
1596 * coroutines.cc (coro_rewrite_function_body): Ensure we have a
1597 BIND_EXPR wrapping the function body.
1599 2022-09-07 Jakub Jelinek <jakub@redhat.com>
1602 * semantics.cc (finish_omp_target_clauses): If current_function_decl
1603 isn't a nonstatic member function, don't set data.current_object to
1606 2022-09-06 Jason Merrill <jason@redhat.com>
1608 * decl.cc (grok_op_properties): Return sooner for C++23 op[].
1610 2022-09-06 Jakub Jelinek <jakub@redhat.com>
1612 * parser.cc (cp_parser_omp_clause_doacross_sink): Don't verify val
1613 in omp_cur_iteration - 1 has integer_type_node type.
1615 2022-09-06 Jakub Jelinek <jakub@redhat.com>
1617 * pt.cc (tsubst_expr) <case OMP_ORDERED>: If OMP_BODY was NULL, keep
1618 it NULL after instantiation too.
1620 2022-09-03 Jakub Jelinek <jakub@redhat.com>
1622 * parser.cc (cp_parser_omp_clause_name): Handle doacross.
1623 (cp_parser_omp_clause_depend_sink): Renamed to ...
1624 (cp_parser_omp_clause_doacross_sink): ... this. Add depend_p
1625 argument. Handle parsing of doacross(sink:omp_cur_iteration-1). Use
1626 OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
1627 OMP_CLAUSE_DEPEND_SINK_NEGATIVE, build OMP_CLAUSE_DOACROSS instead
1628 of OMP_CLAUSE_DEPEND and set OMP_CLAUSE_DOACROSS_DEPEND flag on it.
1629 (cp_parser_omp_clause_depend): Use OMP_CLAUSE_DOACROSS_SINK and
1630 OMP_CLAUSE_DOACROSS_SOURCE instead of OMP_CLAUSE_DEPEND_SINK and
1631 OMP_CLAUSE_DEPEND_SOURCE, build OMP_CLAUSE_DOACROSS for depend(source)
1632 and set OMP_CLAUSE_DOACROSS_DEPEND on it.
1633 (cp_parser_omp_clause_doacross): New function.
1634 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DOACROSS.
1635 (cp_parser_omp_depobj): Use OMP_CLAUSE_DEPEND_INVALID instead of
1636 OMP_CLAUSE_DEPEND_SOURCE.
1637 (cp_parser_omp_for_loop): Don't diagnose here linear clause together
1638 with ordered with argument.
1639 (cp_parser_omp_simd): Don't diagnose ordered clause with argument on
1641 (OMP_ORDERED_DEPEND_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DOACROSS.
1642 (cp_parser_omp_ordered): Handle also doacross and adjust for it
1644 * pt.cc (tsubst_omp_clause_decl): Use
1645 OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
1646 OMP_CLAUSE_DEPEND_SINK_NEGATIVE.
1647 (tsubst_omp_clauses): Handle OMP_CLAUSE_DOACROSS.
1648 (tsubst_expr): Use OMP_CLAUSE_DEPEND_INVALID instead of
1649 OMP_CLAUSE_DEPEND_SOURCE.
1650 * semantics.cc (cp_finish_omp_clause_depend_sink): Rename to ...
1651 (cp_finish_omp_clause_doacross_sink): ... this.
1652 (finish_omp_clauses): Handle OMP_CLAUSE_DOACROSS. Don't handle
1653 OMP_CLAUSE_DEPEND_SOURCE and OMP_CLAUSE_DEPEND_SINK.
1655 2022-09-02 David Malcolm <dmalcolm@redhat.com>
1658 * cp-tree.h (class cp_expr): Add bitfield m_decimal. Clear it in
1659 existing ctors. Add ctor that allows specifying its value.
1660 (cp_expr::decimal_p): New accessor.
1661 * parser.cc (cp_parser_expression_stack_entry::flags): New field.
1662 (cp_parser_primary_expression): Set m_decimal of cp_expr when
1664 (cp_parser_binary_expression): Extract flags from token when
1665 populating stack. Call check_for_xor_used_as_pow.
1667 2022-09-01 Marek Polacek <polacek@redhat.com>
1669 * cp-tree.h (maybe_strip_ref_conversion): Remove.
1671 2022-08-30 Ulrich Drepper <drepper@gmail.com>
1673 * Make-lang.in: Add rule to rebuild std-name-hint.h from
1674 std-name-hint.gperf.
1675 * name-lookup.cc (get_std_name_hint): Remove hints array.
1676 Use gperf-generated class std_name_hint_lookup.
1677 Include "std-name-hint.h".
1678 * std-name-hint.gperf: New file.
1679 * std-name-hint.h: New file. Generated from the .gperf file.
1681 2022-08-30 Marek Polacek <polacek@redhat.com>
1684 * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_NOTHROW_ASSIGNABLE
1685 and RID_IS_NOTHROW_CONSTRUCTIBLE.
1687 2022-08-29 Marek Polacek <polacek@redhat.com>
1690 * decl.cc (grokdeclarator): Reverse the order of arguments to
1693 2022-08-26 Marek Polacek <polacek@redhat.com>
1696 * typeck.cc (maybe_warn_self_move): New.
1697 (cp_build_modify_expr): Call maybe_warn_self_move.
1699 2022-08-25 Marek Polacek <polacek@redhat.com>
1701 * cp-tree.h (enum cp_tree_index): Remove CTI_NULLPTR, CTI_NULLPTR_TYPE.
1702 Move it to c_tree_index.
1703 (nullptr_node): No longer define here.
1704 (nullptr_type_node): Likewise.
1705 (NULLPTR_TYPE_P): Likewise.
1706 * decl.cc (cxx_init_decl_processing): Only keep C++-specific nullptr
1707 initialization; move the shared code to c_common_nodes_and_builtins.
1709 2022-08-25 Jason Merrill <jason@redhat.com>
1711 * call.cc (unsafe_return_slot_p): Return 2 for *this in a
1714 2022-08-23 Marek Polacek <polacek@redhat.com>
1716 * typeck.cc (maybe_warn_pessimizing_move): Don't warn about
1717 redundant std::move when the expression was wrapped in { }.
1719 2022-08-17 Marek Polacek <polacek@redhat.com>
1722 * typeck.cc (can_do_rvo_p): Rename to ...
1723 (can_elide_copy_prvalue_p): ... this.
1724 (maybe_warn_pessimizing_move): Extend the
1725 -Wredundant-move warning to warn about std::move on a
1726 const-qualified object.
1728 2022-08-17 Marek Polacek <polacek@redhat.com>
1731 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Maybe suppress
1733 * typeck.cc (maybe_warn_pessimizing_move): Don't issue warnings
1734 if they are suppressed.
1735 (check_return_expr): Disable -Wpessimizing-move when returning
1736 a dependent expression.
1738 2022-08-17 Marek Polacek <polacek@redhat.com>
1741 * call.cc (build_over_call): Call maybe_warn_pessimizing_move.
1742 * cp-tree.h (maybe_warn_pessimizing_move): Declare.
1743 * decl.cc (build_aggr_init_full_exprs): Call
1744 maybe_warn_pessimizing_move.
1745 * typeck.cc (maybe_warn_pessimizing_move): Handle TREE_LIST and
1746 CONSTRUCTOR. Add a bool parameter and use it. Adjust a diagnostic
1748 (check_return_expr): Adjust the call to maybe_warn_pessimizing_move.
1750 2022-08-17 Tobias Burnus <tobias@codesourcery.com>
1751 Chung-Lin Tang <cltang@codesourcery.com>
1754 * cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Remove.
1755 * cp-tree.h (cp_omp_mappable_type, cp_omp_emit_unmappable_type_notes):
1757 * decl2.cc (cp_omp_mappable_type_1, cp_omp_mappable_type,
1758 cp_omp_emit_unmappable_type_notes): Remove.
1759 (cplus_decl_attributes): Call omp_mappable_type instead of
1761 * decl.cc (cp_finish_decl): Likewise; call cxx_incomplete_type_inform
1762 in lieu of cp_omp_emit_unmappable_type_notes.
1763 * semantics.cc (finish_omp_clauses): Likewise.
1765 2022-08-16 Tom Honermann <tom@honermann.net>
1768 * parser.cc (cp_lexer_saving_tokens): Add comment regarding
1769 diagnostic requirements.
1771 2022-08-16 Jakub Jelinek <jakub@redhat.com>
1773 * typeck.cc (cp_build_modify_expr): Implement
1774 P2327R1 - De-deprecating volatile compound operations. Don't warn
1775 for |=, &= or ^= with volatile lhs.
1776 * expr.cc (mark_use) <case MODIFY_EXPR>: Adjust warning wording,
1779 2022-08-15 Marek Polacek <polacek@redhat.com>
1782 * typeck.cc (can_do_rvo_p): New.
1783 (maybe_warn_pessimizing_move): Warn when moving a temporary object
1784 in a return statement prevents copy elision.
1786 2022-08-11 Marek Polacek <polacek@redhat.com>
1788 PR middle-end/102633
1789 * decl.cc (cp_finish_decl): Call suppress_warning.
1791 2022-08-07 Jakub Jelinek <jakub@redhat.com>
1794 * constexpr.cc (cxx_eval_store_expression): Handle REALPART_EXPR
1795 and IMAGPART_EXPR. Change ctors from releasing_vec to
1796 auto_vec<tree *>, adjust all uses. For !preeval, update ctors
1799 2022-07-31 Lewis Hyatt <lhyatt@gmail.com>
1802 * parser.cc (cp_lexer_new_main): Rename global done_lexing to
1803 override_libcpp_locations.
1805 2022-07-31 Jason Merrill <jason@redhat.com>
1808 * constexpr.cc (reduced_constant_expression_p): Return false
1809 if a CONSTRUCTOR initializes an empty field.
1811 2022-07-29 Jakub Jelinek <jakub@redhat.com>
1814 * parser.cc (cp_parser_omp_atomic): For simple cast followed by
1815 CPP_QUERY token, don't try cp_parser_binary_operation if compare
1818 2022-07-26 Marek Polacek <polacek@redhat.com>
1821 * pt.cc (redeclare_class_template): Check DECL_P before accessing
1822 DECL_SOURCE_LOCATION.
1824 2022-07-26 Jason Merrill <jason@redhat.com>
1827 * semantics.cc (finish_for_stmt): Check stmts_are_full_exprs_p.
1829 2022-07-25 Jason Merrill <jason@redhat.com>
1832 * class.cc (warn_hidden): Remove shortcut.
1834 2022-07-22 Patrick Palka <ppalka@redhat.com>
1837 * pt.cc (do_class_deduction): Don't consider TYPE_HAS_LIST_CTOR
1838 when setting try_list_ctor. Reset args even when try_list_ctor
1839 is true and there are no list candidates. Call resolve_args on
1840 the reset args. Rename try_list_ctor to try_list_cand.
1842 2022-07-22 Martin Liska <mliska@suse.cz>
1845 * init.cc (sort_mem_initializers): Remove continue as last stmt
1848 2022-07-21 Jason Merrill <jason@redhat.com>
1851 * decl.cc (move_fn_p): Remove assert.
1853 2022-07-21 Jason Merrill <jason@redhat.com>
1857 * method.cc (walk_field_subobs): Fix DMI in union case.
1859 2022-07-19 Patrick Palka <ppalka@redhat.com>
1864 * call.cc (enum conversion_kind): Add ck_deferred_bad enumerator.
1865 (has_next): Return false for it.
1866 (reference_binding): Return a ck_deferred_bad conversion instead
1867 of an actual bad conversion when LOOKUP_SHORTCUT_BAD_CONVS is set.
1868 Remove now obsolete early exit for the incomplete TO case.
1869 (implicit_conversion_1): Don't mask out LOOKUP_SHORTCUT_BAD_CONVS.
1870 (add_function_candidate): Set LOOKUP_SHORTCUT_BAD_CONVS iff
1872 (missing_conversion_p): Also return true for a ck_deferred_bad
1874 * cp-tree.h (LOOKUP_SHORTCUT_BAD_CONVS): Define.
1876 2022-07-19 Jonathan Wakely <jwakely@redhat.com>
1878 * cp-objcp-common.cc (names_builtin_p): Return true for
1879 RID_REF_CONSTRUCTS_FROM_TEMPORARY and
1880 RID_REF_CONVERTS_FROM_TEMPORARY.
1882 2022-07-15 Marek Polacek <polacek@redhat.com>
1885 * call.cc (ref_conv_binds_directly_p): Rename to ...
1886 (ref_conv_binds_directly): ... this. Add a new bool parameter. Change
1887 the return type to tristate.
1888 * constraint.cc (diagnose_trait_expr): Handle
1889 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1890 * cp-tree.h: Include "tristate.h".
1891 (enum cp_trait_kind): Add CPTK_REF_CONSTRUCTS_FROM_TEMPORARY
1892 and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1893 (ref_conv_binds_directly_p): Rename to ...
1894 (ref_conv_binds_directly): ... this.
1895 (ref_xes_from_temporary): Declare.
1896 * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
1897 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1898 * method.cc (ref_xes_from_temporary): New.
1899 * parser.cc (cp_parser_primary_expression): Handle
1900 RID_REF_CONSTRUCTS_FROM_TEMPORARY and RID_REF_CONVERTS_FROM_TEMPORARY.
1901 (cp_parser_trait_expr): Likewise.
1902 (warn_for_range_copy): Adjust to call ref_conv_binds_directly.
1903 * semantics.cc (trait_expr_value): Handle
1904 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1905 (finish_trait_expr): Likewise.
1907 2022-07-13 Patrick Palka <ppalka@redhat.com>
1910 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Guard against
1911 NULL_TREE extract_call_expr result.
1913 2022-07-13 Patrick Palka <ppalka@redhat.com>
1916 * constraint.cc (satisfy_declaration_constraints): Refine early
1917 exit test for argument dependence.
1918 * cp-tree.h (uses_outer_template_parms_in_constraints): Declare.
1919 * pt.cc (template_class_depth): Handle TI_TEMPLATE being a
1921 (usse_outer_template_parms): Factor out constraint dependence
1923 (uses_outer_template_parms_in_constraints): ... here.
1924 (type_dependent_expression_p): Use it for FUNCTION_DECL.
1926 2022-07-07 Patrick Palka <ppalka@redhat.com>
1929 * pt.cc (template_arg_to_parm): Define.
1930 (tsubst_argument_pack): Try to reuse the corresponding
1931 ARGUMENT_PACK from 'args' when substituting into a generic
1932 ARGUMENT_PACK for a variadic template parameter.
1933 (tsubst_template_args): Move variable declarations closer to
1934 their first use. Replace 'orig_t' with 'r'. Rename 'need_new'
1935 to 'const_subst_p'. Heuristically detect if the substituted
1936 elements are identical to that of a level from 'args' and avoid
1937 allocating a new TREE_VEC if so. Add sanity check for the
1938 length of the new TREE_VEC, and remove dead ARGUMENT_PACK_P test.
1939 (tsubst_decl) <case TYPE_DECL, case VAR_DECL>: Revert
1940 r13-1045-gcb7fd1ea85feea change for avoiding substitution into
1941 DECL_TI_ARGS, but still avoid coercion in this case.
1943 2022-07-07 Jason Merrill <jason@redhat.com>
1946 * class.cc (warn_hidden): Ignore [cd]tors.
1948 2022-07-06 Lewis Hyatt <lhyatt@gmail.com>
1951 * parser.cc (cp_parser_pragma_kind): Move earlier in the file.
1952 (cp_lexer_handle_early_pragma): New function.
1953 (cp_lexer_new_main): Support parsing and handling early pragmas.
1954 (c_parse_file): Adapt to changes in cp_lexer_new_main.
1956 2022-07-06 Jason Merrill <jason@redhat.com>
1960 * parser.cc (cp_parser_lookup_name): Remove :: requirement
1961 for using unqualified lookup result.
1963 2022-07-05 Nathan Sidwell <nathan@acm.org>
1966 (struct ord_loc_info, ord_loc_traits): New.
1967 (ord_loc_tabke, ord_loc_remap): New globals.
1968 (struct location_map_info): Delete.
1969 (struct module_state_config): Rename ordinary_loc_align to
1971 (module_for_ordinary_loc): Adjust.
1972 (module_state::note_location): Note ordinary locations,
1974 (module_state::write_location): Adjust ordinary location
1976 (module_state::read_location): Likewise.
1977 (module_state::write_init_maps): Allocate ord_loc_table.
1978 (module_state::write_prepare_maps): Reimplement ordinary
1980 (module_state::read_prepare_maps): Adjust.
1981 (module_state::write_ordinary_maps): Reimplement.
1982 (module_state::write_macro_maps): Adjust.
1983 (module_state::read_ordinary_maps): Reimplement.
1984 (module_state::write_macros): Adjust.
1985 (module_state::write_config): Adjust.
1986 (module_state::read_config): Adjust.
1987 (module_state::write_begin): Adjust.
1988 (module_state::read_initial): Adjust.
1990 2022-07-04 Tobias Burnus <tobias@codesourcery.com>
1991 Chung-Lin Tang <cltang@codesourcery.com>
1992 Thomas Schwinge <thomas@codesourcery.com>
1994 * parser.cc (cp_parser_omp_target_data,
1995 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1996 cp_parser_omp_target_update): Set OMP_REQUIRES_TARGET_USED.
1997 (cp_parser_omp_requires): Remove sorry.
1999 2022-07-01 Lewis Hyatt <lhyatt@gmail.com>
2001 * parser.cc (cp_token_is_module_directive): New function
2002 refactoring common code.
2003 (cp_parser_skip_to_closing_parenthesis_1): Use the new function.
2004 (cp_parser_skip_to_end_of_statement): Likewise.
2005 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
2006 (cp_parser_declaration): Likewise.
2008 2022-07-01 Marek Polacek <polacek@redhat.com>
2011 * constexpr.cc (cxx_eval_conditional_expression): Strip TARGET_EXPRs.
2013 2022-07-01 Tobias Burnus <tobias@codesourcery.com>
2015 * parser.cc (cp_parser_omp_target_enter_data,
2016 cp_parser_omp_target_exit_data): Accept tofrom
2017 map-type modifier but use 'to' / 'from' internally.
2019 2022-07-01 Marek Polacek <polacek@redhat.com>
2022 * parser.cc (cp_lexer_get_preprocessor_token): Also warn about
2023 RID_ALIGNOF, RID_ALIGNAS, RID_THREAD.
2025 2022-07-01 Jason Merrill <jason@redhat.com>
2028 * call.cc (resolve_args): Use complain.
2030 2022-07-01 Jason Merrill <jason@redhat.com>
2032 * parser.cc (missing_template_diag): Split out...
2033 (cp_parser_id_expression): ...from here.
2035 2022-07-01 Jason Merrill <jason@redhat.com>
2038 * parser.cc (missing_template_diag): Factor out...
2039 (cp_parser_id_expression): ...from here.
2040 (cp_parser_lookup_name): Don't look in dependent object_type.
2042 2022-06-30 Nathan Sidwell <nathan@acm.org>
2044 * module.cc (module_state::write_define): Drop located param.
2045 (module_state::read_define): Likewise.
2046 (module_state::prepare_macros): New, broken out of ...
2047 (module_state::write_macros): ... here. Adjust.
2048 (module_state::write_begin): Adjust.
2050 2022-06-29 Nathan Sidwell <nathan@acm.org>
2052 * module.cc (macro_info, macro_traits, macro_table,
2053 macro_remap): Rename to ...
2054 (macro_loc_info, macro_loc_traits, macro_loc_table,
2055 macro_loc_remap): ... these. Update all uses.
2056 (module_state::write_prepare_maps): Remove unneeded macro checking.
2057 (module_state::write_begin): Free macro_loc_remap.
2059 2022-06-27 Sergei Trofimovich <siarheit@google.com>
2062 * mapper-client.cc: Include <memory> via "system.h".
2063 * mapper-resolver.cc: Ditto.
2066 2022-06-27 David Malcolm <dmalcolm@redhat.com>
2068 * cxx-pretty-print.h: Add "final" and "override" to various vfunc
2069 implementations, removing redundant "virtual" as appropriate.
2070 * module.cc: Likewise.
2072 2022-06-24 Jason Merrill <jason@redhat.com>
2076 * class.cc (warn_hidden): Handle -Woverloaded-virtual=1.
2078 2022-06-24 Alexandre Oliva <oliva@adacore.com>
2080 * g++spec.cc (lang_specific_driver): Implement -nostdlib++.
2082 2022-06-23 Jason Merrill <jason@redhat.com>
2085 * call.cc (build_aggr_conv): Don't depend on
2086 CONSTRUCTOR_IS_DESIGNATED_INIT.
2088 2022-06-23 Jason Merrill <jason@redhat.com>
2091 * decl.cc (reshape_init_array_1): Set
2092 CONSTRUCTOR_IS_DESIGNATED_INIT here.
2093 (reshape_init_class): And here.
2094 (reshape_init): Not here.
2096 2022-06-23 Patrick Palka <ppalka@redhat.com>
2099 * expr.cc (fold_for_warn): Don't fold when in an unevaluated
2102 2022-06-23 Patrick Palka <ppalka@redhat.com>
2105 * pt.cc (lookup_template_class): After calling complete_type for
2106 the substituted context, check the table again iff the type was
2107 previously incomplete and complete_type made it complete.
2109 2022-06-23 Jason Merrill <jason@redhat.com>
2112 * pt.cc (dependent_operand_p): Split out from...
2113 (tsubst_copy_and_build): ...here.
2114 (tsubst_expr) [IF_STMT]: Use it.
2115 * semantics.cc (finish_if_stmt_cond): Keep the pre-conversion
2116 condition in the template tree.
2118 2022-06-23 Jason Merrill <jason@redhat.com>
2121 * pt.cc (tsubst_copy_and_build): Also suppress -Waddress for
2122 comparison of dependent operands.
2124 2022-06-23 Nathan Sidwell <nathan@acm.org>
2126 * module.cc (struct macro_info): New.
2127 (struct macro_traits): New.
2128 (macro_remap, macro_table): New globals.
2129 (depset::hash::find_dependencies): Note namespace location.
2130 (module_for_macro_loc): Adjust.
2131 (module_state::note_location): New.
2132 (module_state::Write_location): Note location when not
2133 streaming. Adjust macro location streaming.
2134 (module_state::read_location): Adjust macro location
2136 (module_state::write_init_maps): New.
2137 (module_state::write_prepare_maps): Reimplement macro map
2139 (module_state::write_macro_maps): Reimplement.
2140 (module_state::read_macro_maps): Likewise.
2141 (module_state::write_begin): Adjust.
2143 2022-06-23 Jason Merrill <jason@redhat.com>
2145 * pt.cc (type_unification_real): An auto tparm can't
2146 be affected by other deductions.
2148 2022-06-23 Jason Merrill <jason@redhat.com>
2151 * pt.cc (type_dependent_expression_p): Look through BASELINK.
2153 2022-06-22 Jason Merrill <jason@redhat.com>
2156 * name-lookup.cc (outer_binding): Strip BASELINK.
2158 2022-06-22 Nathan Sidwell <nathan@acm.org>
2160 * module.cc (struct duplicate_hash): Remove.
2161 (duplicate_hash_map): Adjust.
2163 2022-06-22 Jason Merrill <jason@redhat.com>
2166 * constexpr.cc (cxx_eval_builtin_function_call): Handle
2167 unreachable/trap earlier.
2168 * cp-gimplify.cc (cp_maybe_instrument_return): Use
2169 build_builtin_unreachable.
2171 2022-06-18 Jakub Jelinek <jakub@redhat.com>
2173 * cp-ubsan.cc (cp_ubsan_instrument_vptr_p): Use
2174 flag_sanitize_trap & SANITIZE_VPTR instead of
2175 flag_sanitize_undefined_trap_on_error.
2177 2022-06-17 Jakub Jelinek <jakub@redhat.com>
2180 * typeck.cc (build_x_shufflevector): Use fold_non_dependent_expr
2181 instead of maybe_constant_value.
2183 2022-06-16 Nathan Sidwell <nathan@acm.org>
2185 * decl2.cc (finish_objects): Add startp parameter, adjust.
2186 (generate_ctor_or_dtor_function): Detect empty fn, and don't
2187 generate unnecessary code. Remove objc startup here ...
2188 (c_parse_final_cleanyps): ... do it here.
2190 2022-06-16 Martin Liska <mliska@suse.cz>
2192 * decl2.cc (struct priority_map_traits): Remove unused param.
2194 2022-06-15 Nathan Sidwell <nathan@acm.org>
2196 * module.cc (module_state::write_readme): Use less confusing
2197 importable unit names.
2199 2022-06-14 Nathan Sidwell <nathan@acm.org>
2201 * cp-tree.h (fini_modules): Add has_inits parm.
2202 * decl2.cc (c_parse_final_cleanups): Check for
2203 inits, adjust fini_modules flags.
2204 * module.cc (module_state): Rename call_init_p to
2206 (module_state::write_config): Write active_init.
2207 (module_state::read_config): Read it.
2208 (module_determine_import_inits): Clear active_init_p
2210 (late_finish_module): Add has_init parm. Record it.
2211 (fini_modules): Adjust.
2213 2022-06-13 Nathan Sidwell <nathan@acm.org>
2215 * module.cc (module_state::write): Separate to ...
2216 (module_state::write_begin, module_state::write_end): ...
2218 (module_state::write_readme): Drop extensions parameter.
2219 (struct module_processing_cookie): Add more fields.
2220 (finish_module_processing): Adjust state writing call.
2221 (late_finish_module): Call write_end.
2223 2022-06-10 Patrick Palka <ppalka@redhat.com>
2226 * decl.cc (typename_hasher::hash): Add extra overloads.
2227 Use iterative_hash_object instead of htab_hash_pointer.
2228 Hash TYPENAME_TYPE_FULLNAME instead of TYPE_IDENTIFIER.
2229 (build_typename_type): Use typename_hasher::hash.
2230 * pt.cc (spec_hasher::hash): Add two-parameter overload.
2231 Set comparing_specializations around the call to
2233 (iterative_hash_template_arg) <case TYPENAME_TYPE>:
2234 When comparing_specializations, hash the TYPE_CONTEXT
2235 and TYPENAME_TYPE_FULLNAME.
2236 (tsubst_function_decl): Use spec_hasher::hash instead of
2238 (tsubst_template_decl): Likewise.
2239 (tsubst_decl): Likewise.
2241 2022-06-10 Patrick Palka <ppalka@redhat.com>
2243 * pt.cc (instantiate_template): Don't substitute the context
2244 of the most general template if that of the partially
2245 instantiated template is already non-dependent.
2247 2022-06-10 Patrick Palka <ppalka@redhat.com>
2249 * pt.cc (lookup_template_class): Remove dead stores to
2250 context parameter. Don't substitute the context of the
2251 most general template if that of the partially instantiated
2252 template is already non-dependent. Check the specializations
2253 table again after completing the context of a nested dependent
2255 (tsubst_aggr_type) <case RECORD_TYPE>: Don't substitute
2256 TYPE_CONTEXT or pass it to lookup_template_class.
2257 (tsubst_decl) <case TYPE_DECL, case TYPE_DECL>: Avoid substituting
2258 the TREE_TYPE for DECL_SELF_REFERENCE_P. Avoid template argument
2259 substitution or coercion in some cases.
2261 2022-06-10 Nathan Sidwell <nathan@acm.org>
2263 * cp-tree.h (fini_modules): Add some parameters.
2264 (finish_module_processing): Return an opaque pointer.
2265 * decl2.cc (c_parse_final_cleanups): Propagate a cookie from
2266 finish_module_processing to fini_modules.
2267 * module.cc (struct module_processing_cookie): New.
2268 (finish_module_processing): Return a heap-allocated cookie.
2269 (late_finish_module): New. Finish out the module writing.
2270 (fini_modules): Adjust.
2272 2022-06-10 Nathan Sidwell <nathan@acm.org>
2274 * cp-tree.h (module_has_import_init): Rename to ...
2275 (module_determined_import_inits): ... here.
2276 * decl2.cc (start_objects): Do not handle module initializers
2278 (c_parse_final_cleanups): Generate a separate module
2279 initializer calling function and add it to the list. Shrink
2281 * module.cc (num_init_calls_needed): Delete.
2282 (module_has_import_init): Rename to ...
2283 (module_determined_import_inits): ... here. Do the
2284 calculation here ...
2285 (finish_module_processing): ... rather than here.
2286 (module_add_import_initializers): Reformat.
2288 2022-06-09 Jakub Jelinek <jakub@redhat.com>
2291 * constexpr.cc (cxx_eval_bit_field_ref): For BIT_FIELD_REF with
2292 non-integral result type use fold_ternary too like for BIT_FIELD_REFs
2293 from VECTOR_CST. If fold_ternary returns NULL, diagnose non-constant
2294 expression, set *non_constant_p and return t, instead of returning
2297 2022-06-09 Nathan Sidwell <nathan@acm.org>
2299 * cp-tree.h (module_initializer_kind): Replace with ...
2300 (module_global_init_needed, module_has_import_inits): ...
2302 * decl2.cc (start_objects): Add has_body parm. Reorganize
2303 module initializer creation.
2304 (generate_ctor_or_dtor_function): Adjust.
2305 (c_parse_final_cleanups): Adjust.
2306 (vtv_start_verification_constructor_init_function): Adjust.
2307 * module.cc (module_initializer_kind): Replace with ...
2308 (module_global_init_needed, module_has_import_inits): ...
2311 2022-06-08 Jason Merrill <jason@redhat.com>
2314 * decl.cc (duplicate_decls): Change non-templated friend
2316 * pt.cc (tsubst_function_decl): Don't set DECL_TEMPLATE_INFO
2317 on non-templated friends.
2318 (tsubst_friend_function): Adjust.
2320 2022-06-08 Jason Merrill <jason@redhat.com>
2324 * decl.cc (duplicate_decls): Avoid copying template info
2325 from non-templated friend even if newdecl isn't a definition.
2326 Correct handling of DECL_UNIQUE_FRIEND_P on templates.
2327 * pt.cc (non_templated_friend_p): New.
2328 * cp-tree.h (non_templated_friend_p): Declare it.
2330 2022-06-08 Nathan Sidwell <nathan@acm.org>
2332 * decl2.cc (struct priority_info_s, priority_info): Delete.
2333 (priority_map_traits, priority_map_t): New.
2334 (static_init_fini_fns): New.
2335 (INITIALIZE_P_IDENTIFIER, PRIORITY_IDENTIFIER): Delete.
2336 (initialize_p_decl, priority_decl): Delete.
2337 (ssdf_decls, priority_info_map): Delete.
2338 (start_static_storage_duration_function): Rename to ...
2339 (start_partial_init_fini_fn): ... here. Create a void arg fn.
2340 Add it to the slot in the appropriate static_init_fini_fns
2342 (finish_static_storage_duration_function): Rename to ...
2343 (finish_partial_init_fini_fn): ... here.
2344 (get_priority_info): Delete.
2345 (one_static_initialization_or_destruction): Assert not
2347 (do_static_initialization_or_destruction): Rename to ...
2348 (emit_partial_init_fini_fn) ... here. Start & finish the fn.
2349 Simply init/fini each var.
2350 (partition_vars_for_init_fini): Partition vars according to
2351 priority and add to init and/or fini list.
2352 (generate_ctor_or_dtor_function): Start and finish the function.
2353 Do santitizer calls here.
2354 (generate_ctor_and_dtor_functions_for_priority): Delete.
2355 (c_parse_final_cleanups): Reimplement global init/fini
2358 2022-06-07 Jakub Jelinek <jakub@redhat.com>
2360 * parser.cc (cp_parser_omp_clause_linear): Parse OpenMP 5.2
2361 style linear clause modifiers. Set
2362 OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER flag on the clauses when
2363 old style modifiers are used.
2364 * semantics.cc (finish_omp_clauses): Only reject linear clause
2365 with val modifier on simd or for if the old style modifiers are
2368 2022-06-07 Roger Sayle <roger@nextmovesoftware.com>
2371 * decl.cc (start_enum): When emitting a "must be integral" error,
2372 set ENUM_UNDERLYING_TYPE to integer_type_node, to avoid an ICE
2373 downstream in build_enumeration.
2375 2022-06-06 Patrick Palka <ppalka@redhat.com>
2379 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Look through an
2380 ADDR_EXPR callee when calling mark_used.
2382 2022-06-04 Marek Polacek <polacek@redhat.com>
2386 * parser.cc (cp_parser_attributes_opt): Accept GNU attributes
2387 followed by [[]] attributes and vice versa.
2389 2022-06-03 Patrick Palka <ppalka@redhat.com>
2392 * typeck.cc (cp_build_binary_op): Don't fold operands
2393 when c_inhibit_evaluation_warnings.
2395 2022-06-03 Jason Merrill <jason@redhat.com>
2398 * decl.cc (duplicate_decls): Don't copy DECL_TEMPLATE_INFO
2399 from a hidden friend.
2401 2022-06-03 Patrick Palka <ppalka@redhat.com>
2404 * tree.cc (maybe_dummy_object): When returning a dummy
2405 object, respect the cv-quals of 'this' if available.
2407 2022-06-03 Patrick Palka <ppalka@redhat.com>
2410 * pt.cc (determine_specialization): Compare overall constraints
2411 not just the trailing constraints.
2412 (tsubst_each_template_parm_constraints): Define.
2413 (tsubst_friend_function): Use it.
2414 (tsubst_friend_class): Use it.
2415 (tsubst_template_parm): Don't substitute TEMPLATE_PARM_CONSTRAINTS.
2417 2022-06-03 Patrick Palka <ppalka@redhat.com>
2420 * pt.cc (for_each_template_parm_r) <case FUNCTION_DECL, VAR_DECL>:
2421 Don't walk DECL_CONTEXT.
2422 <case PARM_DECL>: Likewise. Walk TREE_TYPE.
2423 <case CONST_DECL>: Simplify.
2424 (any_template_parm_r) <case PARM_DECL>: Don't walk TREE_TYPE.
2426 2022-06-02 Marek Polacek <polacek@redhat.com>
2428 * constexpr.cc (potential_constant_expression_1): Treat
2429 {,VEC_}NEW_EXPR and {,VEC_}DELETE_EXPRas potentially constant in C++20.
2431 2022-06-02 Marek Polacek <polacek@redhat.com>
2434 * pt.cc (value_dependent_expression_p): Handle {,VEC_}NEW_EXPR
2437 2022-06-02 David Malcolm <dmalcolm@redhat.com>
2439 * cp-lang.cc (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
2440 (cp_get_sarif_source_language): New.
2442 2022-06-02 Jason Merrill <jason@redhat.com>
2445 * constexpr.cc (init_subob_ctx): Clear ctx->ctor for empty subob.
2446 (cxx_eval_store_expression): Likewise.
2447 (cxx_eval_bare_aggregate): Handle null ctx->ctor.
2449 2022-06-02 Jason Merrill <jason@redhat.com>
2452 * constexpr.cc (cxx_eval_bare_aggregate): Always call
2455 2022-06-01 Jason Merrill <jason@redhat.com>
2458 * parser.cc (cp_parser_postfix_dot_deref_expression): Use typeof
2459 if the expression has auto type.
2461 2022-06-01 Jason Merrill <jason@redhat.com>
2464 * call.cc (resolve_args): Call mark_single_function here.
2465 * pt.cc (unify_one_argument): Not here.
2467 2022-06-01 Nathan Sidwell <nathan@acm.org>
2469 * decl2.cc (fix_temporary_vars_context_r): Use data argument
2471 (one_static_initialization_or_destruction): Adjust tree walk
2472 call. Refactor guard generation.
2474 2022-06-01 Nathan Sidwell <nathan@acm.org>
2476 * decl2.cc (ssdf_decl): Delete global.
2477 (start_static_storage_duration_function): Use some RAII.
2478 (do_static_initialization_or_destruction): Likewise.
2479 (c_parse_final_cleanups): Likewise. Avoid rechecking 'vars'.
2481 2022-06-01 Nathan Sidwell <nathan@acm.org>
2483 * decl2.cc (start_objects): Replace 'method_type' parameter
2484 with 'initp' boolean, rename and retype 'priority' parameter.
2485 (finish_objects): Likewise. Do not expand here.
2486 (one_static_initialization_or_destruction): Move 'initp'
2488 (do_static_initialization_or_destruction): Likewise.
2489 (generate_ctor_or_dtor_function): Rename 'initp' parameter.
2490 Adjust start_objects/finish_obects calls and expand here.
2491 (generate_ctor_and_dtor_functions_for_priority): Adjust calls.
2492 (c_parse_final_cleanups): Likewise.
2493 (vtv_start_verification_constructor_init): Adjust.
2494 (vtv_finish_verification_constructor_init): Use finish_objects.
2496 2022-05-31 Patrick Palka <ppalka@redhat.com>
2499 * call.cc (build_over_call): Use z_candidate::conversion_path
2500 and ::access_path instead of TYPE_BINFO when building the
2501 BASELINK for the templated form.
2503 2022-05-31 Patrick Palka <ppalka@redhat.com>
2505 * parser.cc: Use auto_timevar instead of timevar_push/pop.
2506 Remove wrapper functions.
2509 2022-05-31 Patrick Palka <ppalka@redhat.com>
2511 * cp-tree.h (cp_build_qualified_type_real): Rename to ...
2512 (cp_build_qualified_type): ... this. Give its last parameter
2513 a default argument. Remove macro of the same name.
2514 * decl.cc (grokdeclarator): Adjust accordingly.
2515 * pt.cc (tsubst_aggr_type): Likewise.
2516 (rebuild_function_or_method_type): Likewise.
2518 (maybe_dependent_member_ref): Likewise.
2520 * tree.cc (cp_build_qualified_type_real): Rename to ...
2521 (cp_build_qualified_type): ... this. Adjust accordingly.
2523 2022-05-31 Jason Merrill <jason@redhat.com>
2525 * Make-lang.in (c++.tags): Just look at *.cc.
2527 2022-05-31 Patrick Palka <ppalka@redhat.com>
2529 * cp-tree.h (comp_template_args): Change return type to bool.
2530 * pt.cc (comp_template_args): Document default arguments.
2531 Change return type to bool and adjust returns accordingly.
2533 2022-05-31 Patrick Palka <ppalka@redhat.com>
2535 * decl.cc (grokvardecl): Use current_template_constraints.
2536 (grokdeclarator): Likewise.
2537 (xref_tag): Likewise.
2538 * semantics.cc (finish_template_template_parm): Likewise.
2540 2022-05-31 Jakub Jelinek <jakub@redhat.com>
2542 * parser.cc (OMP_SCOPE_CLAUSE_MASK): Add firstprivate and allocate
2545 2022-05-30 Marek Polacek <polacek@redhat.com>
2548 * pt.cc (type_dependent_expression_p): Assert !TYPE_P.
2549 * semantics.cc (finish_id_expression_1): Handle UNBOUND_CLASS_TEMPLATE
2552 2022-05-28 Jakub Jelinek <jakub@redhat.com>
2554 * parser.cc (handle_omp_declare_target_clause): If OMP_CLAUSE_LINK was
2555 seen first, use "%<to%>" or "%<enter%>" depending on
2556 OMP_CLAUSE_ENTER_TO of the current clause, otherwise use
2557 "%<to%> or %<enter%>" wording.
2559 2022-05-28 Jason Merrill <jason@redhat.com>
2562 * pt.cc (tsubst_lambda_expr): Don't let a namespace-scope lambda
2563 instantiate into a class-scope lambda.
2565 2022-05-27 Marek Polacek <polacek@redhat.com>
2568 * parser.cc (class_decl_loc_t::add): Check CLASS_TYPE_P.
2570 2022-05-27 Jakub Jelinek <jakub@redhat.com>
2572 * parser.cc (cp_parser_omp_clause_name): Parse enter clause.
2573 (cp_parser_omp_all_clauses): For to clause on declare target, use
2574 OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of
2575 OMP_CLAUSE_TO_DECLARE clause. Handle PRAGMA_OMP_CLAUSE_ENTER.
2576 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause.
2577 (cp_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of
2578 OMP_CLAUSE_TO_DECLARE.
2579 * semantics.cc (finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead
2580 of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause
2581 name in diagnostics instead of
2582 omp_clause_code_name[OMP_CLAUSE_CODE (c)].
2584 2022-05-26 Marek Polacek <polacek@redhat.com>
2587 * typeck.cc (warn_for_null_address): Improve the warning when
2588 the POINTER_PLUS_EXPR's base is of reference type.
2590 2022-05-26 Patrick Palka <ppalka@redhat.com>
2593 * decl.cc (shadow_tag): Use the return value of
2594 maybe_process_partial_specialization.
2595 * parser.cc (cp_parser_single_declaration): Call shadow_tag
2596 before associate_classtype_constraints.
2597 * pt.cc (maybe_new_partial_specialization): Change return type
2598 to bool. Take 'type' argument by mutable reference. Set 'type'
2599 to point to the correct constrained specialization when
2601 (maybe_process_partial_specialization): Adjust accordingly.
2603 2022-05-25 Marek Polacek <polacek@redhat.com>
2606 * cp-tree.h (attr_chainon): Declare.
2607 * decl.cc (start_decl): Use attr_chainon.
2608 (grokdeclarator): Likewise.
2609 * parser.cc (cp_parser_statement): No longer static.
2611 2022-05-25 Jason Merrill <jason@redhat.com>
2614 * pt.cc (build_template_decl): Add assert.
2615 (tsubst_function_decl): Don't return a template.
2617 2022-05-25 Jason Merrill <jason@redhat.com>
2620 * decl2.cc (mark_used): Copy type from fn to BASELINK.
2621 * pt.cc (unify_one_argument): Call mark_single_function.
2623 2022-05-25 Jason Merrill <jason@redhat.com>
2625 * constexpr.cc (cxx_eval_call_expression): Check for
2626 heap vars in the result.
2628 2022-05-25 Jason Merrill <jason@redhat.com>
2630 * constexpr.cc (maybe_constant_init_1): Only pass false for
2631 strict when initializing a variable of static duration.
2633 2022-05-25 Marek Polacek <polacek@redhat.com>
2636 * typeck2.cc (potential_prvalue_result_of): New.
2637 (replace_placeholders_for_class_temp_r): New.
2638 (digest_nsdmi_init): Call it.
2640 2022-05-24 Jason Merrill <jason@redhat.com>
2642 * constexpr.cc (cxx_fold_indirect_ref): Add default arg.
2643 (cxx_eval_call_expression): Call it.
2644 (cxx_fold_indirect_ref_1): Handle null empty_base.
2646 2022-05-24 Jason Merrill <jason@redhat.com>
2648 * constexpr.cc (enum value_cat): New. Change all 'lval' parameters
2649 from int to value_cat. Change most false to vc_prvalue, most true
2650 to vc_glvalue, cases where the return value is ignored to
2652 (cxx_eval_statement_list): Only vc_prvalue for stmt-expr result.
2653 (cxx_eval_store_expression): Only build _REF for vc_glvalue.
2654 (cxx_eval_array_reference, cxx_eval_component_reference)
2655 (cxx_eval_indirect_ref, cxx_eval_constant_expression): Likewise.
2657 2022-05-24 Jason Merrill <jason@redhat.com>
2660 * constexpr.cc (cxx_eval_store_expression): Adjust assert.
2661 Use initialized_type.
2663 2022-05-24 Patrick Palka <ppalka@redhat.com>
2665 * cp-tree.h (any_template_arguments_need_structural_equality_p):
2667 * pt.cc (struct ctp_hasher): Define.
2668 (ctp_table): Define.
2669 (canonical_type_parameter): Use it.
2670 (process_template_parm): Set TYPE_CANONICAL for
2671 TEMPLATE_TEMPLATE_PARM too.
2672 (lookup_template_class_1): Remove now outdated comment for the
2673 any_template_arguments_need_structural_equality_p test.
2674 (tsubst) <case TEMPLATE_TEMPLATE_PARM, etc>: Don't specifically
2675 clear TYPE_CANONICAL for ttps. Set TYPE_CANONICAL on the
2676 substituted type later.
2677 (any_template_arguments_need_structural_equality_p): Return
2678 true for any_targ_node. Don't return true just because a
2679 template argument uses structural equality. Add comment for
2680 the PARM_DECL special case.
2681 (rewrite_template_parm): Set TYPE_CANONICAL on the rewritten
2683 * tree.cc (bind_template_template_parm): Set TYPE_CANONICAL
2685 * typeck.cc (structural_comptypes) [check_alias]: Increment
2686 processing_template_decl before checking
2687 dependent_alias_template_spec_p.
2689 2022-05-24 Jakub Jelinek <jakub@redhat.com>
2692 * parser.cc (OMP_TASKWAIT_CLAUSE_MASK): Add nowait clause.
2694 2022-05-20 David Malcolm <dmalcolm@redhat.com>
2696 * cxx-pretty-print.h: Replace uses of "FINAL" and "OVERRIDE" with
2697 "final" and "override".
2698 * error.cc: Likewise.
2700 2022-05-18 Marek Polacek <polacek@redhat.com>
2703 * call.cc (maybe_warn_class_memaccess): Avoid % by zero.
2705 2022-05-17 Jason Merrill <jason@redhat.com>
2708 * decl.cc (check_initializer): Use build_cplus_new in case of
2711 2022-05-17 Jakub Jelinek <jakub@redhat.com>
2713 * parser.cc (cp_parser_omp_clause_depend): Parse
2714 inoutset depend-kind.
2715 (cp_parser_omp_depobj): Likewise.
2716 * cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle
2717 OMP_CLAUSE_DEPEND_INOUTSET.
2719 2022-05-16 Martin Liska <mliska@suse.cz>
2721 * module.cc (depset::entity_kind_name): Use ARRAY_SIZE.
2722 * name-lookup.cc (get_std_name_hint): Likewise.
2723 * parser.cc (cp_parser_new): Likewise.
2725 2022-05-16 Marcel Vollweiler <marcel@codesourcery.com>
2727 * pt.cc (tsubst_omp_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR.
2728 * semantics.cc (finish_omp_clauses): Added template decl processing.
2730 2022-05-15 Jason Merrill <jason@redhat.com>
2734 * friend.cc (is_friend): Hidden friends count as members.
2735 * search.cc (friend_accessible_p): Likewise.
2737 2022-05-15 Jason Merrill <jason@redhat.com>
2739 * parser.cc (cp_parser_template_name): Look through
2740 injected-class-name.
2742 2022-05-15 Jason Merrill <jason@redhat.com>
2747 * init.cc (build_value_init): Handle class in template.
2749 2022-05-13 Nathan Sidwell <nathan@acm.org>
2751 * mangle.cc (maybe_write_module): Check external linkage.
2753 2022-05-13 Richard Biener <rguenther@suse.de>
2755 * constexpr.cc: Remove gimple-fold.h include.
2757 2022-05-12 Patrick Palka <ppalka@redhat.com>
2759 * cp-tree.h (TMPL_ARGS_LEVEL): Assert LEVEL is 1 when
2760 TMPL_ARGS_HAVE_MULTIPLE_LEVELS is false.
2761 * pt.cc (try_class_unification): Correctly copy multidimensional
2762 targs. Free the copy of targs.
2763 (unify_pack_expansion): Fix level comparison.
2765 2022-05-12 Nathan Sidwell <nathan@acm.org>
2767 * parser.cc (cp_parser_linkage_specification): Implement
2768 global module attachment semantics.
2770 2022-05-12 Jakub Jelinek <jakub@redhat.com>
2772 * lex.cc (init_reswords): Register omp_all_memory as keyword
2774 * parser.cc (cp_parser_primary_expression): Diagnose uses of
2775 omp_all_memory in postfix expressions.
2776 (cp_parser_omp_var_list_no_open): Handle omp_all_memory in depend
2778 * semantics.cc (finish_omp_clauses): Handle omp_all_memory
2779 keyword in depend clause as null_pointer_node, diagnose invalid
2781 * pt.cc (tsubst_omp_clause_decl): Pass through omp_all_memory.
2783 2022-05-11 Patrick Palka <ppalka@redhat.com>
2785 * constraint.cc (tsubst_parameter_mapping): Convert loop over
2786 TREE_VEC into a range-based for loop using tree_vec_range.
2787 * pt.cc (iterative_hash_template_arg): Likewise.
2788 (template_parms_level_to_args): Likewise.
2789 (deducible_template_args): Likewise.
2790 (check_undeduced_parms): Likewise.
2791 (dependent_type_p_r): Likewise.
2792 (value_dependent_expression_p) <case NONTYPE_ARGUMENT_PACK>:
2794 (dependent_template_arg_p): Likewise.
2795 * tree.cc (cp_walk_subtrees) <case NONTYPE_ARGUMENT_PACK>:
2798 2022-05-11 Jason Merrill <jason@redhat.com>
2801 * cp-tree.h (TMPL_ARGS_DEPTH): 0 for null args.
2802 * parser.cc (cp_parser_enclosed_template_argument_list):
2803 Use 0-length TREE_VEC for <>.
2805 2022-05-11 Jason Merrill <jason@redhat.com>
2808 * typeck.cc (check_return_expr): Don't mess with ctor return value
2809 while parsing a template.
2811 2022-05-11 Nathan Sidwell <nathan@acm.org>
2813 * cp-tree.h (DECL_MODULE_ATTACH_P): New.
2814 (struct lang_decl_base): Add module_attach_p flag.
2815 * decl.cc (duplicate_decls): Rework module redeclaration
2817 * module.cc (trees_out::lang_decl_bools): Write attach flag.
2818 (trees_in::lang_decl_bools): ... and read it back.
2819 (trees_out::decl_value): Rework module attachment handling.
2820 (trees_in::decl_value): Rename local var to reflect meaning.
2821 (trees_in::key_mergeable): Likewise.
2822 (get_originating_module): Use DECL_MODULE_ATTACH_P. No need
2823 to special-case mangling.
2824 (module_may_redeclare): Reimplement.
2825 (set_originating_module): Deal with attachment.
2826 * name-lookup.cc (maybe_record_mergeable_decl): Deal with
2828 (mergeable_namespace_slots): Likewise.
2829 (do_nonmember_using_decl): Likewise.
2830 * name-lookup.h (mergeable_namespace_slots): Adjust parm
2832 * ptree.cc (cxx_print_decl): Adjust purview & attach printing.
2834 2022-05-11 Martin Liska <mliska@suse.cz>
2837 * lang-specs.h: Use Separate syntax.
2839 2022-05-10 Patrick Palka <ppalka@redhat.com>
2841 * coroutines.cc (instantiate_coro_traits): Adjust accordingly.
2842 * cp-tree.def: Remove mention of SET_PACK_EXPANSION_PATTERN.
2843 * cp-tree.h (SET_PACK_EXPANSION_PATTERN): Remove.
2844 (SET_ARGUMENT_PACK_ARGS): Remove.
2845 * module.cc (trees_in::tree_node): Adjust accordingly.
2846 * parser.cc (make_char_string_pack): Likewise.
2847 (make_string_pack): Likewise.
2848 * pt.cc (make_pack_expansion): Likewise.
2849 (template_parm_to_arg): Likewise.
2850 (coerce_template_parameter_pack): Likewise.
2851 (extract_fnparm_pack): Likewise.
2852 (extract_locals_r): Likewise.
2853 (make_argument_pack): Likewise.
2854 (tsubst_argument_pack): Likewise.
2855 (lookup_init_capture_pack): Likewise.
2856 (type_unification_real): Likewise.
2857 (unify_pack_expansion): Likewise.
2858 (tsubst_initializer_list): Likewise.
2860 2022-05-10 Patrick Palka <ppalka@redhat.com>
2862 * cp-tree.h (PACK_EXPANSION_CHECK): Define.
2863 (PACK_EXPANSION_PATTERN): Use PACK_EXPANSION_CHECK.
2864 (SET_PACK_EXPANSION_PATTERN): Likewise.
2865 (PACK_EXPANSION_PARAMETER_PACKS): Likewise.
2866 (PACK_EXPANSION_EXTRA_ARGS): Likewise.
2867 (PACK_EXPANSION_LOCAL_P): Likewise.
2868 (PACK_EXPANSION_SIZEOF_P): Likewise.
2869 (PACK_EXPANSION_AUTO_P): Likewise.
2870 (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): Likewise.
2871 (ARGUMENT_PACK_CHECK): Define.
2872 (ARGUMENT_PACK_ARGS): Use ARGUMENT_PACK_CHECK.
2873 (SET_ARGUMENT_PACK_ARGS): Likewise.
2874 * parser.cc (cp_parser_sizeof_pack): Check for error_mark_node
2875 before setting PACK_EXPANSION_SIZEOF_P.
2877 2022-05-10 Nathan Sidwell <nathan@acm.org>
2879 * cp-tree.h (enum module_kind_bits): Disambiguate purview,
2880 attach, named module vs header-unit.
2881 (global_purview_p, not_module_p): Delete.
2882 (named_module_p): New.
2883 (header_module_p, module_purview_p): Adjust.
2884 (module_attach_p, named_module_purview_p): New.
2885 * decl.cc (duplicate_decls): Adjust.
2886 * module.cc (declare_module, preprocessed_module): Adjust.
2887 * name-lookup.cc (init_global_partition): Adjust.
2888 (get_fixed_binding_slot, pushdecl): Adjust.
2889 * parser.cc (cp_parser_module_declaration): Adjust.
2890 (cp_parser_import_declaration, cp_parser_declaration): Adjust.
2892 2022-05-10 Jason Merrill <jason@redhat.com>
2895 * decl.cc (maybe_return_this): Replace...
2896 (finish_constructor_body, finish_destructor_body): ...these.
2897 (finish_function_body): Call it.
2898 * optimize.cc (build_delete_destructor_body): Call it.
2899 * cp-tree.h (maybe_return_this): Declare.
2901 2022-05-09 Marek Polacek <polacek@redhat.com>
2904 * parser.cc (cp_parser_statement): Constify the in_compound parameter.
2905 Create a modifiable copy. Allow labels at the end of compound
2908 2022-05-09 Patrick Palka <ppalka@redhat.com>
2911 * call.cc (field_in_pset): Adjust after next_initializable_field
2913 (build_aggr_conv): Likewise.
2914 (convert_like_internal): Likewise.
2915 (type_has_extended_temps): Likewise.
2916 * class.cc (default_init_uninitialized_part): Likewise.
2917 (finish_struct): Likewise.
2918 * constexpr.cc (cx_check_missing_mem_inits): Likewise.
2919 (reduced_constant_expression_p): Use next_subobject_field
2921 * cp-gimplify.cc (get_source_location_impl_type): Adjust after
2922 next_initializable_field renaming.
2923 (fold_builtin_source_location): Likewise.
2924 * cp-tree.h (next_initializable_field): Rename to ...
2925 (next_aggregate_field): ... this.
2926 (next_subobject_field): Declare.
2927 * decl.cc (next_aggregate_field): Renamed from ...
2928 (next_initializable_field): ... this. Skip over vptr fields
2930 (next_subobject_field): Define.
2931 (reshape_init_class): Adjust after next_initializable_field
2933 * init.cc (build_value_init_noctor): Likewise.
2934 (emit_mem_initializers): Likewise.
2935 * lambda.cc (build_capture_proxy): Likewise.
2936 * method.cc (build_comparison_op): Likewise.
2937 * pt.cc (maybe_aggr_guide): Likewise.
2938 * tree.cc (structural_type_p): Likewise.
2939 * typeck2.cc (split_nonconstant_init_1): Likewise.
2940 (digest_init_r): Likewise.
2942 2022-05-09 Nathan Sidwell <nathan@acm.org>
2944 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Renamed from
2945 DECL_MODULE_ATTACHMENTS_P.
2946 (struct lane_decl_base): Rename module_attached_p to
2947 module_keyed_decls_p.
2948 (maybe_key_decl): Renamed from maybe_attach_decl.
2949 * lambda.cc (record_lambda_scope): Adjust.
2950 * lex.cc (cxx_dup_lang_specific_decl): Adjust.
2951 * module.cc (keyed_map_t, keyed_table): Renamed from attached_map_t,
2953 (enum merge_kind): Rename MK_attached to MK_keyed.
2954 (trees_out::lang_decl_bools): Adjust.
2955 (trees_in::lang_decl_bools): Adjust.
2956 (trees_in::decl_value): Adjust.
2957 (trees_out::get_merge_kind): Adjust.
2958 (trees_out::key_mergeable): Adjust.
2959 (trees_in::key_mergeable): Adjust.
2960 (maybe_key_decl): Rename from maybe_attach_decl.
2961 (direct_import): Adjust.
2962 (fini_modules): Adjust.
2964 2022-05-09 Martin Liska <mliska@suse.cz>
2966 * cp-gimplify.cc (cp_genericize_r): Use {,UN}LIKELY
2968 * parser.cc (cp_finalize_omp_declare_simd): Likewise.
2969 (cp_finalize_oacc_routine): Likewise.
2971 2022-05-07 Marek Polacek <polacek@redhat.com>
2975 * tree.cc (maybe_adjust_arg_pos_for_attribute): New.
2977 2022-05-06 Jason Merrill <jason@redhat.com>
2979 * error.cc (decl_to_string): Add show_color parameter.
2980 (subst_to_string): Likewise.
2981 (cp_printer): Pass it.
2982 (type_to_string): Set pp_show_color.
2983 (dump_function_name): Use "fnname" color.
2984 (dump_template_bindings): Use "targs" color.
2985 (struct colorize_guard): New.
2986 (reinit_cxx_pp): Clear pp_show_color.
2988 2022-05-06 Jason Merrill <jason@redhat.com>
2992 * constexpr.cc (cxx_eval_store_expression): Reorganize empty base
2995 2022-05-05 Marek Polacek <polacek@redhat.com>
2998 * parser.cc (cp_parser_parameter_declaration_clause): Maintain
2999 a vector of parameters that haven't been pushed yet. Push them at the
3000 end of a valid parameter-declaration-clause.
3001 (cp_parser_parameter_declaration_list): Take a new auto_vec parameter.
3002 Do not pushdecl while parsing tentatively when pushdecl-ing a parameter
3003 would result in a hard error.
3004 (cp_parser_cache_defarg): Adjust the call to
3005 cp_parser_parameter_declaration_list.
3007 2022-05-05 Richard Biener <rguenther@suse.de>
3009 * module.cc (trees_in::core_vals): Remove separate allocation
3012 2022-05-04 Jason Merrill <jason@redhat.com>
3015 * pt.cc (maybe_dependent_member_ref): Handle types.
3016 (tsubst, tsubst_copy): Use it.
3017 (tsubst_aggr_type, instantiate_alias_template): Don't handle
3020 2022-05-04 Patrick Palka <ppalka@redhat.com>
3023 * pt.cc (maybe_aggr_guide): Set processing_template_decl when
3024 partially instantiating the guide's parameter list.
3026 2022-05-04 Marek Polacek <polacek@redhat.com>
3029 * parser.cc (cp_parser_init_declarator): Properly handle a series of
3030 operator() calls, they are not part of an init-declarator.
3032 2022-05-04 Jason Merrill <jason@redhat.com>
3034 * decl.cc (reshape_init): Shortcut already-reshaped init.
3035 (reshape_init_class): Assert not getting one here.
3037 2022-05-04 Jason Merrill <jason@redhat.com>
3039 * error.cc (cp_print_error_function): Use %qD.
3040 (function_category): Use %qD.
3042 2022-05-04 Marek Polacek <polacek@redhat.com>
3045 * parser.cc (cp_parser_next_token_ends_template_argument_p): Don't
3046 return true for CPP_GREATER_EQ.
3048 2022-05-04 Jason Merrill <jason@redhat.com>
3050 * cp-tree.h (struct language_function): Remove x_cdtor_label.
3051 (cdtor_label, LABEL_DECL_CDTOR): Remove.
3052 * constexpr.cc (returns): Don't check LABEL_DECL_CDTOR.
3053 (cxx_eval_constant_expression): Don't call returns.
3054 * decl.cc (check_goto): Don't check cdtor_label.
3055 (start_preparsed_function): And don't set it.
3056 (finish_constructor_body, finish_destructor_body): Remove.
3057 (finish_function_body): Don't call them.
3058 * typeck.cc (check_return_expr): Handle cdtor_returns_this here.
3059 * semantics.cc (finish_return_stmt): Not here.
3061 2022-05-04 Jakub Jelinek <jakub@redhat.com>
3063 * lambda.cc: Include decl.h.
3064 (maybe_add_lambda_conv_op): Temporarily override deprecated_state to
3065 UNAVAILABLE_DEPRECATED_SUPPRESS.
3067 2022-05-03 Patrick Palka <ppalka@redhat.com>
3070 * cp-tree.h (finish_non_static_data_member): Add defaulted
3072 * pt.cc (tsubst_copy_and_build): Pass complain to
3073 finish_non_static_data_member.
3074 * semantics.cc (finish_non_static_data_member): Respect complain
3076 (finish_qualified_id_expr): Pass complain to
3077 finish_non_static_data_member.
3079 2022-05-02 Jason Merrill <jason@redhat.com>
3081 * pt.cc (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Copy location.
3082 (do_auto_deduction): Use expr location.
3084 2022-05-02 Jason Merrill <jason@redhat.com>
3086 * class.cc (maybe_note_name_used_in_class): Note in all enclosing
3087 classes. Remember location of use.
3088 (note_name_declared_in_class): Adjust.
3090 2022-05-02 Marek Polacek <polacek@redhat.com>
3092 * cp-tree.h (uses_template_parms): Adjust declaration.
3093 * pt.cc (uses_template_parms): Return bool. Use a RAII sentinel.
3095 2022-05-02 Richard Biener <rguenther@suse.de>
3097 * constexpr.cc (fold_simple_1): Use CASE_CONVERT.
3098 * cp-gimplify.cc (cp_fold): Likewise.
3099 * pt.cc (tsubst_copy): Likewise.
3101 2022-04-29 Jason Merrill <jason@redhat.com>
3105 * friend.cc (do_friend): Call check_explicit_specialization here.
3106 * decl.cc (grokdeclarator): Not here.
3107 * decl2.cc (check_classfn): Or here.
3109 2022-04-29 Jason Merrill <jason@redhat.com>
3112 * cp-tree.h (enum tsubst_flags): Add tf_dguide.
3113 * pt.cc (tsubst_aggr_type): Check it.
3114 (tsubst_baselink, tsubst_copy): Check it.
3115 (maybe_dependent_member_ref): Check it.
3116 (instantiate_alias_template): Handle it.
3117 (build_deduction_guide): Set it.
3119 2022-04-29 Jason Merrill <jason@redhat.com>
3122 * lambda.cc (type_deducible_expression_p): Allow more types.
3124 2022-04-29 Jason Merrill <jason@redhat.com>
3126 * decl.cc (cp_finish_decl): Only consider auto for vars.
3128 2022-04-29 Marek Polacek <polacek@redhat.com>
3131 * parser.cc (cp_parser_enum_specifier): Warn about empty unnamed enum
3132 only when it's followed by a semicolon.
3134 2022-04-29 Jason Merrill <jason@redhat.com>
3137 * decl.cc (cp_finish_decl): Check completeness of deduced type.
3139 2022-04-29 Jason Merrill <jason@redhat.com>
3142 * error.cc (dump_decl) [USING_DECL]: Respect flags.
3144 2022-04-29 Jason Merrill <jason@redhat.com>
3146 * error.cc (dump_decl): Check TFF_UNQUALIFIED_NAME.
3148 2022-04-29 Jakub Jelinek <jakub@redhat.com>
3151 * parser.cc (cp_parser_template_argument): Treat >= like C++98 >>
3152 after a type id by setting maybe_type_id and aborting tentative
3154 (cp_parser_enclosed_template_argument_list): Handle
3155 CPP_GREATER_EQ like misspelled CPP_GREATER CPP_RQ and
3156 CPP_RSHIFT_EQ like misspelled CPP_GREATER CPP_GREATER_EQ
3157 or CPP_RSHIFT CPP_EQ or CPP_GREATER CPP_GREATER CPP_EQ.
3158 (cp_parser_next_token_ends_template_argument_p): Return true
3159 also for CPP_GREATER_EQ and CPP_RSHIFT_EQ.
3161 2022-04-29 Iain Sandoe <iain@sandoe.co.uk>
3164 * coroutines.cc (register_local_var_uses): Allow promotion of unnamed
3165 temporaries to coroutine frame copies.
3167 2022-04-29 Jason Merrill <jason@redhat.com>
3169 * semantics.cc (check_trait_type): Don't check completeness
3170 of element type of array of unknown bound.
3172 2022-04-29 Jason Merrill <jason@redhat.com>
3176 * rtti.cc (get_tinfo_decl_direct): Don't complete_type.
3177 (emit_tinfo_decl): Update tdesc type if needed.
3179 2022-04-29 Zhao Wei Liew <zhaoweiliew@gmail.com>
3182 * call.cc (extract_call_expr): Return a NULL_TREE on failure
3183 instead of asserting.
3184 (build_new_method_call): Suppress -Wparentheses diagnostic for
3186 * semantics.cc (is_assignment_op_expr_p): Add function to check
3187 if an expression is a call to an op= operator expression.
3188 (maybe_convert_cond): Handle the case of a op= operator expression
3189 for the -Wparentheses diagnostic.
3191 2022-04-28 Patrick Palka <ppalka@redhat.com>
3194 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Treat
3195 DEPENDENT_OPERATOR_TYPE like an empty type.
3197 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
3200 * coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
3201 non-target expression inputs.
3203 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
3206 * coroutines.cc (coro_promise_type_found_p): Account for possible
3207 mutliple overloads of the promise return_value() method.
3209 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
3212 * coroutines.cc (maybe_promote_temps): Ensure generated temporaries
3213 are added to the bind expr.
3214 (add_var_to_bind): Fix local var naming to use portable punctuation.
3215 (register_local_var_uses): Do not add synthetic names to unnamed
3218 2022-04-28 Nathan Sidwell <nathan@acm.org>
3219 Iain Sandoe <iain@sandoe.co.uk>
3222 * coroutines.cc (finish_co_await_expr): Do not process non-dependent
3223 coroutine expressions at template definition time.
3224 (finish_co_yield_expr): Likewise.
3225 (finish_co_return_stmt): Likewise.
3227 2022-04-28 Marek Polacek <polacek@redhat.com>
3230 * parser.cc (cp_parser_class_specifier_1): Accept :: after a class
3233 2022-04-27 Jason Merrill <jason@redhat.com>
3235 * tree.cc (strip_typedefs): Add default argument comments.
3237 2022-04-27 Marek Polacek <polacek@redhat.com>
3240 * pt.cc (uses_template_parms): Return false for any NAMESPACE_DECL.
3242 2022-04-26 Jason Merrill <jason@redhat.com>
3245 * pt.cc (gen_elem_of_pack_expansion_instantiation): Clear
3246 TEMPLATE_TYPE_PARAMETER_PACK on auto.
3248 2022-04-26 Patrick Palka <ppalka@redhat.com>
3251 * semantics.cc (finish_decltype_type): Pass tf_decltype to
3252 instantiate_non_dependent_expr_sfinae.
3254 2022-04-26 Jason Merrill <jason@redhat.com>
3257 * pt.cc (check_for_bare_parameter_packs): Check for lambda
3258 function parameter pack.
3260 2022-04-26 Patrick Palka <ppalka@redhat.com>
3264 * pt.cc (process_partial_specialization): Downgrade "partial
3265 specialization isn't more specialized" diagnostic from permerror
3266 to an on-by-default pedwarn.
3267 (unify) <case TEMPLATE_PARM_INDEX>: When substituting into the
3268 NTTP type a second time, use the original type not the
3271 2022-04-25 Marek Polacek <polacek@redhat.com>
3274 * typeck.cc (build_x_shufflevector): Use
3275 instantiation_dependent_expression_p except for the first two
3278 2022-04-21 Marek Polacek <polacek@redhat.com>
3280 * constexpr.cc (cxx_eval_logical_expression): Remove unused
3282 (cxx_eval_constant_expression) <case TRUTH_ANDIF_EXPR>,
3283 <case TRUTH_OR_EXPR>: Adjust calls to cxx_eval_logical_expression.
3285 2022-04-21 Marek Polacek <polacek@redhat.com>
3288 * constexpr.cc (cxx_eval_logical_expression): Always pass false for lval
3289 to cxx_eval_constant_expression.
3291 2022-04-20 Ed Catmur <ed@catmur.uk>
3294 * call.cc (compare_ics): When comparing list-initialization
3295 sequences, do not return early.
3297 2022-04-19 Jakub Jelinek <jakub@redhat.com>
3300 * typeck2.cc (process_init_constructor_array,
3301 process_init_constructor_record, process_init_constructor_union): Move
3302 CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag from CONSTRUCTOR elements to the
3303 containing CONSTRUCTOR.
3305 2022-04-15 Marek Polacek <polacek@redhat.com>
3308 * parser.cc (cp_parser_placeholder_type_specifier): Return
3309 error_mark_node when trying to build up a constrained parameter in
3312 2022-04-15 Jason Merrill <jason@redhat.com>
3315 * decl.cc (grokdeclarator): Drop typedef used with 'unsigned'.
3317 2022-04-15 Jason Merrill <jason@redhat.com>
3320 * error.cc (dump_expr): Handle USING_DECL.
3321 [VIEW_CONVERT_EXPR]: Just look through location wrapper.
3323 2022-04-14 Jason Merrill <jason@redhat.com>
3326 * constexpr.cc (maybe_save_constexpr_fundef): Don't do extra
3327 checks for defaulted ctors.
3329 2022-04-14 Jason Merrill <jason@redhat.com>
3332 * lambda.cc (type_deducible_expression_p): New.
3333 (lambda_capture_field_type): Check it.
3335 2022-04-14 Jason Merrill <jason@redhat.com>
3338 * pt.cc (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.
3340 2022-04-14 Jason Merrill <jason@redhat.com>
3343 * name-lookup.cc (dependent_local_decl_p): New.
3344 * cp-tree.h (dependent_local_decl_p): Declare.
3345 * semantics.cc (finish_call_expr): Use it.
3346 * pt.cc (tsubst_arg_types): Also substitute default args
3349 2022-04-14 Jason Merrill <jason@redhat.com>
3352 * pt.cc (tsubst_baselink): Also check dependent optype.
3354 2022-04-14 Jason Merrill <jason@redhat.com>
3357 * decl.cc (cp_finish_decl): Don't pass decl to push_cleanup.
3358 * init.cc (perform_member_init): Likewise.
3359 * semantics.cc (push_cleanup): Adjust comment.
3361 2022-04-13 Jason Merrill <jason@redhat.com>
3365 * constexpr.cc (cxx_eval_store_expression): Build a CONSTRUCTOR
3366 as needed in empty base handling.
3368 2022-04-13 Jakub Jelinek <jakub@redhat.com>
3371 * decl2.cc (cp_check_const_attributes): For aligned attribute
3372 pass manifestly_const_eval=true to fold_non_dependent_expr.
3374 2022-04-13 Marek Polacek <polacek@redhat.com>
3377 * call.cc (direct_reference_binding): strip_top_quals when creating
3380 2022-04-12 Jason Merrill <jason@redhat.com>
3383 * decl.cc (decls_match): Compare versions even if not recording.
3384 (duplicate_decls): Propagate attributes to alias.
3385 * decl2.cc (find_last_decl): Give up if versioned.
3387 2022-04-12 Jason Merrill <jason@redhat.com>
3390 * init.cc (build_new_1): Check array_p for alignment.
3392 2022-04-12 Patrick Palka <ppalka@redhat.com>
3395 * pt.cc (build_extra_args): Call preserve_args.
3397 2022-04-12 Jason Merrill <jason@redhat.com>
3400 * decl.cc (check_initializer): Check TREE_SIDE_EFFECTS.
3402 2022-04-12 Jason Merrill <jason@redhat.com>
3406 * class.cc (finish_struct): Always using op=.
3408 2022-04-11 Jason Merrill <jason@redhat.com>
3411 * call.cc (build_operator_new_call): Just look in ::.
3413 2022-04-11 Alexandre Oliva <oliva@adacore.com>
3415 * constexpr.cc (cxx_eval_call_expression): Disregard dtor
3418 2022-04-11 Alexandre Oliva <oliva@adacore.com>
3420 * semantics.cc (set_cleanup_locs): Propagate locus to call
3421 wrapped in cast-to-void.
3423 2022-04-11 Jason Merrill <jason@redhat.com>
3426 * init.cc (warn_placement_new_too_small): Check deref.
3428 2022-04-09 Jason Merrill <jason@redhat.com>
3432 * tree.cc (build_vec_init_elt): Do {}-init for aggregates.
3433 * constexpr.cc (cxx_eval_vec_init): Only treat {} as value-init
3434 for non-aggregate types.
3435 (build_vec_init_expr): Also check constancy of explicit
3436 initializer elements.
3438 2022-04-09 Jason Merrill <jason@redhat.com>
3442 * name-lookup.cc (set_decl_namespace): Set
3443 DECL_IMPLICIT_INSTANTIATION if no non-template match.
3444 * pt.cc (check_explicit_specialization): Check it.
3445 * decl2.cc (check_classfn): Call it.
3447 2022-04-07 Patrick Palka <ppalka@redhat.com>
3450 * name-lookup.cc (name_lookup::using_queue): Change to an
3451 auto_vec (with 16 elements of internal storage).
3452 (name_lookup::queue_namespace): Change return type to void,
3453 take queue parameter by reference and adjust function body
3455 (name_lookup::do_queue_usings): Inline into ...
3456 (name_lookup::queue_usings): ... here. As in queue_namespace.
3457 (name_lookup::search_unqualified): Don't make queue static,
3458 remove length variable, and adjust function body accordingly.
3460 2022-04-07 Jakub Jelinek <jakub@redhat.com>
3462 PR tree-optimization/102586
3463 * cp-objcp-common.h (cp_classtype_as_base): Declare.
3464 (LANG_HOOKS_CLASSTYPE_AS_BASE): Redefine.
3465 * cp-objcp-common.cc (cp_classtype_as_base): New function.
3467 2022-04-07 Jason Merrill <jason@redhat.com>
3470 * decl.cc (grokdeclarator): Reject conversion with trailing return
3473 2022-04-07 Jason Merrill <jason@redhat.com>
3476 * lambda.cc (lambda_expr_this_capture): Check all enclosing
3477 lambdas for completeness.
3479 2022-04-07 Jason Merrill <jason@redhat.com>
3482 * typeck2.cc (store_init_value): Allow TREE_HAS_CONSTRUCTOR for
3485 2022-04-06 Jakub Jelinek <jakub@redhat.com>
3488 * decl2.cc (splice_template_attributes): Return NULL if *p is
3490 (cplus_decl_attributes): Return early if attributes is
3491 error_mark_node. Don't check that later.
3493 2022-04-06 Patrick Palka <ppalka@redhat.com>
3496 * pt.cc (do_class_deduction): Check complain before attempting
3497 to issue a -Wctad-maybe-unsupported warning.
3499 2022-04-06 Jason Merrill <jason@redhat.com>
3502 * init.cc (build_vec_init): Use a reference for the result.
3504 2022-04-06 Jason Merrill <jason@redhat.com>
3507 * name-lookup.cc (check_local_shadow): Use -Wshadow=local
3508 if exactly one of 'old' and 'decl' is a type.
3510 2022-04-05 Jason Merrill <jason@redhat.com>
3514 * pt.cc (do_class_deduction): Pedwarn for renaming alias in C++17.
3516 2022-04-05 Jason Merrill <jason@redhat.com>
3519 * name-lookup.h (struct cp_binding_level): Add requires_expression
3521 * parser.cc (cp_parser_requires_expression): Set it.
3522 (synthesize_implicit_template_parm): Check it.
3524 2022-04-04 Jason Merrill <jason@redhat.com>
3527 * decl.cc (duplicate_decls): Copy DECL_FRIEND_CONTEXT.
3529 2022-04-04 Jason Merrill <jason@redhat.com>
3533 * pt.cc (get_underlying_template): Compare default template args.
3535 2022-04-03 Benno Evers <benno.evers@tenzir.com>
3536 Iain Sandoe <iain@sandoe.co.uk>
3539 * coroutines.cc (morph_fn_to_coro): Reset
3540 current_binding_level->blocks.
3542 2022-04-01 Jason Merrill <jason@redhat.com>
3545 2022-03-31 Jason Merrill <jason@redhat.com>
3548 * parser.cc (cp_parser_early_parsing_nsdmi): New.
3549 (cp_parser_member_declaration): Call it.
3551 2022-04-01 Jason Merrill <jason@redhat.com>
3554 2022-03-24 Jason Merrill <jason@redhat.com>
3557 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
3558 * class.cc (type_has_default_ctor_to_be_synthesized): New.
3559 (type_has_non_user_provided_default_constructor_1): Support it.
3560 (type_has_non_user_provided_default_constructor): Now a wrapper.
3561 * method.cc (complain_about_unparsed_dmi): New.
3562 (constructible_expr): Call it.
3564 2022-04-01 Patrick Palka <ppalka@redhat.com>
3567 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Drop cv-quals from
3568 the argument type of an NTTP before deducing from it.
3570 2022-03-31 Jason Merrill <jason@redhat.com>
3573 * parser.cc (cp_parser_early_parsing_nsdmi): New.
3574 (cp_parser_member_declaration): Call it.
3576 2022-03-30 Patrick Palka <ppalka@redhat.com>
3579 * constraint.cc (diagnose_trait_expr): Handle all remaining
3580 traits appropriately. Remove default case.
3582 2022-03-30 Marek Polacek <polacek@redhat.com>
3586 * init.cc (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor.
3588 2022-03-30 Jakub Jelinek <jakub@redhat.com>
3591 * pt.cc (tsubst_omp_clause_decl): When handling iterators, set
3592 DECL_CONTEXT of the iterator var to current_function_decl and
3595 2022-03-30 Jakub Jelinek <jakub@redhat.com>
3598 * parser.cc (cp_parser_template_introduction): If member_p, temporarily
3599 clear parser->colon_corrects_to_scope_p around tentative parsing of
3600 nested name specifier.
3602 2022-03-28 Jason Merrill <jason@redhat.com>
3604 * pt.cc (determine_specialization): Add comment.
3606 2022-03-28 Patrick Palka <ppalka@redhat.com>
3609 * pt.cc (finish_concept_definition): Check that a concept is
3610 declared with exactly one template parameter list.
3612 2022-03-28 Patrick Palka <ppalka@redhat.com>
3615 * constraint.cc (maybe_substitute_reqs_for): Don't assume
3616 DECL_TEMPLATE_INFO is available.
3618 2022-03-28 Jason Merrill <jason@redhat.com>
3623 * pt.cc (complex_alias_template_r): walk_tree callback, replacing
3624 uses_all_template_parms_r, complex_pack_expansion_r.
3625 (complex_alias_template_p): Adjust.
3626 * tree.cc (strip_typedefs): Revert r12-7710 change.
3628 2022-03-28 Jason Merrill <jason@redhat.com>
3631 * init.cc (build_new_1): Include cookie in alignment. Omit
3632 constexpr wrapper from alloc_call.
3634 2022-03-28 Jason Merrill <jason@redhat.com>
3637 * name-lookup.cc (push_local_extern_decl_alias): Call
3638 determine_visibility.
3640 2022-03-28 Jason Merrill <jason@redhat.com>
3643 * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting
3644 a type template reference.
3646 2022-03-28 Jason Merrill <jason@redhat.com>
3649 * pt.cc (value_dependent_expression_p): Check
3650 has_value_dependent_address for conversion to reference.
3652 2022-03-28 Jason Merrill <jason@redhat.com>
3655 * pt.cc (tsubst_qualified_id): Handle getting SCOPE_REF from
3657 (instantiation_dependent_scope_ref_p): Check dependent_scope_p.
3659 2022-03-28 Jason Merrill <jason@redhat.com>
3662 * call.cc (make_base_init_ok): Call make_used.
3664 2022-03-28 Jason Merrill <jason@redhat.com>
3667 * mangle.cc (write_expression): Don't write a union designator when
3670 2022-03-28 Jason Merrill <jason@redhat.com>
3674 * tree.cc (strip_typedefs): Use build_distinct_type_copy.
3676 2022-03-26 Patrick Palka <ppalka@redhat.com>
3679 * constexpr.cc (potential_constant_expression_1) <case IF_STMT>:
3680 Clarify error message when a if-stmt is non-constant because its
3681 branches are non-constant.
3683 2022-03-26 Patrick Palka <ppalka@redhat.com>
3686 * call.cc (add_builtin_candidate) <case MEMBER_REF>: Test
3687 CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
3689 2022-03-26 Jakub Jelinek <jakub@redhat.com>
3691 * parser.cc (cp_parser_postfix_expression)
3692 <case RID_BILTIN_CONVERTVECTOR, case RID_BUILTIN_BIT_CAST>: Don't
3693 return cp_build_{vec,convert,bit_cast} result right away, instead
3694 set postfix_expression to it and break.
3696 2022-03-25 Marek Polacek <polacek@redhat.com>
3699 * typeck.cc (cxx_sizeof_or_alignof_type): Diagnose alignof(void).
3700 (cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with
3703 2022-03-24 Marek Polacek <polacek@redhat.com>
3706 * decl.cc (check_initializer): Don't call build_aggr_init in
3709 2022-03-24 Jason Merrill <jason@redhat.com>
3712 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
3713 * class.cc (type_has_default_ctor_to_be_synthesized): New.
3714 (type_has_non_user_provided_default_constructor_1): Support it.
3715 (type_has_non_user_provided_default_constructor): Now a wrapper.
3716 * method.cc (complain_about_unparsed_dmi): New.
3717 (constructible_expr): Call it.
3719 2022-03-24 Marek Polacek <polacek@redhat.com>
3722 * typeck2.cc (massage_init_elt): Avoid folding CONSTRUCTORs.
3724 2022-03-24 Patrick Palka <ppalka@redhat.com>
3727 * call.cc (build_over_call): Use cxx_constant_value_sfinae
3728 instead of cxx_constant_value to evaluate a consteval call.
3729 * constexpr.cc (cxx_constant_value_sfinae): Add decl parameter
3730 and pass it to cxx_eval_outermost_constant_expr.
3731 * cp-tree.h (cxx_constant_value_sfinae): Add decl parameter.
3732 * pt.cc (fold_targs_r): Pass NULL_TREE as decl parameter to
3733 cxx_constant_value_sfinae.
3735 2022-03-24 Jakub Jelinek <jakub@redhat.com>
3738 * constexpr.cc (cxx_eval_constant_expression): Don't diagnose passing
3739 through extern thread_local declarations. Change wording from
3740 declaration to definition.
3741 (potential_constant_expression_1): Don't diagnose extern thread_local
3742 declarations. Change wording from declared to defined.
3743 * decl.cc (start_decl): Likewise.
3745 2022-03-23 Jason Merrill <jason@redhat.com>
3748 * decl.cc (reshape_single_init): New.
3749 (reshape_init_class): Use it.
3751 2022-03-23 Jason Merrill <jason@redhat.com>
3754 * name-lookup.cc (lookup_using_decl): Check that scope is
3755 a dependent type before looking for dependent using.
3757 2022-03-23 Jason Merrill <jason@redhat.com>
3760 * name-lookup.cc (lookup_using_decl): Set DECL_DEPENDENT_P if lookup
3761 finds a dependent using.
3763 2022-03-21 Jason Merrill <jason@redhat.com>
3766 * init.cc (build_vec_init): Check for vla element type.
3768 2022-03-21 Jason Merrill <jason@redhat.com>
3774 * decl.cc (reshape_init_class): Avoid looking for designator
3776 (reshape_init_r): Keep looking for designator.
3778 2022-03-21 Jason Merrill <jason@redhat.com>
3781 * decl.cc (reshape_init_class): Back out of anon struct
3782 if a designator doesn't match.
3784 2022-03-18 Jason Merrill <jason@redhat.com>
3788 * class.cc (add_method): Avoid adding the same used function twice.
3789 (handle_using_decl): Don't add_method.
3790 (finish_struct): Don't using op= if we have one already.
3791 (maybe_push_used_methods): New.
3792 * semantics.cc (finish_member_declaration): Call it.
3793 * name-lookup.cc (diagnose_name_conflict): No longer static.
3794 (push_class_level_binding): Revert 92918 patch, limit
3796 * cp-tree.h: Adjust.
3798 2022-03-18 Jakub Jelinek <jakub@redhat.com>
3801 * init.cc (build_new_constexpr_heap_type): Remove FULL_SIZE
3802 argument and its handling, instead add ITYPE2 argument. Only
3803 support COOKIE_SIZE != NULL.
3804 (build_new_1): If size is 0, change it to 0 * outer_nelts if
3805 outer_nelts is non-NULL. Pass type rather than elt_type to
3806 maybe_wrap_new_for_constexpr.
3807 * constexpr.cc (build_new_constexpr_heap_type): New function.
3808 (cxx_eval_constant_expression) <case CONVERT_EXPR>:
3809 If elt_size is zero sized type, try to recover outer_nelts from
3810 the size argument to operator new/new[] and pass that as
3811 arg_size to build_new_constexpr_heap_type. Pass ctx,
3812 non_constant_p and overflow_p to that call too.
3814 2022-03-18 Marek Polacek <polacek@redhat.com>
3817 * tree.cc (strip_typedefs): Don't strip an alias template when
3818 doing so would result in losing a parameter pack.
3820 2022-03-16 Patrick Palka <ppalka@redhat.com>
3822 * search.cc (lookup_member): Simplify by handling all values
3823 of protect together in the ambiguous case. Don't modify protect.
3825 2022-03-16 Patrick Palka <ppalka@redhat.com>
3828 * cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls to
3829 std::move/forward and other cast-like functions into simple
3832 2022-03-15 Patrick Palka <ppalka@redhat.com>
3835 * search.cc (lookup_field_info::errstr): Remove this data
3837 (lookup_field_r): Don't set errstr.
3838 (lookup_member): Check ambiguity before checking access.
3839 Simplify accordingly after errstr removal. Exit early upon
3840 error or empty result.
3842 2022-03-15 Jakub Jelinek <jakub@redhat.com>
3845 * parser.cc (cp_parser_skip_to_pragma_eol): Don't purge any tokens.
3847 2022-03-14 Jakub Jelinek <jakub@redhat.com>
3849 PR tree-optimization/102586
3850 * call.cc (build_cxx_call): Diagnose __builtin_clear_padding where
3851 first argument's type is pointer to non-trivially-copyable type unless
3852 it is address of a variable or parameter.
3854 2022-03-12 Patrick Palka <ppalka@redhat.com>
3857 * cp-tree.h (tsubst_flags::tf_tst_ok): New flag.
3858 * decl.cc (make_typename_type): Allow a typename-specifier to
3859 resolve to a template when tf_tst_ok, in which case return
3860 a CTAD placeholder for the template.
3861 * pt.cc (tsubst_decl) <case VAR_DECL>: Set tf_tst_ok when
3862 substituting the type.
3863 (tsubst): Clear tf_tst_ok and remember if it was set.
3864 <case TYPENAME_TYPE>: Pass tf_tst_ok to make_typename_type
3866 (tsubst_copy) <case CAST_EXPR>: Set tf_tst_ok when substituting
3868 (tsubst_copy_and_build) <case CAST_EXPR>: Likewise.
3869 <case CONSTRUCTOR>: Likewise.
3871 2022-03-12 Patrick Palka <ppalka@redhat.com>
3874 * call.cc (missing_conversion_p): Define.
3875 (add_candidates): Use it.
3876 * pt.cc (check_non_deducible_conversion): Change type of strict
3877 parameter to unification_kind_t and directly test for DEDUCE_CALL.
3879 2022-03-12 Patrick Palka <ppalka@redhat.com>
3882 * constraint.cc (normalize_atom): Set
3883 ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P appropriately.
3884 (get_mapped_args): Make static, adjust parameters. Always
3885 return a vector whose depth corresponds to the template depth of
3886 the context of the atomic constraint expression. Micro-optimize
3887 by passing false as exact to safe_grow_cleared and by collapsing
3888 a multi-level depth-one argument vector.
3889 (satisfy_atom): Adjust call to get_mapped_args and
3890 diagnose_atomic_constraint.
3891 (diagnose_atomic_constraint): Replace map parameter with an args
3893 * cp-tree.h (ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P): Define.
3894 (get_mapped_args): Remove declaration.
3896 2022-03-12 Patrick Palka <ppalka@redhat.com>
3897 Jason Merrill <jason@redhat.com>
3900 * constexpr.cc (mark_non_constant): Define, split out from ...
3901 (cxx_eval_outermost_constant_expr): ... here.
3902 (maybe_constant_value): Use it.
3904 2022-03-12 Patrick Palka <ppalka@redhat.com>
3906 * semantics.cc (finish_unary_fold_expr): Use input_location
3907 instead of UNKNOWN_LOCATION.
3908 (finish_binary_fold_expr): Likewise.
3910 2022-03-12 Thomas Schwinge <thomas@codesourcery.com>
3913 * semantics.cc (handle_omp_array_sections_1)
3914 (cp_oacc_check_attachments): Call 'user_omp_clause_code_name'
3915 instead of 'c_omp_map_clause_name'.
3917 2022-03-10 Marek Polacek <polacek@redhat.com>
3920 * parser.cc (cp_parser_template_name): Repeat lookup of
3923 2022-03-10 Marek Polacek <polacek@redhat.com>
3926 * semantics.cc (finish_compound_literal): Disallow auto{x} for
3927 is_constrained_auto.
3928 * typeck2.cc (build_functional_cast_1): Likewise.
3930 2022-03-10 Marek Polacek <polacek@redhat.com>
3933 * decl.cc (grokdeclarator): Check FUNC_OR_METHOD_TYPE_P before giving
3936 2022-03-10 Jakub Jelinek <jakub@redhat.com>
3939 * decl.cc (grok_op_properties): Allow variadic operator[] for
3942 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
3945 * decl.cc (finish_enum_value_list): If VALUE isn't an INTEGER_CST
3946 consider it to be zero (i.e. treat it like error_mark_node).
3947 (build_enumerator): Likewise, if PREV_VALUE isn't an INTEGER_CST,
3948 set VALUE to error_mark_node.
3950 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
3953 * parser.cc (cp_parser_late_parsing_for_member): Confirm the token
3954 stream hasn't been purged before processing DECL_PENDING_INLINE.
3956 2022-03-09 Patrick Palka <ppalka@redhat.com>
3959 * except.cc (build_noexcept_spec): Strengthen dependence check
3960 to instantiation_dependent_expression_p.
3961 * parser.cc (cp_parser_parenthesized_expression_list_elt):
3962 Remove fold_expr_p parameter, and don't call
3963 instantiate_non_dependent_expr.
3964 (cp_parser_parenthesized_expression_list): Adjust accordingly.
3965 * pt.cc (expand_integer_pack): Strengthen dependence check
3966 to instantiation_dependent_expression_p.
3967 (instantiate_non_dependent_expr_internal): Adjust comment.
3968 (instantiate_non_dependent_expr_sfinae): Likewise. Drop
3969 the potentially-constant check, and relax and turn the
3970 dependence check into a checking assert.
3971 (instantiate_non_dependent_or_null): Adjust comment.
3972 * semantics.cc (finish_decltype_type): Keep
3973 processing_template_decl cleared after calling
3974 instantiate_non_dependent_expr_sfinae.
3976 2022-03-09 Patrick Palka <ppalka@redhat.com>
3980 * cp-tree.h (is_copy_initialization): Declare.
3981 * decl.cc (cp_finish_decl): Set LOOKUP_ONLYCONVERTING
3982 when is_copy_initialization is true.
3983 * init.cc (build_aggr_init): Split out copy-initialization
3985 (is_copy_initialization): ... here.
3986 * pt.cc (instantiate_decl): Pass 0 instead of
3987 LOOKUP_ONLYCONVERTING as flags to cp_finish_decl.
3989 2022-03-09 Patrick Palka <ppalka@redhat.com>
3992 * cp-tree.h (merge_default_template_args): Declare.
3993 * decl.cc (merge_default_template_args): Define, factored out
3994 from redeclare_class_template.
3995 (duplicate_decls): Use it when merging member function template
3996 and free function declarations.
3997 * pt.cc (redeclare_class_template): Factor out default argument
3998 merging logic into merge_default_template_args. Improve location
3999 of a note when there's a template parameter kind mismatch.
4001 2022-03-09 Jakub Jelinek <jakub@redhat.com>
4004 * constexpr.cc (cxx_eval_check_shift_p): Use TYPE_OVERFLOW_WRAPS
4005 instead of TYPE_UNSIGNED.
4006 * typeck.cc (cp_build_binary_op): Don't emit
4007 -Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
4009 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
4012 * decl.cc (start_decl): Defend against prefix_attributes being
4015 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
4018 * parser.cc (synthesize_implicit_template_parm): Check that
4019 TREE_VALUE (new_parm) isn't error_mark_node before setting its
4022 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
4025 * parser.cc (cp_parser_linkage_specification): Treat the case where
4026 linkage is error_mark_node as "invalid linkage-specification".
4028 2022-03-08 Marek Polacek <polacek@redhat.com>
4031 * pt.cc (convert_nontype_argument): Recompute
4032 value_dependent_expression_p after build_converted_constant_expr.
4034 2022-03-08 Marek Polacek <polacek@redhat.com>
4036 * decl2.cc (is_late_template_attribute): Do not defer attribute
4038 * pt.cc (tsubst_enum): Set TREE_UNAVAILABLE.
4040 2022-03-08 Jakub Jelinek <jakub@redhat.com>
4043 * search.cc (lookup_field_fuzzy_info::fuzzy_lookup_field): Ignore
4044 identifiers with space at the end.
4046 2022-03-07 Jason Merrill <jason@redhat.com>
4049 * decl2.cc (mark_single_function): Look through parens and location
4051 * typeck.cc (cp_build_addr_expr_1): Not here.
4053 2022-03-07 Jakub Jelinek <jakub@redhat.com>
4055 * parser.cc (cp_parser_omp_clause_map): Add missing space in string
4058 2022-03-07 Jakub Jelinek <jakub@redhat.com>
4060 * cvt.cc: Fix up duplicated word issue in a comment.
4062 * module.cc: Likewise.
4063 * coroutines.cc: Likewise.
4065 2022-03-04 Nathan Sidwell <nathan@acm.org>
4067 * mangle.cc (is_std_substitution): Check global module.
4068 (is_std_substitution_char): Return bool.
4070 2022-03-04 Nathan Sidwell <nathan@acm.org>
4072 * cp-tree.h (mangle_identifier): Replace with ...
4073 (mangle_module_component): ... this.
4074 * mangle.cc (dump_substitution_candidates): Adjust.
4075 (add_substitution): Likewise.
4076 (find_substitution): Likewise.
4077 (unmangled_name_p): Likewise.
4078 (mangle_module_substitution): Reimplement.
4079 (mangle_module_component): New.
4080 (write_module, maybe_write_module): Adjust.
4081 (write_name): Drop modules here.
4082 (write_unqualified): Do them here instead.
4083 (mangle_global_init): Adjust.
4084 * module.cc (module_state::mangle): Adjust.
4085 (mangle_module): Likewise.
4086 (get_originating_module): Adjust.
4088 2022-02-28 Marek Polacek <polacek@redhat.com>
4091 * cp-tree.h (build_enumerator): Adjust.
4092 * decl.cc (finish_enum): Make it return the new decl.
4093 * pt.cc (tsubst_enum): Propagate TREE_DEPRECATED and TREE_UNAVAILABLE.
4095 2022-02-28 Marek Polacek <polacek@redhat.com>
4098 * decl2.cc (is_late_template_attribute): Cope with a decl without
4101 2022-02-27 Jason Merrill <jason@redhat.com>
4104 * typeck.cc (cp_build_addr_expr_1): Also
4105 maybe_undo_parenthesized_ref.
4107 2022-02-24 Martin Liska <mliska@suse.cz>
4109 * pt.cc (defarg_insts_for): Use braces for subobject.
4111 2022-02-18 Patrick Palka <ppalka@redhat.com>
4114 * pt.cc (maybe_instantiate_noexcept): For non-static member
4115 functions, set current_class_ptr/ref to the specialized 'this'
4118 2022-02-17 Jason Merrill <jason@redhat.com>
4121 * pt.cc (mark_decl_instantiated): Don't clear DECL_COMDAT.
4123 2022-02-17 Jason Merrill <jason@redhat.com>
4126 * decl2.cc (mark_single_function): New.
4127 * cp-tree.h: Declare it.
4128 * typeck.cc (cp_build_addr_expr_1): mark_used when making a PMF.
4129 * semantics.cc (finish_qualified_id_expr): Not here.
4130 (finish_id_expression_1): Or here.
4131 (finish_decltype_type): Call mark_single_function.
4132 * cvt.cc (convert_to_void): And here.
4133 * pt.cc (convert_nontype_argument): And here.
4134 * init.cc (build_offset_ref): Adjust assert.
4136 2022-02-17 Patrick Palka <ppalka@redhat.com>
4139 * semantics.cc (finish_compound_literal): Don't perform
4140 non-dependent expr folding before calling check_narrowing.
4142 2022-02-16 Patrick Palka <ppalka@redhat.com>
4145 * constexpr.cc (potential_constant_expression_1)
4146 <case NON_DEPENDENT_EXPR>: Return false instead of recursing.
4147 Assert tf_error isn't set.
4149 2022-02-15 Jason Merrill <jason@redhat.com>
4153 * pt.cc (coerce_template_template_parms): Take full parms.
4154 Avoid adding too much of outer_args.
4155 (coerce_template_template_parm): Adjust.
4156 (template_template_parm_bindings_ok_p): Adjust.
4157 (convert_template_argument): Adjust.
4159 2022-02-14 Jakub Jelinek <jakub@redhat.com>
4162 * constexpr.cc (potential_constant_expression_1) <case GOTO_EXPR>:
4163 Don't punt if returns (target).
4165 2022-02-11 Jakub Jelinek <jakub@redhat.com>
4168 * constexpr.cc (cxx_eval_internal_function) <case IFN_VEC_CONVERT>:
4169 Only return fold_const_call result if it is non-NULL. Otherwise
4170 fall through into the default: case to return t, set *non_constant_p
4171 and emit diagnostics if needed.
4173 2022-02-10 Jason Merrill <jason@redhat.com>
4175 * module.cc (depset::hash::add_specializations): Use
4178 2022-02-10 Tobias Burnus <tobias@codesourcery.com>
4181 * decl2.cc (cp_omp_mappable_type_1): Remove check for virtual
4182 members as those are permitted since OpenMP 5.0.
4184 2022-02-10 Patrick Palka <ppalka@redhat.com>
4186 * pt.cc (filter_memfn_lookup): Handle dependent USING_DECL
4189 2022-02-10 Marcel Vollweiler <marcel@codesourcery.com>
4191 * parser.cc (cp_parser_omp_clause_name): Parse 'has_device_addr' clause.
4192 (cp_parser_omp_var_list_no_open): Handle array sections.
4193 (cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
4195 (cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK.
4196 * semantics.cc (handle_omp_array_sections): Handle clause restrictions.
4197 (finish_omp_clauses): Handle array sections.
4199 2022-02-09 Patrick Palka <ppalka@redhat.com>
4202 * call.cc (build_new_method_call): When a non-dependent call
4203 resolves to a specialization of a member template, always build
4204 the pruned overload set using the member template, not the
4206 * pt.cc (filter_memfn_lookup): New parameter newtype. Simplify
4207 and correct how members from the new lookup set are matched to
4208 those from the old one.
4209 (tsubst_baselink): Pass binfo_type as newtype to
4210 filter_memfn_lookup.
4212 2022-02-09 Jason Merrill <jason@redhat.com>
4215 * module.cc (trees_out::core_vals): Stream explicit specifier.
4216 (trees_in::core_vals): Likewise.
4217 * pt.cc (store_explicit_specifier): No longer static.
4218 (tsubst_function_decl): Clear DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
4219 * cp-tree.h (lookup_explicit_specifier): Declare.
4221 2022-02-09 Jason Merrill <jason@redhat.com>
4224 * typeck2.cc (split_nonconstant_init_1): Push cleanups for
4225 preceding members with constant initialization.
4226 (maybe_push_temp_cleanup): Do nothing if -fno-exceptions.
4228 2022-02-08 Jakub Jelinek <jakub@redhat.com>
4231 * name-lookup.cc (check_local_shadow): When diagnosing shadowing
4232 of a member or global declaration, add warning suppression for
4233 the decl and don't warn again on it.
4235 2022-02-08 Jakub Jelinek <jakub@redhat.com>
4238 * constexpr.cc (cxx_eval_constant_expression): Don't assert DECL_EXPRs
4239 of TREE_STATIC vars may only appear in -std=c++23.
4241 2022-02-08 Patrick Palka <ppalka@redhat.com>
4244 * pt.cc (uses_deducible_template_parms): Consider the
4245 noexcept-spec of a function type.
4247 2022-02-08 Patrick Palka <ppalka@redhat.com>
4250 * constraint.cc (satisfaction_value): Relax assert to accept
4253 2022-02-08 Patrick Palka <ppalka@redhat.com>
4256 * pt.cc (preserve_args): New function.
4257 (tsubst_lambda_expr): Use it when setting LAMBDA_EXPR_REGEN_INFO.
4259 2022-02-08 Patrick Palka <ppalka@redhat.com>
4262 * constraint.cc (satisfy_declaration_constraints): Use
4263 lambda_regenerating_args instead.
4264 * cp-tree.h (lambda_regenerating_args): Declare.
4265 * pt.cc (lambda_regenerating_args): Define, split out from
4266 satisfy_declaration_constraints.
4267 (do_auto_deduction): Use lambda_regenerating_args to obtain the
4268 full set of outer template arguments for satisfaction when
4271 2022-02-06 Patrick Palka <ppalka@redhat.com>
4274 * decl2.cc (mark_used): Directly synthesize a DECL_MAYBE_DELETED
4275 fn by calling maybe_synthesize_method instead of relying on
4276 maybe_instantiate_noexcept. Move call to m_i_n after the
4277 DECL_DELETED_FN handling.
4278 * pt.cc (maybe_instantiate_noexcept): Restrict DECL_MAYBE_DELETED
4279 fn synthesis to only those with an implicit noexcept-spec, and
4280 return !DECL_DELETED_FN instead of !DECL_MAYBE_DELETED afterwards.
4282 2022-02-06 Jakub Jelinek <jakub@redhat.com>
4286 * constexpr.cc (cxx_eval_binary_expression): Temporarily set
4287 folding_cxx_constexpr.
4289 2022-02-05 Jason Merrill <jason@redhat.com>
4293 * cp-tree.h (get_vec_init_expr): New.
4294 (target_expr_needs_replace): New.
4295 * cp-gimplify.cc (cp_gimplify_init_expr): Use it.
4296 (struct cp_fold_data): New.
4297 (cp_fold_r): Only genericize inits at end of fn.
4298 (cp_fold_function): Here.
4299 (cp_fully_fold_init): Not here.
4300 * init.cc (build_vec_init): Use get_vec_init_expr.
4301 * tree.cc (build_vec_init_expr): Likewise.
4302 * typeck2.cc (split_nonconstant_init_1): Likewise.
4303 (process_init_constructor): Wrap VEC_INIT_EXPR in
4306 2022-02-05 Jason Merrill <jason@redhat.com>
4308 * pt.cc (iterative_hash_template_arg): Add comment.
4310 2022-02-03 Patrick Palka <ppalka@redhat.com>
4313 * pt.cc (value_dependent_noexcept_spec_p): New predicate split
4315 (dependent_type_p_r): ... here.
4316 (instantiation_dependent_r): Use value_dependent_noexcept_spec_p
4317 to consider dependence of a noexcept-spec before C++17.
4318 * tree.cc (fixup_deferred_exception_variants): Clear
4319 TYPE_DEPENDENT_P_VALID.
4321 2022-02-03 Jason Merrill <jason@redhat.com>
4324 * decl.cc (maybe_deduce_size_from_array_init): Give up
4325 on type-dependent init.
4326 (cp_complete_array_type): Only call reshape_init for character
4329 2022-02-01 Jason Merrill <jason@redhat.com>
4332 * pt.cc (defarg_inst): Use tree_vec_map_cache_hasher.
4333 (defarg_insts_for): New.
4334 (tsubst_default_argument): Adjust.
4336 2022-01-31 Marek Polacek <polacek@redhat.com>
4340 * decl.cc (create_array_type_for_decl): Use template_placeholder_p.
4341 Sorry on a variable-length array of auto.
4343 2022-01-31 Marek Polacek <polacek@redhat.com>
4346 * class.cc (finish_struct): Don't allow union initializer_list.
4348 2022-01-31 Patrick Palka <ppalka@redhat.com>
4351 * pt.cc (ctor_deduction_guides_for): Correct computation of
4354 2022-01-31 Patrick Palka <ppalka@redhat.com>
4357 * pt.cc (for_each_template_parm_r) <case CONSTRUCTOR>: Clear
4358 walk_subtrees if !include_nondeduced_p. Simplify given that
4359 cp_walk_subtrees already walks TYPE_PTRMEMFUNC_FN_TYPE_RAW.
4361 2022-01-28 Patrick Palka <ppalka@redhat.com>
4362 Jason Merrill <jason@redhat.com>
4365 * typeck.cc (build_ptrmemfunc): Cast a nullptr constant to the
4366 unqualified pointer type not the qualified one.
4368 2022-01-28 Patrick Palka <ppalka@redhat.com>
4371 * decl.cc (cp_finish_decl): Pass the template arguments of a
4372 variable template specialization or a templated static data
4373 member to do_auto_deduction when the auto is constrained.
4375 2022-01-28 Jason Merrill <jason@redhat.com>
4380 * parser.cc (cp_parser_enumerator_definition): Sorry on parameter
4382 (cp_parser_class_head): And in class attributes.
4383 * pt.cc (check_for_bare_parameter_packs): Sorry instead of error
4386 2022-01-27 Jason Merrill <jason@redhat.com>
4390 * decl2.cc (save_template_attributes): Take late attrs as parm.
4391 (cplus_decl_attributes): Call it after decl_attributes,
4392 splice_template_attributes before.
4394 2022-01-27 Patrick Palka <ppalka@redhat.com>
4397 * call.cc (build_over_call): For a non-dependent member call,
4398 build up a CALL_EXPR using a COMPONENT_REF callee, as in
4399 build_new_method_call.
4400 * pt.cc (build_non_dependent_expr): Don't wrap PARM_DECL either.
4401 * tree.cc (build_min_non_dep_op_overload): Adjust accordingly
4402 after the build_over_call change.
4404 2022-01-27 Patrick Palka <ppalka@redhat.com>
4408 * parser.cc (cp_parser_class_head): Update 'type' with the result
4409 of maybe_process_partial_specialization in the
4410 nested_name_specifier branch. Refactor nearby code to accomodate
4411 that maybe_process_partial_specialization returns a _TYPE, not a
4412 TYPE_DECL, and eliminate local variable 'class_type' in passing.
4414 2022-01-27 Marek Polacek <polacek@redhat.com>
4417 * decl.cc (create_array_type_for_decl): Reject forming an array of
4418 placeholder for a deduced class type.
4420 2022-01-26 Jason Merrill <jason@redhat.com>
4424 * semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
4426 2022-01-26 Jakub Jelinek <jakub@redhat.com>
4429 * constexpr.cc (init_subob_ctx): For vector ctors containing
4430 vector elements, ensure appending to the same ctor instead of
4431 creating another one.
4433 2022-01-26 Marek Polacek <polacek@redhat.com>
4436 * decl.cc (finish_constructor_body): Suppress -Wuse-after-free.
4437 (finish_destructor_body): Likewise.
4438 * optimize.cc (build_delete_destructor_body): Likewise.
4440 2022-01-26 Jason Merrill <jason@redhat.com>
4443 * parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.
4445 2022-01-26 Jason Merrill <jason@redhat.com>
4448 * pt.cc (tsubst_aggr_type): Call tsubst for alias template
4451 2022-01-25 Patrick Palka <ppalka@redhat.com>
4455 * decl2.cc (mark_used): Don't consider maybe_instantiate_noexcept
4456 on a deleted function.
4458 2022-01-25 Jason Merrill <jason@redhat.com>
4461 * call.cc (build_over_call): Use cp_build_indirect_ref.
4463 2022-01-24 Patrick Palka <ppalka@redhat.com>
4466 * pt.cc (make_auto_1): Use -1 as a placeholder default argument
4469 2022-01-24 Patrick Palka <ppalka@redhat.com>
4472 * typeck.cc (build_class_member_access_expr): Extend
4473 unary_complex_lvalue result adjustment to preserve all
4474 rvalues, not just xvalues.
4476 2022-01-23 Will Wray <wjwray@gmail.com>
4479 * decl.cc (reshape_init_r): Only call has_designator_check when
4480 first_initializer_p or for the inner constructor element.
4481 (cp_complete_array_type): Call reshape_init on braced-init-list.
4483 2022-01-23 Jason Merrill <jason@redhat.com>
4486 * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing
4487 has set DECL_INITIAL on a TARGET_EXPR slot.
4488 * tree.cc (is_local_temp): Don't check DECL_CONTEXT.
4490 2022-01-23 Jason Merrill <jason@redhat.com>
4493 * cp-tree.h (build_implicit_conv_flags): Declare.
4494 * call.cc (build_implicit_conv_flags): Split out from...
4495 (perform_implicit_conversion_flags): ...here.
4496 * decl.cc (check_initializer): Use it.
4497 * pt.cc (tsubst_copy_and_build): Remove TARGET_EXPR handling.
4498 * semantics.cc (finish_compound_literal): Don't treat
4499 scalar values like CONSTRUCTORs.
4501 2022-01-21 Jason Merrill <jason@redhat.com>
4503 * semantics.cc (find_failing_clause): Return expr if not
4505 (finish_static_assert): Show constant values in failing
4508 2022-01-21 Jason Merrill <jason@redhat.com>
4512 * init.cc (build_new_1): Only pull out TARGET_EXPR_INITIAL if
4513 alloc_expr is a TARGET_EXPR.
4515 2022-01-21 Marek Polacek <polacek@redhat.com>
4518 * tree.cc (fixup_deferred_exception_variants): Remove duplicate
4519 variants after parsing the exception specifications.
4521 2022-01-21 Jason Merrill <jason@redhat.com>
4525 * class.cc (end_of_class): Use base_binfo.
4527 2022-01-20 Jason Merrill <jason@redhat.com>
4530 * decl.cc (reshape_init_class): Reject designator for a member of
4533 2022-01-20 Patrick Palka <ppalka@redhat.com>
4537 * pt.cc (keep_template_parm): Punt on a level 0 template parm.
4538 (tsubst_decl) <case VAR_DECL>: Remove !CHECKING_P safeguard.
4539 (tsubst) <case TEMPLATE_TYPE_PARM>: Handle CTAD placeholders
4541 (make_auto_1): Add defaulted 'level' parameter.
4542 (make_template_placeholder): Pass 0 as 'level' to make_auto_1.
4544 2022-01-20 Patrick Palka <ppalka@redhat.com>
4546 * decl.cc (grokdeclarator): Diagnose a CTAD placeholder as
4547 function return type even when !funcdecl_p.
4549 2022-01-20 Martin Liska <mliska@suse.cz>
4552 * error.cc (dump_aggr_type): Partially disable the warning.
4554 2022-01-20 Jason Merrill <jason@redhat.com>
4557 * parser.cc (cp_parser_template_name): Use dependent_scope_p.
4559 2022-01-19 David Malcolm <dmalcolm@redhat.com>
4561 * cp-lang.cc (selftest::run_cp_tests): Update calls for .c to .cc
4563 * cp-tree.h (cp_pt_c_tests): Rename to...
4564 (cp_pt_cc_tests): ...this.
4565 (cp_tree_c_tests): Rename to...
4566 (cp_tree_cc_tests): ...this.
4567 * pt.cc (cp_pt_c_tests): Rename to...
4568 (cp_pt_cc_tests): ...this.
4569 * tree.cc (cp_tree_c_tests): Rename to...
4570 (cp_tree_cc_tests): ...this.
4572 2022-01-19 Jason Merrill <jason@redhat.com>
4574 * parser.cc (saved_token_sentinel::rollback): Use
4575 cp_lexer_previous_token.
4577 2022-01-18 Jakub Jelinek <jakub@redhat.com>
4580 * constexpr.cc (cxx_eval_outermost_constant_expr): If t is a
4581 TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
4582 than get_target_expr_sfinae with tf_no_cleanup, and don't set
4585 2022-01-18 Jason Merrill <jason@redhat.com>
4586 Jakub Jelinek <jakub@redhat.com>
4589 * parser.cc (saved_token_sentinel::rollback): Call
4590 cp_lexer_set_source_position.
4591 (~saved_token_sentinel): Call rollback.
4593 2022-01-18 Patrick Palka <ppalka@redhat.com>
4596 * pt.cc (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
4597 that we return false for DEPENDENT_OPERATOR_TYPE too.
4599 2022-01-17 Martin Liska <mliska@suse.cz>
4601 * Make-lang.in: Rename .c names to .cc.
4602 * config-lang.in: Likewise.
4603 * constexpr.cc (cxx_eval_constant_expression): Likewise.
4604 * coroutines.cc (morph_fn_to_coro): Likewise.
4605 * cp-gimplify.cc (cp_gimplify_expr): Likewise.
4606 * cp-lang.cc (struct lang_hooks): Likewise.
4607 (get_template_argument_pack_elems_folded): Likewise.
4608 * cp-objcp-common.cc (cp_tree_size): Likewise.
4609 (cp_unit_size_without_reusable_padding): Likewise.
4610 (pop_file_scope): Likewise.
4611 (cp_pushdecl): Likewise.
4612 * cp-objcp-common.h (GCC_CP_OBJCP_COMMON): Likewise.
4613 (cxx_simulate_record_decl): Likewise.
4614 * cp-tree.h (struct named_label_entry): Likewise.
4615 (current_function_return_value): Likewise.
4616 (more_aggr_init_expr_args_p): Likewise.
4617 (get_function_version_dispatcher): Likewise.
4618 (common_enclosing_class): Likewise.
4619 (strip_fnptr_conv): Likewise.
4620 (current_decl_namespace): Likewise.
4621 (do_aggregate_paren_init): Likewise.
4622 (cp_check_const_attributes): Likewise.
4623 (qualified_name_lookup_error): Likewise.
4624 (generic_targs_for): Likewise.
4625 (mark_exp_read): Likewise.
4626 (is_global_friend): Likewise.
4627 (maybe_reject_flexarray_init): Likewise.
4628 (module_token_lang): Likewise.
4629 (handle_module_option): Likewise.
4630 (literal_integer_zerop): Likewise.
4631 (build_extra_args): Likewise.
4632 (build_if_nonnull): Likewise.
4633 (maybe_check_overriding_exception_spec): Likewise.
4634 (finish_omp_target_clauses): Likewise.
4635 (maybe_warn_zero_as_null_pointer_constant): Likewise.
4636 (cxx_print_error_function): Likewise.
4637 (decl_in_std_namespace_p): Likewise.
4638 (merge_exception_specifiers): Likewise.
4639 (mangle_module_global_init): Likewise.
4640 (cxx_block_may_fallthru): Likewise.
4641 (fold_builtin_source_location): Likewise.
4642 (enum cp_oracle_request): Likewise.
4643 (subsumes): Likewise.
4644 (cp_finish_injected_record_type): Likewise.
4645 (vtv_build_vtable_verify_fndecl): Likewise.
4646 (cp_tree_c_finish_parsing): Likewise.
4647 * cvt.cc (diagnose_ref_binding): Likewise.
4648 (convert_to_void): Likewise.
4649 (convert_force): Likewise.
4650 (type_promotes_to): Likewise.
4651 * decl.cc (make_unbound_class_template_raw): Likewise.
4652 (cxx_init_decl_processing): Likewise.
4653 (check_class_member_definition_namespace): Likewise.
4654 (cxx_maybe_build_cleanup): Likewise.
4655 * decl2.cc (maybe_emit_vtables): Likewise.
4656 * error.cc (dump_function_name): Likewise.
4657 * init.cc (is_class_type): Likewise.
4658 (build_new_1): Likewise.
4659 * lang-specs.h: Likewise.
4660 * method.cc (make_alias_for_thunk): Likewise.
4661 * module.cc (specialization_add): Likewise.
4662 (module_state::read_cluster): Likewise.
4663 * name-lookup.cc (check_extern_c_conflict): Likewise.
4664 * name-lookup.h (struct cxx_binding): Likewise.
4665 * parser.cc (cp_parser_identifier): Likewise.
4666 * parser.h (struct cp_parser): Likewise.
4667 * pt.cc (has_value_dependent_address): Likewise.
4668 (push_tinst_level_loc): Likewise.
4669 * semantics.cc (finish_omp_clauses): Likewise.
4670 (finish_omp_atomic): Likewise.
4671 * tree.cc (cp_save_expr): Likewise.
4672 (cp_free_lang_data): Likewise.
4673 * typeck.cc (cp_common_type): Likewise.
4674 (strip_array_domain): Likewise.
4675 (rationalize_conditional_expr): Likewise.
4676 (check_return_expr): Likewise.
4677 * vtable-class-hierarchy.cc: Likewise.
4679 2022-01-17 Martin Liska <mliska@suse.cz>
4681 * call.c: Moved to...
4683 * class.c: Moved to...
4684 * class.cc: ...here.
4685 * constexpr.c: Moved to...
4686 * constexpr.cc: ...here.
4687 * cp-gimplify.c: Moved to...
4688 * cp-gimplify.cc: ...here.
4689 * cp-lang.c: Moved to...
4690 * cp-lang.cc: ...here.
4691 * cp-objcp-common.c: Moved to...
4692 * cp-objcp-common.cc: ...here.
4693 * cp-ubsan.c: Moved to...
4694 * cp-ubsan.cc: ...here.
4695 * cvt.c: Moved to...
4697 * cxx-pretty-print.c: Moved to...
4698 * cxx-pretty-print.cc: ...here.
4699 * decl.c: Moved to...
4701 * decl2.c: Moved to...
4702 * decl2.cc: ...here.
4703 * dump.c: Moved to...
4705 * error.c: Moved to...
4706 * error.cc: ...here.
4707 * except.c: Moved to...
4708 * except.cc: ...here.
4709 * expr.c: Moved to...
4711 * friend.c: Moved to...
4712 * friend.cc: ...here.
4713 * g++spec.c: Moved to...
4714 * g++spec.cc: ...here.
4715 * init.c: Moved to...
4717 * lambda.c: Moved to...
4718 * lambda.cc: ...here.
4719 * lex.c: Moved to...
4721 * mangle.c: Moved to...
4722 * mangle.cc: ...here.
4723 * method.c: Moved to...
4724 * method.cc: ...here.
4725 * name-lookup.c: Moved to...
4726 * name-lookup.cc: ...here.
4727 * optimize.c: Moved to...
4728 * optimize.cc: ...here.
4729 * parser.c: Moved to...
4730 * parser.cc: ...here.
4733 * ptree.c: Moved to...
4734 * ptree.cc: ...here.
4735 * rtti.c: Moved to...
4737 * search.c: Moved to...
4738 * search.cc: ...here.
4739 * semantics.c: Moved to...
4740 * semantics.cc: ...here.
4741 * tree.c: Moved to...
4743 * typeck.c: Moved to...
4744 * typeck.cc: ...here.
4745 * typeck2.c: Moved to...
4746 * typeck2.cc: ...here.
4747 * vtable-class-hierarchy.c: Moved to...
4748 * vtable-class-hierarchy.cc: ...here.
4750 2022-01-17 Jakub Jelinek <jakub@redhat.com>
4753 * cp-gimplify.c (cp_genericize_target_expr): Set DECL_CONTEXT of
4754 TARGET_EXPR_SLOT to current_function_decl if it was NULL.
4756 2022-01-17 Andrew Stubbs <ams@codesourcery.com>
4758 * parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.
4760 2022-01-14 Chung-Lin Tang <cltang@codesourcery.com>
4763 * semantics.c (finish_omp_clauses): Also continue peeling off of
4764 outer node for ARRAY_REFs.
4766 2022-01-14 Jakub Jelinek <jakub@redhat.com>
4769 * cp-objcp-common.c (cxx_block_may_fallthru) <case IF_STMT>: For
4770 IF_STMT_CONSTEXPR_P with constant false or true condition only
4771 check if the taken clause may fall through.
4772 * cp-gimplify.c (genericize_if_stmt): For consteval if, revert
4773 to r12-5638^ behavior if then_ block can't fall through. For
4774 constexpr if, revert to r12-5638^ behavior.
4776 2022-01-13 Anthony Sharp <anthonysharp15@gmail.com>
4777 Jason Merrill <jason@redhat.com>
4780 * parser.c (cp_parser_id_expression): Handle
4781 -Wmissing-template-keyword.
4782 (struct saved_token_sentinel): Add modes to control what happens
4784 (cp_parser_statement): Adjust.
4785 (cp_parser_skip_entire_template_parameter_list): New function that
4786 skips an entire template parameter list.
4787 (cp_parser_require_end_of_template_parameter_list): Rename old
4788 cp_parser_skip_to_end_of_template_parameter_list.
4789 (cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
4790 called from one of the above two functions.
4791 (cp_parser_lambda_declarator_opt)
4792 (cp_parser_explicit_template_declaration)
4793 (cp_parser_enclosed_template_argument_list): Adjust.
4795 2022-01-12 Jakub Jelinek <jakub@redhat.com>
4796 Jason Merrill <jason@redhat.com>
4799 * tree.c (move): If expr is xvalue_p, just return expr without
4802 2022-01-11 Jakub Jelinek <jakub@redhat.com>
4805 * class.c (build_vfn_ref): Build OBJ_TYPE_REF with INTEGER_CST
4806 OBJ_TYPE_REF_TOKEN with type equal to OBJ_TYPE_REF_OBJECT type.
4807 * error.c (resolve_virtual_fun_from_obj_type_ref): Use type of
4808 OBJ_TYPE_REF_TOKEN rather than type of OBJ_TYPE_REF_OBJECT as
4811 2022-01-11 Patrick Palka <ppalka@redhat.com>
4814 * call.c (build_new_method_call): Consider dependent bases only
4815 if 'this' is available.
4817 2022-01-11 Olivier Hainque <hainque@adacore.com>
4819 * decl.c (cxx_init_decl_processing): Move code possibly
4820 altering flag_weak before code testing it.
4822 2022-01-10 Patrick Palka <ppalka@redhat.com>
4825 * constexpr.c (cxx_fold_indirect_ref): Split out object/offset
4826 canonicalization step into a local lambda. Strengthen it to
4827 absorb more components at position 0. Use it before both calls
4828 to cxx_fold_indirect_ref_1.
4830 2022-01-10 Patrick Palka <ppalka@redhat.com>
4833 * call.c (cand_parms_match): Skip over 'this' when given one
4834 static and one non-static member function.
4836 2022-01-10 Jakub Jelinek <jakub@redhat.com>
4839 * semantics.c (expand_or_defer_fn): For immediate functions, set
4840 node->body_removed to true and clear analyzed, definition and
4842 * decl2.c (c_parse_final_cleanups): Ignore immediate functions for
4845 2022-01-08 Jakub Jelinek <jakub@redhat.com>
4848 * constexpr.c (cxx_maybe_fold_addr_pointer_plus): New function.
4849 (cxx_eval_binary_expression): Use it.
4851 2022-01-08 Jason Merrill <jason@redhat.com>
4854 * init.c (build_vec_init): Remove assert.
4855 * tree.c (build_vec_init_expr): Likewise.
4857 2022-01-08 Jason Merrill <jason@redhat.com>
4860 * call.c (build_op_delete_call): Ignore destroying delete
4863 2022-01-07 Jason Merrill <jason@redhat.com>
4866 * init.c (build_new_1): Also build pointer cleanup if
4868 * cp-tree.h (TYPE_GETS_VEC_DELETE): New.
4870 2022-01-07 Jason Merrill <jason@redhat.com>
4874 * cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling.
4876 2022-01-07 Jason Merrill <jason@redhat.com>
4879 * init.c (perform_target_ctor): Select destructor by in_chrg.
4881 2022-01-07 Jason Merrill <jason@redhat.com>
4884 * except.c (in_nested_catch): New.
4885 (expand_end_catch_block): Check it.
4887 2022-01-07 Jason Merrill <jason@redhat.com>
4891 * except.c (maybe_splice_retval_cleanup): Check
4892 current_binding_level.
4893 * semantics.c (do_poplevel): Call it here.
4894 * parser.c (cp_parser_compound_statement): Not here.
4896 2022-01-07 Jason Merrill <jason@redhat.com>
4899 * decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
4900 cleanups from set_up_extended_ref_temp.
4901 (wrap_temporary_cleanups): Ignore array cleanups.
4902 (initialize_local_var): Don't check for array here.
4903 * cp-tree.h (BIND_EXPR_VEC_DTOR): New.
4904 * init.c (build_vec_delete_1): Set it.
4906 2022-01-07 Jason Merrill <jason@redhat.com>
4909 * init.c (build_vec_delete_1): Handle throwing dtor.
4910 (build_vec_init): Tell it we're in a cleanup already.
4912 2022-01-07 Jason Merrill <jason@redhat.com>
4914 * typeck2.c (split_nonconstant_init_1): Don't cleanup the last elt.
4915 (split_nonconstant_init): Adjust.
4917 2022-01-07 Jason Merrill <jason@redhat.com>
4921 * constexpr.c (replace_decl): Rename from replace_result_decl.
4922 * cp-tree.h (replace_decl): Declare it.
4923 * cp-gimplify.c (cp_gimplify_init_expr): Call it.
4924 (cp_gimplify_expr): Don't handle VEC_INIT_EXPR.
4925 (cp_genericize_init, cp_genericize_init_expr)
4926 (cp_genericize_target_expr): New.
4927 (cp_fold_r): Call them.
4928 * tree.c (build_array_copy): Add a TARGET_EXPR.
4929 * typeck2.c (digest_init_r): Look through a TARGET_EXPR.
4931 2022-01-07 Jason Merrill <jason@redhat.com>
4934 * decl.c (initialize_local_var): Fix comment.
4935 * init.c (build_new_1): Do stabilize array init.
4936 (build_vec_init): Use TARGET_EXPR for cleanup. Initialization
4937 of an element from an explicit initializer is not a
4939 * tree.c (expand_vec_init_expr): Pass flags through.
4940 * typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
4941 (split_nonconstant_init): Handle array cleanups.
4942 * cp-tree.h: Adjust.
4944 2022-01-07 Jason Merrill <jason@redhat.com>
4947 * decl.c (check_initializer): Remove obsolete comment.
4948 (wrap_cleanups_r): Don't wrap CLEANUP_EH_ONLY.
4949 (initialize_local_var): Change assert to test.
4950 * typeck2.c (maybe_push_temp_cleanup): New.
4951 (split_nonconstant_init_1): Use it.
4952 (split_nonconstant_init): Clear cleanup flags.
4954 2022-01-07 Jason Merrill <jason@redhat.com>
4957 * typeck2.c (PICFLAG_VEC_INIT): New.
4958 (process_init_constructor_array): Set it.
4959 (process_init_constructor): Handle it.
4960 (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
4961 * init.c (build_vec_init): Likewise.
4962 * cp-gimplify.c (cp_gimplify_expr): Factor out...
4963 * tree.c (expand_vec_init_expr): ...this function.
4964 (build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P.
4965 (build_vec_init_expr): Likewise.
4966 * constexpr.c (cxx_eval_vec_init): Likewise.
4967 (reduced_constant_expression_p): Check arrays before C++20.
4968 * cp-tree.h (expand_vec_init_expr): Declare.
4970 2022-01-07 Jason Merrill <jason@redhat.com>
4972 * init.c (build_new_1): Remove preevaluation code.
4974 2022-01-05 Nathan Sidwell <nathan@acm.org>
4976 * pt.c (instantiate_class_template_1): Process attribute((used)) set
4979 2022-01-05 Nathan Sidwell <nathan@acm.org>
4981 * init.c (build_new_1): Check complain before alignment warning.
4983 2022-01-04 Jason Merrill <jason@redhat.com>
4985 * cp-tree.h (class releasing_vec): Add begin/end fns.
4987 2022-01-04 Jason Merrill <jason@redhat.com>
4989 * init.c: Include -*- C++ -*- on first line.
4991 2022-01-03 Marek Polacek <polacek@redhat.com>
4994 * parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
4997 2022-01-03 Marek Polacek <polacek@redhat.com>
4999 * parser.c (make_char_string_pack): Add a cast to const unsigned
5002 2022-01-03 Jakub Jelinek <jakub@redhat.com>
5005 * rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
5006 to DECL_TINFO_P VAR_DECLs.
5008 2022-01-02 Jason Merrill <jason@redhat.com>
5010 * init.c (build_vec_init): Append the decrement to elt_init.
5012 2022-01-02 Jason Merrill <jason@redhat.com>
5014 * decl.c (wrap_cleanups_r): Don't wrap if noexcept.
5017 Copyright (C) 2022 Free Software Foundation, Inc.
5019 Copying and distribution of this file, with or without modification,
5020 are permitted in any medium without royalty provided the copyright
5021 notice and this notice are preserved.