]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/ChangeLog-2022
doc: Remove @code wrapping of fortran option names [PR116801]
[thirdparty/gcc.git] / gcc / cp / ChangeLog-2022
CommitLineData
d64f8779
JJ
12022-12-29 Alexandre Oliva <oliva@adacore.com>
2
3 * constexpr.cc (cxx_eval_call_expression): Do not request an
4 INSERT that would not be completed.
5
62022-12-29 Alexandre Oliva <oliva@adacore.com>
7
8 * constraint.cc (normalize_concept_check): Use NO_INSERT for
9 pre-insertion check.
10
112022-12-23 Patrick Palka <ppalka@redhat.com>
12
13 PR c++/108116
14 * constexpr.cc (maybe_constant_value): Clear
15 processing_template_decl before calling break_out_target_exprs.
16 * init.cc (get_nsdmi): Likewise.
17 * tree.cc (break_out_target_exprs): Assert processing_template_decl
18 is cleared.
19
202022-12-23 Patrick Palka <ppalka@redhat.com>
21
22 PR c++/107853
23 * constraint.cc (maybe_substitute_reqs_for): Substitute into
24 the template-head requirements of a template friend using only
25 its outer arguments via outer_template_args.
26 * cp-tree.h (outer_template_args): Declare.
27 * pt.cc (outer_template_args): Define, factored out and
28 generalized from ...
29 (ctor_deduction_guides_for): ... here.
30
312022-12-23 Iain Sandoe <iain@sandoe.co.uk>
32
33 * g++spec.cc (lang_specific_driver): Preserve -static-libstdc++ in
34 the driver command line for targets without -Bstatic/dynamic support
35 in their static linker.
36
372022-12-21 Jakub Jelinek <jakub@redhat.com>
38
39 PR c++/108180
40 * pt.cc (tsubst_expr): Don't call cp_finish_decl on
41 DECL_OMP_PRIVATIZED_MEMBER vars.
42
432022-12-21 Jason Merrill <jason@redhat.com>
44
45 PR c++/84471
46 PR c++/107504
47 * coroutines.cc (transform_local_var_uses): Don't
48 specify a location for DECL_VALUE_EXPR.
49 * decl.cc (cp_finish_decomp): Likewise.
50
512022-12-20 Patrick Palka <ppalka@redhat.com>
52
53 PR c++/101886
54 * pt.cc (find_template_parameter_info::parm_list_tail):
55 New data member.
56 (keep_template_parm): Use parm_list_tail to append rather
57 than prepend to parm_list.
58
592022-12-20 Iain Sandoe <iain@sandoe.co.uk>
60
61 * mangle.cc (write_mangled_name): Append the helper function
62 suffixes here...
63 (write_encoding): ... rather than here.
64
652022-12-20 Patrick Palka <ppalka@redhat.com>
66
67 PR c++/103346
68 PR c++/104278
69 PR c++/102553
70 * pt.cc (tsubst_copy) <case VIEW_CONVERT_EXPR>: Move the
71 handling of C++20 template parameter object wrappers to ...
72 (tsubst_copy_and_build) <case VIEW_CONVERT_EXPR>: ... here.
73 Accept non-TEMPLATE_PARM_INDEX inner operand. Handle empty
74 TREE_TYPE on substituted inner operand. Remove same_type_p
75 assert. Also handle REF_PARENTHESIZED_P VIEW_CONVERT_EXPRs.
76
772022-12-19 Patrick Palka <ppalka@redhat.com>
78
79 PR c++/100881
80 * constexpr.cc (cxx_eval_builtin_function_call): Adjust calls
81 to fold_builtin_source_location.
82 * cp-gimplify.cc (cp_gimplify_expr): Likewise.
83 (cp_fold): Likewise.
84 (get_source_location_impl_type): Remove location_t parameter and
85 adjust accordingly. No longer static.
86 (fold_builtin_source_location): Take a CALL_EXPR tree instead of a
87 location and obtain the impl type from its return type.
88 * cp-tree.h (enum cp_tree_index): Remove CPTI_SOURCE_LOCATION_IMPL
89 enumerator.
90 (source_location_impl): Remove.
91 (fold_builtin_source_location): Adjust parameter type.
92 (get_source_location_impl_type): Declare.
93 * decl.cc (cxx_init_decl_processing): Declare
94 __builtin_source_location with auto return type instead of
95 const void*.
96 (require_deduced_type): Update the return type of
97 __builtin_source_location.
98
992022-12-19 Patrick Palka <ppalka@redhat.com>
100
101 PR c++/101886
102 * pt.cc (extract_autos_r): Recompute TYPE_CANONICAL after
103 adjusting the template type parameter's index. Simplify
104 by using TEMPLATE_TYPE_IDX. Add some sanity checks.
105
1062022-12-19 Arsen Arsenović <arsen@aarsen.me>
107
108 * contracts.cc: Rename references to
109 contract_violation_continuation_mode constants to be lowercase.
110
1112022-12-17 Patrick Palka <ppalka@redhat.com>
112
113 PR c++/107437
114 PR c++/87765
115 * pt.cc (convert_nontype_argument): Relax is_nondep_const_expr
116 test to !inst_dep_expr_p.
117
1182022-12-16 Andrew Pinski <pinskia@gmail.com>
119 Iain Sandoe <iain@sandoe.co.uk>
120
121 PR c++/107768
122 * coroutines.cc (coro_rewrite_function_body): Initialize pointers
123 from nullptr_node. (morph_fn_to_coro): Likewise.
124
1252022-12-15 Patrick Palka <ppalka@redhat.com>
126
127 PR c++/102104
128 PR c++/108090
129 * error.cc (dump_decl) <case USING_DECL>: Look through a
130 pack expansion in the name as well.
131 * parser.cc (cp_parser_using_declaration): Handle a parameter
132 pack appearing in the terminal name of a variadic using-decl.
133 * pt.cc (tsubst_decl) <case USING_DECL>: Likewise. Combine the
134 handling of variadic and non-variadic using-decls.
135
1362022-12-15 Jason Merrill <jason@redhat.com>
137
138 * init.cc (build_vec_init): Rename "flags" to "cleanup_flags"
139 to distinguish from LOOKUP_*.
140
1412022-12-15 Arsen Arsenović <arsen@aarsen.me>
142
143 * mangle.cc (write_encoding): Move contract pre/post function
144 mangling from here...
145 (write_mangled_name): ... to here, and make it happen always.
146
1472022-12-15 Patrick Palka <ppalka@redhat.com>
148
149 PR c++/107188
150 * parser.cc (cp_parser_using_declaration): Give up early if the
151 scope of an access-declaration isn't possibly a class type.
152
1532022-12-15 Patrick Palka <ppalka@redhat.com>
154
155 PR c++/100295
156 PR c++/107579
157 * pt.cc (el_data::skip_unevaluated_operands): New data member.
158 (extract_locals_r): If skip_unevaluated_operands is true,
159 don't walk into unevaluated contexts.
160 (extract_local_specs): Walk the pattern twice, first with
161 skip_unevaluated_operands true followed by it set to false.
162
1632022-12-15 Patrick Palka <ppalka@redhat.com>
164
165 PR c++/105518
166 * pt.cc (tsubst_aggr_type): Handle typedefs by delegating to
167 tsubst and adjusting the result if entering_scope. Split out
168 the main part of the function into ...
169 (tsubst_aggr_type_1) ... here.
170 (tsubst): Use tsubst_aggr_type_1 instead of tsubst_aggr_type.
171 Handle TYPE_PTRMEMFUNC_P RECORD_TYPEs here instead of in
172 tsubst_aggr_type_1.
173
1742022-12-15 Patrick Palka <ppalka@redhat.com>
175
176 PR c++/108104
177 * pt.cc (unify) <default>: Relax assert to accept any
178 CONSTRUCTOR parm, not just COMPOUND_LITERAL_P one.
179
1802022-12-15 Jakub Jelinek <jakub@redhat.com>
181
182 PR c++/107065
183 * typeck.cc (cp_build_unary_op) <case TRUTH_NOT_EXPR>: If
184 invert_truthvalue_loc returns obvalue_p, wrap it into NON_LVALUE_EXPR.
185 * parser.cc (cp_parser_binary_expression): Don't call
186 warn_logical_not_parentheses if current.lhs is a NON_LVALUE_EXPR
187 of a decl with boolean type.
188
1892022-12-15 Jakub Jelinek <jakub@redhat.com>
190
191 PR libstdc++/108075
192 * rtti.cc (emit_support_tinfos): Add pointers to
193 {bfloat16,float{16,32,64,128,32x,64x,128x}}_type_node to fundamentals
194 array.
195
1962022-12-15 Jason Merrill <jason@redhat.com>
197
198 PR c++/108071
199 PR c++/105838
200 * call.cc (struct conversion_obstack_sentinel): New.
201 (maybe_init_list_as_array): Compare conversion of dummy argument.
202
2032022-12-12 Jason Merrill <jason@redhat.com>
204
205 Revert:
206 2022-12-08 Jason Merrill <jason@redhat.com>
207
208 PR c++/105838
209 * call.cc (convert_like_internal) [ck_list]: Use
210 maybe_init_list_as_array.
211 * constexpr.cc (cxx_eval_vec_init_1): Init might have
212 a different type.
213 * tree.cc (build_vec_init_elt): Likewise.
214 * init.cc (build_vec_init): Handle from_array from a
215 TARGET_EXPR. Retain TARGET_EXPR of a different type.
216
2172022-12-08 Jason Merrill <jason@redhat.com>
218
219 PR c++/105838
220 * call.cc (convert_like_internal) [ck_list]: Use
221 maybe_init_list_as_array.
222 * constexpr.cc (cxx_eval_vec_init_1): Init might have
223 a different type.
224 * tree.cc (build_vec_init_elt): Likewise.
225 * init.cc (build_vec_init): Handle from_array from a
226 TARGET_EXPR. Retain TARGET_EXPR of a different type.
227
2282022-12-08 Jason Merrill <jason@redhat.com>
229
230 PR c++/105838
231 * call.cc (list_ctor_element_type): New.
232 (braced_init_element_type): New.
233 (has_non_trivial_temporaries): New.
234 (maybe_init_list_as_array): New.
235 (maybe_init_list_as_range): New.
236 (build_user_type_conversion_1): Use maybe_init_list_as_range.
237 * parser.cc (cp_parser_braced_list): Call
238 recompute_constructor_flags.
239 * cp-tree.h (find_temps_r): Declare.
240
2412022-12-08 Jason Merrill <jason@redhat.com>
242
243 PR c++/105838
244 * cp-tree.h (is_std_allocator): Declare.
245 * constexpr.cc (is_std_allocator): Split out from...
246 (is_std_allocator_allocate): ...here.
247 * init.cc (find_temps_r): New.
248 (find_allocator_temp): New.
249 (build_vec_init): Use it.
250
2512022-12-08 Jason Merrill <jason@redhat.com>
252
253 * constexpr.cc (maybe_constant_value): Add default arg comments.
254
2552022-12-05 Scott Snyder <sss@li-snyder.org>
256
257 PR plugins/107964
258 * Make-lang.in (CP_PLUGIN_HEADERS): Install contracts.h
259
2602022-12-04 Patrick Palka <ppalka@redhat.com>
261
262 PR c++/107417
263 * pt.cc (for_each_template_parm_r) <case REQUIRES_EXPR>: Move
264 walking of the TREE_TYPE of each parameter to ...
265 * tree.cc (cp_walk_subtrees) <case REQUIRES_EXPR>: ... here.
266
2672022-12-04 Iain Sandoe <iain@sandoe.co.uk>
268 Adrian Perl <adrian.perl@web.de>
269
270 PR c++/100611
271 PR c++/101367
272 PR c++/101976
273 PR c++/99576
274 * coroutines.cc (find_interesting_subtree): Do not promote temporaries
275 that are only used as direct initializers for some other object.
276
2772022-12-03 Patrick Palka <ppalka@redhat.com>
278
279 PR c++/103081
280 * pt.cc (tsubst_copy) <case CONST_DECL>: Generalize
281 early exit test for namespace-scope decls to check dependence of
282 the enclosing scope instead. Remove dead early exit test.
283
2842022-12-02 Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
285 Jason Merrill <jason@redhat.com>
286
287 * decl.cc (grokdeclarator): Build RESULT_DECL.
288 (start_preparsed_function): Copy location from template.
289 * semantics.cc (apply_deduced_return_type): Handle
290 arg != current_function_decl.
291 * method.cc (implicitly_declare_fn): Use it.
292
2932022-12-02 Jason Merrill <jason@redhat.com>
294
295 * g++spec.cc (lang_specific_driver): Set SKIPOPT for nostdlib++.
296
2972022-12-02 Jakub Jelinek <jakub@redhat.com>
298
299 PR c++/84469
300 * parser.cc (cp_convert_omp_range_for): After do_auto_deduction if
301 !processing_template_decl call cp_finish_decomp with
302 processing_template_decl temporarily incremented.
303
3042022-12-02 Jakub Jelinek <jakub@redhat.com>
305
306 PR c++/84469
307 * parser.cc (do_range_for_auto_deduction): Add DECOMP_FIRST_NAME
308 and DECOMP_CNT arguments. Call cp_finish_decomp if DECL
309 is a structured binding.
310 (cp_parser_range_for): Adjust do_range_for_auto_deduction caller.
311 (cp_convert_omp_range_for): Likewise.
312
3132022-12-02 Patrick Palka <ppalka@redhat.com>
314
315 PR c++/107539
316 * constraint.cc (norm_hasher::hash, norm_hasher::equal): Set
317 comparing_specializations.
318 (sat_hasher::hash, sat_hasher::equal): Likewise.
319 * cp-tree.h (atom_hasher::hash, atom_hasher::equal): Likewise.
320 * pt.cc (ctp_hasher::hash, ctp_hasher::equal): Likewise.
321
3222022-12-01 Martin Liska <mliska@suse.cz>
323
324 * Make-lang.in: Remove extra object dependency.
325
3262022-12-01 Jason Merrill <jason@redhat.com>
327
328 * contracts.cc (remove_contract_attributes): Actually prepend
329 to the list.
330 * pt.cc (tsubst_contract): Only look for a postcondition if type is
331 nonnull.
332
3332022-11-30 Patrick Palka <ppalka@redhat.com>
334
335 PR c++/107542
336 * typeck.cc (cp_build_binary_op): In the SPACESHIP_EXPR case,
337 handle an error_mark_node result type.
338
3392022-11-29 Patrick Palka <ppalka@redhat.com>
340
341 PR c++/107864
342 * decl.cc (function_requirements_equivalent_p): Don't check
343 DECL_TEMPLATE_SPECIALIZATION.
344 * pt.cc (determine_specialization): Propagate constraints when
345 specializing a function template too. Simplify by using
346 add_outermost_template_args.
347
3482022-11-28 Jason Merrill <jason@redhat.com>
349
350 PR c++/101733
351 * parser.cc (cp_parser_requirement): Parse tentatively for the
352 'typename' case.
353
3542022-11-28 Jason Merrill <jason@redhat.com>
355
356 * parser.cc (cp_parser_decl_specifier_seq): Change 'concept bool'
357 diagnostic from pedwarn to permerror.
358
3592022-11-28 Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
360 Yvan ROUX <yvan.roux@foss.st.com>
361
362 * module.cc: On Windows, 'A:Foo' is supposed to be a module
363 and not a path.
364
3652022-11-22 Jason Merrill <jason@redhat.com>
366
367 PR c++/107781
368 * contracts.cc (role_name_equal): Use strcspn instead
369 of strchrnul.
370
3712022-11-22 Jason Merrill <jason@redhat.com>
372
373 * contracts.cc (build_contract_condition_function):
374 Set DECL_ARTIFICIAL on return value parm.
375 * g++spec.cc (lang_specific_driver): Add -lstdc++exp
376 just before -lstdc++.
377
3782022-11-20 Patrick Palka <ppalka@redhat.com>
379
380 * constraint.cc (struct norm_entry): Define.
381 (struct norm_hasher): Define.
382 (norm_cache): Define.
383 (normalize_concept_check): Add function comment. Cache the
384 the normal form of the substituted concept-id. Canonicalize
385 generic arguments as NULL_TREE. Don't coerce arguments unless
386 they were substituted.
387 (normalize_concept_definition): Simplify. Use norm_cache
388 instead of normalized_map.
389
3902022-11-20 Patrick Palka <ppalka@redhat.com>
391
392 * pt.cc (coerce_template_parms): Salvage part of the function
393 comment from c_innermost_t_p. Handle parms being a full
394 template parameter list.
395 (coerce_innermost_template_parms): Remove.
396 (lookup_template_class): Use c_t_p instead of c_innermost_t_p.
397 (finish_template_variable): Likewise.
398 (tsubst_decl): Likewise.
399 (instantiate_alias_template): Likewise.
400
4012022-11-19 Jakub Jelinek <jakub@redhat.com>
402
403 * constexpr.cc (cxx_eval_constant_expression): Implement C++23
404 P2647R1 - Permitting static constexpr variables in constexpr functions.
405 Allow DECL_EXPRs of decl_constant_var_p static or thread_local vars.
406 (potential_constant_expression_1): Similarly, except use
407 decl_maybe_constant_var_p instead of decl_constant_var_p if
408 processing_template_decl.
409
4102022-11-19 Jeff Chapman II <jchapman@lock3software.com>
411 Andrew Sutton <asutton@lock3software.com>
412 Andrew Marmaduke <amarmaduke@lock3software.com>
413 Michael Lopez <mlopez@lock3software.com>
414 Jason Merrill <jason@redhat.com>
415
416 * cp-tree.h (enum cp_tree_index): Add
417 CPTI_PSEUDO_CONTRACT_VIOLATION.
418 (pseudo_contract_violation_type): New macro.
419 (struct saved_scope): Add x_processing_contract_condition.
420 (processing_contract_condition): New macro.
421 (comparing_override_contracts): New variable decl.
422 (find_contract): New inline.
423 (set_decl_contracts): New inline.
424 (get_contract_semantic): New inline.
425 (set_contract_semantic): New inline.
426 * constexpr.cc (cxx_eval_assert): Split out from...
427 (cxx_eval_internal_function): ...here.
428 (cxx_eval_constant_expression): Use it for contracts.
429 (potential_constant_expression_1): Handle contracts.
430 * cp-gimplify.cc (cp_genericize_r): Handle contracts.
431 * cp-objcp-common.cc (cp_tree_size): Handle contracts.
432 (cp_common_init_ts): Handle contracts.
433 (cp_handle_option): Handle contracts.
434 * decl.cc (duplicate_decls): Handle contracts.
435 (check_tag_decl): Check for bogus contracts.
436 (start_decl): Check flag_contracts.
437 (grokfndecl): Call rebuild_postconditions.
438 (grokdeclarator): Handle contract attributes.
439 (start_preparsed_function): Call start_function_contracts.
440 (finish_function): Call finish_function_contracts.
441 * decl2.cc (cp_check_const_attributes): Skip contracts.
442 (comdat_linkage): Handle outlined contracts.
443 * error.cc (dump_type): Handle null TYPE_IDENTIFIER.
444 * g++spec.cc (EXPERIMENTAL): New macro.
445 (lang_specific_driver): Add -lstdc++exp if -fcontracts.
446 * mangle.cc (write_encoding): Handle outlined contracts.
447 * module.cc (trees_out::fn_parms_init): Handle outlined contracts.
448 (trees_in::fn_parms_init): Likewise.
449 (check_mergeable_decl): Likewise.
450 (module_state_config::get_dialect): Record -fcontracts.
451 * parser.h (struct cp_unparsed_functions_entry): Add contracts.
452 * parser.cc (unparsed_contracts): New macro.
453 (push_unparsed_function_queues): Adjust.
454 (contract_attribute_p): New.
455 (cp_parser_statement): Check contracts.
456 (cp_parser_decl_specifier_seq): Handle contracts.
457 (cp_parser_skip_to_closing_square_bracket): Split out...
458 (cp_parser_skip_up_to_closing_square_bracket): ...this fn.
459 (cp_parser_class_specifier): Do contract late parsing.
460 (cp_parser_class_head): Check contracts.
461 (cp_parser_contract_role): New.
462 (cp_parser_contract_mode_opt): New.
463 (find_error, contains_error_p): New.
464 (cp_parser_contract_attribute_spec): New.
465 (cp_parser_late_contract_condition): New.
466 (cp_parser_std_attribute_spec): Handle contracts.
467 (cp_parser_save_default_args): Also save contracts.
468 * pt.cc (register_parameter_specializations): No longer static.
469 (register_local_identity): New.
470 (check_explicit_specialization): Call remove_contract_attributes.
471 (tsubst_contract, tsubst_contract_attribute): New.
472 (tsubst_contract_attributes): New.
473 (tsubst_attribute): Add comment.
474 (tsubst_copy): Also allow parm when processing_contract_condition.
475 (tsubst_expr): Handle contracts.
476 (regenerate_decl_from_template): Handle contracts.
477 * search.cc (check_final_overrider): Compare contracts.
478 * semantics.cc (set_cleanup_locs): Skip POSTCONDITION_STMT.
479 (finish_non_static_data_member): Check contracts.
480 (finish_this_expr): Check contracts.
481 (process_outer_var_ref): Handle contracts.
482 (finish_id_expression_1): Handle contracts.
483 (apply_deduced_return_type): Adjust contracts.
484 * tree.cc (handle_contract_attribute): New.
485 (get_innermost_component, is_this_expression): New.
486 (comparing_this_references): New.
487 (equivalent_member_references): New.
488 (cp_tree_equal): Check it.
489 * typeck.cc (check_return_expr): Apply contracts.
490 * Make-lang.in: Add contracts.o.
491 * config-lang.in: Add contracts.cc.
492 * cp-tree.def (ASSERTION_STMT, PRECONDITION_STMT)
493 (POSTCONDITION_STMT): New.
494 * contracts.h: New file.
495 * contracts.cc: New file.
496
4972022-11-18 Jakub Jelinek <jakub@redhat.com>
498
499 * decl.cc (grokdeclarator): Implement
500 CWG2635 - Constrained structured bindings. Emit a pedwarn on
501 constrained auto type. Add auto_diagnostic_group for error_at
502 and inform for non-auto type on structured bindings declaration.
503
5042022-11-18 Marek Polacek <polacek@redhat.com>
505
506 PR c++/104066
507 * decl.cc (grokdeclarator): Check funcdecl_p before complaining
508 about constinit.
509
5102022-11-16 Marek Polacek <polacek@redhat.com>
511
512 PR c++/106649
513 * constexpr.cc (constexpr_error): New function.
514 (is_valid_constexpr_fn): Use constexpr_error.
515 (maybe_save_constexpr_fundef): Call
516 require_potential_rvalue_constant_expression_fncheck rather than
517 require_potential_rvalue_constant_expression. Register the
518 function if -Wno-invalid-constexpr was specified.
519 (explain_invalid_constexpr_fn): Don't return early if a function marked
520 'constexpr' that isn't actually a constant expression was called.
521 (non_const_var_error): Add a bool parameter. Use constexpr_error.
522 (inline_asm_in_constexpr_error): Likewise.
523 (cxx_eval_constant_expression): Adjust calls to non_const_var_error
524 and inline_asm_in_constexpr_error.
525 (potential_constant_expression_1): Add a bool parameter. Use
526 constexpr_error.
527 (require_potential_rvalue_constant_expression_fncheck): New function.
528 * cp-tree.h (require_potential_rvalue_constant_expression_fncheck):
529 Declare.
530 * method.cc (struct comp_info): Call
531 require_potential_rvalue_constant_expression_fncheck rather than
532 require_potential_rvalue_constant_expression.
533
5342022-11-16 Jakub Jelinek <jakub@redhat.com>
535
536 * typeck.cc (next_common_initial_sequence): Return false members have
537 different DECL_ALIGN.
538 (layout_compatible_type_p): Don't test TYPE_ALIGN of ENUMERAL_TYPE
539 or CLASS_TYPE_P.
540
5412022-11-16 Jakub Jelinek <jakub@redhat.com>
542
543 PR c++/107624
544 * call.cc (keep_unused_object_arg): New function.
545 (build_op_call): Use it.
546 (build_op_subscript): Likewise.
547 (build_new_op): Similarly for ARRAY_REF.
548 (build_new_method_call): Use it.
549 * decl.cc (grok_op_properties): For C++20 and earlier, if operator[]
550 is static member function, require exactly one parameter rather than
551 exactly two parameters.
552
5532022-11-16 Jakub Jelinek <jakub@redhat.com>
554
555 * typeck.cc (cp_build_modify_expr): Implement CWG 2654
556 - Un-deprecation of compound volatile assignments. Remove
557 -Wvolatile warning about compound volatile assignments.
558
5592022-11-16 Jakub Jelinek <jakub@redhat.com>
560
561 * cp-tree.def (CONCEPT_DECL): Move to c-common.def.
562 * cp-objcp-common.cc (cp_common_init_ts): Don't handle CONCEPT_DECL
563 here.
564 * cp-tree.h (finish_concept_definition): Add ATTRS parameter.
565 * parser.cc (cp_parser_concept_definition): Parse attributes in
566 between identifier and =. Adjust finish_concept_definition
567 caller.
568 * pt.cc (finish_concept_definition): Add ATTRS parameter. Call
569 cplus_decl_attributes.
570 * constraint.cc (build_standard_check): If CONCEPT_DECL is
571 TREE_DEPRECATED, emit -Wdeprecated-declaration warnings.
572
5732022-11-15 Marek Polacek <polacek@redhat.com>
574
575 PR c++/107492
576 * decl.cc (grokdeclarator): Only emit a -Wignored-qualifiers warning
577 when funcdecl_p.
578
5792022-11-15 Patrick Palka <ppalka@redhat.com>
580
581 * constexpr.cc (potential_constant_expression_1)
582 <case *_CAST_EXPR>: Use
583 cast_valid_in_integral_constant_expression_p instead of
584 open coding it.
585 * constraint.cc (tsubst_valid_expression_requirement): Adjust
586 calls to tsubst_copy_and_build and tsubst_expr.
587 (tsubst_constraint): Likewise.
588 (satisfy_atom): Likewise.
589 (diagnose_trait_expr): Likewise.
590 * cp-tree.h (tsubst_copy_and_build): Remove i_c_e_p parameter.
591 (tsubst_expr): Likewise.
592 * init.cc (get_nsdmi): Adjust calls to tsubst_copy_and_build
593 and tsubst_expr.
594 * pt.cc (expand_integer_pack): Likewise.
595 (instantiate_non_dependent_expr_internal): Likewise.
596 (tsubst_friend_function): Likewise.
597 (tsubst_attribute): Likewise.
598 (instantiate_class_template): Likewise.
599 (tsubst_template_arg): Likewise.
600 (gen_elem_of_pack_expansion_instantiation): Likewise.
601 (tsubst_fold_expr_init): Likewise.
602 (tsubst_pack_expansion): Likewise.
603 (tsubst_default_argument): Likewise.
604 (tsubst_function_decl): Likewise.
605 (tsubst_decl): Likewise.
606 (tsubst_arg_types): Likewise.
607 (tsubst_exception_specification): Likewise.
608 (tsubst): Likewise.
609 (tsubst_init): Likewise.
610 (tsubst_copy): Likewise.
611 (tsubst_omp_clause_decl): Likewise.
612 (tsubst_omp_clauses): Likewise.
613 (tsubst_copy_asm_operands): Likewise.
614 (tsubst_omp_for_iterator): Likewise.
615 (tsubst_expr): Likewise. Remove i_c_e_p parameter.
616 (tsubst_omp_udr): Likewise.
617 (tsubst_non_call_postfix_expression): Likewise. Remove i_c_e_p parameter.
618 (tsubst_lambda_expr): Likewise.
619 (tsubst_copy_and_build_call_args): Likewise.
620 (tsubst_copy_and_build): Likewise. Remove i_c_e_p parameter.
621 <case IDENTIFIER_NODE>: Adjust call to finish_id_expression
622 following removal of i_c_e_p.
623 <case *_CAST_EXPR>: Remove C++98-specific cast validity check
624 guarded by i_c_e_p.
625 (maybe_instantiate_noexcept): Adjust calls to
626 tsubst_copy_and_build and tsubst_expr.
627 (instantiate_body): Likewise.
628 (instantiate_decl): Likewise.
629 (tsubst_initializer_list): Likewise.
630 (tsubst_enum): Likewise.
631
6322022-11-15 Patrick Palka <ppalka@redhat.com>
633
634 * cp-lang.cc (objcp_tsubst_copy_and_build): Remove
635 function_p parameter.
636 * cp-objcp-common.h (objcp_tsubst_copy_and_build):
637 Likewise.
638 * cp-tree.h (tsubst_copy_and_build): Likewise.
639 * init.cc (get_nsdmi): Adjust calls to tsubst_copy_and_build.
640 * pt.cc (expand_integer_pack): Likewise.
641 (instantiate_non_dependent_expr_internal): Likewise.
642 (tsubst_function_decl): Likewise.
643 (tsubst_arg_types): Likewise.
644 (tsubst_exception_specification): Likewise.
645 (tsubst): Likewise.
646 (tsubst_copy_asm_operands): Likewise.
647 (tsubst_expr): Likewise.
648 (tsubst_non_call_postfix_expression): Likewise.
649 (tsubst_lambda_expr): Likewise.
650 (tsubst_copy_and_build_call_args): Likewise.
651 (tsubst_copy_and_build): Remove function_p parameter
652 and adjust function comment. Adjust recursive calls.
653 <case CALL_EXPR>: Update outdated comment about when
654 we can see an IDENTIFIER_NODE callee with koenig_p=false.
655 (maybe_instantiate_noexcept): Adjust calls to
656 tsubst_copy_and_build.
657
6582022-11-15 Jakub Jelinek <jakub@redhat.com>
659
660 * cp-tree.h (next_common_initial_seqence): Rename to ...
661 (next_common_initial_sequence): ... this.
662 * typeck.cc (next_common_initial_seqence): Rename to ...
663 (next_common_initial_sequence): ... this.
664 (layout_compatible_type_p): Call next_common_initial_sequence
665 rather than next_common_initial_seqence.
666 * semantics.cc (is_corresponding_member_aggr): Likewise.
667
6682022-11-15 Jakub Jelinek <jakub@redhat.com>
669
670 * decl.cc (grok_op_properties): Implement C++23 P2589R1
671 - static operator[]. Handle operator[] similarly to operator()
672 - allow static member functions, but pedwarn on it for C++20 and
673 older. Unlike operator(), perform rest of checks on it though for
674 C++20.
675 * call.cc (add_operator_candidates): For operator[] with class
676 typed first parameter, pass that parameter as first_arg and
677 an adjusted arglist without that parameter.
678
6792022-11-15 Patrick Palka <ppalka@redhat.com>
680
681 PR c++/107638
682 * tree.cc (cxx_attribute_table): Don't conditionally exclude
683 the init_priority entry.
684 (handle_init_priority_attribute): Remove ATTRIBUTE_UNUSED.
685 Return error_mark_node if !SUPPORTS_INIT_PRIORITY.
686
6872022-11-15 Marek Polacek <polacek@redhat.com>
688
689 * call.cc (maybe_warn_dangling_reference): Don't warn when initializing
690 a non-const lvalue reference.
691
6922022-11-14 Jason Merrill <jason@redhat.com>
693
694 * pt.cc (tsubst_friend_function): Check satisfaction.
695
6962022-11-14 Martin Liska <mliska@suse.cz>
697
698 Revert:
699 2022-11-14 Martin Liska <mliska@suse.cz>
700
701 * Make-lang.in: Support Sphinx based documentation.
702
7032022-11-14 Martin Liska <mliska@suse.cz>
704
705 Revert:
706 2022-11-14 Martin Liska <mliska@suse.cz>
707
708 * Make-lang.in:
709 Support installation if sphinx-build is missing.
710
7112022-11-10 Marek Polacek <polacek@redhat.com>
712
713 * call.cc (std_pair_ref_ref_p): New.
714 (do_warn_dangling_reference): Also warn when the function returns
715 std::pair<const T&, const T&>. Recurse into TARGET_EXPR_INITIAL.
716 (maybe_warn_dangling_reference): Don't return early if we're
717 initializing a std_pair_ref_ref_p.
718
7192022-11-09 Jakub Jelinek <jakub@redhat.com>
720
721 * tree.cc (handle_carries_dependency_attribute): New function.
722 (std_attribute_table): Add carries_dependency attribute.
723 * parser.cc (cp_parser_check_std_attribute): Add carries_dependency
724 attribute.
725
7262022-11-09 Martin Liska <mliska@suse.cz>
727
728 * Make-lang.in:
729 Support installation if sphinx-build is missing.
730
7312022-11-09 Martin Liska <mliska@suse.cz>
732
733 * Make-lang.in: Support Sphinx based documentation.
734
7352022-11-09 Marek Polacek <polacek@redhat.com>
736
737 PR c++/107363
738 * semantics.cc (finish_call_expr): Suppress OPT_Wpessimizing_move.
739 * typeck.cc (maybe_warn_pessimizing_move): Check warn_redundant_move
740 and warning_suppressed_p. Adjust a message depending on return_p.
741 (check_return_expr): Don't suppress OPT_Wpessimizing_move here.
742
7432022-11-08 Jason Merrill <jason@redhat.com>
744 Jakub Jelinek <jakub@redhat.com>
745
746 * cp-tree.h (fns_correspond): Declare.
747 * decl.cc (fns_correspond): New.
748 * call.cc (add_candidates): Look for op!= matching op==.
749 (joust): Complain about non-standard reversed tiebreaker.
750 (tourney): Fix champ_compared_to_predecessor logic.
751 (build_new_op): Don't complain about error_mark_node not having
752 'bool' type.
753 * pt.cc (tsubst_copy_and_build): Don't try to be permissive
754 when seen_error().
755
7562022-11-06 Patrick Palka <ppalka@redhat.com>
757
758 * tree.cc (cxx_attribute_table): Include init_priority entry
759 only if SUPPORTS_INIT_PRIORITY.
760 (handle_init_priority_attribute): Add ATTRIBUTE_UNUSED. Assert
761 SUPPORTS_INIT_PRIORITY is true.
762
7632022-11-04 Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
764 Yvan ROUX <yvan.roux@foss.st.com>
765
766 * mapper-client.cc: Use in-process client when networking is
767 disabled.
768
7692022-11-03 Marek Polacek <polacek@redhat.com>
770
771 PR c++/107488
772 * call.cc (do_warn_dangling_reference): Quash -Wdangling-reference
773 for member operator*.
774
7752022-11-03 Patrick Palka <ppalka@redhat.com>
776
777 PR c++/107179
778 * constraint.cc (tsubst_requires_expr): Make sure we're not
779 deferring access checks.
780
7812022-11-03 Jason Merrill <jason@redhat.com>
782
783 * parser.cc (cp_parser_template_declaration_after_parameters): Fix
784 concept parsing below C++20.
785
7862022-11-03 Patrick Palka <ppalka@redhat.com>
787
788 PR c++/93413
789 * decl2.cc (mark_used): Don't defer synthesis of virtual
790 functions.
791
7922022-11-01 Nathan Sidwell <nathan@acm.org>
793
794 * cp-tree.h (LAMBDA_EXPR_SCOPE_SIG_DISCRIMINATOR): New.
795 (struct tree_lambda_expr): Add discriminator_sig bitfield.
796 (recrd_lambda_scope_sig_discriminator): Declare.
797 * lambda.cc (struct lambda_sig_count): New.
798 (lambda_discriminator): Add signature vector.
799 (start_lambda_scope): Adjust.
800 (compare_lambda_template_head, compare_lambda_sig): New.
801 (record_lambda_scope_sig_discriminator): New.
802 * mangle.cc (write_closure_type): Use the scope-sig discriminator for
803 ABI >= 18. Emit abi mangling warning if needed.
804 * module.cc (trees_out::core_vals): Stream the new discriminator.
805 (trees_in::core_vals): Likewise.
806 * parser.cc (cp_parser_lambda_declarator_opt): Call
807 record_lambda_scope_sig_discriminator.
808 * pt.cc (tsubst_lambda_expr): Likewise.
809
8102022-11-01 Nathan Sidwell <nathan@acm.org>
811
812 * cp-tree.h (LAMBDA_EXPR_DISCRIMINATOR): Rename to ...
813 (LAMBDA_EXPR_SCOPE_ONLY_DISCRIMINATOR): ... here.
814 (struct tree_lambda_expr): Make default_capture_mode &
815 discriminator_scope bitfields.
816 (record_null_lambda_scope) Delete.
817 (record_lambda_scope_discriminator): Declare.
818 * lambda.cc (struct lambda_discriminator): New struct.
819 (lambda_scope, lambda_scope_stack): Adjust types.
820 (lambda_count): Delete.
821 (struct tree_int): Delete.
822 (start_lambda_scope, finish_lambda_scope): Adjust.
823 (record_lambda_scope): Only record the scope.
824 (record_lambda_scope_discriminator): New.
825 * mangle.cc (write_closure_type_name): Adjust.
826 * module.cc (trees_out::core_vals): Likewise,
827 (trees_in::core_vals): Likewise.
828 * parser.cc (cp_parser_lambda_expression): Call
829 record_lambda_scope_discriminator.
830 * pt.cc (tsubst_lambda_expr): Adjust record_lambda_scope caling. Call
831 record_lambda_scope_discriminator. Commonize control flow on tsubsting
832 the operator function.
833
8342022-11-01 Jason Merrill <jason@redhat.com>
835
836 * parser.cc (make_call_declarator): Add std_attrs parm.
837 (cp_parser_lambda_declarator_opt): Pass it.
838 (cp_parser_direct_declarator): Pass it.
839
8402022-11-01 Jason Merrill <jason@redhat.com>
841
842 * decl.cc (finish_function): Set TREE_NOTHROW later in the function.
843
8442022-11-01 Jason Merrill <jason@redhat.com>
845
846 * decl.cc (duplicate_decls): Reformat loop.
847 * parser.cc (cp_parser_member_declaration): Add newline.
848 * semantics.cc: Remove newline.
849
8502022-10-28 Marek Polacek <polacek@redhat.com>
851
852 * call.cc (maybe_warn_dangling_reference): Enable the warning in
853 system headers if the decl isn't in a system header.
854
8552022-10-28 Jason Merrill <jason@redhat.com>
856
857 * decl.cc (grokdeclarator): Call decl_attributes before do_friend.
858
8592022-10-28 Jakub Jelinek <jakub@redhat.com>
860
861 * parser.cc (cp_parser_omp_all_clauses): Allow optional comma
862 before the first clause even in pragma syntax.
863 (cp_parser_omp_allocate, cp_parser_omp_atomic, cp_parser_omp_depobj,
864 cp_parser_omp_flush, cp_parser_omp_scan_loop_body,
865 cp_parser_omp_ordered, cp_parser_omp_assumption_clauses,
866 cp_finish_omp_declare_variant, cp_parser_omp_declare_target,
867 cp_parser_omp_declare_reduction_exprs, cp_parser_omp_requires,
868 cp_parser_omp_error): Likewise.
869
8702022-10-28 Joseph Myers <joseph@codesourcery.com>
871
872 PR c/61469
873 * cp-tree.h (ENUM_FIXED_UNDERLYING_TYPE_P, ENUM_UNDERLYING_TYPE):
874 Remove. Moved to c-common.h.
875
8762022-10-27 Jakub Jelinek <jakub@redhat.com>
877
878 PR c++/107379
879 * name-lookup.cc (push_namespace): Call find_namespace_slot again
880 after pushdecl as the hash table might be expanded during pushdecl.
881
8822022-10-27 Nathan Sidwell <nathan@acm.org>
883
884 * mangle.cc (write_closure_template_head): New.
885 (write_closure_type_name): Call it.
886
8872022-10-27 Jakub Jelinek <jakub@redhat.com>
888
889 PR c++/107382
890 PR c++/107383
891 * typeck.cc (cp_build_binary_op): Don't compute semantic_result_type
892 if result_type is NULL.
893
8942022-10-26 Marek Polacek <polacek@redhat.com>
895
896 PR c++/106393
897 * call.cc (expr_represents_temporary_p): New, factored out of...
898 (conv_binds_ref_to_temporary): ...here. Don't return false just
899 because a ck_base is missing. Use expr_represents_temporary_p.
900 (do_warn_dangling_reference): New.
901 (maybe_warn_dangling_reference): New.
902 (extend_ref_init_temps): Call maybe_warn_dangling_reference.
903 * cp-tree.h: Adjust comment.
904 * typeck.cc (check_return_expr): Suppress -Wdangling-reference
905 warnings.
906
9072022-10-25 Nathan Sidwell <nathan@acm.org>
908
909 * parser.cc (synthesize_implicit_template_parm): Fix thinko about
910 mark the new parm DECL_VIRTUAL_P. Avoid unneccessary tree_last call.
911
9122022-10-25 Patrick Palka <ppalka@redhat.com>
913
914 * constraint.cc (resolve_function_concept_overload): Explicitly
915 pass complain=tf_none to coerce_template_parms.
916 (resolve_concept_check): Likewise.
917 (normalize_concept_check): Likewise.
918 * cp-tree.h (coerce_template_parms): Declare the main overload
919 and default its last parameter to true. Remove wrapper overloads.
920 * pt.cc (determine_specialization): Adjust calls to
921 coerce_template_parms and coerce_innermost_template_parms after
922 removing their last parameter.
923 (coerce_template_args_for_ttp): Likewise.
924 (coerce_ttp_args_for_tta): Likewise.
925 (coerce_template_template_parms): Likewise.
926 (coerce_template_parms): Remove use_default_args parameter and
927 adjust function comment. Document default argument. Remove
928 wrapper overloads. No longer static.
929 (coerce_innermost_template_parms): Remove use_default_args
930 parameter. Default require_all_args to true.
931 (lookup_template_class): As with determine_specialization.
932 (finish_template_variable): Likewise.
933 (tsubst_decl): Likewise.
934 (instantiate_alias_template): Likewise.
935 (fn_type_unification): Likewise.
936 (resolve_overloaded_unification): Likewise.
937 (resolve_nondeduced_context): Likewise.
938 (get_partial_spec_bindings): Likewise.
939
9402022-10-25 Jason Merrill <jason@redhat.com>
941
942 * constexpr.cc (find_failing_clause_r): Re-add the call to
943 contextual_conv_bool.
944
9452022-10-25 Patrick Palka <ppalka@redhat.com>
946
947 PR c++/106848
948 PR c++/102600
949 * module.cc (trees_out::core_vals): Stream TYPE_MAX_VALUE and
950 TYPE_MIN_VALUE of ENUMERAL_TYPE.
951 (trees_in::core_vals): Likewise.
952 (trees_out::write_enum_def): Don't stream them here.
953 (trees_in::read_enum_def): Likewise.
954
9552022-10-25 Jason Merrill <jason@redhat.com>
956
957 * constexpr.cc (class constexpr_global_ctx): Add modifiable field,
958 get_value, get_value_ptr, put_value, remove_value, flush_modifiable
959 member functions.
960 (class modifiable_tracker): New.
961 (cxx_eval_internal_function): Use it.
962 (diagnose_failing_condition): Strip CLEANUP_POINT_EXPR.
963
9642022-10-25 Jason Merrill <jason@redhat.com>
965
966 * constexpr.cc (fold_operand): New function.
967 (find_failing_clause_r): Add const.
968 (find_failing_clause): Add const.
969 (diagnose_failing_condition): Add ctx parameter.
970 (cxx_eval_internal_function): Pass it.
971 * semantics.cc (diagnose_failing_condition): Move to constexpr.cc.
972 * cp-tree.h: Adjust.
973
9742022-10-24 Jason Merrill <jason@redhat.com>
975
976 * cp-gimplify.cc (fold_builtin_source_location)
977 * vtable-class-hierarchy.cc (register_all_pairs): Simplify calls to
978 build_string_literal.
979 (build_string_from_id): Remove.
980
9812022-10-24 Marek Polacek <polacek@redhat.com>
982
983 PR c++/107276
984 * typeck.cc (treat_lvalue_as_rvalue_p): Check the return value of move.
985
9862022-10-24 Jakub Jelinek <jakub@redhat.com>
987
988 PR c++/107358
989 * typeck.cc (cp_build_binary_op): Pass operands before excess precision
990 promotions to scalar_to_vector call.
991
9922022-10-24 Jakub Jelinek <jakub@redhat.com>
993
994 PR c++/105774
995 * constexpr.cc (cxx_eval_increment_expression): For signed types
996 that promote to int, evaluate PLUS_EXPR or MINUS_EXPR in int type.
997
9982022-10-24 Arsen Arsenović <arsen@aarsen.me>
999
1000 * cp-tree.h (DECL_MAIN_P): Move most logic, besides the hosted
1001 check, from here...
1002 (DECL_MAIN_ANY_P): ... to here, so that it can be reused ...
1003 (DECL_MAIN_FREESTANDING_P): ... here, with an additional
1004 constraint on (hosted OR return type == int)
1005 * decl.cc (finish_function): Use DECL_MAIN_FREESTANDING_P
1006 instead of DECL_MAIN_P, to loosen the hosted requirement, but
1007 check noreturn, before adding implicit returns.
1008
10092022-10-21 Jakub Jelinek <jakub@redhat.com>
1010
1011 PR c++/107295
1012 * constexpr.cc (reduced_constant_expression_p) <case CONSTRUCTOR>:
1013 Return false for VECTOR_TYPE CONSTRUCTORs even without
1014 CONSTRUCTOR_NO_CLEARING set on them.
1015 (cxx_eval_bare_aggregate): If constant but !changed, fold before
1016 returning VECTOR_TYPE_P CONSTRUCTOR.
1017 (cxx_eval_constant_expression) <case CONSTRUCTOR>: Don't fold
1018 TREE_CONSTANT CONSTRUCTOR, just return it.
1019
10202022-10-21 Jakub Jelinek <jakub@redhat.com>
1021
1022 PR c++/106863
1023 * semantics.cc (finish_compound_literal): For void{}, if
1024 processing_template_decl return a COMPOUND_LITERAL_P
1025 CONSTRUCTOR rather than void_node.
1026
10272022-10-20 Patrick Palka <ppalka@redhat.com>
1028
1029 * pt.cc (lookup_and_finish_template_variable): Don't
1030 instantiate if the template's scope is dependent.
1031 (tsubst_copy) <case TEMPLATE_DECL>: Pass entering_scope=true
1032 when substituting the class scope.
1033
10342022-10-20 Patrick Palka <ppalka@redhat.com>
1035
1036 PR c++/102963
1037 * module.cc (node_template_info): Handle CONCEPT_DECL.
1038
10392022-10-20 Jonathan Wakely <jwakely@redhat.com>
1040 Ulrich Drepper <drepper@redhat.com>
1041
1042 * Make-lang.in: Add rules to generate std-name-hint.gperf. Adjust
1043 rule to generate std-name-hint.h to allow chain rule.
1044 * std-name-hint.h: Regenerated.
1045 * std-name-hint.gperf: This file is now generated.
1046 * cxxapi-data.csv: New file. CSV file with C++ API data.
1047 * gen-cxxapi-file.py: New file. Generate std-name-hint.gperf
1048 and module export source (in future).
1049
10502022-10-19 Marek Polacek <polacek@redhat.com>
1051
1052 PR c++/85043
1053 * typeck.cc (maybe_warn_about_useless_cast): Don't warn when
1054 a glvalue is cast to a non-reference type.
1055
10562022-10-18 Patrick Palka <ppalka@redhat.com>
1057
1058 PR c++/105045
1059 * module.cc (trees_out::tpl_parms_fini): Don't assume default
1060 template arguments must be trailing.
1061 (trees_in::tpl_parms_fini): Likewise.
1062
10632022-10-18 Jakub Jelinek <jakub@redhat.com>
1064
1065 PR c++/106654
1066 * cp-tree.h (build_assume_call): Declare.
1067 * parser.cc (cp_parser_omp_assumption_clauses): Use build_assume_call.
1068 * cp-gimplify.cc (build_assume_call): New function.
1069 (process_stmt_assume_attribute): Use build_assume_call.
1070 * pt.cc (tsubst_copy_and_build): Likewise.
1071
10722022-10-17 Patrick Palka <ppalka@redhat.com>
1073
1074 PR c++/101449
1075 * module.cc (trees_out::write_function_def): Stream the
1076 parms and result of the constexpr_fundef entry.
1077 (trees_in::read_function_def): Likewise.
1078
10792022-10-14 Patrick Palka <ppalka@redhat.com>
1080
1081 PR c++/106304
1082 * constexpr.cc (cxx_dynamic_cast_fn_p): Check for abi_node
1083 instead of global_namespace.
1084 * rtti.cc (build_dynamic_cast_1): Set DECL_CONTEXT and
1085 DECL_SOURCE_LOCATION when building dynamic_cast_node. Push
1086 it into the namespace.
1087
10882022-10-14 Jakub Jelinek <jakub@redhat.com>
1089
1090 * cp-tree.h (extended_float_type_p): Return true for
1091 bfloat16_type_node.
1092 * typeck.cc (cp_compare_floating_point_conversion_ranks): Set
1093 extended{1,2} if mv{1,2} is bfloat16_type_node. Adjust comment.
1094
10952022-10-14 Jakub Jelinek <jakub@redhat.com>
1096
1097 PR c/82071
1098 PR c/87390
1099 PR c++/107097
1100 * cp-tree.h (cp_ep_convert_and_check): Remove.
1101 * cvt.cc (cp_ep_convert_and_check): Remove.
1102 * call.cc (build_conditional_expr): Use excess precision for ?: with
1103 one arm floating and another integral. Don't convert first to
1104 semantic result type from integral types.
1105 (convert_like_internal): Don't call cp_ep_convert_and_check, instead
1106 just strip EXCESS_PRECISION_EXPR before calling cp_convert_and_check
1107 or cp_convert.
1108 * typeck.cc (cp_build_binary_op): Set may_need_excess_precision
1109 for comparisons or SPACESHIP_EXPR with at least one operand integral.
1110 Don't compute semantic_result_type if build_type is non-NULL. Call
1111 cp_convert_and_check instead of cp_ep_convert_and_check.
1112
11132022-10-14 Jakub Jelinek <jakub@redhat.com>
1114
1115 PR middle-end/323
1116 PR c++/107097
1117 * parser.cc (cp_parser_primary_expression): Handle
1118 EXCESS_PRECISION_EXPR with REAL_CST operand the same as REAL_CST.
1119 * cvt.cc (cp_ep_convert_and_check): New function.
1120 * call.cc (build_conditional_expr): Add excess precision support.
1121 When type_after_usual_arithmetic_conversions returns error_mark_node,
1122 use gcc_checking_assert that it is because of uncomparable floating
1123 point ranks instead of checking all those conditions and make it
1124 work also with complex types.
1125 (convert_like_internal): Likewise. Add NESTED_P argument, pass true
1126 to recursive calls to convert_like.
1127 (convert_like): Add NESTED_P argument, pass it through to
1128 convert_like_internal. For other overload pass false to it.
1129 (convert_like_with_context): Pass false to NESTED_P.
1130 (convert_arg_to_ellipsis): Add excess precision support.
1131 (magic_varargs_p): For __builtin_is{finite,inf,inf_sign,nan,normal}
1132 and __builtin_fpclassify return 2 instead of 1, document what it
1133 means.
1134 (build_over_call): Don't handle former magic 2 which is no longer
1135 used, instead for magic 1 remove EXCESS_PRECISION_EXPR.
1136 (perform_direct_initialization_if_possible): Pass false to NESTED_P
1137 convert_like argument.
1138 * constexpr.cc (cxx_eval_constant_expression): Handle
1139 EXCESS_PRECISION_EXPR.
1140 (potential_constant_expression_1): Likewise.
1141 * pt.cc (tsubst_copy, tsubst_copy_and_build): Likewise.
1142 * cp-tree.h (cp_ep_convert_and_check): Declare.
1143 * cp-gimplify.cc (cp_fold): Handle EXCESS_PRECISION_EXPR.
1144 * typeck.cc (cp_common_type): For COMPLEX_TYPEs, return error_mark_node
1145 if recursive call returned it.
1146 (convert_arguments): For magic 1 remove EXCESS_PRECISION_EXPR.
1147 (cp_build_binary_op): Add excess precision support. When
1148 cp_common_type returns error_mark_node, use gcc_checking_assert that
1149 it is because of uncomparable floating point ranks instead of checking
1150 all those conditions and make it work also with complex types.
1151 (cp_build_unary_op): Likewise.
1152 (cp_build_compound_expr): Likewise.
1153 (build_static_cast_1): Remove EXCESS_PRECISION_EXPR.
1154
11552022-10-13 Jason Merrill <jason@redhat.com>
1156
1157 * cp-tree.h: Fix whitespace.
1158 * parser.h: Fix whitespace.
1159 * decl.cc: Fix whitespace.
1160 * parser.cc: Fix whitespace.
1161 * pt.cc: Fix whitespace.
1162
11632022-10-13 Martin Liska <mliska@suse.cz>
1164
1165 * vtable-class-hierarchy.cc (vtv_generate_init_routine): Emit
1166 an artificial variable that would be put into .preinit_array
1167 section.
1168
11692022-10-13 Marek Polacek <polacek@redhat.com>
1170
1171 PR c++/106925
1172 * except.cc (maybe_splice_retval_cleanup): Check current_function_decl.
1173 Make the bool const.
1174
11752022-10-12 Marek Polacek <polacek@redhat.com>
1176
1177 * call.cc (standard_conversion): Remove LOOKUP_PREFER_RVALUE code.
1178 (reference_binding): Honor clk_implicit_rval even pre-C++20.
1179 (implicit_conversion_1): Remove LOOKUP_PREFER_RVALUE code.
1180 (build_user_type_conversion_1): Likewise.
1181 (convert_like_internal): Likewise.
1182 (build_over_call): Likewise.
1183 * cp-tree.h (LOOKUP_PREFER_RVALUE): Remove.
1184 (LOOKUP_NO_NARROWING): Adjust definition.
1185 * except.cc (build_throw): Don't perform two overload resolutions.
1186 * typeck.cc (maybe_warn_pessimizing_move): Don't use
1187 LOOKUP_PREFER_RVALUE.
1188 (check_return_expr): Don't perform two overload resolutions.
1189
11902022-10-12 Jason Merrill <jason@redhat.com>
1191
1192 DR 2631
1193 * cp-tree.h (source_location_current_p): Remove.
1194 * name-lookup.h (struct cp_binding_level): Remove
1195 immediate_fn_ctx_p.
1196 * call.cc (in_immediate_context): All default args
1197 and DMI are potentially immediate context.
1198 (immediate_invocation_p): Don't treat source_location specially.
1199 (struct in_consteval_if_p_temp_override): Move to cp-tree.h.
1200 * constexpr.cc (get_nth_callarg): Move to cp-tree.h.
1201 * cp-gimplify.cc (cp_fold_r): Don't fold consteval.
1202 * name-lookup.cc (begin_scope): Don't set immediate_fn_ctx_p.
1203 * parser.cc (cp_parser_lambda_declarator_opt): Likewise.
1204 (cp_parser_direct_declarator): Likewise.
1205 * pt.cc (tsubst_default_argument): Open sk_function_parms level.
1206 * tree.cc (source_location_current_p): Remove.
1207 (bot_replace): Fold consteval here.
1208 (break_out_target_exprs): Handle errors.
1209
12102022-10-11 Patrick Palka <ppalka@redhat.com>
1211
1212 PR c++/100134
1213 * pt.cc (tsubst_friend_function): Propagate DECL_MODULE_PURVIEW_P
1214 from the introduced namespace-scope function to the namespace.
1215
12162022-10-11 Patrick Palka <ppalka@redhat.com>
1217
1218 PR c++/99377
1219 * module.cc (lazy_load_binding): Clear processing_template_decl.
1220 (lazy_load_pendings): Likewise.
1221
12222022-10-10 Nathan Sidwell <nathan@acm.org>
1223
1224 * mangle.cc (write_prefix): Add VAR_DECL & FIELD_DECL to
1225 substitution table under abi=18. Note possible mismatch.
1226
12272022-10-10 Marek Polacek <polacek@redhat.com>
1228
1229 PR c++/106937
1230 * error.cc: Include "attribs.h".
1231 (dump_type_prefix): Print only GNU attributes here.
1232 (dump_type_suffix): Print standard attributes here.
1233
12342022-10-08 Jason Merrill <jason@redhat.com>
1235
1236 * cp-tree.h (TARGET_EXPR_ELIDING_P): New.
1237 (unsafe_copy_elision_p, set_target_expr_eliding)
1238 (cp_build_init_expr): Declare.
1239 * call.cc (unsafe_copy_elision_p): No longer static.
1240 (build_over_call, build_special_member_call)
1241 (build_new_method_call): Use cp_build_init_expr.
1242 * coroutines.cc (expand_one_await_expression)
1243 (build_actor_fn, flatten_await_stmt, handle_nested_conditionals)
1244 (await_statement_walker, morph_fn_to_coro): Use cp_build_init_expr.
1245 * cp-gimplify.cc (cp_gimplify_init_expr)
1246 (cp_gimplify_expr): Check TARGET_EXPR_ELIDING_P.
1247 (cp_fold_r): Propagate it.
1248 (cp_fold): Use cp_build_init_expr.
1249 * decl.cc (check_initializer): Use cp_build_init_expr.
1250 * except.cc (build_throw): Use cp_build_init_expr.
1251 * init.cc (get_nsdmi): Call set_target_expr_eliding.
1252 (perform_member_init, expand_default_init, expand_aggr_init_1)
1253 (build_new_1, build_vec_init): Use cp_build_init_expr.
1254 * method.cc (do_build_copy_constructor): Use cp_build_init_expr.
1255 * semantics.cc (simplify_aggr_init_expr, finalize_nrv_r)
1256 (finish_omp_reduction_clause): Use cp_build_init_expr.
1257 * tree.cc (build_target_expr): Call set_target_expr_eliding.
1258 (bot_manip): Copy TARGET_EXPR_ELIDING_P.
1259 * typeck.cc (cp_build_modify_expr): Call set_target_expr_eliding.
1260 (check_return_expr): Use cp_build_modify_expr.
1261 * typeck2.cc (split_nonconstant_init_1)
1262 (split_nonconstant_init): Use cp_build_init_expr.
1263 (massage_init_elt): Call set_target_expr_eliding.
1264 (process_init_constructor_record): Clear TARGET_EXPR_ELIDING_P on
1265 unsafe copy elision.
1266 (set_target_expr_eliding, cp_build_init_expr): New.
1267
12682022-10-07 Marek Polacek <polacek@redhat.com>
1269
1270 PR c++/107085
1271 * call.cc (conv_binds_ref_to_temporary): New.
1272 (ref_conv_binds_directly): Rename to...
1273 (ref_conv_binds_to_temporary): ...this. Use
1274 conv_binds_ref_to_temporary.
1275 * cp-tree.h (ref_conv_binds_directly): Rename to...
1276 (ref_conv_binds_to_temporary): ...this.
1277 * method.cc (ref_xes_from_temporary): Use ref_conv_binds_to_temporary.
1278 * parser.cc (warn_for_range_copy): Likewise.
1279
12802022-10-07 Qing Zhao <qing.zhao@oracle.com>
1281
1282 * module.cc (trees_out::core_bools): Stream out new bit
1283 decl_not_flexarray.
1284 (trees_in::core_bools): Stream in new bit decl_not_flexarray.
1285
12862022-10-07 Patrick Palka <ppalka@redhat.com>
1287
1288 * module.cc (trees_out::mark_class_def): Guard against
1289 DECL_BIT_FIELD_REPRESENTATIVE not being a decl.
1290
12912022-10-07 Jason Merrill <jason@redhat.com>
1292
1293 * init.cc (expand_default_init): Also push the INIT_EXPR inside a
1294 CLEANUP_POINT_EXPR.
1295
12962022-10-07 Patrick Palka <ppalka@redhat.com>
1297
1298 PR c++/104433
1299 * module.cc (trees_out::core_bools): Don't override
1300 DECL_EXTERNAL to true for static variables from an inline
1301 function.
1302
13032022-10-07 Martin Liska <mliska@suse.cz>
1304
1305 * module.cc (enum module_state_counts): Use array size.
1306 * name-lookup.cc (class namespace_limit_reached): Likewise.
1307 (class module_state): Move up in the file.
1308
13092022-10-07 Jakub Jelinek <jakub@redhat.com>
1310
1311 * parser.cc (cp_parser_check_std_attribute): Only do checks if
1312 attribute is a standard attribute or in gnu namespace and only
1313 lookup other attributes in those namespaces.
1314 * cp-gimplify.cc (lookup_hotness_attribute): Adjust function comment.
1315 Only return true for standard attribute or gnu namespace attribute.
1316 (remove_hotness_attribute): Only remove hotness attributes when
1317 they are standard or in gnu namespace, implement it in a single
1318 loop rather than former 4 now 8 remove_attribute calls.
1319
13202022-10-06 Jason Merrill <jason@redhat.com>
1321
1322 * coroutines.cc (expand_one_await_expression): Change conversion
1323 to VIEW_CONVERT_EXPR.
1324 * cp-gimplify.cc (cp_genericize_r) [CONVERT_EXPR]: Add assert.
1325
13262022-10-06 Joseph Myers <joseph@codesourcery.com>
1327
1328 * lex.cc (init_reswords): Handle D_EXT11.
1329
13302022-10-06 Patrick Palka <ppalka@redhat.com>
1331
1332 * pt.cc (optimize_specialization_lookup_p): Remove.
1333 (retrieve_specialization): Assume the above returns false
1334 and simplify accordingly.
1335 (register_specialization): Likewise.
1336
13372022-10-06 Jakub Jelinek <jakub@redhat.com>
1338
1339 * parser.cc (cp_parser_omp_assumption_clauses): Emit IFN_ASSUME
1340 call for holds clause on assume construct.
1341
13422022-10-06 Jakub Jelinek <jakub@redhat.com>
1343
1344 PR c++/106654
1345 * cp-tree.h (process_stmt_assume_attribute): Implement C++23
1346 P1774R8 - Portable assumptions. Declare.
1347 (diagnose_failing_condition): Declare.
1348 (find_failing_clause): Likewise.
1349 * parser.cc (assume_attr): New enumerator.
1350 (cp_parser_parenthesized_expression_list): Handle assume_attr.
1351 Remove identifier variable, for id_attr push the identifier into
1352 expression_list right away instead of inserting it before all the
1353 others at the end.
1354 (cp_parser_conditional_expression): New function.
1355 (cp_parser_constant_expression): Use it.
1356 (cp_parser_statement): Handle assume attribute.
1357 (cp_parser_expression_statement): Likewise.
1358 (cp_parser_gnu_attribute_list): Use assume_attr for assume
1359 attribute.
1360 (cp_parser_std_attribute): Likewise. Handle standard assume
1361 attribute like gnu::assume.
1362 * cp-gimplify.cc (process_stmt_assume_attribute): New function.
1363 * constexpr.cc: Include fold-const.h.
1364 (find_failing_clause_r, find_failing_clause): New functions,
1365 moved from semantics.cc with ctx argument added and if non-NULL,
1366 call cxx_eval_constant_expression rather than fold_non_dependent_expr.
1367 (cxx_eval_internal_function): Handle IFN_ASSUME.
1368 (potential_constant_expression_1): Likewise.
1369 * pt.cc (tsubst_copy_and_build): Likewise.
1370 * semantics.cc (diagnose_failing_condition): New function.
1371 (find_failing_clause_r, find_failing_clause): Moved to constexpr.cc.
1372 (finish_static_assert): Use it. Add auto_diagnostic_group.
1373
13742022-10-05 Jason Merrill <jason@redhat.com>
1375
1376 * tree.cc (lvalue_kind) [VIEW_CONVERT_EXPR]: Change prvalue to
1377 xvalue.
1378
13792022-10-04 Jason Merrill <jason@redhat.com>
1380
1381 PR c++/107154
1382 * cp-gimplify.cc (cp_genericize_init_expr): Use iloc_sentinel.
1383 (cp_genericize_target_expr): Likewise.
1384
13852022-10-04 Patrick Palka <ppalka@redhat.com>
1386
1387 PR c++/107136
1388 * Make-lang.in (CP_PLUGIN_HEADERS): Add cp-trait.def.
1389
13902022-10-04 Jakub Jelinek <jakub@redhat.com>
1391
1392 * cp-tree.h (struct omp_declare_target_attr): Rename to ...
1393 (cp_omp_declare_target_attr): ... this. Add device_type member.
1394 (omp_begin_assumes_data): Rename to ...
1395 (cp_omp_begin_assumes_data): ... this.
1396 (struct saved_scope): Change types of omp_declare_target_attribute
1397 and omp_begin_assumes.
1398 * parser.cc (cp_parser_omp_clause_device_type): Uncomment
1399 check_no_duplicate_clause call.
1400 (cp_parser_omp_all_clauses): Fix up pasto, c_name for OMP_CLAUSE_LINK
1401 should be "link" rather than "to".
1402 (cp_parser_omp_declare_target): Adjust for omp_declare_target_attr
1403 to cp_omp_declare_target_attr changes, push -1 as device_type. Use
1404 error_at rather than warning_at for declare target with only
1405 device_type clauses.
1406 (OMP_BEGIN_DECLARE_TARGET_CLAUSE_MASK): Define.
1407 (cp_parser_omp_begin): Add begin declare target support. Adjust
1408 for omp_begin_assumes_data to cp_omp_begin_assumes_data change.
1409 (cp_parser_omp_end): Adjust for the
1410 omp_declare_target_attr to cp_omp_declare_target_attr and
1411 omp_begin_assumes_data to cp_omp_begin_assumes_data type changes,
1412 adjust diagnostics wording and simplify format strings for easier
1413 translations.
1414 * semantics.cc (finish_translation_unit): Likewise.
1415 * decl2.cc (cplus_decl_attributes): If device_type was present on
1416 begin declare target, add "omp declare target host" and/or
1417 "omp declare target nohost" attributes.
1418
14192022-10-03 Jakub Jelinek <jakub@redhat.com>
1420
1421 * cp-tree.h (BCS_STMT_EXPR): New enumerator.
1422 * name-lookup.h (enum scope_kind): Add sk_stmt_expr.
1423 * name-lookup.cc (begin_scope): Handle sk_stmt_expr like sk_block.
1424 * semantics.cc (begin_compound_stmt): For BCS_STMT_EXPR use
1425 sk_stmt_expr.
1426 * parser.cc (cp_parser_statement_expr): Use BCS_STMT_EXPR instead of
1427 BCS_NORMAL.
1428 * decl.cc (struct named_label_entry): Add in_stmt_expr.
1429 (poplevel_named_label_1): Handle sk_stmt_expr.
1430 (check_previous_goto_1): Diagnose entering of statement expression.
1431 (check_goto): Likewise.
1432
14332022-10-03 Patrick Palka <ppalka@redhat.com>
1434
1435 * constraint.cc (diagnose_trait_expr): Use CPTK_IS_SAME instead
1436 of CPTK_IS_SAME_AS.
1437 * cp-trait.def (IS_SAME_AS): Rename to ...
1438 (IS_SAME): ... this.
1439 * pt.cc (alias_ctad_tweaks): Use CPTK_IS_SAME instead of
1440 CPTK_IS_SAME_AS.
1441 * semantics.cc (trait_expr_value): Likewise.
1442 (finish_trait_expr): Likewise.
1443
14442022-10-01 Patrick Palka <ppalka@redhat.com>
1445
1446 * semantics.cc (trait_expr_value): Make cp_trait_kind switch
1447 statement exhaustive.
1448 (finish_trait_expr): Likewise.
1449 (finish_trait_type): Likewise.
1450
14512022-10-01 Jason Merrill <jason@redhat.com>
1452
1453 * init.cc (build_vec_init): Clear from_array for CONSTRUCTOR
1454 initializer.
1455
14562022-10-01 Jason Merrill <jason@redhat.com>
1457
1458 * cp-gimplify.cc (cp_genericize_init): Also convert the result of
1459 split_nonconstant_init to void.
1460
14612022-09-30 Patrick Palka <ppalka@redhat.com>
1462
1463 * constraint.cc (diagnose_trait_expr): Likewise.
1464 * cp-objcp-common.cc (names_builtin_p): Likewise.
1465 * cp-tree.h (enum cp_trait_kind): Likewise.
1466 * cxx-pretty-print.cc (pp_cxx_trait): Likewise.
1467 * parser.cc (cp_keyword_starts_decl_specifier_p): Likewise.
1468 (cp_parser_primary_expression): Likewise.
1469 (cp_parser_trait): Likewise.
1470 (cp_parser_simple_type_specifier): Likewise.
1471 * cp-trait.def: New file.
1472
14732022-09-30 Jason Merrill <jason@redhat.com>
1474
1475 * cp-gimplify.cc (cp_fold_r) [TARGET_EXPR]: Collapse
1476 TARGET_EXPR within TARGET_EXPR.
1477 * constexpr.cc (cxx_eval_outermost_constant_expr): Avoid
1478 adding redundant TARGET_EXPR.
1479 * cp-tree.h (target_expr_needs_replace): VEC_INIT_EXPR doesn't.
1480
14812022-09-29 Patrick Palka <ppalka@redhat.com>
1482
1483 PR c++/102576
1484 * pt.cc (listify): Use lookup_qualified_name instead of
1485 get_namespace_binding.
1486
14872022-09-29 Jason Merrill <jason@redhat.com>
1488
1489 * class.cc (check_methods): Call constraints_satisfied_p.
1490
14912022-09-29 Jason Merrill <jason@redhat.com>
1492
1493 * constexpr.cc (potential_constant_expression_1): Look into
1494 DECL_INITIAL. Use location wrappers.
1495
14962022-09-29 Jason Merrill <jason@redhat.com>
1497
1498 PR c++/93046
1499 * call.cc (build_conditional_expr): For a?:c extension, treat
1500 a reused class prvalue as an xvalue.
1501
15022022-09-29 Jason Merrill <jason@redhat.com>
1503
1504 * call.cc (build_conditional_expr): Set TARGET_EXPR_NO_ELIDE on the
1505 outer TARGET_EXPR.
1506
15072022-09-29 Patrick Palka <ppalka@redhat.com>
1508
1509 * constraint.cc (diagnose_trait_expr): Handle CPTK_REMOVE_CV,
1510 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
1511 * cp-objcp-common.cc (names_builtin_p): Likewise.
1512 * cp-tree.h (enum cp_trait_kind): Add CPTK_REMOVE_CV,
1513 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
1514 * cxx-pretty-print.cc (pp_cxx_trait): Handle CPTK_REMOVE_CV,
1515 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
1516 * parser.cc (cp_keyword_starts_decl_specifier_p): Return true
1517 for RID_REMOVE_CV, RID_REMOVE_REFERENCE and RID_REMOVE_CVREF.
1518 (cp_parser_trait): Handle RID_REMOVE_CV, RID_REMOVE_REFERENCE
1519 and RID_REMOVE_CVREF.
1520 (cp_parser_simple_type_specifier): Likewise.
1521 * semantics.cc (finish_trait_type): Likewise.
1522
15232022-09-29 Patrick Palka <ppalka@redhat.com>
1524
1525 * cp-objcp-common.cc (cp_common_init_ts): Replace
1526 UNDERLYING_TYPE with TRAIT_TYPE.
1527 * cp-tree.def (TRAIT_TYPE): Define.
1528 (UNDERLYING_TYPE): Remove.
1529 * cp-tree.h (TRAIT_TYPE_KIND_RAW): Define.
1530 (TRAIT_TYPE_KIND): Define.
1531 (TRAIT_TYPE_TYPE1): Define.
1532 (TRAIT_TYPE_TYPE2): Define.
1533 (WILDCARD_TYPE_P): Return true for TRAIT_TYPE.
1534 (finish_trait_type): Declare.
1535 * cxx-pretty-print.cc (cxx_pretty_printer::primary_expression):
1536 Adjust after renaming pp_cxx_trait_expression.
1537 (cxx_pretty_printer::simple_type_specifier) <case TRAIT_TYPE>:
1538 New.
1539 (cxx_pretty_printer::type_id): Replace UNDERLYING_TYPE with
1540 TRAIT_TYPE.
1541 (pp_cxx_trait_expression): Rename to ...
1542 (pp_cxx_trait): ... this. Handle TRAIT_TYPE as well. Correct
1543 pretty printing of the trailing arguments.
1544 * cxx-pretty-print.h (pp_cxx_trait_expression): Rename to ...
1545 (pp_cxx_trait_type): ... this.
1546 * error.cc (dump_type) <case UNDERLYING_TYPE>: Remove.
1547 <case TRAIT_TYPE>: New.
1548 (dump_type_prefix): Replace UNDERLYING_WITH with TRAIT_TYPE.
1549 (dump_type_suffix): Likewise.
1550 * mangle.cc (write_type) <case UNDERLYING_TYPE>: Remove.
1551 <case TRAIT_TYPE>: New.
1552 * module.cc (trees_out::type_node) <case UNDERLYING_TYPE>:
1553 Remove.
1554 <case TRAIT_TYPE>: New.
1555 (trees_in::tree_node): Likewise.
1556 * parser.cc (cp_parser_primary_expression): Adjust after
1557 renaming cp_parser_trait_expr.
1558 (cp_parser_trait_expr): Rename to ...
1559 (cp_parser_trait): ... this. Call finish_trait_type for traits
1560 that yield a type.
1561 (cp_parser_simple_type_specifier): Adjust after renaming
1562 cp_parser_trait_expr.
1563 * pt.cc (for_each_template_parm_r) <case UNDERLYING_TYPE>:
1564 Remove.
1565 <case TRAIT_TYPE>: New.
1566 (tsubst): Likewise.
1567 (unify): Replace UNDERLYING_TYPE with TRAIT_TYPE.
1568 (dependent_type_p_r): Likewise.
1569 * semantics.cc (finish_underlying_type): Don't return
1570 UNDERLYING_TYPE anymore when processing_template_decl.
1571 (finish_trait_type): Define.
1572 * tree.cc (strip_typedefs) <case UNDERLYING_TYPE>: Remove.
1573 <case TRAIT_TYPE>: New.
1574 (cp_walk_subtrees): Likewise.
1575 * typeck.cc (structural_comptypes): Likewise.
1576
15772022-09-29 Nathan Sidwell <nathan@acm.org>
1578
1579 PR c++/100616
1580 * module.cc (enum tree_tag): Add tt_nttp_var.
1581 (trees_out::decl_node): Handle NTTP objects.
1582 (trees_in::tree_node): Handle tt_nttp_var.
1583 (depset::hash::add_binding_entry): Skip NTTP objects.
1584
15852022-09-28 Eugene Rozenfeld <erozen@microsoft.com>
1586
1587 * module.cc (write_location): Write discriminator.
1588 (read_location): Read discriminator.
1589
15902022-09-28 Nathan Sidwell <nathan@acm.org>
1591
1592 * cp-tree.h (DECL_NTTP_OBJECT_P): New.
1593 (template_parm_object_p): Delete.
1594 (build_template_parm_object): Declare.
1595 * cxx-pretty-print.cc (pp_cx_template_argument_list): Use DECL_NTTP_OBJECT_P.
1596 * error.cc (dump_simple_decl): Likewise.
1597 * mangle.cc (write_template_arg): Likewise.
1598 * pt.cc (template_parm_object_p): Delete.
1599 (create_template_parm_object): Separated out checking from ...
1600 (get_template_parm_object): ... this, new external entry point.
1601
16022022-09-27 Marek Polacek <polacek@redhat.com>
1603
1604 PR c++/101165
1605 PR c++/106882
1606 * call.cc (reference_binding): Check clk_implicit_rval in C++20 only.
1607 * cp-tree.h (unparenthesized_id_or_class_member_access_p): Declare.
1608 * pt.cc (unparenthesized_id_or_class_member_access_p): New function,
1609 broken out of...
1610 (do_auto_deduction): ...here. Use it. In C++23, maybe call
1611 treat_lvalue_as_rvalue_p.
1612 * tree.cc (xvalue_p): Check & clk_rvalueref, not == clk_rvalueref.
1613 * typeck.cc (check_return_expr): Allow implicit move for functions
1614 returning a reference as well, or when the return value type is not
1615 a scalar type.
1616
16172022-09-27 Marek Polacek <polacek@redhat.com>
1618
1619 * constraint.cc (diagnose_trait_expr): Say "nothrow" without quotes
1620 rather than in quotes.
1621
16222022-09-27 Jonathan Wakely <jwakely@redhat.com>
1623
1624 PR c++/107049
1625 * method.cc (is_convertible_helper): Use access check sentinel.
1626
16272022-09-27 Jakub Jelinek <jakub@redhat.com>
1628
1629 PR c++/106651
1630 * cp-tree.h (LAMBDA_EXPR_STATIC_P): Implement C++23
1631 P1169R4 - static operator(). Define.
1632 * parser.cc (CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR): Document
1633 that it also allows static.
1634 (cp_parser_lambda_declarator_opt): Handle static lambda specifier.
1635 (cp_parser_decl_specifier_seq): Allow RID_STATIC for
1636 CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
1637 * decl.cc (grok_op_properties): If operator() isn't a method,
1638 use a different error wording, if it is static member function,
1639 allow it (for C++20 and older with a pedwarn unless it is
1640 a lambda function or template instantiation).
1641 * call.cc (joust): Don't ICE if one candidate is static member
1642 function and the other is an indirect call. If the parameter
1643 conversion on the other candidate is user defined conversion,
1644 ellipsis or bad conversion, make static member function candidate
1645 a winner for that parameter.
1646 * lambda.cc (maybe_add_lambda_conv_op): Handle static lambdas.
1647 * error.cc (dump_lambda_function): Print static for static lambdas.
1648
16492022-09-27 Jakub Jelinek <jakub@redhat.com>
1650
1651 * cp-tree.h (struct omp_begin_assumes_data): New type.
1652 (struct saved_scope): Add omp_begin_assumes member.
1653 * parser.cc: Include bitmap.h.
1654 (cp_parser_omp_assumption_clauses, cp_parser_omp_assume,
1655 cp_parser_omp_assumes, cp_parser_omp_begin): New functions.
1656 (cp_parser_omp_end_declare_target): Rename to ...
1657 (cp_parser_omp_end): ... this. Handle also end assumes.
1658 (cp_parser_omp_construct): Handle PRAGMA_OMP_ASSUME.
1659 (cp_parser_pragma): Handle PRAGMA_OMP_ASSUME, PRAGMA_OMP_ASSUMES
1660 and PRAGMA_OMP_BEGIN. Handle PRAGMA_OMP_END rather than
1661 PRAGMA_OMP_END_DECLARE_TARGET and call cp_parser_omp_end
1662 for it rather than cp_parser_omp_end_declare_target.
1663 * pt.cc (apply_late_template_attributes): Also temporarily clear
1664 omp_begin_assumes.
1665 * semantics.cc (finish_translation_unit): Also diagnose
1666 #pragma omp begin assumes without corresponding
1667 #pragma omp end assumes.
1668
16692022-09-27 Jakub Jelinek <jakub@redhat.com>
1670
1671 * parser.cc (cp_parser_lambda_declarator_opt): Don't diagnose
1672 conflicting specifiers here.
1673 (cp_storage_class_name): New variable.
1674 (cp_parser_decl_specifier_seq): When setting conflicting_specifiers_p
1675 for the first time, diagnose which exact specifiers conflict.
1676 (cp_parser_set_storage_class): Likewise. Move storage_class
1677 computation earlier.
1678 * decl.cc (grokdeclarator): Don't diagnose conflicting specifiers
1679 here, just return error_mark_node.
1680
16812022-09-27 Jakub Jelinek <jakub@redhat.com>
1682
1683 PR c++/106652
1684 PR c++/85518
1685 * cp-tree.h (cp_compare_floating_point_conversion_ranks): Implement
1686 P1467R9 - Extended floating-point types and standard names except
1687 for std::bfloat16_t for now. Declare.
1688 (extended_float_type_p): New inline function.
1689 * mangle.cc (write_builtin_type): Mangle float{16,32,64,128}_type_node
1690 as DF{16,32,64,128}_. Mangle float{32,64,128}x_type_node as
1691 DF{32,64,128}x. Remove FIXED_POINT_TYPE mangling that conflicts
1692 with that.
1693 * typeck2.cc (check_narrowing): If one of ftype or type is extended
1694 floating-point type, compare floating-point conversion ranks.
1695 * parser.cc (cp_keyword_starts_decl_specifier_p): Handle
1696 CASE_RID_FLOATN_NX.
1697 (cp_parser_simple_type_specifier): Likewise and diagnose missing
1698 _Float<N> or _Float<N>x support if not supported by target.
1699 * typeck.cc (cp_compare_floating_point_conversion_ranks): New function.
1700 (cp_common_type): If both types are REAL_TYPE and one or both are
1701 extended floating-point types, select common type based on comparison
1702 of floating-point conversion ranks and subranks.
1703 (cp_build_binary_op): Diagnose operation with floating point arguments
1704 with unordered conversion ranks.
1705 * call.cc (standard_conversion): For floating-point conversion, if
1706 either from or to are extended floating-point types, set conv->bad_p
1707 for implicit conversion from larger to smaller conversion rank or
1708 with unordered conversion ranks.
1709 (convert_like_internal): Emit a pedwarn on such conversions.
1710 (build_conditional_expr): Diagnose operation with floating point
1711 arguments with unordered conversion ranks.
1712 (convert_arg_to_ellipsis): Don't promote extended floating-point types
1713 narrower than double to double.
1714 (compare_ics): Implement P1467R9 [over.ics.rank]/4 changes.
1715
17162022-09-26 Marek Polacek <polacek@redhat.com>
1717
1718 PR c++/106656
1719 * typeck2.cc (array_string_literal_compatible_p): Allow
1720 initializing arrays of char or unsigned char by a UTF-8 string literal.
1721
17222022-09-26 Marek Polacek <polacek@redhat.com>
1723
1724 PR c++/106784
1725 * method.cc (is_convertible_helper): New.
1726 (is_convertible): Use it.
1727 (is_nothrow_convertible): Likewise.
1728
17292022-09-26 Patrick Palka <ppalka@redhat.com>
1730
1731 PR c++/107033
1732 * module.cc (trees_in::decl_value): In the MK_partial case for
1733 a variable template partial specialization, pass decl_p=true to
1734 add_mergeable_specialization, and set spec to the VAR_DECL not
1735 the TEMPLATE_DECL.
1736 * pt.cc (add_mergeable_specialization): For a variable template
1737 partial specialization, set the TREE_TYPE of the new
1738 DECL_TEMPLATE_SPECIALIZATIONS node to the TREE_TYPE of the
1739 VAR_DECL not the VAR_DECL itself.
1740
17412022-09-23 Marek Polacek <polacek@redhat.com>
1742
1743 PR c++/106784
1744 * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONVERTIBLE
1745 and CPTK_IS_NOTHROW_CONVERTIBLE.
1746 * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_CONVERTIBLE
1747 RID_IS_NOTHROW_CONVERTIBLE.
1748 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_CONVERTIBLE and
1749 CPTK_IS_NOTHROW_CONVERTIBLE.
1750 (is_convertible): Declare.
1751 (is_nothrow_convertible): Likewise.
1752 * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
1753 CPTK_IS_CONVERTIBLE and CPTK_IS_NOTHROW_CONVERTIBLE.
1754 * method.cc (is_convertible): New.
1755 (is_nothrow_convertible): Likewise.
1756 * parser.cc (cp_parser_primary_expression): Handle RID_IS_CONVERTIBLE
1757 and RID_IS_NOTHROW_CONVERTIBLE.
1758 (cp_parser_trait_expr): Likewise.
1759 * semantics.cc (trait_expr_value): Handle CPTK_IS_CONVERTIBLE and
1760 CPTK_IS_NOTHROW_CONVERTIBLE.
1761 (finish_trait_expr): Likewise.
1762
17632022-09-23 Marek Polacek <polacek@redhat.com>
1764
1765 PR c++/106983
1766 * typeck2.cc (split_nonconstant_init_1): Check TYPE_P.
1767
17682022-09-22 Patrick Palka <ppalka@redhat.com>
1769
1770 PR c++/106826
1771 * module.cc (trees_out::decl_value): Use get_template_info in
1772 the MK_partial case to handle both VAR_DECL and TYPE_DECL.
1773 (trees_out::key_mergeable): Likewise.
1774 (trees_in::key_mergeable): Likewise.
1775 (has_definition): Consider DECL_INITIAL of a partial variable
1776 template specialization.
1777 (depset::hash::make_dependency): Handle partial variable template
1778 specializations too.
1779
17802022-09-20 Patrick Palka <ppalka@redhat.com>
1781
1782 * decl.cc (cp_finish_decl): After updating the deduced type of a
1783 VAR_DECL, also update the corresponding TEMPLATE_DECL if there
1784 is one.
1785
17862022-09-20 Patrick Palka <ppalka@redhat.com>
1787
1788 PR c++/106761
1789 * module.cc (trees_out::type_node) <case TYPE_PACK_EXPANSION>:
1790 Stream PACK_EXPANSION_EXTRA_ARGS.
1791 (trees_in::tree_node) <case TYPE_PACK_EXPANSION>: Likewise.
1792
17932022-09-17 Patrick Palka <ppalka@redhat.com>
1794
1795 * module.cc (friend_from_decl_list): Don't consider
1796 CLASSTYPE_TEMPLATE_INFO for a TYPENAME_TYPE friend.
1797 (trees_in::read_class_def): Don't add to
1798 CLASSTYPE_BEFRIENDING_CLASSES for a TYPENAME_TYPE friend.
1799
18002022-09-16 Patrick Palka <ppalka@redhat.com>
1801
1802 PR c++/92505
1803 * constexpr.cc (cxx_eval_component_reference): Check non_constant_p
1804 sooner. In C++14 or later, reject a DECL_MUTABLE_P member access
1805 only if CONSTRUCTOR_MUTABLE_POISION is also set.
1806
18072022-09-16 Jason Merrill <jason@redhat.com>
1808
1809 PR c++/106858
1810 * parser.cc (cp_parser_omp_var_list_no_open): Pass the
1811 initial token location down.
1812 * semantics.cc (finish_omp_clauses): Check
1813 invalid_nonstatic_memfn_p.
1814 * typeck.cc (invalid_nonstatic_memfn_p): Handle null TREE_TYPE.
1815
18162022-09-15 Richard Biener <rguenther@suse.de>
1817
1818 * decl.cc (cxx_init_decl_processing): Inline last
1819 build_void_list_node call.
1820 (build_void_list_node): Remove.
1821
18222022-09-14 Julian Brown <julian@codesourcery.com>
1823
1824 * semantics.cc (finish_omp_clauses): Likewise.
1825
18262022-09-13 Patrick Palka <ppalka@redhat.com>
1827
1828 * cp-tree.h (mark_used): Remove single-parameter overload. Add
1829 default argument to the two-parameter overload.
1830 * decl2.cc (mark_used): Likewise.
1831
18322022-09-13 Patrick Palka <ppalka@redhat.com>
1833
1834 * cp-tree.h (cxx_constant_value): Define two-parameter version
1835 that omits the object parameter.
1836 * decl.cc (build_explicit_specifier): Omit NULL_TREE object
1837 argument to cxx_constant_value.
1838 * except.cc (build_noexcept_spec): Likewise.
1839 * pt.cc (expand_integer_pack): Likewise.
1840 (fold_targs_r): Likewise.
1841 * semantics.cc (finish_if_stmt_cond): Likewise.
1842
18432022-09-13 Patrick Palka <ppalka@redhat.com>
1844
1845 * decl.cc (build_explicit_specifier): Pass complain to
1846 cxx_constant_value.
1847 * except.cc (build_noexcept_spec): Likewise.
1848 * pt.cc (expand_integer_pack): Likewise.
1849 (tsubst_function_decl): Propagate error_mark_node returned
1850 from build_explicit_specifier.
1851
18522022-09-12 Patrick Palka <ppalka@redhat.com>
1853
1854 * call.cc (build_conditional_expr): Adjust calls to
1855 '_sfinae'-suffixed functions.
1856 (build_temp): Likewise.
1857 (convert_like_internal): Likewise.
1858 (convert_arg_to_ellipsis): Likewise.
1859 (build_over_call): Likewise.
1860 (build_cxx_call): Likewise.
1861 (build_new_method_call): Likewise.
1862 * constexpr.cc (cxx_eval_outermost_constant_expr): Likewise.
1863 (cxx_constant_value_sfinae): Rename to ...
1864 (cxx_constant_value): ... this. Document its default arguments.
1865 (fold_non_dependent_expr): Adjust function comment.
1866 * cp-tree.h (instantiate_non_dependent_expr_sfinae): Rename to ...
1867 (instantiate_non_dependent_expr): ... this. Give its 'complain'
1868 parameter a default argument.
1869 (get_target_expr_sfinae, get_target_expr): Likewise.
1870 (require_complete_type_sfinae, require_complete_type): Likewise.
1871 (abstract_virtuals_error_sfinae, abstract_virtuals_error):
1872 Likewise.
1873 (cxx_constant_value_sfinae, cxx_constant_value): Likewise.
1874 * cvt.cc (build_up_reference): Adjust calls to '_sfinae'-suffixed
1875 functions.
1876 (ocp_convert): Likewise.
1877 * decl.cc (build_explicit_specifier): Likewise.
1878 * except.cc (build_noexcept_spec): Likewise.
1879 * init.cc (build_new_1): Likewise.
1880 * pt.cc (expand_integer_pack): Likewise.
1881 (instantiate_non_dependent_expr_internal): Adjust function
1882 comment.
1883 (instantiate_non_dependent_expr): Rename to ...
1884 (instantiate_non_dependent_expr_sfinae): ... this. Document its
1885 default argument.
1886 (tsubst_init): Adjust calls to '_sfinae'-suffixed functions.
1887 (fold_targs_r): Likewise.
1888 * semantics.cc (finish_compound_literal): Likewise.
1889 (finish_decltype_type): Likewise.
1890 (cp_build_bit_cast): Likewise.
1891 * tree.cc (build_cplus_new): Likewise.
1892 (get_target_expr): Rename to ...
1893 (get_target_expr_sfinae): ... this. Document its default
1894 argument.
1895 * typeck.cc (require_complete_type): Rename to ...
1896 (require_complete_type_sfinae): ... this. Document its default
1897 argument.
1898 (cp_build_array_ref): Adjust calls to '_sfinae'-suffixed
1899 functions.
1900 (convert_arguments): Likewise.
1901 (cp_build_binary_op): Likewise.
1902 (build_static_cast_1): Likewise.
1903 (cp_build_modify_expr): Likewise.
1904 (convert_for_initialization): Likewise.
1905 * typeck2.cc (abstract_virtuals_error): Rename to ...
1906 (abstract_virtuals_error_sfinae): ... this. Document its default
1907 argument.
1908 (build_functional_cast_1): Adjust calls to '_sfinae'-suffixed
1909 functions.
1910
19112022-09-12 Patrick Palka <ppalka@redhat.com>
1912
1913 PR c++/101906
1914 * pt.cc (tsubst_template_args): Set cp_evaluated here.
1915 (tsubst_aggr_type): Not here.
1916
19172022-09-12 Jason Merrill <jason@redhat.com>
1918
1919 PR c++/106893
1920 PR c++/90451
1921 * decl.cc (cp_finish_decl): Call mark_single_function.
1922
19232022-09-12 Jason Merrill <jason@redhat.com>
1924
1925 PR c++/93259
1926 * pt.cc (type_dependent_expression_p): Treat a compound
1927 literal of array-of-unknown-bound type like a variable.
1928
19292022-09-12 Jason Merrill <jason@redhat.com>
1930
1931 PR c++/106567
1932 * lambda.cc (type_deducible_expression_p): Check
1933 array_of_unknown_bound_p.
1934
19352022-09-12 Jonathan Wakely <jwakely@redhat.com>
1936
1937 PR c++/86491
1938 * decl2.cc (constrain_class_visibility): Adjust wording of
1939 -Wsubobject-linkage for cases where anonymous
1940 namespaces aren't used.
1941 * tree.cc (decl_anon_ns_mem_p): Now only true for actual anonymous
1942 namespace members, rename old semantics to...
1943 (decl_internal_context_p): ...this.
1944 * cp-tree.h, name-lookup.cc, pt.cc: Adjust.
1945
19462022-09-08 Jonathan Wakely <jwakely@redhat.com>
1947
1948 PR c++/106838
1949 * class.cc (type_has_virtual_destructor): Return false for
1950 union types.
1951 * semantics.cc (check_trait_type): Add KIND parameter to support
1952 different sets of requirements.
1953 (finish_trait_expr): Pass KIND argument for relevant traits.
1954
19552022-09-08 Patrick Palka <ppalka@redhat.com>
1956
1957 PR c++/99130
1958 * decl2.cc (maybe_instantiate_decl): Adjust function comment.
1959 Check VAR_OR_FUNCTION_DECL_P. Pull out the disjunction into ...
1960 (mark_used): ... here, removing the decl_maybe_constant_var_p
1961 part of it.
1962
19632022-09-07 Jason Merrill <jason@redhat.com>
1964
1965 PR c++/106793
1966 * decl.cc (grokdeclarator): Improve placeholder diagnostics.
1967 * parser.cc (cp_parser_type_id_1): Add fixit.
1968
19692022-09-07 Arsen Arsenović <arsen@aarsen.me>
1970
1971 PR c++/106188
1972 PR c++/106713
1973 * coroutines.cc (coro_rewrite_function_body): Ensure we have a
1974 BIND_EXPR wrapping the function body.
1975
19762022-09-07 Jakub Jelinek <jakub@redhat.com>
1977
1978 PR c++/106829
1979 * semantics.cc (finish_omp_target_clauses): If current_function_decl
1980 isn't a nonstatic member function, don't set data.current_object to
1981 non-NULL.
1982
19832022-09-06 Jason Merrill <jason@redhat.com>
1984
1985 * decl.cc (grok_op_properties): Return sooner for C++23 op[].
1986
19872022-09-06 Jakub Jelinek <jakub@redhat.com>
1988
1989 * parser.cc (cp_parser_omp_clause_doacross_sink): Don't verify val
1990 in omp_cur_iteration - 1 has integer_type_node type.
1991
19922022-09-06 Jakub Jelinek <jakub@redhat.com>
1993
1994 * pt.cc (tsubst_expr) <case OMP_ORDERED>: If OMP_BODY was NULL, keep
1995 it NULL after instantiation too.
1996
19972022-09-03 Jakub Jelinek <jakub@redhat.com>
1998
1999 * parser.cc (cp_parser_omp_clause_name): Handle doacross.
2000 (cp_parser_omp_clause_depend_sink): Renamed to ...
2001 (cp_parser_omp_clause_doacross_sink): ... this. Add depend_p
2002 argument. Handle parsing of doacross(sink:omp_cur_iteration-1). Use
2003 OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
2004 OMP_CLAUSE_DEPEND_SINK_NEGATIVE, build OMP_CLAUSE_DOACROSS instead
2005 of OMP_CLAUSE_DEPEND and set OMP_CLAUSE_DOACROSS_DEPEND flag on it.
2006 (cp_parser_omp_clause_depend): Use OMP_CLAUSE_DOACROSS_SINK and
2007 OMP_CLAUSE_DOACROSS_SOURCE instead of OMP_CLAUSE_DEPEND_SINK and
2008 OMP_CLAUSE_DEPEND_SOURCE, build OMP_CLAUSE_DOACROSS for depend(source)
2009 and set OMP_CLAUSE_DOACROSS_DEPEND on it.
2010 (cp_parser_omp_clause_doacross): New function.
2011 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DOACROSS.
2012 (cp_parser_omp_depobj): Use OMP_CLAUSE_DEPEND_INVALID instead of
2013 OMP_CLAUSE_DEPEND_SOURCE.
2014 (cp_parser_omp_for_loop): Don't diagnose here linear clause together
2015 with ordered with argument.
2016 (cp_parser_omp_simd): Don't diagnose ordered clause with argument on
2017 for simd.
2018 (OMP_ORDERED_DEPEND_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DOACROSS.
2019 (cp_parser_omp_ordered): Handle also doacross and adjust for it
2020 diagnostic wording.
2021 * pt.cc (tsubst_omp_clause_decl): Use
2022 OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
2023 OMP_CLAUSE_DEPEND_SINK_NEGATIVE.
2024 (tsubst_omp_clauses): Handle OMP_CLAUSE_DOACROSS.
2025 (tsubst_expr): Use OMP_CLAUSE_DEPEND_INVALID instead of
2026 OMP_CLAUSE_DEPEND_SOURCE.
2027 * semantics.cc (cp_finish_omp_clause_depend_sink): Rename to ...
2028 (cp_finish_omp_clause_doacross_sink): ... this.
2029 (finish_omp_clauses): Handle OMP_CLAUSE_DOACROSS. Don't handle
2030 OMP_CLAUSE_DEPEND_SOURCE and OMP_CLAUSE_DEPEND_SINK.
2031
20322022-09-02 David Malcolm <dmalcolm@redhat.com>
2033
2034 PR c/90885
2035 * cp-tree.h (class cp_expr): Add bitfield m_decimal. Clear it in
2036 existing ctors. Add ctor that allows specifying its value.
2037 (cp_expr::decimal_p): New accessor.
2038 * parser.cc (cp_parser_expression_stack_entry::flags): New field.
2039 (cp_parser_primary_expression): Set m_decimal of cp_expr when
2040 handling numbers.
2041 (cp_parser_binary_expression): Extract flags from token when
2042 populating stack. Call check_for_xor_used_as_pow.
2043
20442022-09-01 Marek Polacek <polacek@redhat.com>
2045
2046 * cp-tree.h (maybe_strip_ref_conversion): Remove.
2047
20482022-08-30 Ulrich Drepper <drepper@gmail.com>
2049
2050 * Make-lang.in: Add rule to rebuild std-name-hint.h from
2051 std-name-hint.gperf.
2052 * name-lookup.cc (get_std_name_hint): Remove hints array.
2053 Use gperf-generated class std_name_hint_lookup.
2054 Include "std-name-hint.h".
2055 * std-name-hint.gperf: New file.
2056 * std-name-hint.h: New file. Generated from the .gperf file.
2057
20582022-08-30 Marek Polacek <polacek@redhat.com>
2059
2060 PR c++/106759
2061 * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_NOTHROW_ASSIGNABLE
2062 and RID_IS_NOTHROW_CONSTRUCTIBLE.
2063
20642022-08-29 Marek Polacek <polacek@redhat.com>
2065
2066 PR c++/106712
2067 * decl.cc (grokdeclarator): Reverse the order of arguments to
2068 attr_chainon.
2069
20702022-08-26 Marek Polacek <polacek@redhat.com>
2071
2072 PR c++/81159
2073 * typeck.cc (maybe_warn_self_move): New.
2074 (cp_build_modify_expr): Call maybe_warn_self_move.
2075
20762022-08-25 Marek Polacek <polacek@redhat.com>
2077
2078 * cp-tree.h (enum cp_tree_index): Remove CTI_NULLPTR, CTI_NULLPTR_TYPE.
2079 Move it to c_tree_index.
2080 (nullptr_node): No longer define here.
2081 (nullptr_type_node): Likewise.
2082 (NULLPTR_TYPE_P): Likewise.
2083 * decl.cc (cxx_init_decl_processing): Only keep C++-specific nullptr
2084 initialization; move the shared code to c_common_nodes_and_builtins.
2085
20862022-08-25 Jason Merrill <jason@redhat.com>
2087
2088 * call.cc (unsafe_return_slot_p): Return 2 for *this in a
2089 constructor.
2090
20912022-08-23 Marek Polacek <polacek@redhat.com>
2092
2093 * typeck.cc (maybe_warn_pessimizing_move): Don't warn about
2094 redundant std::move when the expression was wrapped in { }.
2095
20962022-08-17 Marek Polacek <polacek@redhat.com>
2097
2098 PR c++/90428
2099 * typeck.cc (can_do_rvo_p): Rename to ...
2100 (can_elide_copy_prvalue_p): ... this.
2101 (maybe_warn_pessimizing_move): Extend the
2102 -Wredundant-move warning to warn about std::move on a
2103 const-qualified object.
2104
21052022-08-17 Marek Polacek <polacek@redhat.com>
2106
2107 PR c++/89780
2108 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Maybe suppress
2109 -Wpessimizing-move.
2110 * typeck.cc (maybe_warn_pessimizing_move): Don't issue warnings
2111 if they are suppressed.
2112 (check_return_expr): Disable -Wpessimizing-move when returning
2113 a dependent expression.
2114
21152022-08-17 Marek Polacek <polacek@redhat.com>
2116
2117 PR c++/106276
2118 * call.cc (build_over_call): Call maybe_warn_pessimizing_move.
2119 * cp-tree.h (maybe_warn_pessimizing_move): Declare.
2120 * decl.cc (build_aggr_init_full_exprs): Call
2121 maybe_warn_pessimizing_move.
2122 * typeck.cc (maybe_warn_pessimizing_move): Handle TREE_LIST and
2123 CONSTRUCTOR. Add a bool parameter and use it. Adjust a diagnostic
2124 message.
2125 (check_return_expr): Adjust the call to maybe_warn_pessimizing_move.
2126
21272022-08-17 Tobias Burnus <tobias@codesourcery.com>
2128 Chung-Lin Tang <cltang@codesourcery.com>
2129
2130 PR c++/104493
2131 * cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Remove.
2132 * cp-tree.h (cp_omp_mappable_type, cp_omp_emit_unmappable_type_notes):
2133 Remove.
2134 * decl2.cc (cp_omp_mappable_type_1, cp_omp_mappable_type,
2135 cp_omp_emit_unmappable_type_notes): Remove.
2136 (cplus_decl_attributes): Call omp_mappable_type instead of
2137 removed langhook.
2138 * decl.cc (cp_finish_decl): Likewise; call cxx_incomplete_type_inform
2139 in lieu of cp_omp_emit_unmappable_type_notes.
2140 * semantics.cc (finish_omp_clauses): Likewise.
2141
21422022-08-16 Tom Honermann <tom@honermann.net>
2143
2144 PR c++/106423
2145 * parser.cc (cp_lexer_saving_tokens): Add comment regarding
2146 diagnostic requirements.
2147
21482022-08-16 Jakub Jelinek <jakub@redhat.com>
2149
2150 * typeck.cc (cp_build_modify_expr): Implement
2151 P2327R1 - De-deprecating volatile compound operations. Don't warn
2152 for |=, &= or ^= with volatile lhs.
2153 * expr.cc (mark_use) <case MODIFY_EXPR>: Adjust warning wording,
2154 leave out simple.
2155
21562022-08-15 Marek Polacek <polacek@redhat.com>
2157
2158 PR c++/106276
2159 * typeck.cc (can_do_rvo_p): New.
2160 (maybe_warn_pessimizing_move): Warn when moving a temporary object
2161 in a return statement prevents copy elision.
2162
21632022-08-11 Marek Polacek <polacek@redhat.com>
2164
2165 PR middle-end/102633
2166 * decl.cc (cp_finish_decl): Call suppress_warning.
2167
21682022-08-07 Jakub Jelinek <jakub@redhat.com>
2169
2170 PR c++/88174
2171 * constexpr.cc (cxx_eval_store_expression): Handle REALPART_EXPR
2172 and IMAGPART_EXPR. Change ctors from releasing_vec to
2173 auto_vec<tree *>, adjust all uses. For !preeval, update ctors
2174 vector.
2175
21762022-07-31 Lewis Hyatt <lhyatt@gmail.com>
2177
2178 PR c++/66290
2179 * parser.cc (cp_lexer_new_main): Rename global done_lexing to
2180 override_libcpp_locations.
2181
21822022-07-31 Jason Merrill <jason@redhat.com>
2183
2184 PR c++/106369
2185 * constexpr.cc (reduced_constant_expression_p): Return false
2186 if a CONSTRUCTOR initializes an empty field.
2187
21882022-07-29 Jakub Jelinek <jakub@redhat.com>
2189
2190 PR c++/106448
2191 * parser.cc (cp_parser_omp_atomic): For simple cast followed by
2192 CPP_QUERY token, don't try cp_parser_binary_operation if compare
2193 is true.
2194
21952022-07-26 Marek Polacek <polacek@redhat.com>
2196
2197 PR c++/106311
2198 * pt.cc (redeclare_class_template): Check DECL_P before accessing
2199 DECL_SOURCE_LOCATION.
2200
22012022-07-26 Jason Merrill <jason@redhat.com>
2202
2203 PR c++/106230
2204 * semantics.cc (finish_for_stmt): Check stmts_are_full_exprs_p.
2205
22062022-07-25 Jason Merrill <jason@redhat.com>
2207
2208 PR c++/87729
2209 * class.cc (warn_hidden): Remove shortcut.
2210
22112022-07-22 Patrick Palka <ppalka@redhat.com>
2212
2213 PR c++/106366
2214 * pt.cc (do_class_deduction): Don't consider TYPE_HAS_LIST_CTOR
2215 when setting try_list_ctor. Reset args even when try_list_ctor
2216 is true and there are no list candidates. Call resolve_args on
2217 the reset args. Rename try_list_ctor to try_list_cand.
2218
22192022-07-22 Martin Liska <mliska@suse.cz>
2220
2221 PR other/106370
2222 * init.cc (sort_mem_initializers): Remove continue as last stmt
2223 in a loop.
2224
22252022-07-21 Jason Merrill <jason@redhat.com>
2226
2227 PR c++/106361
2228 * decl.cc (move_fn_p): Remove assert.
2229
22302022-07-21 Jason Merrill <jason@redhat.com>
2231
2232 DR 2084
2233 PR c++/98423
2234 * method.cc (walk_field_subobs): Fix DMI in union case.
2235
22362022-07-19 Patrick Palka <ppalka@redhat.com>
2237
2238 PR c++/94894
2239 PR c++/105766
2240 PR c++/106201
2241 * call.cc (enum conversion_kind): Add ck_deferred_bad enumerator.
2242 (has_next): Return false for it.
2243 (reference_binding): Return a ck_deferred_bad conversion instead
2244 of an actual bad conversion when LOOKUP_SHORTCUT_BAD_CONVS is set.
2245 Remove now obsolete early exit for the incomplete TO case.
2246 (implicit_conversion_1): Don't mask out LOOKUP_SHORTCUT_BAD_CONVS.
2247 (add_function_candidate): Set LOOKUP_SHORTCUT_BAD_CONVS iff
2248 shortcut_bad_convs.
2249 (missing_conversion_p): Also return true for a ck_deferred_bad
2250 conversion.
2251 * cp-tree.h (LOOKUP_SHORTCUT_BAD_CONVS): Define.
2252
22532022-07-19 Jonathan Wakely <jwakely@redhat.com>
2254
2255 * cp-objcp-common.cc (names_builtin_p): Return true for
2256 RID_REF_CONSTRUCTS_FROM_TEMPORARY and
2257 RID_REF_CONVERTS_FROM_TEMPORARY.
2258
22592022-07-15 Marek Polacek <polacek@redhat.com>
2260
2261 PR c++/104477
2262 * call.cc (ref_conv_binds_directly_p): Rename to ...
2263 (ref_conv_binds_directly): ... this. Add a new bool parameter. Change
2264 the return type to tristate.
2265 * constraint.cc (diagnose_trait_expr): Handle
2266 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
2267 * cp-tree.h: Include "tristate.h".
2268 (enum cp_trait_kind): Add CPTK_REF_CONSTRUCTS_FROM_TEMPORARY
2269 and CPTK_REF_CONVERTS_FROM_TEMPORARY.
2270 (ref_conv_binds_directly_p): Rename to ...
2271 (ref_conv_binds_directly): ... this.
2272 (ref_xes_from_temporary): Declare.
2273 * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
2274 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
2275 * method.cc (ref_xes_from_temporary): New.
2276 * parser.cc (cp_parser_primary_expression): Handle
2277 RID_REF_CONSTRUCTS_FROM_TEMPORARY and RID_REF_CONVERTS_FROM_TEMPORARY.
2278 (cp_parser_trait_expr): Likewise.
2279 (warn_for_range_copy): Adjust to call ref_conv_binds_directly.
2280 * semantics.cc (trait_expr_value): Handle
2281 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
2282 (finish_trait_expr): Likewise.
2283
22842022-07-13 Patrick Palka <ppalka@redhat.com>
2285
2286 PR c++/105912
2287 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Guard against
2288 NULL_TREE extract_call_expr result.
2289
22902022-07-13 Patrick Palka <ppalka@redhat.com>
2291
2292 PR c++/105842
2293 * constraint.cc (satisfy_declaration_constraints): Refine early
2294 exit test for argument dependence.
2295 * cp-tree.h (uses_outer_template_parms_in_constraints): Declare.
2296 * pt.cc (template_class_depth): Handle TI_TEMPLATE being a
2297 FIELD_DECL.
2298 (usse_outer_template_parms): Factor out constraint dependence
2299 test into ...
2300 (uses_outer_template_parms_in_constraints): ... here.
2301 (type_dependent_expression_p): Use it for FUNCTION_DECL.
2302
23032022-07-07 Patrick Palka <ppalka@redhat.com>
2304
2305 PR c++/105956
2306 * pt.cc (template_arg_to_parm): Define.
2307 (tsubst_argument_pack): Try to reuse the corresponding
2308 ARGUMENT_PACK from 'args' when substituting into a generic
2309 ARGUMENT_PACK for a variadic template parameter.
2310 (tsubst_template_args): Move variable declarations closer to
2311 their first use. Replace 'orig_t' with 'r'. Rename 'need_new'
2312 to 'const_subst_p'. Heuristically detect if the substituted
2313 elements are identical to that of a level from 'args' and avoid
2314 allocating a new TREE_VEC if so. Add sanity check for the
2315 length of the new TREE_VEC, and remove dead ARGUMENT_PACK_P test.
2316 (tsubst_decl) <case TYPE_DECL, case VAR_DECL>: Revert
2317 r13-1045-gcb7fd1ea85feea change for avoiding substitution into
2318 DECL_TI_ARGS, but still avoid coercion in this case.
2319
23202022-07-07 Jason Merrill <jason@redhat.com>
2321
2322 PR c++/87729
2323 * class.cc (warn_hidden): Ignore [cd]tors.
2324
23252022-07-06 Lewis Hyatt <lhyatt@gmail.com>
2326
2327 PR c++/53431
2328 * parser.cc (cp_parser_pragma_kind): Move earlier in the file.
2329 (cp_lexer_handle_early_pragma): New function.
2330 (cp_lexer_new_main): Support parsing and handling early pragmas.
2331 (c_parse_file): Adapt to changes in cp_lexer_new_main.
2332
23332022-07-06 Jason Merrill <jason@redhat.com>
2334
2335 PR c++/106179
2336 PR c++/106024
2337 * parser.cc (cp_parser_lookup_name): Remove :: requirement
2338 for using unqualified lookup result.
2339
23402022-07-05 Nathan Sidwell <nathan@acm.org>
2341
2342 * module.cc
2343 (struct ord_loc_info, ord_loc_traits): New.
2344 (ord_loc_tabke, ord_loc_remap): New globals.
2345 (struct location_map_info): Delete.
2346 (struct module_state_config): Rename ordinary_loc_align to
2347 loc_range_bits.
2348 (module_for_ordinary_loc): Adjust.
2349 (module_state::note_location): Note ordinary locations,
2350 return bool.
2351 (module_state::write_location): Adjust ordinary location
2352 streaming.
2353 (module_state::read_location): Likewise.
2354 (module_state::write_init_maps): Allocate ord_loc_table.
2355 (module_state::write_prepare_maps): Reimplement ordinary
2356 map preparation.
2357 (module_state::read_prepare_maps): Adjust.
2358 (module_state::write_ordinary_maps): Reimplement.
2359 (module_state::write_macro_maps): Adjust.
2360 (module_state::read_ordinary_maps): Reimplement.
2361 (module_state::write_macros): Adjust.
2362 (module_state::write_config): Adjust.
2363 (module_state::read_config): Adjust.
2364 (module_state::write_begin): Adjust.
2365 (module_state::read_initial): Adjust.
2366
23672022-07-04 Tobias Burnus <tobias@codesourcery.com>
2368 Chung-Lin Tang <cltang@codesourcery.com>
2369 Thomas Schwinge <thomas@codesourcery.com>
2370
2371 * parser.cc (cp_parser_omp_target_data,
2372 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
2373 cp_parser_omp_target_update): Set OMP_REQUIRES_TARGET_USED.
2374 (cp_parser_omp_requires): Remove sorry.
2375
23762022-07-01 Lewis Hyatt <lhyatt@gmail.com>
2377
2378 * parser.cc (cp_token_is_module_directive): New function
2379 refactoring common code.
2380 (cp_parser_skip_to_closing_parenthesis_1): Use the new function.
2381 (cp_parser_skip_to_end_of_statement): Likewise.
2382 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
2383 (cp_parser_declaration): Likewise.
2384
23852022-07-01 Marek Polacek <polacek@redhat.com>
2386
2387 PR c++/105550
2388 * constexpr.cc (cxx_eval_conditional_expression): Strip TARGET_EXPRs.
2389
23902022-07-01 Tobias Burnus <tobias@codesourcery.com>
2391
2392 * parser.cc (cp_parser_omp_target_enter_data,
2393 cp_parser_omp_target_exit_data): Accept tofrom
2394 map-type modifier but use 'to' / 'from' internally.
2395
23962022-07-01 Marek Polacek <polacek@redhat.com>
2397
2398 PR c++/106111
2399 * parser.cc (cp_lexer_get_preprocessor_token): Also warn about
2400 RID_ALIGNOF, RID_ALIGNAS, RID_THREAD.
2401
24022022-07-01 Jason Merrill <jason@redhat.com>
2403
2404 PR c++/105779
2405 * call.cc (resolve_args): Use complain.
2406
24072022-07-01 Jason Merrill <jason@redhat.com>
2408
2409 * parser.cc (missing_template_diag): Split out...
2410 (cp_parser_id_expression): ...from here.
2411
24122022-07-01 Jason Merrill <jason@redhat.com>
2413
2414 PR c++/106024
2415 * parser.cc (missing_template_diag): Factor out...
2416 (cp_parser_id_expression): ...from here.
2417 (cp_parser_lookup_name): Don't look in dependent object_type.
2418
24192022-06-30 Nathan Sidwell <nathan@acm.org>
2420
2421 * module.cc (module_state::write_define): Drop located param.
2422 (module_state::read_define): Likewise.
2423 (module_state::prepare_macros): New, broken out of ...
2424 (module_state::write_macros): ... here. Adjust.
2425 (module_state::write_begin): Adjust.
2426
24272022-06-29 Nathan Sidwell <nathan@acm.org>
2428
2429 * module.cc (macro_info, macro_traits, macro_table,
2430 macro_remap): Rename to ...
2431 (macro_loc_info, macro_loc_traits, macro_loc_table,
2432 macro_loc_remap): ... these. Update all uses.
2433 (module_state::write_prepare_maps): Remove unneeded macro checking.
2434 (module_state::write_begin): Free macro_loc_remap.
2435
24362022-06-27 Sergei Trofimovich <siarheit@google.com>
2437
2438 PR c++/106102
2439 * mapper-client.cc: Include <memory> via "system.h".
2440 * mapper-resolver.cc: Ditto.
2441 * module.cc: Ditto.
2442
24432022-06-27 David Malcolm <dmalcolm@redhat.com>
2444
2445 * cxx-pretty-print.h: Add "final" and "override" to various vfunc
2446 implementations, removing redundant "virtual" as appropriate.
2447 * module.cc: Likewise.
2448
24492022-06-24 Jason Merrill <jason@redhat.com>
2450
2451 PR c++/87729
2452 PR c++/20423
2453 * class.cc (warn_hidden): Handle -Woverloaded-virtual=1.
2454
24552022-06-24 Alexandre Oliva <oliva@adacore.com>
2456
2457 * g++spec.cc (lang_specific_driver): Implement -nostdlib++.
2458
24592022-06-23 Jason Merrill <jason@redhat.com>
2460
2461 PR c++/105925
2462 * call.cc (build_aggr_conv): Don't depend on
2463 CONSTRUCTOR_IS_DESIGNATED_INIT.
2464
24652022-06-23 Jason Merrill <jason@redhat.com>
2466
2467 PR c++/105925
2468 * decl.cc (reshape_init_array_1): Set
2469 CONSTRUCTOR_IS_DESIGNATED_INIT here.
2470 (reshape_init_class): And here.
2471 (reshape_init): Not here.
2472
24732022-06-23 Patrick Palka <ppalka@redhat.com>
2474
2475 PR c++/105931
2476 * expr.cc (fold_for_warn): Don't fold when in an unevaluated
2477 context.
2478
24792022-06-23 Patrick Palka <ppalka@redhat.com>
2480
2481 PR c++/105982
2482 * pt.cc (lookup_template_class): After calling complete_type for
2483 the substituted context, check the table again iff the type was
2484 previously incomplete and complete_type made it complete.
2485
24862022-06-23 Jason Merrill <jason@redhat.com>
2487
2488 PR c++/94554
2489 * pt.cc (dependent_operand_p): Split out from...
2490 (tsubst_copy_and_build): ...here.
2491 (tsubst_expr) [IF_STMT]: Use it.
2492 * semantics.cc (finish_if_stmt_cond): Keep the pre-conversion
2493 condition in the template tree.
2494
24952022-06-23 Jason Merrill <jason@redhat.com>
2496
2497 PR c++/105885
2498 * pt.cc (tsubst_copy_and_build): Also suppress -Waddress for
2499 comparison of dependent operands.
2500
25012022-06-23 Nathan Sidwell <nathan@acm.org>
2502
2503 * module.cc (struct macro_info): New.
2504 (struct macro_traits): New.
2505 (macro_remap, macro_table): New globals.
2506 (depset::hash::find_dependencies): Note namespace location.
2507 (module_for_macro_loc): Adjust.
2508 (module_state::note_location): New.
2509 (module_state::Write_location): Note location when not
2510 streaming. Adjust macro location streaming.
2511 (module_state::read_location): Adjust macro location
2512 streaming.
2513 (module_state::write_init_maps): New.
2514 (module_state::write_prepare_maps): Reimplement macro map
2515 preparation.
2516 (module_state::write_macro_maps): Reimplement.
2517 (module_state::read_macro_maps): Likewise.
2518 (module_state::write_begin): Adjust.
2519
25202022-06-23 Jason Merrill <jason@redhat.com>
2521
2522 * pt.cc (type_unification_real): An auto tparm can't
2523 be affected by other deductions.
2524
25252022-06-23 Jason Merrill <jason@redhat.com>
2526
2527 PR c++/105964
2528 * pt.cc (type_dependent_expression_p): Look through BASELINK.
2529
25302022-06-22 Jason Merrill <jason@redhat.com>
2531
2532 PR c++/105908
2533 * name-lookup.cc (outer_binding): Strip BASELINK.
2534
25352022-06-22 Nathan Sidwell <nathan@acm.org>
2536
2537 * module.cc (struct duplicate_hash): Remove.
2538 (duplicate_hash_map): Adjust.
2539
25402022-06-22 Jason Merrill <jason@redhat.com>
2541
2542 PR c++/104642
2543 * constexpr.cc (cxx_eval_builtin_function_call): Handle
2544 unreachable/trap earlier.
2545 * cp-gimplify.cc (cp_maybe_instrument_return): Use
2546 build_builtin_unreachable.
2547
25482022-06-18 Jakub Jelinek <jakub@redhat.com>
2549
2550 * cp-ubsan.cc (cp_ubsan_instrument_vptr_p): Use
2551 flag_sanitize_trap & SANITIZE_VPTR instead of
2552 flag_sanitize_undefined_trap_on_error.
2553
25542022-06-17 Jakub Jelinek <jakub@redhat.com>
2555
2556 PR c++/106001
2557 * typeck.cc (build_x_shufflevector): Use fold_non_dependent_expr
2558 instead of maybe_constant_value.
2559
25602022-06-16 Nathan Sidwell <nathan@acm.org>
2561
2562 * decl2.cc (finish_objects): Add startp parameter, adjust.
2563 (generate_ctor_or_dtor_function): Detect empty fn, and don't
2564 generate unnecessary code. Remove objc startup here ...
2565 (c_parse_final_cleanyps): ... do it here.
2566
25672022-06-16 Martin Liska <mliska@suse.cz>
2568
2569 * decl2.cc (struct priority_map_traits): Remove unused param.
2570
25712022-06-15 Nathan Sidwell <nathan@acm.org>
2572
2573 * module.cc (module_state::write_readme): Use less confusing
2574 importable unit names.
2575
25762022-06-14 Nathan Sidwell <nathan@acm.org>
2577
2578 * cp-tree.h (fini_modules): Add has_inits parm.
2579 * decl2.cc (c_parse_final_cleanups): Check for
2580 inits, adjust fini_modules flags.
2581 * module.cc (module_state): Rename call_init_p to
2582 active_init_p.
2583 (module_state::write_config): Write active_init.
2584 (module_state::read_config): Read it.
2585 (module_determine_import_inits): Clear active_init_p
2586 of covered inits.
2587 (late_finish_module): Add has_init parm. Record it.
2588 (fini_modules): Adjust.
2589
25902022-06-13 Nathan Sidwell <nathan@acm.org>
2591
2592 * module.cc (module_state::write): Separate to ...
2593 (module_state::write_begin, module_state::write_end): ...
2594 these.
2595 (module_state::write_readme): Drop extensions parameter.
2596 (struct module_processing_cookie): Add more fields.
2597 (finish_module_processing): Adjust state writing call.
2598 (late_finish_module): Call write_end.
2599
26002022-06-10 Patrick Palka <ppalka@redhat.com>
2601
2602 PR c++/65328
2603 * decl.cc (typename_hasher::hash): Add extra overloads.
2604 Use iterative_hash_object instead of htab_hash_pointer.
2605 Hash TYPENAME_TYPE_FULLNAME instead of TYPE_IDENTIFIER.
2606 (build_typename_type): Use typename_hasher::hash.
2607 * pt.cc (spec_hasher::hash): Add two-parameter overload.
2608 Set comparing_specializations around the call to
2609 hash_tmpl_and_args.
2610 (iterative_hash_template_arg) <case TYPENAME_TYPE>:
2611 When comparing_specializations, hash the TYPE_CONTEXT
2612 and TYPENAME_TYPE_FULLNAME.
2613 (tsubst_function_decl): Use spec_hasher::hash instead of
2614 hash_tmpl_and_args.
2615 (tsubst_template_decl): Likewise.
2616 (tsubst_decl): Likewise.
2617
26182022-06-10 Patrick Palka <ppalka@redhat.com>
2619
2620 * pt.cc (instantiate_template): Don't substitute the context
2621 of the most general template if that of the partially
2622 instantiated template is already non-dependent.
2623
26242022-06-10 Patrick Palka <ppalka@redhat.com>
2625
2626 * pt.cc (lookup_template_class): Remove dead stores to
2627 context parameter. Don't substitute the context of the
2628 most general template if that of the partially instantiated
2629 template is already non-dependent. Check the specializations
2630 table again after completing the context of a nested dependent
2631 specialization.
2632 (tsubst_aggr_type) <case RECORD_TYPE>: Don't substitute
2633 TYPE_CONTEXT or pass it to lookup_template_class.
2634 (tsubst_decl) <case TYPE_DECL, case TYPE_DECL>: Avoid substituting
2635 the TREE_TYPE for DECL_SELF_REFERENCE_P. Avoid template argument
2636 substitution or coercion in some cases.
2637
26382022-06-10 Nathan Sidwell <nathan@acm.org>
2639
2640 * cp-tree.h (fini_modules): Add some parameters.
2641 (finish_module_processing): Return an opaque pointer.
2642 * decl2.cc (c_parse_final_cleanups): Propagate a cookie from
2643 finish_module_processing to fini_modules.
2644 * module.cc (struct module_processing_cookie): New.
2645 (finish_module_processing): Return a heap-allocated cookie.
2646 (late_finish_module): New. Finish out the module writing.
2647 (fini_modules): Adjust.
2648
26492022-06-10 Nathan Sidwell <nathan@acm.org>
2650
2651 * cp-tree.h (module_has_import_init): Rename to ...
2652 (module_determined_import_inits): ... here.
2653 * decl2.cc (start_objects): Do not handle module initializers
2654 here.
2655 (c_parse_final_cleanups): Generate a separate module
2656 initializer calling function and add it to the list. Shrink
2657 the c-lang region.
2658 * module.cc (num_init_calls_needed): Delete.
2659 (module_has_import_init): Rename to ...
2660 (module_determined_import_inits): ... here. Do the
2661 calculation here ...
2662 (finish_module_processing): ... rather than here.
2663 (module_add_import_initializers): Reformat.
2664
26652022-06-09 Jakub Jelinek <jakub@redhat.com>
2666
2667 PR c++/105871
2668 * constexpr.cc (cxx_eval_bit_field_ref): For BIT_FIELD_REF with
2669 non-integral result type use fold_ternary too like for BIT_FIELD_REFs
2670 from VECTOR_CST. If fold_ternary returns NULL, diagnose non-constant
2671 expression, set *non_constant_p and return t, instead of returning
2672 NULL.
2673
26742022-06-09 Nathan Sidwell <nathan@acm.org>
2675
2676 * cp-tree.h (module_initializer_kind): Replace with ...
2677 (module_global_init_needed, module_has_import_inits): ...
2678 these.
2679 * decl2.cc (start_objects): Add has_body parm. Reorganize
2680 module initializer creation.
2681 (generate_ctor_or_dtor_function): Adjust.
2682 (c_parse_final_cleanups): Adjust.
2683 (vtv_start_verification_constructor_init_function): Adjust.
2684 * module.cc (module_initializer_kind): Replace with ...
2685 (module_global_init_needed, module_has_import_inits): ...
2686 these.
2687
26882022-06-08 Jason Merrill <jason@redhat.com>
2689
2690 PR c++/105852
2691 * decl.cc (duplicate_decls): Change non-templated friend
2692 check to an assert.
2693 * pt.cc (tsubst_function_decl): Don't set DECL_TEMPLATE_INFO
2694 on non-templated friends.
2695 (tsubst_friend_function): Adjust.
2696
26972022-06-08 Jason Merrill <jason@redhat.com>
2698
2699 PR c++/105852
2700 PR c++/105761
2701 * decl.cc (duplicate_decls): Avoid copying template info
2702 from non-templated friend even if newdecl isn't a definition.
2703 Correct handling of DECL_UNIQUE_FRIEND_P on templates.
2704 * pt.cc (non_templated_friend_p): New.
2705 * cp-tree.h (non_templated_friend_p): Declare it.
2706
27072022-06-08 Nathan Sidwell <nathan@acm.org>
2708
2709 * decl2.cc (struct priority_info_s, priority_info): Delete.
2710 (priority_map_traits, priority_map_t): New.
2711 (static_init_fini_fns): New.
2712 (INITIALIZE_P_IDENTIFIER, PRIORITY_IDENTIFIER): Delete.
2713 (initialize_p_decl, priority_decl): Delete.
2714 (ssdf_decls, priority_info_map): Delete.
2715 (start_static_storage_duration_function): Rename to ...
2716 (start_partial_init_fini_fn): ... here. Create a void arg fn.
2717 Add it to the slot in the appropriate static_init_fini_fns
2718 hash table.
2719 (finish_static_storage_duration_function): Rename to ...
2720 (finish_partial_init_fini_fn): ... here.
2721 (get_priority_info): Delete.
2722 (one_static_initialization_or_destruction): Assert not
2723 trivial dtor.
2724 (do_static_initialization_or_destruction): Rename to ...
2725 (emit_partial_init_fini_fn) ... here. Start & finish the fn.
2726 Simply init/fini each var.
2727 (partition_vars_for_init_fini): Partition vars according to
2728 priority and add to init and/or fini list.
2729 (generate_ctor_or_dtor_function): Start and finish the function.
2730 Do santitizer calls here.
2731 (generate_ctor_and_dtor_functions_for_priority): Delete.
2732 (c_parse_final_cleanups): Reimplement global init/fini
2733 processing.
2734
27352022-06-07 Jakub Jelinek <jakub@redhat.com>
2736
2737 * parser.cc (cp_parser_omp_clause_linear): Parse OpenMP 5.2
2738 style linear clause modifiers. Set
2739 OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER flag on the clauses when
2740 old style modifiers are used.
2741 * semantics.cc (finish_omp_clauses): Only reject linear clause
2742 with val modifier on simd or for if the old style modifiers are
2743 used.
2744
27452022-06-07 Roger Sayle <roger@nextmovesoftware.com>
2746
2747 PR c++/96442
2748 * decl.cc (start_enum): When emitting a "must be integral" error,
2749 set ENUM_UNDERLYING_TYPE to integer_type_node, to avoid an ICE
2750 downstream in build_enumeration.
2751
27522022-06-06 Patrick Palka <ppalka@redhat.com>
2753
2754 PR c++/53164
2755 PR c++/105848
2756 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Look through an
2757 ADDR_EXPR callee when calling mark_used.
2758
27592022-06-04 Marek Polacek <polacek@redhat.com>
2760
2761 PR c++/102399
2762 PR c++/69585
2763 * parser.cc (cp_parser_attributes_opt): Accept GNU attributes
2764 followed by [[]] attributes and vice versa.
2765
27662022-06-03 Patrick Palka <ppalka@redhat.com>
2767
2768 PR c++/105756
2769 * typeck.cc (cp_build_binary_op): Don't fold operands
2770 when c_inhibit_evaluation_warnings.
2771
27722022-06-03 Jason Merrill <jason@redhat.com>
2773
2774 PR c++/105761
2775 * decl.cc (duplicate_decls): Don't copy DECL_TEMPLATE_INFO
2776 from a hidden friend.
2777
27782022-06-03 Patrick Palka <ppalka@redhat.com>
2779
2780 PR c++/105637
2781 * tree.cc (maybe_dummy_object): When returning a dummy
2782 object, respect the cv-quals of 'this' if available.
2783
27842022-06-03 Patrick Palka <ppalka@redhat.com>
2785
2786 PR c++/100374
2787 * pt.cc (determine_specialization): Compare overall constraints
2788 not just the trailing constraints.
2789 (tsubst_each_template_parm_constraints): Define.
2790 (tsubst_friend_function): Use it.
2791 (tsubst_friend_class): Use it.
2792 (tsubst_template_parm): Don't substitute TEMPLATE_PARM_CONSTRAINTS.
2793
27942022-06-03 Patrick Palka <ppalka@redhat.com>
2795
2796 PR c++/105797
2797 * pt.cc (for_each_template_parm_r) <case FUNCTION_DECL, VAR_DECL>:
2798 Don't walk DECL_CONTEXT.
2799 <case PARM_DECL>: Likewise. Walk TREE_TYPE.
2800 <case CONST_DECL>: Simplify.
2801 (any_template_parm_r) <case PARM_DECL>: Don't walk TREE_TYPE.
2802
28032022-06-02 Marek Polacek <polacek@redhat.com>
2804
2805 * constexpr.cc (potential_constant_expression_1): Treat
2806 {,VEC_}NEW_EXPR and {,VEC_}DELETE_EXPRas potentially constant in C++20.
2807
28082022-06-02 Marek Polacek <polacek@redhat.com>
2809
2810 PR c++/105803
2811 * pt.cc (value_dependent_expression_p): Handle {,VEC_}NEW_EXPR
2812 in the switch.
2813
28142022-06-02 David Malcolm <dmalcolm@redhat.com>
2815
2816 * cp-lang.cc (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
2817 (cp_get_sarif_source_language): New.
2818
28192022-06-02 Jason Merrill <jason@redhat.com>
2820
2821 PR c++/105795
2822 * constexpr.cc (init_subob_ctx): Clear ctx->ctor for empty subob.
2823 (cxx_eval_store_expression): Likewise.
2824 (cxx_eval_bare_aggregate): Handle null ctx->ctor.
2825
28262022-06-02 Jason Merrill <jason@redhat.com>
2827
2828 PR c++/105795
2829 * constexpr.cc (cxx_eval_bare_aggregate): Always call
2830 init_subob_ctx.
2831
28322022-06-01 Jason Merrill <jason@redhat.com>
2833
2834 PR c++/105734
2835 * parser.cc (cp_parser_postfix_dot_deref_expression): Use typeof
2836 if the expression has auto type.
2837
28382022-06-01 Jason Merrill <jason@redhat.com>
2839
2840 PR c++/105779
2841 * call.cc (resolve_args): Call mark_single_function here.
2842 * pt.cc (unify_one_argument): Not here.
2843
28442022-06-01 Nathan Sidwell <nathan@acm.org>
2845
2846 * decl2.cc (fix_temporary_vars_context_r): Use data argument
2847 for new context.
2848 (one_static_initialization_or_destruction): Adjust tree walk
2849 call. Refactor guard generation.
2850
28512022-06-01 Nathan Sidwell <nathan@acm.org>
2852
2853 * decl2.cc (ssdf_decl): Delete global.
2854 (start_static_storage_duration_function): Use some RAII.
2855 (do_static_initialization_or_destruction): Likewise.
2856 (c_parse_final_cleanups): Likewise. Avoid rechecking 'vars'.
2857
28582022-06-01 Nathan Sidwell <nathan@acm.org>
2859
2860 * decl2.cc (start_objects): Replace 'method_type' parameter
2861 with 'initp' boolean, rename and retype 'priority' parameter.
2862 (finish_objects): Likewise. Do not expand here.
2863 (one_static_initialization_or_destruction): Move 'initp'
2864 parameter first.
2865 (do_static_initialization_or_destruction): Likewise.
2866 (generate_ctor_or_dtor_function): Rename 'initp' parameter.
2867 Adjust start_objects/finish_obects calls and expand here.
2868 (generate_ctor_and_dtor_functions_for_priority): Adjust calls.
2869 (c_parse_final_cleanups): Likewise.
2870 (vtv_start_verification_constructor_init): Adjust.
2871 (vtv_finish_verification_constructor_init): Use finish_objects.
2872
28732022-05-31 Patrick Palka <ppalka@redhat.com>
2874
2875 PR c++/105758
2876 * call.cc (build_over_call): Use z_candidate::conversion_path
2877 and ::access_path instead of TYPE_BINFO when building the
2878 BASELINK for the templated form.
2879
28802022-05-31 Patrick Palka <ppalka@redhat.com>
2881
2882 * parser.cc: Use auto_timevar instead of timevar_push/pop.
2883 Remove wrapper functions.
2884 * pt.cc: Likewise.
2885
28862022-05-31 Patrick Palka <ppalka@redhat.com>
2887
2888 * cp-tree.h (cp_build_qualified_type_real): Rename to ...
2889 (cp_build_qualified_type): ... this. Give its last parameter
2890 a default argument. Remove macro of the same name.
2891 * decl.cc (grokdeclarator): Adjust accordingly.
2892 * pt.cc (tsubst_aggr_type): Likewise.
2893 (rebuild_function_or_method_type): Likewise.
2894 (tsubst): Likewise.
2895 (maybe_dependent_member_ref): Likewise.
2896 (unify): Likewise.
2897 * tree.cc (cp_build_qualified_type_real): Rename to ...
2898 (cp_build_qualified_type): ... this. Adjust accordingly.
2899
29002022-05-31 Jason Merrill <jason@redhat.com>
2901
2902 * Make-lang.in (c++.tags): Just look at *.cc.
2903
29042022-05-31 Patrick Palka <ppalka@redhat.com>
2905
2906 * cp-tree.h (comp_template_args): Change return type to bool.
2907 * pt.cc (comp_template_args): Document default arguments.
2908 Change return type to bool and adjust returns accordingly.
2909
29102022-05-31 Patrick Palka <ppalka@redhat.com>
2911
2912 * decl.cc (grokvardecl): Use current_template_constraints.
2913 (grokdeclarator): Likewise.
2914 (xref_tag): Likewise.
2915 * semantics.cc (finish_template_template_parm): Likewise.
2916
29172022-05-31 Jakub Jelinek <jakub@redhat.com>
2918
2919 * parser.cc (OMP_SCOPE_CLAUSE_MASK): Add firstprivate and allocate
2920 clauses.
2921
29222022-05-30 Marek Polacek <polacek@redhat.com>
2923
2924 PR c++/99080
2925 * pt.cc (type_dependent_expression_p): Assert !TYPE_P.
2926 * semantics.cc (finish_id_expression_1): Handle UNBOUND_CLASS_TEMPLATE
2927 specifically.
2928
29292022-05-28 Jakub Jelinek <jakub@redhat.com>
2930
2931 * parser.cc (handle_omp_declare_target_clause): If OMP_CLAUSE_LINK was
2932 seen first, use "%<to%>" or "%<enter%>" depending on
2933 OMP_CLAUSE_ENTER_TO of the current clause, otherwise use
2934 "%<to%> or %<enter%>" wording.
2935
29362022-05-28 Jason Merrill <jason@redhat.com>
2937
2938 PR c++/105652
2939 * pt.cc (tsubst_lambda_expr): Don't let a namespace-scope lambda
2940 instantiate into a class-scope lambda.
2941
29422022-05-27 Marek Polacek <polacek@redhat.com>
2943
2944 PR c++/105725
2945 * parser.cc (class_decl_loc_t::add): Check CLASS_TYPE_P.
2946
29472022-05-27 Jakub Jelinek <jakub@redhat.com>
2948
2949 * parser.cc (cp_parser_omp_clause_name): Parse enter clause.
2950 (cp_parser_omp_all_clauses): For to clause on declare target, use
2951 OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of
2952 OMP_CLAUSE_TO_DECLARE clause. Handle PRAGMA_OMP_CLAUSE_ENTER.
2953 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause.
2954 (cp_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of
2955 OMP_CLAUSE_TO_DECLARE.
2956 * semantics.cc (finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead
2957 of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause
2958 name in diagnostics instead of
2959 omp_clause_code_name[OMP_CLAUSE_CODE (c)].
2960
29612022-05-26 Marek Polacek <polacek@redhat.com>
2962
2963 PR c++/105569
2964 * typeck.cc (warn_for_null_address): Improve the warning when
2965 the POINTER_PLUS_EXPR's base is of reference type.
2966
29672022-05-26 Patrick Palka <ppalka@redhat.com>
2968
2969 PR c++/96363
2970 * decl.cc (shadow_tag): Use the return value of
2971 maybe_process_partial_specialization.
2972 * parser.cc (cp_parser_single_declaration): Call shadow_tag
2973 before associate_classtype_constraints.
2974 * pt.cc (maybe_new_partial_specialization): Change return type
2975 to bool. Take 'type' argument by mutable reference. Set 'type'
2976 to point to the correct constrained specialization when
2977 appropriate.
2978 (maybe_process_partial_specialization): Adjust accordingly.
2979
29802022-05-25 Marek Polacek <polacek@redhat.com>
2981
2982 PR c++/96637
2983 * cp-tree.h (attr_chainon): Declare.
2984 * decl.cc (start_decl): Use attr_chainon.
2985 (grokdeclarator): Likewise.
2986 * parser.cc (cp_parser_statement): No longer static.
2987
29882022-05-25 Jason Merrill <jason@redhat.com>
2989
2990 PR c++/105655
2991 * pt.cc (build_template_decl): Add assert.
2992 (tsubst_function_decl): Don't return a template.
2993
29942022-05-25 Jason Merrill <jason@redhat.com>
2995
2996 PR c++/105623
2997 * decl2.cc (mark_used): Copy type from fn to BASELINK.
2998 * pt.cc (unify_one_argument): Call mark_single_function.
2999
30002022-05-25 Jason Merrill <jason@redhat.com>
3001
3002 * constexpr.cc (cxx_eval_call_expression): Check for
3003 heap vars in the result.
3004
30052022-05-25 Jason Merrill <jason@redhat.com>
3006
3007 * constexpr.cc (maybe_constant_init_1): Only pass false for
3008 strict when initializing a variable of static duration.
3009
30102022-05-25 Marek Polacek <polacek@redhat.com>
3011
3012 PR c++/100252
3013 * typeck2.cc (potential_prvalue_result_of): New.
3014 (replace_placeholders_for_class_temp_r): New.
3015 (digest_nsdmi_init): Call it.
3016
30172022-05-24 Jason Merrill <jason@redhat.com>
3018
3019 * constexpr.cc (cxx_fold_indirect_ref): Add default arg.
3020 (cxx_eval_call_expression): Call it.
3021 (cxx_fold_indirect_ref_1): Handle null empty_base.
3022
30232022-05-24 Jason Merrill <jason@redhat.com>
3024
3025 * constexpr.cc (enum value_cat): New. Change all 'lval' parameters
3026 from int to value_cat. Change most false to vc_prvalue, most true
3027 to vc_glvalue, cases where the return value is ignored to
3028 vc_discard.
3029 (cxx_eval_statement_list): Only vc_prvalue for stmt-expr result.
3030 (cxx_eval_store_expression): Only build _REF for vc_glvalue.
3031 (cxx_eval_array_reference, cxx_eval_component_reference)
3032 (cxx_eval_indirect_ref, cxx_eval_constant_expression): Likewise.
3033
30342022-05-24 Jason Merrill <jason@redhat.com>
3035
3036 PR c++/105622
3037 * constexpr.cc (cxx_eval_store_expression): Adjust assert.
3038 Use initialized_type.
3039
30402022-05-24 Patrick Palka <ppalka@redhat.com>
3041
3042 * cp-tree.h (any_template_arguments_need_structural_equality_p):
3043 Declare.
3044 * pt.cc (struct ctp_hasher): Define.
3045 (ctp_table): Define.
3046 (canonical_type_parameter): Use it.
3047 (process_template_parm): Set TYPE_CANONICAL for
3048 TEMPLATE_TEMPLATE_PARM too.
3049 (lookup_template_class_1): Remove now outdated comment for the
3050 any_template_arguments_need_structural_equality_p test.
3051 (tsubst) <case TEMPLATE_TEMPLATE_PARM, etc>: Don't specifically
3052 clear TYPE_CANONICAL for ttps. Set TYPE_CANONICAL on the
3053 substituted type later.
3054 (any_template_arguments_need_structural_equality_p): Return
3055 true for any_targ_node. Don't return true just because a
3056 template argument uses structural equality. Add comment for
3057 the PARM_DECL special case.
3058 (rewrite_template_parm): Set TYPE_CANONICAL on the rewritten
3059 parm's type later.
3060 * tree.cc (bind_template_template_parm): Set TYPE_CANONICAL
3061 when safe to do so.
3062 * typeck.cc (structural_comptypes) [check_alias]: Increment
3063 processing_template_decl before checking
3064 dependent_alias_template_spec_p.
3065
30662022-05-24 Jakub Jelinek <jakub@redhat.com>
3067
3068 PR c/105378
3069 * parser.cc (OMP_TASKWAIT_CLAUSE_MASK): Add nowait clause.
3070
30712022-05-20 David Malcolm <dmalcolm@redhat.com>
3072
3073 * cxx-pretty-print.h: Replace uses of "FINAL" and "OVERRIDE" with
3074 "final" and "override".
3075 * error.cc: Likewise.
3076
30772022-05-18 Marek Polacek <polacek@redhat.com>
3078
3079 PR c++/105634
3080 * call.cc (maybe_warn_class_memaccess): Avoid % by zero.
3081
30822022-05-17 Jason Merrill <jason@redhat.com>
3083
3084 PR c++/102307
3085 * decl.cc (check_initializer): Use build_cplus_new in case of
3086 constexpr failure.
3087
30882022-05-17 Jakub Jelinek <jakub@redhat.com>
3089
3090 * parser.cc (cp_parser_omp_clause_depend): Parse
3091 inoutset depend-kind.
3092 (cp_parser_omp_depobj): Likewise.
3093 * cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle
3094 OMP_CLAUSE_DEPEND_INOUTSET.
3095
30962022-05-16 Martin Liska <mliska@suse.cz>
3097
3098 * module.cc (depset::entity_kind_name): Use ARRAY_SIZE.
3099 * name-lookup.cc (get_std_name_hint): Likewise.
3100 * parser.cc (cp_parser_new): Likewise.
3101
31022022-05-16 Marcel Vollweiler <marcel@codesourcery.com>
3103
3104 * pt.cc (tsubst_omp_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR.
3105 * semantics.cc (finish_omp_clauses): Added template decl processing.
3106
31072022-05-15 Jason Merrill <jason@redhat.com>
3108
3109 PR c++/100502
3110 PR c++/58993
3111 * friend.cc (is_friend): Hidden friends count as members.
3112 * search.cc (friend_accessible_p): Likewise.
3113
31142022-05-15 Jason Merrill <jason@redhat.com>
3115
3116 * parser.cc (cp_parser_template_name): Look through
3117 injected-class-name.
3118
31192022-05-15 Jason Merrill <jason@redhat.com>
3120
3121 PR c++/105589
3122 PR c++/105191
3123 PR c++/92385
3124 * init.cc (build_value_init): Handle class in template.
3125
31262022-05-13 Nathan Sidwell <nathan@acm.org>
3127
3128 * mangle.cc (maybe_write_module): Check external linkage.
3129
31302022-05-13 Richard Biener <rguenther@suse.de>
3131
3132 * constexpr.cc: Remove gimple-fold.h include.
3133
31342022-05-12 Patrick Palka <ppalka@redhat.com>
3135
3136 * cp-tree.h (TMPL_ARGS_LEVEL): Assert LEVEL is 1 when
3137 TMPL_ARGS_HAVE_MULTIPLE_LEVELS is false.
3138 * pt.cc (try_class_unification): Correctly copy multidimensional
3139 targs. Free the copy of targs.
3140 (unify_pack_expansion): Fix level comparison.
3141
31422022-05-12 Nathan Sidwell <nathan@acm.org>
3143
3144 * parser.cc (cp_parser_linkage_specification): Implement
3145 global module attachment semantics.
3146
31472022-05-12 Jakub Jelinek <jakub@redhat.com>
3148
3149 * lex.cc (init_reswords): Register omp_all_memory as keyword
3150 if flag_openmp.
3151 * parser.cc (cp_parser_primary_expression): Diagnose uses of
3152 omp_all_memory in postfix expressions.
3153 (cp_parser_omp_var_list_no_open): Handle omp_all_memory in depend
3154 clause.
3155 * semantics.cc (finish_omp_clauses): Handle omp_all_memory
3156 keyword in depend clause as null_pointer_node, diagnose invalid
3157 uses.
3158 * pt.cc (tsubst_omp_clause_decl): Pass through omp_all_memory.
3159
31602022-05-11 Patrick Palka <ppalka@redhat.com>
3161
3162 * constraint.cc (tsubst_parameter_mapping): Convert loop over
3163 TREE_VEC into a range-based for loop using tree_vec_range.
3164 * pt.cc (iterative_hash_template_arg): Likewise.
3165 (template_parms_level_to_args): Likewise.
3166 (deducible_template_args): Likewise.
3167 (check_undeduced_parms): Likewise.
3168 (dependent_type_p_r): Likewise.
3169 (value_dependent_expression_p) <case NONTYPE_ARGUMENT_PACK>:
3170 Likewise.
3171 (dependent_template_arg_p): Likewise.
3172 * tree.cc (cp_walk_subtrees) <case NONTYPE_ARGUMENT_PACK>:
3173 Likewise.
3174
31752022-05-11 Jason Merrill <jason@redhat.com>
3176
3177 PR c++/105541
3178 * cp-tree.h (TMPL_ARGS_DEPTH): 0 for null args.
3179 * parser.cc (cp_parser_enclosed_template_argument_list):
3180 Use 0-length TREE_VEC for <>.
3181
31822022-05-11 Jason Merrill <jason@redhat.com>
3183
3184 PR bootstrap/105567
3185 * typeck.cc (check_return_expr): Don't mess with ctor return value
3186 while parsing a template.
3187
31882022-05-11 Nathan Sidwell <nathan@acm.org>
3189
3190 * cp-tree.h (DECL_MODULE_ATTACH_P): New.
3191 (struct lang_decl_base): Add module_attach_p flag.
3192 * decl.cc (duplicate_decls): Rework module redeclaration
3193 checking.
3194 * module.cc (trees_out::lang_decl_bools): Write attach flag.
3195 (trees_in::lang_decl_bools): ... and read it back.
3196 (trees_out::decl_value): Rework module attachment handling.
3197 (trees_in::decl_value): Rename local var to reflect meaning.
3198 (trees_in::key_mergeable): Likewise.
3199 (get_originating_module): Use DECL_MODULE_ATTACH_P. No need
3200 to special-case mangling.
3201 (module_may_redeclare): Reimplement.
3202 (set_originating_module): Deal with attachment.
3203 * name-lookup.cc (maybe_record_mergeable_decl): Deal with
3204 attachment.
3205 (mergeable_namespace_slots): Likewise.
3206 (do_nonmember_using_decl): Likewise.
3207 * name-lookup.h (mergeable_namespace_slots): Adjust parm
3208 meaning.
3209 * ptree.cc (cxx_print_decl): Adjust purview & attach printing.
3210
32112022-05-11 Martin Liska <mliska@suse.cz>
3212
3213 PR target/105355
3214 * lang-specs.h: Use Separate syntax.
3215
32162022-05-10 Patrick Palka <ppalka@redhat.com>
3217
3218 * coroutines.cc (instantiate_coro_traits): Adjust accordingly.
3219 * cp-tree.def: Remove mention of SET_PACK_EXPANSION_PATTERN.
3220 * cp-tree.h (SET_PACK_EXPANSION_PATTERN): Remove.
3221 (SET_ARGUMENT_PACK_ARGS): Remove.
3222 * module.cc (trees_in::tree_node): Adjust accordingly.
3223 * parser.cc (make_char_string_pack): Likewise.
3224 (make_string_pack): Likewise.
3225 * pt.cc (make_pack_expansion): Likewise.
3226 (template_parm_to_arg): Likewise.
3227 (coerce_template_parameter_pack): Likewise.
3228 (extract_fnparm_pack): Likewise.
3229 (extract_locals_r): Likewise.
3230 (make_argument_pack): Likewise.
3231 (tsubst_argument_pack): Likewise.
3232 (lookup_init_capture_pack): Likewise.
3233 (type_unification_real): Likewise.
3234 (unify_pack_expansion): Likewise.
3235 (tsubst_initializer_list): Likewise.
3236
32372022-05-10 Patrick Palka <ppalka@redhat.com>
3238
3239 * cp-tree.h (PACK_EXPANSION_CHECK): Define.
3240 (PACK_EXPANSION_PATTERN): Use PACK_EXPANSION_CHECK.
3241 (SET_PACK_EXPANSION_PATTERN): Likewise.
3242 (PACK_EXPANSION_PARAMETER_PACKS): Likewise.
3243 (PACK_EXPANSION_EXTRA_ARGS): Likewise.
3244 (PACK_EXPANSION_LOCAL_P): Likewise.
3245 (PACK_EXPANSION_SIZEOF_P): Likewise.
3246 (PACK_EXPANSION_AUTO_P): Likewise.
3247 (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): Likewise.
3248 (ARGUMENT_PACK_CHECK): Define.
3249 (ARGUMENT_PACK_ARGS): Use ARGUMENT_PACK_CHECK.
3250 (SET_ARGUMENT_PACK_ARGS): Likewise.
3251 * parser.cc (cp_parser_sizeof_pack): Check for error_mark_node
3252 before setting PACK_EXPANSION_SIZEOF_P.
3253
32542022-05-10 Nathan Sidwell <nathan@acm.org>
3255
3256 * cp-tree.h (enum module_kind_bits): Disambiguate purview,
3257 attach, named module vs header-unit.
3258 (global_purview_p, not_module_p): Delete.
3259 (named_module_p): New.
3260 (header_module_p, module_purview_p): Adjust.
3261 (module_attach_p, named_module_purview_p): New.
3262 * decl.cc (duplicate_decls): Adjust.
3263 * module.cc (declare_module, preprocessed_module): Adjust.
3264 * name-lookup.cc (init_global_partition): Adjust.
3265 (get_fixed_binding_slot, pushdecl): Adjust.
3266 * parser.cc (cp_parser_module_declaration): Adjust.
3267 (cp_parser_import_declaration, cp_parser_declaration): Adjust.
3268
32692022-05-10 Jason Merrill <jason@redhat.com>
3270
3271 PR c++/105529
3272 * decl.cc (maybe_return_this): Replace...
3273 (finish_constructor_body, finish_destructor_body): ...these.
3274 (finish_function_body): Call it.
3275 * optimize.cc (build_delete_destructor_body): Call it.
3276 * cp-tree.h (maybe_return_this): Declare.
3277
32782022-05-09 Marek Polacek <polacek@redhat.com>
3279
3280 PR c++/103539
3281 * parser.cc (cp_parser_statement): Constify the in_compound parameter.
3282 Create a modifiable copy. Allow labels at the end of compound
3283 statements.
3284
32852022-05-09 Patrick Palka <ppalka@redhat.com>
3286
3287 PR c++/105491
3288 * call.cc (field_in_pset): Adjust after next_initializable_field
3289 renaming.
3290 (build_aggr_conv): Likewise.
3291 (convert_like_internal): Likewise.
3292 (type_has_extended_temps): Likewise.
3293 * class.cc (default_init_uninitialized_part): Likewise.
3294 (finish_struct): Likewise.
3295 * constexpr.cc (cx_check_missing_mem_inits): Likewise.
3296 (reduced_constant_expression_p): Use next_subobject_field
3297 instead.
3298 * cp-gimplify.cc (get_source_location_impl_type): Adjust after
3299 next_initializable_field renaming.
3300 (fold_builtin_source_location): Likewise.
3301 * cp-tree.h (next_initializable_field): Rename to ...
3302 (next_aggregate_field): ... this.
3303 (next_subobject_field): Declare.
3304 * decl.cc (next_aggregate_field): Renamed from ...
3305 (next_initializable_field): ... this. Skip over vptr fields
3306 again.
3307 (next_subobject_field): Define.
3308 (reshape_init_class): Adjust after next_initializable_field
3309 renaming.
3310 * init.cc (build_value_init_noctor): Likewise.
3311 (emit_mem_initializers): Likewise.
3312 * lambda.cc (build_capture_proxy): Likewise.
3313 * method.cc (build_comparison_op): Likewise.
3314 * pt.cc (maybe_aggr_guide): Likewise.
3315 * tree.cc (structural_type_p): Likewise.
3316 * typeck2.cc (split_nonconstant_init_1): Likewise.
3317 (digest_init_r): Likewise.
3318
33192022-05-09 Nathan Sidwell <nathan@acm.org>
3320
3321 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Renamed from
3322 DECL_MODULE_ATTACHMENTS_P.
3323 (struct lane_decl_base): Rename module_attached_p to
3324 module_keyed_decls_p.
3325 (maybe_key_decl): Renamed from maybe_attach_decl.
3326 * lambda.cc (record_lambda_scope): Adjust.
3327 * lex.cc (cxx_dup_lang_specific_decl): Adjust.
3328 * module.cc (keyed_map_t, keyed_table): Renamed from attached_map_t,
3329 attached_table.
3330 (enum merge_kind): Rename MK_attached to MK_keyed.
3331 (trees_out::lang_decl_bools): Adjust.
3332 (trees_in::lang_decl_bools): Adjust.
3333 (trees_in::decl_value): Adjust.
3334 (trees_out::get_merge_kind): Adjust.
3335 (trees_out::key_mergeable): Adjust.
3336 (trees_in::key_mergeable): Adjust.
3337 (maybe_key_decl): Rename from maybe_attach_decl.
3338 (direct_import): Adjust.
3339 (fini_modules): Adjust.
3340
33412022-05-09 Martin Liska <mliska@suse.cz>
3342
3343 * cp-gimplify.cc (cp_genericize_r): Use {,UN}LIKELY
3344 macros.
3345 * parser.cc (cp_finalize_omp_declare_simd): Likewise.
3346 (cp_finalize_oacc_routine): Likewise.
3347
33482022-05-07 Marek Polacek <polacek@redhat.com>
3349
3350 PR c++/101833
3351 PR c++/47634
3352 * tree.cc (maybe_adjust_arg_pos_for_attribute): New.
3353
33542022-05-06 Jason Merrill <jason@redhat.com>
3355
3356 * error.cc (decl_to_string): Add show_color parameter.
3357 (subst_to_string): Likewise.
3358 (cp_printer): Pass it.
3359 (type_to_string): Set pp_show_color.
3360 (dump_function_name): Use "fnname" color.
3361 (dump_template_bindings): Use "targs" color.
3362 (struct colorize_guard): New.
3363 (reinit_cxx_pp): Clear pp_show_color.
3364
33652022-05-06 Jason Merrill <jason@redhat.com>
3366
3367 PR c++/105245
3368 PR c++/100111
3369 * constexpr.cc (cxx_eval_store_expression): Reorganize empty base
3370 handling.
3371
33722022-05-05 Marek Polacek <polacek@redhat.com>
3373
3374 PR c++/64679
3375 * parser.cc (cp_parser_parameter_declaration_clause): Maintain
3376 a vector of parameters that haven't been pushed yet. Push them at the
3377 end of a valid parameter-declaration-clause.
3378 (cp_parser_parameter_declaration_list): Take a new auto_vec parameter.
3379 Do not pushdecl while parsing tentatively when pushdecl-ing a parameter
3380 would result in a hard error.
3381 (cp_parser_cache_defarg): Adjust the call to
3382 cp_parser_parameter_declaration_list.
3383
33842022-05-05 Richard Biener <rguenther@suse.de>
3385
3386 * module.cc (trees_in::core_vals): Remove separate allocation
3387 for REAL_CST.
3388
33892022-05-04 Jason Merrill <jason@redhat.com>
3390
3391 PR c++/104470
3392 * pt.cc (maybe_dependent_member_ref): Handle types.
3393 (tsubst, tsubst_copy): Use it.
3394 (tsubst_aggr_type, instantiate_alias_template): Don't handle
3395 tf_dguide here.
3396
33972022-05-04 Patrick Palka <ppalka@redhat.com>
3398
3399 PR c++/105476
3400 * pt.cc (maybe_aggr_guide): Set processing_template_decl when
3401 partially instantiating the guide's parameter list.
3402
34032022-05-04 Marek Polacek <polacek@redhat.com>
3404
3405 PR c++/64679
3406 * parser.cc (cp_parser_init_declarator): Properly handle a series of
3407 operator() calls, they are not part of an init-declarator.
3408
34092022-05-04 Jason Merrill <jason@redhat.com>
3410
3411 * decl.cc (reshape_init): Shortcut already-reshaped init.
3412 (reshape_init_class): Assert not getting one here.
3413
34142022-05-04 Jason Merrill <jason@redhat.com>
3415
3416 * error.cc (cp_print_error_function): Use %qD.
3417 (function_category): Use %qD.
3418
34192022-05-04 Marek Polacek <polacek@redhat.com>
3420
3421 PR c++/105436
3422 * parser.cc (cp_parser_next_token_ends_template_argument_p): Don't
3423 return true for CPP_GREATER_EQ.
3424
34252022-05-04 Jason Merrill <jason@redhat.com>
3426
3427 * cp-tree.h (struct language_function): Remove x_cdtor_label.
3428 (cdtor_label, LABEL_DECL_CDTOR): Remove.
3429 * constexpr.cc (returns): Don't check LABEL_DECL_CDTOR.
3430 (cxx_eval_constant_expression): Don't call returns.
3431 * decl.cc (check_goto): Don't check cdtor_label.
3432 (start_preparsed_function): And don't set it.
3433 (finish_constructor_body, finish_destructor_body): Remove.
3434 (finish_function_body): Don't call them.
3435 * typeck.cc (check_return_expr): Handle cdtor_returns_this here.
3436 * semantics.cc (finish_return_stmt): Not here.
3437
34382022-05-04 Jakub Jelinek <jakub@redhat.com>
3439
3440 * lambda.cc: Include decl.h.
3441 (maybe_add_lambda_conv_op): Temporarily override deprecated_state to
3442 UNAVAILABLE_DEPRECATED_SUPPRESS.
3443
34442022-05-03 Patrick Palka <ppalka@redhat.com>
3445
3446 PR c++/105351
3447 * cp-tree.h (finish_non_static_data_member): Add defaulted
3448 complain parameter.
3449 * pt.cc (tsubst_copy_and_build): Pass complain to
3450 finish_non_static_data_member.
3451 * semantics.cc (finish_non_static_data_member): Respect complain
3452 parameter.
3453 (finish_qualified_id_expr): Pass complain to
3454 finish_non_static_data_member.
3455
34562022-05-02 Jason Merrill <jason@redhat.com>
3457
3458 * pt.cc (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Copy location.
3459 (do_auto_deduction): Use expr location.
3460
34612022-05-02 Jason Merrill <jason@redhat.com>
3462
3463 * class.cc (maybe_note_name_used_in_class): Note in all enclosing
3464 classes. Remember location of use.
3465 (note_name_declared_in_class): Adjust.
3466
34672022-05-02 Marek Polacek <polacek@redhat.com>
3468
3469 * cp-tree.h (uses_template_parms): Adjust declaration.
3470 * pt.cc (uses_template_parms): Return bool. Use a RAII sentinel.
3471
34722022-05-02 Richard Biener <rguenther@suse.de>
3473
3474 * constexpr.cc (fold_simple_1): Use CASE_CONVERT.
3475 * cp-gimplify.cc (cp_fold): Likewise.
3476 * pt.cc (tsubst_copy): Likewise.
3477
34782022-04-29 Jason Merrill <jason@redhat.com>
3479
3480 PR c++/91618
3481 PR c++/96604
3482 * friend.cc (do_friend): Call check_explicit_specialization here.
3483 * decl.cc (grokdeclarator): Not here.
3484 * decl2.cc (check_classfn): Or here.
3485
34862022-04-29 Jason Merrill <jason@redhat.com>
3487
3488 PR c++/104470
3489 * cp-tree.h (enum tsubst_flags): Add tf_dguide.
3490 * pt.cc (tsubst_aggr_type): Check it.
3491 (tsubst_baselink, tsubst_copy): Check it.
3492 (maybe_dependent_member_ref): Check it.
3493 (instantiate_alias_template): Handle it.
3494 (build_deduction_guide): Set it.
3495
34962022-04-29 Jason Merrill <jason@redhat.com>
3497
3498 PR c++/82980
3499 * lambda.cc (type_deducible_expression_p): Allow more types.
3500
35012022-04-29 Jason Merrill <jason@redhat.com>
3502
3503 * decl.cc (cp_finish_decl): Only consider auto for vars.
3504
35052022-04-29 Marek Polacek <polacek@redhat.com>
3506
3507 PR c++/67048
3508 * parser.cc (cp_parser_enum_specifier): Warn about empty unnamed enum
3509 only when it's followed by a semicolon.
3510
35112022-04-29 Jason Merrill <jason@redhat.com>
3512
3513 PR c++/80351
3514 * decl.cc (cp_finish_decl): Check completeness of deduced type.
3515
35162022-04-29 Jason Merrill <jason@redhat.com>
3517
3518 PR c++/102987
3519 * error.cc (dump_decl) [USING_DECL]: Respect flags.
3520
35212022-04-29 Jason Merrill <jason@redhat.com>
3522
3523 * error.cc (dump_decl): Check TFF_UNQUALIFIED_NAME.
3524
35252022-04-29 Jakub Jelinek <jakub@redhat.com>
3526
3527 PR c++/104319
3528 * parser.cc (cp_parser_template_argument): Treat >= like C++98 >>
3529 after a type id by setting maybe_type_id and aborting tentative
3530 parse.
3531 (cp_parser_enclosed_template_argument_list): Handle
3532 CPP_GREATER_EQ like misspelled CPP_GREATER CPP_RQ and
3533 CPP_RSHIFT_EQ like misspelled CPP_GREATER CPP_GREATER_EQ
3534 or CPP_RSHIFT CPP_EQ or CPP_GREATER CPP_GREATER CPP_EQ.
3535 (cp_parser_next_token_ends_template_argument_p): Return true
3536 also for CPP_GREATER_EQ and CPP_RSHIFT_EQ.
3537
35382022-04-29 Iain Sandoe <iain@sandoe.co.uk>
3539
3540 PR c++/105426
3541 * coroutines.cc (register_local_var_uses): Allow promotion of unnamed
3542 temporaries to coroutine frame copies.
3543
35442022-04-29 Jason Merrill <jason@redhat.com>
3545
3546 * semantics.cc (check_trait_type): Don't check completeness
3547 of element type of array of unknown bound.
3548
35492022-04-29 Jason Merrill <jason@redhat.com>
3550
3551 PR c++/102651
3552 PR c++/49387
3553 * rtti.cc (get_tinfo_decl_direct): Don't complete_type.
3554 (emit_tinfo_decl): Update tdesc type if needed.
3555
35562022-04-29 Zhao Wei Liew <zhaoweiliew@gmail.com>
3557
3558 PR c++/25689
3559 * call.cc (extract_call_expr): Return a NULL_TREE on failure
3560 instead of asserting.
3561 (build_new_method_call): Suppress -Wparentheses diagnostic for
3562 MODIFY_EXPR.
3563 * semantics.cc (is_assignment_op_expr_p): Add function to check
3564 if an expression is a call to an op= operator expression.
3565 (maybe_convert_cond): Handle the case of a op= operator expression
3566 for the -Wparentheses diagnostic.
3567
35682022-04-28 Patrick Palka <ppalka@redhat.com>
3569
3570 PR c++/105425
3571 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Treat
3572 DEPENDENT_OPERATOR_TYPE like an empty type.
3573
35742022-04-28 Iain Sandoe <iain@sandoe.co.uk>
3575
3576 PR c++/104051
3577 * coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
3578 non-target expression inputs.
3579
35802022-04-28 Iain Sandoe <iain@sandoe.co.uk>
3581
3582 PR c++/105301
3583 * coroutines.cc (coro_promise_type_found_p): Account for possible
3584 mutliple overloads of the promise return_value() method.
3585
35862022-04-28 Iain Sandoe <iain@sandoe.co.uk>
3587
3588 PR c++/105287
3589 * coroutines.cc (maybe_promote_temps): Ensure generated temporaries
3590 are added to the bind expr.
3591 (add_var_to_bind): Fix local var naming to use portable punctuation.
3592 (register_local_var_uses): Do not add synthetic names to unnamed
3593 temporaries.
3594
35952022-04-28 Nathan Sidwell <nathan@acm.org>
3596 Iain Sandoe <iain@sandoe.co.uk>
3597
3598 PR c++/103868
3599 * coroutines.cc (finish_co_await_expr): Do not process non-dependent
3600 coroutine expressions at template definition time.
3601 (finish_co_yield_expr): Likewise.
3602 (finish_co_return_stmt): Likewise.
3603
36042022-04-28 Marek Polacek <polacek@redhat.com>
3605
3606 PR c++/90107
3607 * parser.cc (cp_parser_class_specifier_1): Accept :: after a class
3608 definition.
3609
36102022-04-27 Jason Merrill <jason@redhat.com>
3611
3612 * tree.cc (strip_typedefs): Add default argument comments.
3613
36142022-04-27 Marek Polacek <polacek@redhat.com>
3615
3616 PR c++/105398
3617 * pt.cc (uses_template_parms): Return false for any NAMESPACE_DECL.
3618
36192022-04-26 Jason Merrill <jason@redhat.com>
3620
3621 PR c++/102629
3622 * pt.cc (gen_elem_of_pack_expansion_instantiation): Clear
3623 TEMPLATE_TYPE_PARAMETER_PACK on auto.
3624
36252022-04-26 Patrick Palka <ppalka@redhat.com>
3626
3627 PR c++/105386
3628 * semantics.cc (finish_decltype_type): Pass tf_decltype to
3629 instantiate_non_dependent_expr_sfinae.
3630
36312022-04-26 Jason Merrill <jason@redhat.com>
3632
3633 PR c++/104624
3634 * pt.cc (check_for_bare_parameter_packs): Check for lambda
3635 function parameter pack.
3636
36372022-04-26 Patrick Palka <ppalka@redhat.com>
3638
3639 PR c++/105289
3640 PR c++/86193
3641 * pt.cc (process_partial_specialization): Downgrade "partial
3642 specialization isn't more specialized" diagnostic from permerror
3643 to an on-by-default pedwarn.
3644 (unify) <case TEMPLATE_PARM_INDEX>: When substituting into the
3645 NTTP type a second time, use the original type not the
3646 substituted type.
3647
36482022-04-25 Marek Polacek <polacek@redhat.com>
3649
3650 PR c++/105353
3651 * typeck.cc (build_x_shufflevector): Use
3652 instantiation_dependent_expression_p except for the first two
3653 arguments.
3654
36552022-04-21 Marek Polacek <polacek@redhat.com>
3656
3657 * constexpr.cc (cxx_eval_logical_expression): Remove unused
3658 parameter.
3659 (cxx_eval_constant_expression) <case TRUTH_ANDIF_EXPR>,
3660 <case TRUTH_OR_EXPR>: Adjust calls to cxx_eval_logical_expression.
3661
36622022-04-21 Marek Polacek <polacek@redhat.com>
3663
3664 PR c++/105321
3665 * constexpr.cc (cxx_eval_logical_expression): Always pass false for lval
3666 to cxx_eval_constant_expression.
3667
36682022-04-20 Ed Catmur <ed@catmur.uk>
3669
3670 PR c++/104996
3671 * call.cc (compare_ics): When comparing list-initialization
3672 sequences, do not return early.
3673
36742022-04-19 Jakub Jelinek <jakub@redhat.com>
3675
3676 PR c++/105256
3677 * typeck2.cc (process_init_constructor_array,
3678 process_init_constructor_record, process_init_constructor_union): Move
3679 CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag from CONSTRUCTOR elements to the
3680 containing CONSTRUCTOR.
3681
36822022-04-15 Marek Polacek <polacek@redhat.com>
3683
3684 PR c++/105268
3685 * parser.cc (cp_parser_placeholder_type_specifier): Return
3686 error_mark_node when trying to build up a constrained parameter in
3687 a default argument.
3688
36892022-04-15 Jason Merrill <jason@redhat.com>
3690
3691 PR c++/102804
3692 * decl.cc (grokdeclarator): Drop typedef used with 'unsigned'.
3693
36942022-04-15 Jason Merrill <jason@redhat.com>
3695
3696 PR c++/102987
3697 * error.cc (dump_expr): Handle USING_DECL.
3698 [VIEW_CONVERT_EXPR]: Just look through location wrapper.
3699
37002022-04-14 Jason Merrill <jason@redhat.com>
3701
3702 PR c++/104646
3703 * constexpr.cc (maybe_save_constexpr_fundef): Don't do extra
3704 checks for defaulted ctors.
3705
37062022-04-14 Jason Merrill <jason@redhat.com>
3707
3708 PR c++/82980
3709 * lambda.cc (type_deducible_expression_p): New.
3710 (lambda_capture_field_type): Check it.
3711
37122022-04-14 Jason Merrill <jason@redhat.com>
3713
3714 PR c++/65211
3715 * pt.cc (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.
3716
37172022-04-14 Jason Merrill <jason@redhat.com>
3718
3719 PR c++/97219
3720 * name-lookup.cc (dependent_local_decl_p): New.
3721 * cp-tree.h (dependent_local_decl_p): Declare.
3722 * semantics.cc (finish_call_expr): Use it.
3723 * pt.cc (tsubst_arg_types): Also substitute default args
3724 for local externs.
3725
37262022-04-14 Jason Merrill <jason@redhat.com>
3727
3728 PR c++/101698
3729 * pt.cc (tsubst_baselink): Also check dependent optype.
3730
37312022-04-14 Jason Merrill <jason@redhat.com>
3732
3733 PR c++/101442
3734 * decl.cc (cp_finish_decl): Don't pass decl to push_cleanup.
3735 * init.cc (perform_member_init): Likewise.
3736 * semantics.cc (push_cleanup): Adjust comment.
3737
37382022-04-13 Jason Merrill <jason@redhat.com>
3739
3740 PR c++/105245
3741 PR c++/100111
3742 * constexpr.cc (cxx_eval_store_expression): Build a CONSTRUCTOR
3743 as needed in empty base handling.
3744
37452022-04-13 Jakub Jelinek <jakub@redhat.com>
3746
3747 PR c++/105233
3748 * decl2.cc (cp_check_const_attributes): For aligned attribute
3749 pass manifestly_const_eval=true to fold_non_dependent_expr.
3750
37512022-04-13 Marek Polacek <polacek@redhat.com>
3752
3753 PR c++/97296
3754 * call.cc (direct_reference_binding): strip_top_quals when creating
3755 a ck_qual.
3756
37572022-04-12 Jason Merrill <jason@redhat.com>
3758
3759 PR c++/104669
3760 * decl.cc (decls_match): Compare versions even if not recording.
3761 (duplicate_decls): Propagate attributes to alias.
3762 * decl2.cc (find_last_decl): Give up if versioned.
3763
37642022-04-12 Jason Merrill <jason@redhat.com>
3765
3766 PR c++/102071
3767 * init.cc (build_new_1): Check array_p for alignment.
3768
37692022-04-12 Patrick Palka <ppalka@redhat.com>
3770
3771 PR c++/103105
3772 * pt.cc (build_extra_args): Call preserve_args.
3773
37742022-04-12 Jason Merrill <jason@redhat.com>
3775
3776 PR c++/104142
3777 * decl.cc (check_initializer): Check TREE_SIDE_EFFECTS.
3778
37792022-04-12 Jason Merrill <jason@redhat.com>
3780
3781 PR c++/105223
3782 PR c++/92918
3783 * class.cc (finish_struct): Always using op=.
3784
37852022-04-11 Jason Merrill <jason@redhat.com>
3786
3787 PR c++/98249
3788 * call.cc (build_operator_new_call): Just look in ::.
3789
37902022-04-11 Alexandre Oliva <oliva@adacore.com>
3791
3792 * constexpr.cc (cxx_eval_call_expression): Disregard dtor
3793 result.
3794
37952022-04-11 Alexandre Oliva <oliva@adacore.com>
3796
3797 * semantics.cc (set_cleanup_locs): Propagate locus to call
3798 wrapped in cast-to-void.
3799
38002022-04-11 Jason Merrill <jason@redhat.com>
3801
3802 PR c++/100370
3803 * init.cc (warn_placement_new_too_small): Check deref.
3804
38052022-04-09 Jason Merrill <jason@redhat.com>
3806
3807 PR c++/105191
3808 PR c++/92385
3809 * tree.cc (build_vec_init_elt): Do {}-init for aggregates.
3810 * constexpr.cc (cxx_eval_vec_init): Only treat {} as value-init
3811 for non-aggregate types.
3812 (build_vec_init_expr): Also check constancy of explicit
3813 initializer elements.
3814
38152022-04-09 Jason Merrill <jason@redhat.com>
3816
3817 PR c++/91618
3818 PR c++/96604
3819 * name-lookup.cc (set_decl_namespace): Set
3820 DECL_IMPLICIT_INSTANTIATION if no non-template match.
3821 * pt.cc (check_explicit_specialization): Check it.
3822 * decl2.cc (check_classfn): Call it.
3823
38242022-04-07 Patrick Palka <ppalka@redhat.com>
3825
3826 PR c++/99479
3827 * name-lookup.cc (name_lookup::using_queue): Change to an
3828 auto_vec (with 16 elements of internal storage).
3829 (name_lookup::queue_namespace): Change return type to void,
3830 take queue parameter by reference and adjust function body
3831 accordingly.
3832 (name_lookup::do_queue_usings): Inline into ...
3833 (name_lookup::queue_usings): ... here. As in queue_namespace.
3834 (name_lookup::search_unqualified): Don't make queue static,
3835 remove length variable, and adjust function body accordingly.
3836
38372022-04-07 Jakub Jelinek <jakub@redhat.com>
3838
3839 PR tree-optimization/102586
3840 * cp-objcp-common.h (cp_classtype_as_base): Declare.
3841 (LANG_HOOKS_CLASSTYPE_AS_BASE): Redefine.
3842 * cp-objcp-common.cc (cp_classtype_as_base): New function.
3843
38442022-04-07 Jason Merrill <jason@redhat.com>
3845
3846 PR c++/101051
3847 * decl.cc (grokdeclarator): Reject conversion with trailing return
3848 sooner.
3849
38502022-04-07 Jason Merrill <jason@redhat.com>
3851
3852 PR c++/101717
3853 * lambda.cc (lambda_expr_this_capture): Check all enclosing
3854 lambdas for completeness.
3855
38562022-04-07 Jason Merrill <jason@redhat.com>
3857
3858 PR c++/105187
3859 * typeck2.cc (store_init_value): Allow TREE_HAS_CONSTRUCTOR for
3860 vectors.
3861
38622022-04-06 Jakub Jelinek <jakub@redhat.com>
3863
3864 PR c++/104668
3865 * decl2.cc (splice_template_attributes): Return NULL if *p is
3866 error_mark_node.
3867 (cplus_decl_attributes): Return early if attributes is
3868 error_mark_node. Don't check that later.
3869
38702022-04-06 Patrick Palka <ppalka@redhat.com>
3871
3872 PR c++/105143
3873 * pt.cc (do_class_deduction): Check complain before attempting
3874 to issue a -Wctad-maybe-unsupported warning.
3875
38762022-04-06 Jason Merrill <jason@redhat.com>
3877
3878 PR c++/104702
3879 * init.cc (build_vec_init): Use a reference for the result.
3880
38812022-04-06 Jason Merrill <jason@redhat.com>
3882
3883 PR c++/100608
3884 * name-lookup.cc (check_local_shadow): Use -Wshadow=local
3885 if exactly one of 'old' and 'decl' is a type.
3886
38872022-04-05 Jason Merrill <jason@redhat.com>
3888
3889 PR c++/103852
3890 DR 1286
3891 * pt.cc (do_class_deduction): Pedwarn for renaming alias in C++17.
3892
38932022-04-05 Jason Merrill <jason@redhat.com>
3894
3895 PR c++/101677
3896 * name-lookup.h (struct cp_binding_level): Add requires_expression
3897 bit-field.
3898 * parser.cc (cp_parser_requires_expression): Set it.
3899 (synthesize_implicit_template_parm): Check it.
3900
39012022-04-04 Jason Merrill <jason@redhat.com>
3902
3903 PR c++/101894
3904 * decl.cc (duplicate_decls): Copy DECL_FRIEND_CONTEXT.
3905
39062022-04-04 Jason Merrill <jason@redhat.com>
3907
3908 PR c++/103852
3909 DR 1286
3910 * pt.cc (get_underlying_template): Compare default template args.
3911
39122022-04-03 Benno Evers <benno.evers@tenzir.com>
3913 Iain Sandoe <iain@sandoe.co.uk>
3914
3915 PR c++/103328
3916 * coroutines.cc (morph_fn_to_coro): Reset
3917 current_binding_level->blocks.
3918
39192022-04-01 Jason Merrill <jason@redhat.com>
3920
3921 Revert:
3922 2022-03-31 Jason Merrill <jason@redhat.com>
3923
3924 PR c++/96645
3925 * parser.cc (cp_parser_early_parsing_nsdmi): New.
3926 (cp_parser_member_declaration): Call it.
3927
39282022-04-01 Jason Merrill <jason@redhat.com>
3929
3930 Revert:
3931 2022-03-24 Jason Merrill <jason@redhat.com>
3932
3933 PR c++/96645
3934 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
3935 * class.cc (type_has_default_ctor_to_be_synthesized): New.
3936 (type_has_non_user_provided_default_constructor_1): Support it.
3937 (type_has_non_user_provided_default_constructor): Now a wrapper.
3938 * method.cc (complain_about_unparsed_dmi): New.
3939 (constructible_expr): Call it.
3940
39412022-04-01 Patrick Palka <ppalka@redhat.com>
3942
3943 PR c++/105110
3944 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Drop cv-quals from
3945 the argument type of an NTTP before deducing from it.
3946
39472022-03-31 Jason Merrill <jason@redhat.com>
3948
3949 PR c++/96645
3950 * parser.cc (cp_parser_early_parsing_nsdmi): New.
3951 (cp_parser_member_declaration): Call it.
3952
39532022-03-30 Patrick Palka <ppalka@redhat.com>
3954
3955 PR c++/100474
3956 * constraint.cc (diagnose_trait_expr): Handle all remaining
3957 traits appropriately. Remove default case.
3958
39592022-03-30 Marek Polacek <polacek@redhat.com>
3960
3961 PR c++/93280
3962 PR c++/104583
3963 * init.cc (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor.
3964
39652022-03-30 Jakub Jelinek <jakub@redhat.com>
3966
3967 PR c++/105092
3968 * pt.cc (tsubst_omp_clause_decl): When handling iterators, set
3969 DECL_CONTEXT of the iterator var to current_function_decl and
3970 call pushdecl.
3971
39722022-03-30 Jakub Jelinek <jakub@redhat.com>
3973
3974 PR c++/105061
3975 * parser.cc (cp_parser_template_introduction): If member_p, temporarily
3976 clear parser->colon_corrects_to_scope_p around tentative parsing of
3977 nested name specifier.
3978
39792022-03-28 Jason Merrill <jason@redhat.com>
3980
3981 * pt.cc (determine_specialization): Add comment.
3982
39832022-03-28 Patrick Palka <ppalka@redhat.com>
3984
3985 PR c++/105067
3986 * pt.cc (finish_concept_definition): Check that a concept is
3987 declared with exactly one template parameter list.
3988
39892022-03-28 Patrick Palka <ppalka@redhat.com>
3990
3991 PR c++/105064
3992 * constraint.cc (maybe_substitute_reqs_for): Don't assume
3993 DECL_TEMPLATE_INFO is available.
3994
39952022-03-28 Jason Merrill <jason@redhat.com>
3996
3997 PR c++/105003
3998 PR c++/104008
3999 PR c++/102869
4000 * pt.cc (complex_alias_template_r): walk_tree callback, replacing
4001 uses_all_template_parms_r, complex_pack_expansion_r.
4002 (complex_alias_template_p): Adjust.
4003 * tree.cc (strip_typedefs): Revert r12-7710 change.
4004
40052022-03-28 Jason Merrill <jason@redhat.com>
4006
4007 PR c++/102071
4008 * init.cc (build_new_1): Include cookie in alignment. Omit
4009 constexpr wrapper from alloc_call.
4010
40112022-03-28 Jason Merrill <jason@redhat.com>
4012
4013 PR c++/103291
4014 * name-lookup.cc (push_local_extern_decl_alias): Call
4015 determine_visibility.
4016
40172022-03-28 Jason Merrill <jason@redhat.com>
4018
4019 PR c++/102123
4020 * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting
4021 a type template reference.
4022
40232022-03-28 Jason Merrill <jason@redhat.com>
4024
4025 PR c++/103968
4026 * pt.cc (value_dependent_expression_p): Check
4027 has_value_dependent_address for conversion to reference.
4028
40292022-03-28 Jason Merrill <jason@redhat.com>
4030
4031 PR c++/103943
4032 * pt.cc (tsubst_qualified_id): Handle getting SCOPE_REF from
4033 tsubst_baselink.
4034 (instantiation_dependent_scope_ref_p): Check dependent_scope_p.
4035
40362022-03-28 Jason Merrill <jason@redhat.com>
4037
4038 PR c++/102045
4039 * call.cc (make_base_init_ok): Call make_used.
4040
40412022-03-28 Jason Merrill <jason@redhat.com>
4042
4043 PR c++/104847
4044 * mangle.cc (write_expression): Don't write a union designator when
4045 undigested.
4046
40472022-03-28 Jason Merrill <jason@redhat.com>
4048
4049 PR c++/99445
4050 PR c++/103769
4051 * tree.cc (strip_typedefs): Use build_distinct_type_copy.
4052
40532022-03-26 Patrick Palka <ppalka@redhat.com>
4054
4055 PR c++/105050
4056 * constexpr.cc (potential_constant_expression_1) <case IF_STMT>:
4057 Clarify error message when a if-stmt is non-constant because its
4058 branches are non-constant.
4059
40602022-03-26 Patrick Palka <ppalka@redhat.com>
4061
4062 PR c++/103455
4063 * call.cc (add_builtin_candidate) <case MEMBER_REF>: Test
4064 CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
4065
40662022-03-26 Jakub Jelinek <jakub@redhat.com>
4067
4068 * parser.cc (cp_parser_postfix_expression)
4069 <case RID_BILTIN_CONVERTVECTOR, case RID_BUILTIN_BIT_CAST>: Don't
4070 return cp_build_{vec,convert,bit_cast} result right away, instead
4071 set postfix_expression to it and break.
4072
40732022-03-25 Marek Polacek <polacek@redhat.com>
4074
4075 PR c++/104944
4076 * typeck.cc (cxx_sizeof_or_alignof_type): Diagnose alignof(void).
4077 (cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with
4078 complain == true.
4079
40802022-03-24 Marek Polacek <polacek@redhat.com>
4081
4082 PR c++/104284
4083 * decl.cc (check_initializer): Don't call build_aggr_init in
4084 a template.
4085
40862022-03-24 Jason Merrill <jason@redhat.com>
4087
4088 PR c++/96645
4089 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
4090 * class.cc (type_has_default_ctor_to_be_synthesized): New.
4091 (type_has_non_user_provided_default_constructor_1): Support it.
4092 (type_has_non_user_provided_default_constructor): Now a wrapper.
4093 * method.cc (complain_about_unparsed_dmi): New.
4094 (constructible_expr): Call it.
4095
40962022-03-24 Marek Polacek <polacek@redhat.com>
4097
4098 PR c++/102990
4099 * typeck2.cc (massage_init_elt): Avoid folding CONSTRUCTORs.
4100
41012022-03-24 Patrick Palka <ppalka@redhat.com>
4102
4103 PR c++/104620
4104 * call.cc (build_over_call): Use cxx_constant_value_sfinae
4105 instead of cxx_constant_value to evaluate a consteval call.
4106 * constexpr.cc (cxx_constant_value_sfinae): Add decl parameter
4107 and pass it to cxx_eval_outermost_constant_expr.
4108 * cp-tree.h (cxx_constant_value_sfinae): Add decl parameter.
4109 * pt.cc (fold_targs_r): Pass NULL_TREE as decl parameter to
4110 cxx_constant_value_sfinae.
4111
41122022-03-24 Jakub Jelinek <jakub@redhat.com>
4113
4114 PR c++/104994
4115 * constexpr.cc (cxx_eval_constant_expression): Don't diagnose passing
4116 through extern thread_local declarations. Change wording from
4117 declaration to definition.
4118 (potential_constant_expression_1): Don't diagnose extern thread_local
4119 declarations. Change wording from declared to defined.
4120 * decl.cc (start_decl): Likewise.
4121
41222022-03-23 Jason Merrill <jason@redhat.com>
4123
4124 PR c++/103337
4125 * decl.cc (reshape_single_init): New.
4126 (reshape_init_class): Use it.
4127
41282022-03-23 Jason Merrill <jason@redhat.com>
4129
4130 PR c++/105006
4131 * name-lookup.cc (lookup_using_decl): Check that scope is
4132 a dependent type before looking for dependent using.
4133
41342022-03-23 Jason Merrill <jason@redhat.com>
4135
4136 PR c++/105006
4137 * name-lookup.cc (lookup_using_decl): Set DECL_DEPENDENT_P if lookup
4138 finds a dependent using.
4139
41402022-03-21 Jason Merrill <jason@redhat.com>
4141
4142 PR c++/58646
4143 * init.cc (build_vec_init): Check for vla element type.
4144
41452022-03-21 Jason Merrill <jason@redhat.com>
4146
4147 PR c++/103337
4148 PR c++/102740
4149 PR c++/103299
4150 PR c++/102538
4151 * decl.cc (reshape_init_class): Avoid looking for designator
4152 after we found it.
4153 (reshape_init_r): Keep looking for designator.
4154
41552022-03-21 Jason Merrill <jason@redhat.com>
4156
4157 PR c++/101767
4158 * decl.cc (reshape_init_class): Back out of anon struct
4159 if a designator doesn't match.
4160
41612022-03-18 Jason Merrill <jason@redhat.com>
4162
4163 PR c++/92918
4164 PR c++/104476
4165 * class.cc (add_method): Avoid adding the same used function twice.
4166 (handle_using_decl): Don't add_method.
4167 (finish_struct): Don't using op= if we have one already.
4168 (maybe_push_used_methods): New.
4169 * semantics.cc (finish_member_declaration): Call it.
4170 * name-lookup.cc (diagnose_name_conflict): No longer static.
4171 (push_class_level_binding): Revert 92918 patch, limit
4172 to dependent using.
4173 * cp-tree.h: Adjust.
4174
41752022-03-18 Jakub Jelinek <jakub@redhat.com>
4176
4177 PR c++/104568
4178 * init.cc (build_new_constexpr_heap_type): Remove FULL_SIZE
4179 argument and its handling, instead add ITYPE2 argument. Only
4180 support COOKIE_SIZE != NULL.
4181 (build_new_1): If size is 0, change it to 0 * outer_nelts if
4182 outer_nelts is non-NULL. Pass type rather than elt_type to
4183 maybe_wrap_new_for_constexpr.
4184 * constexpr.cc (build_new_constexpr_heap_type): New function.
4185 (cxx_eval_constant_expression) <case CONVERT_EXPR>:
4186 If elt_size is zero sized type, try to recover outer_nelts from
4187 the size argument to operator new/new[] and pass that as
4188 arg_size to build_new_constexpr_heap_type. Pass ctx,
4189 non_constant_p and overflow_p to that call too.
4190
41912022-03-18 Marek Polacek <polacek@redhat.com>
4192
4193 PR c++/104008
4194 * tree.cc (strip_typedefs): Don't strip an alias template when
4195 doing so would result in losing a parameter pack.
4196
41972022-03-16 Patrick Palka <ppalka@redhat.com>
4198
4199 * search.cc (lookup_member): Simplify by handling all values
4200 of protect together in the ambiguous case. Don't modify protect.
4201
42022022-03-16 Patrick Palka <ppalka@redhat.com>
4203
4204 PR c++/96780
4205 * cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls to
4206 std::move/forward and other cast-like functions into simple
4207 casts.
4208
42092022-03-15 Patrick Palka <ppalka@redhat.com>
4210
4211 PR c++/103177
4212 * search.cc (lookup_field_info::errstr): Remove this data
4213 member.
4214 (lookup_field_r): Don't set errstr.
4215 (lookup_member): Check ambiguity before checking access.
4216 Simplify accordingly after errstr removal. Exit early upon
4217 error or empty result.
4218
42192022-03-15 Jakub Jelinek <jakub@redhat.com>
4220
4221 PR c++/104623
4222 * parser.cc (cp_parser_skip_to_pragma_eol): Don't purge any tokens.
4223
42242022-03-14 Jakub Jelinek <jakub@redhat.com>
4225
4226 PR tree-optimization/102586
4227 * call.cc (build_cxx_call): Diagnose __builtin_clear_padding where
4228 first argument's type is pointer to non-trivially-copyable type unless
4229 it is address of a variable or parameter.
4230
42312022-03-12 Patrick Palka <ppalka@redhat.com>
4232
4233 PR c++/104641
4234 * cp-tree.h (tsubst_flags::tf_tst_ok): New flag.
4235 * decl.cc (make_typename_type): Allow a typename-specifier to
4236 resolve to a template when tf_tst_ok, in which case return
4237 a CTAD placeholder for the template.
4238 * pt.cc (tsubst_decl) <case VAR_DECL>: Set tf_tst_ok when
4239 substituting the type.
4240 (tsubst): Clear tf_tst_ok and remember if it was set.
4241 <case TYPENAME_TYPE>: Pass tf_tst_ok to make_typename_type
4242 appropriately.
4243 (tsubst_copy) <case CAST_EXPR>: Set tf_tst_ok when substituting
4244 the type.
4245 (tsubst_copy_and_build) <case CAST_EXPR>: Likewise.
4246 <case CONSTRUCTOR>: Likewise.
4247
42482022-03-12 Patrick Palka <ppalka@redhat.com>
4249
4250 PR c++/104622
4251 * call.cc (missing_conversion_p): Define.
4252 (add_candidates): Use it.
4253 * pt.cc (check_non_deducible_conversion): Change type of strict
4254 parameter to unification_kind_t and directly test for DEDUCE_CALL.
4255
42562022-03-12 Patrick Palka <ppalka@redhat.com>
4257
4258 PR c++/104527
4259 * constraint.cc (normalize_atom): Set
4260 ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P appropriately.
4261 (get_mapped_args): Make static, adjust parameters. Always
4262 return a vector whose depth corresponds to the template depth of
4263 the context of the atomic constraint expression. Micro-optimize
4264 by passing false as exact to safe_grow_cleared and by collapsing
4265 a multi-level depth-one argument vector.
4266 (satisfy_atom): Adjust call to get_mapped_args and
4267 diagnose_atomic_constraint.
4268 (diagnose_atomic_constraint): Replace map parameter with an args
4269 parameter.
4270 * cp-tree.h (ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P): Define.
4271 (get_mapped_args): Remove declaration.
4272
42732022-03-12 Patrick Palka <ppalka@redhat.com>
4274 Jason Merrill <jason@redhat.com>
4275
4276 PR c++/98644
4277 * constexpr.cc (mark_non_constant): Define, split out from ...
4278 (cxx_eval_outermost_constant_expr): ... here.
4279 (maybe_constant_value): Use it.
4280
42812022-03-12 Patrick Palka <ppalka@redhat.com>
4282
4283 * semantics.cc (finish_unary_fold_expr): Use input_location
4284 instead of UNKNOWN_LOCATION.
4285 (finish_binary_fold_expr): Likewise.
4286
42872022-03-12 Thomas Schwinge <thomas@codesourcery.com>
4288
4289 PR other/65095
4290 * semantics.cc (handle_omp_array_sections_1)
4291 (cp_oacc_check_attachments): Call 'user_omp_clause_code_name'
4292 instead of 'c_omp_map_clause_name'.
4293
42942022-03-10 Marek Polacek <polacek@redhat.com>
4295
4296 PR c++/104608
4297 * parser.cc (cp_parser_template_name): Repeat lookup of
4298 TYPE_DECLs.
4299
43002022-03-10 Marek Polacek <polacek@redhat.com>
4301
4302 PR c++/104752
4303 * semantics.cc (finish_compound_literal): Disallow auto{x} for
4304 is_constrained_auto.
4305 * typeck2.cc (build_functional_cast_1): Likewise.
4306
43072022-03-10 Marek Polacek <polacek@redhat.com>
4308
4309 PR c++/104846
4310 * decl.cc (grokdeclarator): Check FUNC_OR_METHOD_TYPE_P before giving
4311 data member errors.
4312
43132022-03-10 Jakub Jelinek <jakub@redhat.com>
4314
4315 PR c++/103460
4316 * decl.cc (grok_op_properties): Allow variadic operator[] for
4317 C++23.
4318
43192022-03-10 Roger Sayle <roger@nextmovesoftware.com>
4320
4321 PR c++/95999
4322 * decl.cc (finish_enum_value_list): If VALUE isn't an INTEGER_CST
4323 consider it to be zero (i.e. treat it like error_mark_node).
4324 (build_enumerator): Likewise, if PREV_VALUE isn't an INTEGER_CST,
4325 set VALUE to error_mark_node.
4326
43272022-03-10 Roger Sayle <roger@nextmovesoftware.com>
4328
4329 PR c++/39751
4330 * parser.cc (cp_parser_late_parsing_for_member): Confirm the token
4331 stream hasn't been purged before processing DECL_PENDING_INLINE.
4332
43332022-03-09 Patrick Palka <ppalka@redhat.com>
4334
4335 PR c++/104823
4336 * except.cc (build_noexcept_spec): Strengthen dependence check
4337 to instantiation_dependent_expression_p.
4338 * parser.cc (cp_parser_parenthesized_expression_list_elt):
4339 Remove fold_expr_p parameter, and don't call
4340 instantiate_non_dependent_expr.
4341 (cp_parser_parenthesized_expression_list): Adjust accordingly.
4342 * pt.cc (expand_integer_pack): Strengthen dependence check
4343 to instantiation_dependent_expression_p.
4344 (instantiate_non_dependent_expr_internal): Adjust comment.
4345 (instantiate_non_dependent_expr_sfinae): Likewise. Drop
4346 the potentially-constant check, and relax and turn the
4347 dependence check into a checking assert.
4348 (instantiate_non_dependent_or_null): Adjust comment.
4349 * semantics.cc (finish_decltype_type): Keep
4350 processing_template_decl cleared after calling
4351 instantiate_non_dependent_expr_sfinae.
4352
43532022-03-09 Patrick Palka <ppalka@redhat.com>
4354
4355 PR c++/102137
4356 PR c++/87820
4357 * cp-tree.h (is_copy_initialization): Declare.
4358 * decl.cc (cp_finish_decl): Set LOOKUP_ONLYCONVERTING
4359 when is_copy_initialization is true.
4360 * init.cc (build_aggr_init): Split out copy-initialization
4361 check into ...
4362 (is_copy_initialization): ... here.
4363 * pt.cc (instantiate_decl): Pass 0 instead of
4364 LOOKUP_ONLYCONVERTING as flags to cp_finish_decl.
4365
43662022-03-09 Patrick Palka <ppalka@redhat.com>
4367
4368 PR c++/65396
4369 * cp-tree.h (merge_default_template_args): Declare.
4370 * decl.cc (merge_default_template_args): Define, factored out
4371 from redeclare_class_template.
4372 (duplicate_decls): Use it when merging member function template
4373 and free function declarations.
4374 * pt.cc (redeclare_class_template): Factor out default argument
4375 merging logic into merge_default_template_args. Improve location
4376 of a note when there's a template parameter kind mismatch.
4377
43782022-03-09 Jakub Jelinek <jakub@redhat.com>
4379
4380 PR c/104711
4381 * constexpr.cc (cxx_eval_check_shift_p): Use TYPE_OVERFLOW_WRAPS
4382 instead of TYPE_UNSIGNED.
4383 * typeck.cc (cp_build_binary_op): Don't emit
4384 -Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
4385
43862022-03-08 Roger Sayle <roger@nextmovesoftware.com>
4387
4388 PR c++/96440
4389 * decl.cc (start_decl): Defend against prefix_attributes being
4390 error_mark_node.
4391
43922022-03-08 Roger Sayle <roger@nextmovesoftware.com>
4393
4394 PR c++/96437
4395 * parser.cc (synthesize_implicit_template_parm): Check that
4396 TREE_VALUE (new_parm) isn't error_mark_node before setting its
4397 DECL_VIRTUAL_P.
4398
43992022-03-08 Roger Sayle <roger@nextmovesoftware.com>
4400
4401 PR c++/96329
4402 * parser.cc (cp_parser_linkage_specification): Treat the case where
4403 linkage is error_mark_node as "invalid linkage-specification".
4404
44052022-03-08 Marek Polacek <polacek@redhat.com>
4406
4407 PR c++/104108
4408 * pt.cc (convert_nontype_argument): Recompute
4409 value_dependent_expression_p after build_converted_constant_expr.
4410
44112022-03-08 Marek Polacek <polacek@redhat.com>
4412
4413 * decl2.cc (is_late_template_attribute): Do not defer attribute
4414 unavailable.
4415 * pt.cc (tsubst_enum): Set TREE_UNAVAILABLE.
4416
44172022-03-08 Jakub Jelinek <jakub@redhat.com>
4418
4419 PR c++/104806
4420 * search.cc (lookup_field_fuzzy_info::fuzzy_lookup_field): Ignore
4421 identifiers with space at the end.
4422
44232022-03-07 Jason Merrill <jason@redhat.com>
4424
4425 PR c++/104618
4426 * decl2.cc (mark_single_function): Look through parens and location
4427 wrapper.
4428 * typeck.cc (cp_build_addr_expr_1): Not here.
4429
44302022-03-07 Jakub Jelinek <jakub@redhat.com>
4431
4432 * parser.cc (cp_parser_omp_clause_map): Add missing space in string
4433 literal.
4434
44352022-03-07 Jakub Jelinek <jakub@redhat.com>
4436
4437 * cvt.cc: Fix up duplicated word issue in a comment.
4438 * pt.cc: Likewise.
4439 * module.cc: Likewise.
4440 * coroutines.cc: Likewise.
4441
44422022-03-04 Nathan Sidwell <nathan@acm.org>
4443
4444 * mangle.cc (is_std_substitution): Check global module.
4445 (is_std_substitution_char): Return bool.
4446
44472022-03-04 Nathan Sidwell <nathan@acm.org>
4448
4449 * cp-tree.h (mangle_identifier): Replace with ...
4450 (mangle_module_component): ... this.
4451 * mangle.cc (dump_substitution_candidates): Adjust.
4452 (add_substitution): Likewise.
4453 (find_substitution): Likewise.
4454 (unmangled_name_p): Likewise.
4455 (mangle_module_substitution): Reimplement.
4456 (mangle_module_component): New.
4457 (write_module, maybe_write_module): Adjust.
4458 (write_name): Drop modules here.
4459 (write_unqualified): Do them here instead.
4460 (mangle_global_init): Adjust.
4461 * module.cc (module_state::mangle): Adjust.
4462 (mangle_module): Likewise.
4463 (get_originating_module): Adjust.
4464
44652022-02-28 Marek Polacek <polacek@redhat.com>
4466
4467 PR c++/104682
4468 * cp-tree.h (build_enumerator): Adjust.
4469 * decl.cc (finish_enum): Make it return the new decl.
4470 * pt.cc (tsubst_enum): Propagate TREE_DEPRECATED and TREE_UNAVAILABLE.
4471
44722022-02-28 Marek Polacek <polacek@redhat.com>
4473
4474 PR c++/104667
4475 * decl2.cc (is_late_template_attribute): Cope with a decl without
4476 a type.
4477
44782022-02-27 Jason Merrill <jason@redhat.com>
4479
4480 PR c++/104618
4481 * typeck.cc (cp_build_addr_expr_1): Also
4482 maybe_undo_parenthesized_ref.
4483
44842022-02-24 Martin Liska <mliska@suse.cz>
4485
4486 * pt.cc (defarg_insts_for): Use braces for subobject.
4487
44882022-02-18 Patrick Palka <ppalka@redhat.com>
4489
4490 PR c++/94944
4491 * pt.cc (maybe_instantiate_noexcept): For non-static member
4492 functions, set current_class_ptr/ref to the specialized 'this'
4493 instead.
4494
44952022-02-17 Jason Merrill <jason@redhat.com>
4496
4497 PR c++/104539
4498 * pt.cc (mark_decl_instantiated): Don't clear DECL_COMDAT.
4499
45002022-02-17 Jason Merrill <jason@redhat.com>
4501
4502 PR c++/90451
4503 * decl2.cc (mark_single_function): New.
4504 * cp-tree.h: Declare it.
4505 * typeck.cc (cp_build_addr_expr_1): mark_used when making a PMF.
4506 * semantics.cc (finish_qualified_id_expr): Not here.
4507 (finish_id_expression_1): Or here.
4508 (finish_decltype_type): Call mark_single_function.
4509 * cvt.cc (convert_to_void): And here.
4510 * pt.cc (convert_nontype_argument): And here.
4511 * init.cc (build_offset_ref): Adjust assert.
4512
45132022-02-17 Patrick Palka <ppalka@redhat.com>
4514
4515 PR c++/104565
4516 * semantics.cc (finish_compound_literal): Don't perform
4517 non-dependent expr folding before calling check_narrowing.
4518
45192022-02-16 Patrick Palka <ppalka@redhat.com>
4520
4521 PR c++/104507
4522 * constexpr.cc (potential_constant_expression_1)
4523 <case NON_DEPENDENT_EXPR>: Return false instead of recursing.
4524 Assert tf_error isn't set.
4525
45262022-02-15 Jason Merrill <jason@redhat.com>
4527
4528 PR c++/104107
4529 PR c++/95036
4530 * pt.cc (coerce_template_template_parms): Take full parms.
4531 Avoid adding too much of outer_args.
4532 (coerce_template_template_parm): Adjust.
4533 (template_template_parm_bindings_ok_p): Adjust.
4534 (convert_template_argument): Adjust.
4535
45362022-02-14 Jakub Jelinek <jakub@redhat.com>
4537
4538 PR c++/104513
4539 * constexpr.cc (potential_constant_expression_1) <case GOTO_EXPR>:
4540 Don't punt if returns (target).
4541
45422022-02-11 Jakub Jelinek <jakub@redhat.com>
4543
4544 PR c++/104472
4545 * constexpr.cc (cxx_eval_internal_function) <case IFN_VEC_CONVERT>:
4546 Only return fold_const_call result if it is non-NULL. Otherwise
4547 fall through into the default: case to return t, set *non_constant_p
4548 and emit diagnostics if needed.
4549
45502022-02-10 Jason Merrill <jason@redhat.com>
4551
4552 * module.cc (depset::hash::add_specializations): Use
4553 STRIP_TEMPLATE.
4554
45552022-02-10 Tobias Burnus <tobias@codesourcery.com>
4556
4557 PR c++/102204
4558 * decl2.cc (cp_omp_mappable_type_1): Remove check for virtual
4559 members as those are permitted since OpenMP 5.0.
4560
45612022-02-10 Patrick Palka <ppalka@redhat.com>
4562
4563 * pt.cc (filter_memfn_lookup): Handle dependent USING_DECL
4564 better.
4565
45662022-02-10 Marcel Vollweiler <marcel@codesourcery.com>
4567
4568 * parser.cc (cp_parser_omp_clause_name): Parse 'has_device_addr' clause.
4569 (cp_parser_omp_var_list_no_open): Handle array sections.
4570 (cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
4571 case.
4572 (cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK.
4573 * semantics.cc (handle_omp_array_sections): Handle clause restrictions.
4574 (finish_omp_clauses): Handle array sections.
4575
45762022-02-09 Patrick Palka <ppalka@redhat.com>
4577
4578 PR c++/104432
4579 * call.cc (build_new_method_call): When a non-dependent call
4580 resolves to a specialization of a member template, always build
4581 the pruned overload set using the member template, not the
4582 specialization.
4583 * pt.cc (filter_memfn_lookup): New parameter newtype. Simplify
4584 and correct how members from the new lookup set are matched to
4585 those from the old one.
4586 (tsubst_baselink): Pass binfo_type as newtype to
4587 filter_memfn_lookup.
4588
45892022-02-09 Jason Merrill <jason@redhat.com>
4590
4591 PR c++/103752
4592 * module.cc (trees_out::core_vals): Stream explicit specifier.
4593 (trees_in::core_vals): Likewise.
4594 * pt.cc (store_explicit_specifier): No longer static.
4595 (tsubst_function_decl): Clear DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
4596 * cp-tree.h (lookup_explicit_specifier): Declare.
4597
45982022-02-09 Jason Merrill <jason@redhat.com>
4599
4600 PR c++/96876
4601 * typeck2.cc (split_nonconstant_init_1): Push cleanups for
4602 preceding members with constant initialization.
4603 (maybe_push_temp_cleanup): Do nothing if -fno-exceptions.
4604
46052022-02-08 Jakub Jelinek <jakub@redhat.com>
4606
4607 PR c++/104379
4608 * name-lookup.cc (check_local_shadow): When diagnosing shadowing
4609 of a member or global declaration, add warning suppression for
4610 the decl and don't warn again on it.
4611
46122022-02-08 Jakub Jelinek <jakub@redhat.com>
4613
4614 PR c++/104403
4615 * constexpr.cc (cxx_eval_constant_expression): Don't assert DECL_EXPRs
4616 of TREE_STATIC vars may only appear in -std=c++23.
4617
46182022-02-08 Patrick Palka <ppalka@redhat.com>
4619
4620 PR c++/80951
4621 * pt.cc (uses_deducible_template_parms): Consider the
4622 noexcept-spec of a function type.
4623
46242022-02-08 Patrick Palka <ppalka@redhat.com>
4625
4626 PR c++/104410
4627 * constraint.cc (satisfaction_value): Relax assert to accept
4628 cv-qualified bool.
4629
46302022-02-08 Patrick Palka <ppalka@redhat.com>
4631
4632 PR c++/103706
4633 * pt.cc (preserve_args): New function.
4634 (tsubst_lambda_expr): Use it when setting LAMBDA_EXPR_REGEN_INFO.
4635
46362022-02-08 Patrick Palka <ppalka@redhat.com>
4637
4638 PR c++/103706
4639 * constraint.cc (satisfy_declaration_constraints): Use
4640 lambda_regenerating_args instead.
4641 * cp-tree.h (lambda_regenerating_args): Declare.
4642 * pt.cc (lambda_regenerating_args): Define, split out from
4643 satisfy_declaration_constraints.
4644 (do_auto_deduction): Use lambda_regenerating_args to obtain the
4645 full set of outer template arguments for satisfaction when
4646 inside a lambda.
4647
46482022-02-06 Patrick Palka <ppalka@redhat.com>
4649
4650 PR c++/96242
4651 * decl2.cc (mark_used): Directly synthesize a DECL_MAYBE_DELETED
4652 fn by calling maybe_synthesize_method instead of relying on
4653 maybe_instantiate_noexcept. Move call to m_i_n after the
4654 DECL_DELETED_FN handling.
4655 * pt.cc (maybe_instantiate_noexcept): Restrict DECL_MAYBE_DELETED
4656 fn synthesis to only those with an implicit noexcept-spec, and
4657 return !DECL_DELETED_FN instead of !DECL_MAYBE_DELETED afterwards.
4658
46592022-02-06 Jakub Jelinek <jakub@redhat.com>
4660
4661 PR c++/89074
4662 PR c++/104033
4663 * constexpr.cc (cxx_eval_binary_expression): Temporarily set
4664 folding_cxx_constexpr.
4665
46662022-02-05 Jason Merrill <jason@redhat.com>
4667
4668 PR c++/104300
4669 PR c++/92385
4670 * cp-tree.h (get_vec_init_expr): New.
4671 (target_expr_needs_replace): New.
4672 * cp-gimplify.cc (cp_gimplify_init_expr): Use it.
4673 (struct cp_fold_data): New.
4674 (cp_fold_r): Only genericize inits at end of fn.
4675 (cp_fold_function): Here.
4676 (cp_fully_fold_init): Not here.
4677 * init.cc (build_vec_init): Use get_vec_init_expr.
4678 * tree.cc (build_vec_init_expr): Likewise.
4679 * typeck2.cc (split_nonconstant_init_1): Likewise.
4680 (process_init_constructor): Wrap VEC_INIT_EXPR in
4681 TARGET_EXPR.
4682
46832022-02-05 Jason Merrill <jason@redhat.com>
4684
4685 * pt.cc (iterative_hash_template_arg): Add comment.
4686
46872022-02-03 Patrick Palka <ppalka@redhat.com>
4688
4689 PR c++/104079
4690 * pt.cc (value_dependent_noexcept_spec_p): New predicate split
4691 out from ...
4692 (dependent_type_p_r): ... here.
4693 (instantiation_dependent_r): Use value_dependent_noexcept_spec_p
4694 to consider dependence of a noexcept-spec before C++17.
4695 * tree.cc (fixup_deferred_exception_variants): Clear
4696 TYPE_DEPENDENT_P_VALID.
4697
46982022-02-03 Jason Merrill <jason@redhat.com>
4699
4700 PR c++/104302
4701 * decl.cc (maybe_deduce_size_from_array_init): Give up
4702 on type-dependent init.
4703 (cp_complete_array_type): Only call reshape_init for character
4704 array.
4705
47062022-02-01 Jason Merrill <jason@redhat.com>
4707
4708 PR c++/103186
4709 * pt.cc (defarg_inst): Use tree_vec_map_cache_hasher.
4710 (defarg_insts_for): New.
4711 (tsubst_default_argument): Adjust.
4712
47132022-01-31 Marek Polacek <polacek@redhat.com>
4714
4715 PR c++/102414
4716 PR c++/101874
4717 * decl.cc (create_array_type_for_decl): Use template_placeholder_p.
4718 Sorry on a variable-length array of auto.
4719
47202022-01-31 Marek Polacek <polacek@redhat.com>
4721
4722 PR c++/102434
4723 * class.cc (finish_struct): Don't allow union initializer_list.
4724
47252022-01-31 Patrick Palka <ppalka@redhat.com>
4726
4727 PR c++/104294
4728 * pt.cc (ctor_deduction_guides_for): Correct computation of
4729 outer_args.
4730
47312022-01-31 Patrick Palka <ppalka@redhat.com>
4732
4733 PR c++/104291
4734 * pt.cc (for_each_template_parm_r) <case CONSTRUCTOR>: Clear
4735 walk_subtrees if !include_nondeduced_p. Simplify given that
4736 cp_walk_subtrees already walks TYPE_PTRMEMFUNC_FN_TYPE_RAW.
4737
47382022-01-28 Patrick Palka <ppalka@redhat.com>
4739 Jason Merrill <jason@redhat.com>
4740
4741 PR c++/92752
4742 * typeck.cc (build_ptrmemfunc): Cast a nullptr constant to the
4743 unqualified pointer type not the qualified one.
4744
47452022-01-28 Patrick Palka <ppalka@redhat.com>
4746
4747 PR c++/103341
4748 * decl.cc (cp_finish_decl): Pass the template arguments of a
4749 variable template specialization or a templated static data
4750 member to do_auto_deduction when the auto is constrained.
4751
47522022-01-28 Jason Merrill <jason@redhat.com>
4753
4754 PR c++/100198
4755 PR c++/100030
4756 PR c++/100282
4757 * parser.cc (cp_parser_enumerator_definition): Sorry on parameter
4758 pack in lambda.
4759 (cp_parser_class_head): And in class attributes.
4760 * pt.cc (check_for_bare_parameter_packs): Sorry instead of error
4761 in lambda.
4762
47632022-01-27 Jason Merrill <jason@redhat.com>
4764
4765 PR c++/104245
4766 PR c++/51344
4767 * decl2.cc (save_template_attributes): Take late attrs as parm.
4768 (cplus_decl_attributes): Call it after decl_attributes,
4769 splice_template_attributes before.
4770
47712022-01-27 Patrick Palka <ppalka@redhat.com>
4772
4773 PR c++/99895
4774 * call.cc (build_over_call): For a non-dependent member call,
4775 build up a CALL_EXPR using a COMPONENT_REF callee, as in
4776 build_new_method_call.
4777 * pt.cc (build_non_dependent_expr): Don't wrap PARM_DECL either.
4778 * tree.cc (build_min_non_dep_op_overload): Adjust accordingly
4779 after the build_over_call change.
4780
47812022-01-27 Patrick Palka <ppalka@redhat.com>
4782
4783 PR c++/92944
4784 PR c++/103678
4785 * parser.cc (cp_parser_class_head): Update 'type' with the result
4786 of maybe_process_partial_specialization in the
4787 nested_name_specifier branch. Refactor nearby code to accomodate
4788 that maybe_process_partial_specialization returns a _TYPE, not a
4789 TYPE_DECL, and eliminate local variable 'class_type' in passing.
4790
47912022-01-27 Marek Polacek <polacek@redhat.com>
4792
4793 PR c++/101988
4794 * decl.cc (create_array_type_for_decl): Reject forming an array of
4795 placeholder for a deduced class type.
4796
47972022-01-26 Jason Merrill <jason@redhat.com>
4798
4799 PR c++/104206
4800 PR c++/101072
4801 * semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
4802
48032022-01-26 Jakub Jelinek <jakub@redhat.com>
4804
4805 PR c++/104226
4806 * constexpr.cc (init_subob_ctx): For vector ctors containing
4807 vector elements, ensure appending to the same ctor instead of
4808 creating another one.
4809
48102022-01-26 Marek Polacek <polacek@redhat.com>
4811
4812 PR target/104213
4813 * decl.cc (finish_constructor_body): Suppress -Wuse-after-free.
4814 (finish_destructor_body): Likewise.
4815 * optimize.cc (build_delete_destructor_body): Likewise.
4816
48172022-01-26 Jason Merrill <jason@redhat.com>
4818
4819 PR c++/104235
4820 * parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.
4821
48222022-01-26 Jason Merrill <jason@redhat.com>
4823
4824 PR c++/103057
4825 * pt.cc (tsubst_aggr_type): Call tsubst for alias template
4826 specialization.
4827
48282022-01-25 Patrick Palka <ppalka@redhat.com>
4829
4830 PR c++/101532
4831 PR c++/104225
4832 * decl2.cc (mark_used): Don't consider maybe_instantiate_noexcept
4833 on a deleted function.
4834
48352022-01-25 Jason Merrill <jason@redhat.com>
4836
4837 PR c++/59950
4838 * call.cc (build_over_call): Use cp_build_indirect_ref.
4839
48402022-01-24 Patrick Palka <ppalka@redhat.com>
4841
4842 PR c++/104197
4843 * pt.cc (make_auto_1): Use -1 as a placeholder default argument
4844 for level.
4845
48462022-01-24 Patrick Palka <ppalka@redhat.com>
4847
4848 PR c++/104173
4849 * typeck.cc (build_class_member_access_expr): Extend
4850 unary_complex_lvalue result adjustment to preserve all
4851 rvalues, not just xvalues.
4852
48532022-01-23 Will Wray <wjwray@gmail.com>
4854
4855 PR c++/55227
4856 * decl.cc (reshape_init_r): Only call has_designator_check when
4857 first_initializer_p or for the inner constructor element.
4858 (cp_complete_array_type): Call reshape_init on braced-init-list.
4859
48602022-01-23 Jason Merrill <jason@redhat.com>
4861
4862 PR c++/104182
4863 * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing
4864 has set DECL_INITIAL on a TARGET_EXPR slot.
4865 * tree.cc (is_local_temp): Don't check DECL_CONTEXT.
4866
48672022-01-23 Jason Merrill <jason@redhat.com>
4868
4869 PR c++/101072
4870 * cp-tree.h (build_implicit_conv_flags): Declare.
4871 * call.cc (build_implicit_conv_flags): Split out from...
4872 (perform_implicit_conversion_flags): ...here.
4873 * decl.cc (check_initializer): Use it.
4874 * pt.cc (tsubst_copy_and_build): Remove TARGET_EXPR handling.
4875 * semantics.cc (finish_compound_literal): Don't treat
4876 scalar values like CONSTRUCTORs.
4877
48782022-01-21 Jason Merrill <jason@redhat.com>
4879
4880 * semantics.cc (find_failing_clause): Return expr if not
4881 decomposable.
4882 (finish_static_assert): Show constant values in failing
4883 comparison.
4884
48852022-01-21 Jason Merrill <jason@redhat.com>
4886
4887 PR c++/104084
4888 PR c++/20040
4889 * init.cc (build_new_1): Only pull out TARGET_EXPR_INITIAL if
4890 alloc_expr is a TARGET_EXPR.
4891
48922022-01-21 Marek Polacek <polacek@redhat.com>
4893
4894 PR c++/101715
4895 * tree.cc (fixup_deferred_exception_variants): Remove duplicate
4896 variants after parsing the exception specifications.
4897
48982022-01-21 Jason Merrill <jason@redhat.com>
4899
4900 PR c++/104139
4901 PR c++/103681
4902 * class.cc (end_of_class): Use base_binfo.
4903
49042022-01-20 Jason Merrill <jason@redhat.com>
4905
4906 PR c++/101405
4907 * decl.cc (reshape_init_class): Reject designator for a member of
4908 another class.
4909
49102022-01-20 Patrick Palka <ppalka@redhat.com>
4911
4912 PR c++/91911
4913 PR c++/103672
4914 * pt.cc (keep_template_parm): Punt on a level 0 template parm.
4915 (tsubst_decl) <case VAR_DECL>: Remove !CHECKING_P safeguard.
4916 (tsubst) <case TEMPLATE_TYPE_PARM>: Handle CTAD placeholders
4917 specially.
4918 (make_auto_1): Add defaulted 'level' parameter.
4919 (make_template_placeholder): Pass 0 as 'level' to make_auto_1.
4920
49212022-01-20 Patrick Palka <ppalka@redhat.com>
4922
4923 * decl.cc (grokdeclarator): Diagnose a CTAD placeholder as
4924 function return type even when !funcdecl_p.
4925
49262022-01-20 Martin Liska <mliska@suse.cz>
4927
4928 PR c++/104134
4929 * error.cc (dump_aggr_type): Partially disable the warning.
4930
49312022-01-20 Jason Merrill <jason@redhat.com>
4932
4933 PR c++/102300
4934 * parser.cc (cp_parser_template_name): Use dependent_scope_p.
4935
49362022-01-19 David Malcolm <dmalcolm@redhat.com>
4937
4938 * cp-lang.cc (selftest::run_cp_tests): Update calls for .c to .cc
4939 renaming.
4940 * cp-tree.h (cp_pt_c_tests): Rename to...
4941 (cp_pt_cc_tests): ...this.
4942 (cp_tree_c_tests): Rename to...
4943 (cp_tree_cc_tests): ...this.
4944 * pt.cc (cp_pt_c_tests): Rename to...
4945 (cp_pt_cc_tests): ...this.
4946 * tree.cc (cp_tree_c_tests): Rename to...
4947 (cp_tree_cc_tests): ...this.
4948
49492022-01-19 Jason Merrill <jason@redhat.com>
4950
4951 * parser.cc (saved_token_sentinel::rollback): Use
4952 cp_lexer_previous_token.
4953
49542022-01-18 Jakub Jelinek <jakub@redhat.com>
4955
4956 PR c++/104055
4957 * constexpr.cc (cxx_eval_outermost_constant_expr): If t is a
4958 TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
4959 than get_target_expr_sfinae with tf_no_cleanup, and don't set
4960 TREE_CONSTANT.
4961
49622022-01-18 Jason Merrill <jason@redhat.com>
4963 Jakub Jelinek <jakub@redhat.com>
4964
4965 PR c++/104025
4966 * parser.cc (saved_token_sentinel::rollback): Call
4967 cp_lexer_set_source_position.
4968 (~saved_token_sentinel): Call rollback.
4969
49702022-01-18 Patrick Palka <ppalka@redhat.com>
4971
4972 PR c++/104074
4973 * pt.cc (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
4974 that we return false for DEPENDENT_OPERATOR_TYPE too.
4975
49762022-01-17 Martin Liska <mliska@suse.cz>
4977
4978 * Make-lang.in: Rename .c names to .cc.
4979 * config-lang.in: Likewise.
4980 * constexpr.cc (cxx_eval_constant_expression): Likewise.
4981 * coroutines.cc (morph_fn_to_coro): Likewise.
4982 * cp-gimplify.cc (cp_gimplify_expr): Likewise.
4983 * cp-lang.cc (struct lang_hooks): Likewise.
4984 (get_template_argument_pack_elems_folded): Likewise.
4985 * cp-objcp-common.cc (cp_tree_size): Likewise.
4986 (cp_unit_size_without_reusable_padding): Likewise.
4987 (pop_file_scope): Likewise.
4988 (cp_pushdecl): Likewise.
4989 * cp-objcp-common.h (GCC_CP_OBJCP_COMMON): Likewise.
4990 (cxx_simulate_record_decl): Likewise.
4991 * cp-tree.h (struct named_label_entry): Likewise.
4992 (current_function_return_value): Likewise.
4993 (more_aggr_init_expr_args_p): Likewise.
4994 (get_function_version_dispatcher): Likewise.
4995 (common_enclosing_class): Likewise.
4996 (strip_fnptr_conv): Likewise.
4997 (current_decl_namespace): Likewise.
4998 (do_aggregate_paren_init): Likewise.
4999 (cp_check_const_attributes): Likewise.
5000 (qualified_name_lookup_error): Likewise.
5001 (generic_targs_for): Likewise.
5002 (mark_exp_read): Likewise.
5003 (is_global_friend): Likewise.
5004 (maybe_reject_flexarray_init): Likewise.
5005 (module_token_lang): Likewise.
5006 (handle_module_option): Likewise.
5007 (literal_integer_zerop): Likewise.
5008 (build_extra_args): Likewise.
5009 (build_if_nonnull): Likewise.
5010 (maybe_check_overriding_exception_spec): Likewise.
5011 (finish_omp_target_clauses): Likewise.
5012 (maybe_warn_zero_as_null_pointer_constant): Likewise.
5013 (cxx_print_error_function): Likewise.
5014 (decl_in_std_namespace_p): Likewise.
5015 (merge_exception_specifiers): Likewise.
5016 (mangle_module_global_init): Likewise.
5017 (cxx_block_may_fallthru): Likewise.
5018 (fold_builtin_source_location): Likewise.
5019 (enum cp_oracle_request): Likewise.
5020 (subsumes): Likewise.
5021 (cp_finish_injected_record_type): Likewise.
5022 (vtv_build_vtable_verify_fndecl): Likewise.
5023 (cp_tree_c_finish_parsing): Likewise.
5024 * cvt.cc (diagnose_ref_binding): Likewise.
5025 (convert_to_void): Likewise.
5026 (convert_force): Likewise.
5027 (type_promotes_to): Likewise.
5028 * decl.cc (make_unbound_class_template_raw): Likewise.
5029 (cxx_init_decl_processing): Likewise.
5030 (check_class_member_definition_namespace): Likewise.
5031 (cxx_maybe_build_cleanup): Likewise.
5032 * decl2.cc (maybe_emit_vtables): Likewise.
5033 * error.cc (dump_function_name): Likewise.
5034 * init.cc (is_class_type): Likewise.
5035 (build_new_1): Likewise.
5036 * lang-specs.h: Likewise.
5037 * method.cc (make_alias_for_thunk): Likewise.
5038 * module.cc (specialization_add): Likewise.
5039 (module_state::read_cluster): Likewise.
5040 * name-lookup.cc (check_extern_c_conflict): Likewise.
5041 * name-lookup.h (struct cxx_binding): Likewise.
5042 * parser.cc (cp_parser_identifier): Likewise.
5043 * parser.h (struct cp_parser): Likewise.
5044 * pt.cc (has_value_dependent_address): Likewise.
5045 (push_tinst_level_loc): Likewise.
5046 * semantics.cc (finish_omp_clauses): Likewise.
5047 (finish_omp_atomic): Likewise.
5048 * tree.cc (cp_save_expr): Likewise.
5049 (cp_free_lang_data): Likewise.
5050 * typeck.cc (cp_common_type): Likewise.
5051 (strip_array_domain): Likewise.
5052 (rationalize_conditional_expr): Likewise.
5053 (check_return_expr): Likewise.
5054 * vtable-class-hierarchy.cc: Likewise.
5055
50562022-01-17 Martin Liska <mliska@suse.cz>
5057
5058 * call.c: Moved to...
5059 * call.cc: ...here.
5060 * class.c: Moved to...
5061 * class.cc: ...here.
5062 * constexpr.c: Moved to...
5063 * constexpr.cc: ...here.
5064 * cp-gimplify.c: Moved to...
5065 * cp-gimplify.cc: ...here.
5066 * cp-lang.c: Moved to...
5067 * cp-lang.cc: ...here.
5068 * cp-objcp-common.c: Moved to...
5069 * cp-objcp-common.cc: ...here.
5070 * cp-ubsan.c: Moved to...
5071 * cp-ubsan.cc: ...here.
5072 * cvt.c: Moved to...
5073 * cvt.cc: ...here.
5074 * cxx-pretty-print.c: Moved to...
5075 * cxx-pretty-print.cc: ...here.
5076 * decl.c: Moved to...
5077 * decl.cc: ...here.
5078 * decl2.c: Moved to...
5079 * decl2.cc: ...here.
5080 * dump.c: Moved to...
5081 * dump.cc: ...here.
5082 * error.c: Moved to...
5083 * error.cc: ...here.
5084 * except.c: Moved to...
5085 * except.cc: ...here.
5086 * expr.c: Moved to...
5087 * expr.cc: ...here.
5088 * friend.c: Moved to...
5089 * friend.cc: ...here.
5090 * g++spec.c: Moved to...
5091 * g++spec.cc: ...here.
5092 * init.c: Moved to...
5093 * init.cc: ...here.
5094 * lambda.c: Moved to...
5095 * lambda.cc: ...here.
5096 * lex.c: Moved to...
5097 * lex.cc: ...here.
5098 * mangle.c: Moved to...
5099 * mangle.cc: ...here.
5100 * method.c: Moved to...
5101 * method.cc: ...here.
5102 * name-lookup.c: Moved to...
5103 * name-lookup.cc: ...here.
5104 * optimize.c: Moved to...
5105 * optimize.cc: ...here.
5106 * parser.c: Moved to...
5107 * parser.cc: ...here.
5108 * pt.c: Moved to...
5109 * pt.cc: ...here.
5110 * ptree.c: Moved to...
5111 * ptree.cc: ...here.
5112 * rtti.c: Moved to...
5113 * rtti.cc: ...here.
5114 * search.c: Moved to...
5115 * search.cc: ...here.
5116 * semantics.c: Moved to...
5117 * semantics.cc: ...here.
5118 * tree.c: Moved to...
5119 * tree.cc: ...here.
5120 * typeck.c: Moved to...
5121 * typeck.cc: ...here.
5122 * typeck2.c: Moved to...
5123 * typeck2.cc: ...here.
5124 * vtable-class-hierarchy.c: Moved to...
5125 * vtable-class-hierarchy.cc: ...here.
5126
51272022-01-17 Jakub Jelinek <jakub@redhat.com>
5128
5129 PR c++/104031
5130 * cp-gimplify.c (cp_genericize_target_expr): Set DECL_CONTEXT of
5131 TARGET_EXPR_SLOT to current_function_decl if it was NULL.
5132
51332022-01-17 Andrew Stubbs <ams@codesourcery.com>
5134
5135 * parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.
5136
51372022-01-14 Chung-Lin Tang <cltang@codesourcery.com>
5138
5139 PR c++/103705
5140 * semantics.c (finish_omp_clauses): Also continue peeling off of
5141 outer node for ARRAY_REFs.
5142
51432022-01-14 Jakub Jelinek <jakub@redhat.com>
5144
5145 PR c++/103991
5146 * cp-objcp-common.c (cxx_block_may_fallthru) <case IF_STMT>: For
5147 IF_STMT_CONSTEXPR_P with constant false or true condition only
5148 check if the taken clause may fall through.
5149 * cp-gimplify.c (genericize_if_stmt): For consteval if, revert
5150 to r12-5638^ behavior if then_ block can't fall through. For
5151 constexpr if, revert to r12-5638^ behavior.
5152
51532022-01-13 Anthony Sharp <anthonysharp15@gmail.com>
5154 Jason Merrill <jason@redhat.com>
5155
5156 PR c++/70417
5157 * parser.c (cp_parser_id_expression): Handle
5158 -Wmissing-template-keyword.
5159 (struct saved_token_sentinel): Add modes to control what happens
5160 on destruction.
5161 (cp_parser_statement): Adjust.
5162 (cp_parser_skip_entire_template_parameter_list): New function that
5163 skips an entire template parameter list.
5164 (cp_parser_require_end_of_template_parameter_list): Rename old
5165 cp_parser_skip_to_end_of_template_parameter_list.
5166 (cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
5167 called from one of the above two functions.
5168 (cp_parser_lambda_declarator_opt)
5169 (cp_parser_explicit_template_declaration)
5170 (cp_parser_enclosed_template_argument_list): Adjust.
5171
51722022-01-12 Jakub Jelinek <jakub@redhat.com>
5173 Jason Merrill <jason@redhat.com>
5174
5175 PR c++/103480
5176 * tree.c (move): If expr is xvalue_p, just return expr without
5177 build_static_cast.
5178
51792022-01-11 Jakub Jelinek <jakub@redhat.com>
5180
5181 PR c++/101597
5182 * class.c (build_vfn_ref): Build OBJ_TYPE_REF with INTEGER_CST
5183 OBJ_TYPE_REF_TOKEN with type equal to OBJ_TYPE_REF_OBJECT type.
5184 * error.c (resolve_virtual_fun_from_obj_type_ref): Use type of
5185 OBJ_TYPE_REF_TOKEN rather than type of OBJ_TYPE_REF_OBJECT as
5186 obj_type.
5187
51882022-01-11 Patrick Palka <ppalka@redhat.com>
5189
5190 PR c++/103831
5191 * call.c (build_new_method_call): Consider dependent bases only
5192 if 'this' is available.
5193
51942022-01-11 Olivier Hainque <hainque@adacore.com>
5195
5196 * decl.c (cxx_init_decl_processing): Move code possibly
5197 altering flag_weak before code testing it.
5198
51992022-01-10 Patrick Palka <ppalka@redhat.com>
5200
5201 PR c++/103879
5202 * constexpr.c (cxx_fold_indirect_ref): Split out object/offset
5203 canonicalization step into a local lambda. Strengthen it to
5204 absorb more components at position 0. Use it before both calls
5205 to cxx_fold_indirect_ref_1.
5206
52072022-01-10 Patrick Palka <ppalka@redhat.com>
5208
5209 PR c++/103783
5210 * call.c (cand_parms_match): Skip over 'this' when given one
5211 static and one non-static member function.
5212
52132022-01-10 Jakub Jelinek <jakub@redhat.com>
5214
5215 PR c++/103912
5216 * semantics.c (expand_or_defer_fn): For immediate functions, set
5217 node->body_removed to true and clear analyzed, definition and
5218 force_output.
5219 * decl2.c (c_parse_final_cleanups): Ignore immediate functions for
5220 expand_or_defer_fn.
5221
52222022-01-08 Jakub Jelinek <jakub@redhat.com>
5223
5224 PR c++/89074
5225 * constexpr.c (cxx_maybe_fold_addr_pointer_plus): New function.
5226 (cxx_eval_binary_expression): Use it.
5227
52282022-01-08 Jason Merrill <jason@redhat.com>
5229
5230 PR c++/103946
5231 * init.c (build_vec_init): Remove assert.
5232 * tree.c (build_vec_init_expr): Likewise.
5233
52342022-01-08 Jason Merrill <jason@redhat.com>
5235
5236 PR c++/100588
5237 * call.c (build_op_delete_call): Ignore destroying delete
5238 if alloc_fn.
5239
52402022-01-07 Jason Merrill <jason@redhat.com>
5241
5242 PR c++/20040
5243 * init.c (build_new_1): Also build pointer cleanup if
5244 TYPE_GETS_DELETE.
5245 * cp-tree.h (TYPE_GETS_VEC_DELETE): New.
5246
52472022-01-07 Jason Merrill <jason@redhat.com>
5248
5249 PR c++/103936
5250 PR c++/65591
5251 * cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling.
5252
52532022-01-07 Jason Merrill <jason@redhat.com>
5254
5255 PR c++/103711
5256 * init.c (perform_target_ctor): Select destructor by in_chrg.
5257
52582022-01-07 Jason Merrill <jason@redhat.com>
5259
5260 PR c++/61611
5261 * except.c (in_nested_catch): New.
5262 (expand_end_catch_block): Check it.
5263
52642022-01-07 Jason Merrill <jason@redhat.com>
5265
5266 PR c++/33799
5267 PR c++/102191
5268 * except.c (maybe_splice_retval_cleanup): Check
5269 current_binding_level.
5270 * semantics.c (do_poplevel): Call it here.
5271 * parser.c (cp_parser_compound_statement): Not here.
5272
52732022-01-07 Jason Merrill <jason@redhat.com>
5274
5275 PR c++/53868
5276 * decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
5277 cleanups from set_up_extended_ref_temp.
5278 (wrap_temporary_cleanups): Ignore array cleanups.
5279 (initialize_local_var): Don't check for array here.
5280 * cp-tree.h (BIND_EXPR_VEC_DTOR): New.
5281 * init.c (build_vec_delete_1): Set it.
5282
52832022-01-07 Jason Merrill <jason@redhat.com>
5284
5285 PR c++/66451
5286 * init.c (build_vec_delete_1): Handle throwing dtor.
5287 (build_vec_init): Tell it we're in a cleanup already.
5288
52892022-01-07 Jason Merrill <jason@redhat.com>
5290
5291 * typeck2.c (split_nonconstant_init_1): Don't cleanup the last elt.
5292 (split_nonconstant_init): Adjust.
5293
52942022-01-07 Jason Merrill <jason@redhat.com>
5295
5296 PR c++/66139
5297 PR c++/52320
5298 * constexpr.c (replace_decl): Rename from replace_result_decl.
5299 * cp-tree.h (replace_decl): Declare it.
5300 * cp-gimplify.c (cp_gimplify_init_expr): Call it.
5301 (cp_gimplify_expr): Don't handle VEC_INIT_EXPR.
5302 (cp_genericize_init, cp_genericize_init_expr)
5303 (cp_genericize_target_expr): New.
5304 (cp_fold_r): Call them.
5305 * tree.c (build_array_copy): Add a TARGET_EXPR.
5306 * typeck2.c (digest_init_r): Look through a TARGET_EXPR.
5307
53082022-01-07 Jason Merrill <jason@redhat.com>
5309
5310 PR c++/94041
5311 * decl.c (initialize_local_var): Fix comment.
5312 * init.c (build_new_1): Do stabilize array init.
5313 (build_vec_init): Use TARGET_EXPR for cleanup. Initialization
5314 of an element from an explicit initializer is not a
5315 full-expression.
5316 * tree.c (expand_vec_init_expr): Pass flags through.
5317 * typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
5318 (split_nonconstant_init): Handle array cleanups.
5319 * cp-tree.h: Adjust.
5320
53212022-01-07 Jason Merrill <jason@redhat.com>
5322
5323 PR c++/94041
5324 * decl.c (check_initializer): Remove obsolete comment.
5325 (wrap_cleanups_r): Don't wrap CLEANUP_EH_ONLY.
5326 (initialize_local_var): Change assert to test.
5327 * typeck2.c (maybe_push_temp_cleanup): New.
5328 (split_nonconstant_init_1): Use it.
5329 (split_nonconstant_init): Clear cleanup flags.
5330
53312022-01-07 Jason Merrill <jason@redhat.com>
5332
5333 PR c++/92385
5334 * typeck2.c (PICFLAG_VEC_INIT): New.
5335 (process_init_constructor_array): Set it.
5336 (process_init_constructor): Handle it.
5337 (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
5338 * init.c (build_vec_init): Likewise.
5339 * cp-gimplify.c (cp_gimplify_expr): Factor out...
5340 * tree.c (expand_vec_init_expr): ...this function.
5341 (build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P.
5342 (build_vec_init_expr): Likewise.
5343 * constexpr.c (cxx_eval_vec_init): Likewise.
5344 (reduced_constant_expression_p): Check arrays before C++20.
5345 * cp-tree.h (expand_vec_init_expr): Declare.
5346
53472022-01-07 Jason Merrill <jason@redhat.com>
5348
5349 * init.c (build_new_1): Remove preevaluation code.
5350
53512022-01-05 Nathan Sidwell <nathan@acm.org>
5352
5353 * pt.c (instantiate_class_template_1): Process attribute((used)) set
5354 in class's context.
5355
53562022-01-05 Nathan Sidwell <nathan@acm.org>
5357
5358 * init.c (build_new_1): Check complain before alignment warning.
5359
53602022-01-04 Jason Merrill <jason@redhat.com>
5361
5362 * cp-tree.h (class releasing_vec): Add begin/end fns.
5363
53642022-01-04 Jason Merrill <jason@redhat.com>
5365
5366 * init.c: Include -*- C++ -*- on first line.
5367
53682022-01-03 Marek Polacek <polacek@redhat.com>
5369
5370 PR c++/103758
5371 * parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
5372 with %qD.
5373
53742022-01-03 Marek Polacek <polacek@redhat.com>
5375
5376 * parser.c (make_char_string_pack): Add a cast to const unsigned
5377 char *.
5378
53792022-01-03 Jakub Jelinek <jakub@redhat.com>
5380
5381 PR c++/103600
5382 * rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
5383 to DECL_TINFO_P VAR_DECLs.
5384
53852022-01-02 Jason Merrill <jason@redhat.com>
5386
5387 * init.c (build_vec_init): Append the decrement to elt_init.
5388
53892022-01-02 Jason Merrill <jason@redhat.com>
5390
5391 * decl.c (wrap_cleanups_r): Don't wrap if noexcept.
5392
5393\f
5394Copyright (C) 2022 Free Software Foundation, Inc.
5395
5396Copying and distribution of this file, with or without modification,
5397are permitted in any medium without royalty provided the copyright
5398notice and this notice are preserved.