]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/cp/ChangeLog
9458657292cd1cf27d22e9194dd76a595a5da94e
[thirdparty/gcc.git] / gcc / cp / ChangeLog
1 2022-11-08 Jason Merrill <jason@redhat.com>
2 Jakub Jelinek <jakub@redhat.com>
3
4 * cp-tree.h (fns_correspond): Declare.
5 * decl.cc (fns_correspond): New.
6 * call.cc (add_candidates): Look for op!= matching op==.
7 (joust): Complain about non-standard reversed tiebreaker.
8 (tourney): Fix champ_compared_to_predecessor logic.
9 (build_new_op): Don't complain about error_mark_node not having
10 'bool' type.
11 * pt.cc (tsubst_copy_and_build): Don't try to be permissive
12 when seen_error().
13
14 2022-11-06 Patrick Palka <ppalka@redhat.com>
15
16 * tree.cc (cxx_attribute_table): Include init_priority entry
17 only if SUPPORTS_INIT_PRIORITY.
18 (handle_init_priority_attribute): Add ATTRIBUTE_UNUSED. Assert
19 SUPPORTS_INIT_PRIORITY is true.
20
21 2022-11-04 Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
22 Yvan ROUX <yvan.roux@foss.st.com>
23
24 * mapper-client.cc: Use in-process client when networking is
25 disabled.
26
27 2022-11-03 Marek Polacek <polacek@redhat.com>
28
29 PR c++/107488
30 * call.cc (do_warn_dangling_reference): Quash -Wdangling-reference
31 for member operator*.
32
33 2022-11-03 Patrick Palka <ppalka@redhat.com>
34
35 PR c++/107179
36 * constraint.cc (tsubst_requires_expr): Make sure we're not
37 deferring access checks.
38
39 2022-11-03 Jason Merrill <jason@redhat.com>
40
41 * parser.cc (cp_parser_template_declaration_after_parameters): Fix
42 concept parsing below C++20.
43
44 2022-11-03 Patrick Palka <ppalka@redhat.com>
45
46 PR c++/93413
47 * decl2.cc (mark_used): Don't defer synthesis of virtual
48 functions.
49
50 2022-11-01 Nathan Sidwell <nathan@acm.org>
51
52 * cp-tree.h (LAMBDA_EXPR_SCOPE_SIG_DISCRIMINATOR): New.
53 (struct tree_lambda_expr): Add discriminator_sig bitfield.
54 (recrd_lambda_scope_sig_discriminator): Declare.
55 * lambda.cc (struct lambda_sig_count): New.
56 (lambda_discriminator): Add signature vector.
57 (start_lambda_scope): Adjust.
58 (compare_lambda_template_head, compare_lambda_sig): New.
59 (record_lambda_scope_sig_discriminator): New.
60 * mangle.cc (write_closure_type): Use the scope-sig discriminator for
61 ABI >= 18. Emit abi mangling warning if needed.
62 * module.cc (trees_out::core_vals): Stream the new discriminator.
63 (trees_in::core_vals): Likewise.
64 * parser.cc (cp_parser_lambda_declarator_opt): Call
65 record_lambda_scope_sig_discriminator.
66 * pt.cc (tsubst_lambda_expr): Likewise.
67
68 2022-11-01 Nathan Sidwell <nathan@acm.org>
69
70 * cp-tree.h (LAMBDA_EXPR_DISCRIMINATOR): Rename to ...
71 (LAMBDA_EXPR_SCOPE_ONLY_DISCRIMINATOR): ... here.
72 (struct tree_lambda_expr): Make default_capture_mode &
73 discriminator_scope bitfields.
74 (record_null_lambda_scope) Delete.
75 (record_lambda_scope_discriminator): Declare.
76 * lambda.cc (struct lambda_discriminator): New struct.
77 (lambda_scope, lambda_scope_stack): Adjust types.
78 (lambda_count): Delete.
79 (struct tree_int): Delete.
80 (start_lambda_scope, finish_lambda_scope): Adjust.
81 (record_lambda_scope): Only record the scope.
82 (record_lambda_scope_discriminator): New.
83 * mangle.cc (write_closure_type_name): Adjust.
84 * module.cc (trees_out::core_vals): Likewise,
85 (trees_in::core_vals): Likewise.
86 * parser.cc (cp_parser_lambda_expression): Call
87 record_lambda_scope_discriminator.
88 * pt.cc (tsubst_lambda_expr): Adjust record_lambda_scope caling. Call
89 record_lambda_scope_discriminator. Commonize control flow on tsubsting
90 the operator function.
91
92 2022-11-01 Jason Merrill <jason@redhat.com>
93
94 * parser.cc (make_call_declarator): Add std_attrs parm.
95 (cp_parser_lambda_declarator_opt): Pass it.
96 (cp_parser_direct_declarator): Pass it.
97
98 2022-11-01 Jason Merrill <jason@redhat.com>
99
100 * decl.cc (finish_function): Set TREE_NOTHROW later in the function.
101
102 2022-11-01 Jason Merrill <jason@redhat.com>
103
104 * decl.cc (duplicate_decls): Reformat loop.
105 * parser.cc (cp_parser_member_declaration): Add newline.
106 * semantics.cc: Remove newline.
107
108 2022-10-28 Marek Polacek <polacek@redhat.com>
109
110 * call.cc (maybe_warn_dangling_reference): Enable the warning in
111 system headers if the decl isn't in a system header.
112
113 2022-10-28 Jason Merrill <jason@redhat.com>
114
115 * decl.cc (grokdeclarator): Call decl_attributes before do_friend.
116
117 2022-10-28 Jakub Jelinek <jakub@redhat.com>
118
119 * parser.cc (cp_parser_omp_all_clauses): Allow optional comma
120 before the first clause even in pragma syntax.
121 (cp_parser_omp_allocate, cp_parser_omp_atomic, cp_parser_omp_depobj,
122 cp_parser_omp_flush, cp_parser_omp_scan_loop_body,
123 cp_parser_omp_ordered, cp_parser_omp_assumption_clauses,
124 cp_finish_omp_declare_variant, cp_parser_omp_declare_target,
125 cp_parser_omp_declare_reduction_exprs, cp_parser_omp_requires,
126 cp_parser_omp_error): Likewise.
127
128 2022-10-28 Joseph Myers <joseph@codesourcery.com>
129
130 PR c/61469
131 * cp-tree.h (ENUM_FIXED_UNDERLYING_TYPE_P, ENUM_UNDERLYING_TYPE):
132 Remove. Moved to c-common.h.
133
134 2022-10-27 Jakub Jelinek <jakub@redhat.com>
135
136 PR c++/107379
137 * name-lookup.cc (push_namespace): Call find_namespace_slot again
138 after pushdecl as the hash table might be expanded during pushdecl.
139
140 2022-10-27 Nathan Sidwell <nathan@acm.org>
141
142 * mangle.cc (write_closure_template_head): New.
143 (write_closure_type_name): Call it.
144
145 2022-10-27 Jakub Jelinek <jakub@redhat.com>
146
147 PR c++/107382
148 PR c++/107383
149 * typeck.cc (cp_build_binary_op): Don't compute semantic_result_type
150 if result_type is NULL.
151
152 2022-10-26 Marek Polacek <polacek@redhat.com>
153
154 PR c++/106393
155 * call.cc (expr_represents_temporary_p): New, factored out of...
156 (conv_binds_ref_to_temporary): ...here. Don't return false just
157 because a ck_base is missing. Use expr_represents_temporary_p.
158 (do_warn_dangling_reference): New.
159 (maybe_warn_dangling_reference): New.
160 (extend_ref_init_temps): Call maybe_warn_dangling_reference.
161 * cp-tree.h: Adjust comment.
162 * typeck.cc (check_return_expr): Suppress -Wdangling-reference
163 warnings.
164
165 2022-10-25 Nathan Sidwell <nathan@acm.org>
166
167 * parser.cc (synthesize_implicit_template_parm): Fix thinko about
168 mark the new parm DECL_VIRTUAL_P. Avoid unneccessary tree_last call.
169
170 2022-10-25 Patrick Palka <ppalka@redhat.com>
171
172 * constraint.cc (resolve_function_concept_overload): Explicitly
173 pass complain=tf_none to coerce_template_parms.
174 (resolve_concept_check): Likewise.
175 (normalize_concept_check): Likewise.
176 * cp-tree.h (coerce_template_parms): Declare the main overload
177 and default its last parameter to true. Remove wrapper overloads.
178 * pt.cc (determine_specialization): Adjust calls to
179 coerce_template_parms and coerce_innermost_template_parms after
180 removing their last parameter.
181 (coerce_template_args_for_ttp): Likewise.
182 (coerce_ttp_args_for_tta): Likewise.
183 (coerce_template_template_parms): Likewise.
184 (coerce_template_parms): Remove use_default_args parameter and
185 adjust function comment. Document default argument. Remove
186 wrapper overloads. No longer static.
187 (coerce_innermost_template_parms): Remove use_default_args
188 parameter. Default require_all_args to true.
189 (lookup_template_class): As with determine_specialization.
190 (finish_template_variable): Likewise.
191 (tsubst_decl): Likewise.
192 (instantiate_alias_template): Likewise.
193 (fn_type_unification): Likewise.
194 (resolve_overloaded_unification): Likewise.
195 (resolve_nondeduced_context): Likewise.
196 (get_partial_spec_bindings): Likewise.
197
198 2022-10-25 Jason Merrill <jason@redhat.com>
199
200 * constexpr.cc (find_failing_clause_r): Re-add the call to
201 contextual_conv_bool.
202
203 2022-10-25 Patrick Palka <ppalka@redhat.com>
204
205 PR c++/106848
206 PR c++/102600
207 * module.cc (trees_out::core_vals): Stream TYPE_MAX_VALUE and
208 TYPE_MIN_VALUE of ENUMERAL_TYPE.
209 (trees_in::core_vals): Likewise.
210 (trees_out::write_enum_def): Don't stream them here.
211 (trees_in::read_enum_def): Likewise.
212
213 2022-10-25 Jason Merrill <jason@redhat.com>
214
215 * constexpr.cc (class constexpr_global_ctx): Add modifiable field,
216 get_value, get_value_ptr, put_value, remove_value, flush_modifiable
217 member functions.
218 (class modifiable_tracker): New.
219 (cxx_eval_internal_function): Use it.
220 (diagnose_failing_condition): Strip CLEANUP_POINT_EXPR.
221
222 2022-10-25 Jason Merrill <jason@redhat.com>
223
224 * constexpr.cc (fold_operand): New function.
225 (find_failing_clause_r): Add const.
226 (find_failing_clause): Add const.
227 (diagnose_failing_condition): Add ctx parameter.
228 (cxx_eval_internal_function): Pass it.
229 * semantics.cc (diagnose_failing_condition): Move to constexpr.cc.
230 * cp-tree.h: Adjust.
231
232 2022-10-24 Jason Merrill <jason@redhat.com>
233
234 * cp-gimplify.cc (fold_builtin_source_location)
235 * vtable-class-hierarchy.cc (register_all_pairs): Simplify calls to
236 build_string_literal.
237 (build_string_from_id): Remove.
238
239 2022-10-24 Marek Polacek <polacek@redhat.com>
240
241 PR c++/107276
242 * typeck.cc (treat_lvalue_as_rvalue_p): Check the return value of move.
243
244 2022-10-24 Jakub Jelinek <jakub@redhat.com>
245
246 PR c++/107358
247 * typeck.cc (cp_build_binary_op): Pass operands before excess precision
248 promotions to scalar_to_vector call.
249
250 2022-10-24 Jakub Jelinek <jakub@redhat.com>
251
252 PR c++/105774
253 * constexpr.cc (cxx_eval_increment_expression): For signed types
254 that promote to int, evaluate PLUS_EXPR or MINUS_EXPR in int type.
255
256 2022-10-24 Arsen Arsenović <arsen@aarsen.me>
257
258 * cp-tree.h (DECL_MAIN_P): Move most logic, besides the hosted
259 check, from here...
260 (DECL_MAIN_ANY_P): ... to here, so that it can be reused ...
261 (DECL_MAIN_FREESTANDING_P): ... here, with an additional
262 constraint on (hosted OR return type == int)
263 * decl.cc (finish_function): Use DECL_MAIN_FREESTANDING_P
264 instead of DECL_MAIN_P, to loosen the hosted requirement, but
265 check noreturn, before adding implicit returns.
266
267 2022-10-21 Jakub Jelinek <jakub@redhat.com>
268
269 PR c++/107295
270 * constexpr.cc (reduced_constant_expression_p) <case CONSTRUCTOR>:
271 Return false for VECTOR_TYPE CONSTRUCTORs even without
272 CONSTRUCTOR_NO_CLEARING set on them.
273 (cxx_eval_bare_aggregate): If constant but !changed, fold before
274 returning VECTOR_TYPE_P CONSTRUCTOR.
275 (cxx_eval_constant_expression) <case CONSTRUCTOR>: Don't fold
276 TREE_CONSTANT CONSTRUCTOR, just return it.
277
278 2022-10-21 Jakub Jelinek <jakub@redhat.com>
279
280 PR c++/106863
281 * semantics.cc (finish_compound_literal): For void{}, if
282 processing_template_decl return a COMPOUND_LITERAL_P
283 CONSTRUCTOR rather than void_node.
284
285 2022-10-20 Patrick Palka <ppalka@redhat.com>
286
287 * pt.cc (lookup_and_finish_template_variable): Don't
288 instantiate if the template's scope is dependent.
289 (tsubst_copy) <case TEMPLATE_DECL>: Pass entering_scope=true
290 when substituting the class scope.
291
292 2022-10-20 Patrick Palka <ppalka@redhat.com>
293
294 PR c++/102963
295 * module.cc (node_template_info): Handle CONCEPT_DECL.
296
297 2022-10-20 Jonathan Wakely <jwakely@redhat.com>
298 Ulrich Drepper <drepper@redhat.com>
299
300 * Make-lang.in: Add rules to generate std-name-hint.gperf. Adjust
301 rule to generate std-name-hint.h to allow chain rule.
302 * std-name-hint.h: Regenerated.
303 * std-name-hint.gperf: This file is now generated.
304 * cxxapi-data.csv: New file. CSV file with C++ API data.
305 * gen-cxxapi-file.py: New file. Generate std-name-hint.gperf
306 and module export source (in future).
307
308 2022-10-19 Marek Polacek <polacek@redhat.com>
309
310 PR c++/85043
311 * typeck.cc (maybe_warn_about_useless_cast): Don't warn when
312 a glvalue is cast to a non-reference type.
313
314 2022-10-18 Patrick Palka <ppalka@redhat.com>
315
316 PR c++/105045
317 * module.cc (trees_out::tpl_parms_fini): Don't assume default
318 template arguments must be trailing.
319 (trees_in::tpl_parms_fini): Likewise.
320
321 2022-10-18 Jakub Jelinek <jakub@redhat.com>
322
323 PR c++/106654
324 * cp-tree.h (build_assume_call): Declare.
325 * parser.cc (cp_parser_omp_assumption_clauses): Use build_assume_call.
326 * cp-gimplify.cc (build_assume_call): New function.
327 (process_stmt_assume_attribute): Use build_assume_call.
328 * pt.cc (tsubst_copy_and_build): Likewise.
329
330 2022-10-17 Patrick Palka <ppalka@redhat.com>
331
332 PR c++/101449
333 * module.cc (trees_out::write_function_def): Stream the
334 parms and result of the constexpr_fundef entry.
335 (trees_in::read_function_def): Likewise.
336
337 2022-10-14 Patrick Palka <ppalka@redhat.com>
338
339 PR c++/106304
340 * constexpr.cc (cxx_dynamic_cast_fn_p): Check for abi_node
341 instead of global_namespace.
342 * rtti.cc (build_dynamic_cast_1): Set DECL_CONTEXT and
343 DECL_SOURCE_LOCATION when building dynamic_cast_node. Push
344 it into the namespace.
345
346 2022-10-14 Jakub Jelinek <jakub@redhat.com>
347
348 * cp-tree.h (extended_float_type_p): Return true for
349 bfloat16_type_node.
350 * typeck.cc (cp_compare_floating_point_conversion_ranks): Set
351 extended{1,2} if mv{1,2} is bfloat16_type_node. Adjust comment.
352
353 2022-10-14 Jakub Jelinek <jakub@redhat.com>
354
355 PR c/82071
356 PR c/87390
357 PR c++/107097
358 * cp-tree.h (cp_ep_convert_and_check): Remove.
359 * cvt.cc (cp_ep_convert_and_check): Remove.
360 * call.cc (build_conditional_expr): Use excess precision for ?: with
361 one arm floating and another integral. Don't convert first to
362 semantic result type from integral types.
363 (convert_like_internal): Don't call cp_ep_convert_and_check, instead
364 just strip EXCESS_PRECISION_EXPR before calling cp_convert_and_check
365 or cp_convert.
366 * typeck.cc (cp_build_binary_op): Set may_need_excess_precision
367 for comparisons or SPACESHIP_EXPR with at least one operand integral.
368 Don't compute semantic_result_type if build_type is non-NULL. Call
369 cp_convert_and_check instead of cp_ep_convert_and_check.
370
371 2022-10-14 Jakub Jelinek <jakub@redhat.com>
372
373 PR middle-end/323
374 PR c++/107097
375 * parser.cc (cp_parser_primary_expression): Handle
376 EXCESS_PRECISION_EXPR with REAL_CST operand the same as REAL_CST.
377 * cvt.cc (cp_ep_convert_and_check): New function.
378 * call.cc (build_conditional_expr): Add excess precision support.
379 When type_after_usual_arithmetic_conversions returns error_mark_node,
380 use gcc_checking_assert that it is because of uncomparable floating
381 point ranks instead of checking all those conditions and make it
382 work also with complex types.
383 (convert_like_internal): Likewise. Add NESTED_P argument, pass true
384 to recursive calls to convert_like.
385 (convert_like): Add NESTED_P argument, pass it through to
386 convert_like_internal. For other overload pass false to it.
387 (convert_like_with_context): Pass false to NESTED_P.
388 (convert_arg_to_ellipsis): Add excess precision support.
389 (magic_varargs_p): For __builtin_is{finite,inf,inf_sign,nan,normal}
390 and __builtin_fpclassify return 2 instead of 1, document what it
391 means.
392 (build_over_call): Don't handle former magic 2 which is no longer
393 used, instead for magic 1 remove EXCESS_PRECISION_EXPR.
394 (perform_direct_initialization_if_possible): Pass false to NESTED_P
395 convert_like argument.
396 * constexpr.cc (cxx_eval_constant_expression): Handle
397 EXCESS_PRECISION_EXPR.
398 (potential_constant_expression_1): Likewise.
399 * pt.cc (tsubst_copy, tsubst_copy_and_build): Likewise.
400 * cp-tree.h (cp_ep_convert_and_check): Declare.
401 * cp-gimplify.cc (cp_fold): Handle EXCESS_PRECISION_EXPR.
402 * typeck.cc (cp_common_type): For COMPLEX_TYPEs, return error_mark_node
403 if recursive call returned it.
404 (convert_arguments): For magic 1 remove EXCESS_PRECISION_EXPR.
405 (cp_build_binary_op): Add excess precision support. When
406 cp_common_type returns error_mark_node, use gcc_checking_assert that
407 it is because of uncomparable floating point ranks instead of checking
408 all those conditions and make it work also with complex types.
409 (cp_build_unary_op): Likewise.
410 (cp_build_compound_expr): Likewise.
411 (build_static_cast_1): Remove EXCESS_PRECISION_EXPR.
412
413 2022-10-13 Jason Merrill <jason@redhat.com>
414
415 * cp-tree.h: Fix whitespace.
416 * parser.h: Fix whitespace.
417 * decl.cc: Fix whitespace.
418 * parser.cc: Fix whitespace.
419 * pt.cc: Fix whitespace.
420
421 2022-10-13 Martin Liska <mliska@suse.cz>
422
423 * vtable-class-hierarchy.cc (vtv_generate_init_routine): Emit
424 an artificial variable that would be put into .preinit_array
425 section.
426
427 2022-10-13 Marek Polacek <polacek@redhat.com>
428
429 PR c++/106925
430 * except.cc (maybe_splice_retval_cleanup): Check current_function_decl.
431 Make the bool const.
432
433 2022-10-12 Marek Polacek <polacek@redhat.com>
434
435 * call.cc (standard_conversion): Remove LOOKUP_PREFER_RVALUE code.
436 (reference_binding): Honor clk_implicit_rval even pre-C++20.
437 (implicit_conversion_1): Remove LOOKUP_PREFER_RVALUE code.
438 (build_user_type_conversion_1): Likewise.
439 (convert_like_internal): Likewise.
440 (build_over_call): Likewise.
441 * cp-tree.h (LOOKUP_PREFER_RVALUE): Remove.
442 (LOOKUP_NO_NARROWING): Adjust definition.
443 * except.cc (build_throw): Don't perform two overload resolutions.
444 * typeck.cc (maybe_warn_pessimizing_move): Don't use
445 LOOKUP_PREFER_RVALUE.
446 (check_return_expr): Don't perform two overload resolutions.
447
448 2022-10-12 Jason Merrill <jason@redhat.com>
449
450 DR 2631
451 * cp-tree.h (source_location_current_p): Remove.
452 * name-lookup.h (struct cp_binding_level): Remove
453 immediate_fn_ctx_p.
454 * call.cc (in_immediate_context): All default args
455 and DMI are potentially immediate context.
456 (immediate_invocation_p): Don't treat source_location specially.
457 (struct in_consteval_if_p_temp_override): Move to cp-tree.h.
458 * constexpr.cc (get_nth_callarg): Move to cp-tree.h.
459 * cp-gimplify.cc (cp_fold_r): Don't fold consteval.
460 * name-lookup.cc (begin_scope): Don't set immediate_fn_ctx_p.
461 * parser.cc (cp_parser_lambda_declarator_opt): Likewise.
462 (cp_parser_direct_declarator): Likewise.
463 * pt.cc (tsubst_default_argument): Open sk_function_parms level.
464 * tree.cc (source_location_current_p): Remove.
465 (bot_replace): Fold consteval here.
466 (break_out_target_exprs): Handle errors.
467
468 2022-10-11 Patrick Palka <ppalka@redhat.com>
469
470 PR c++/100134
471 * pt.cc (tsubst_friend_function): Propagate DECL_MODULE_PURVIEW_P
472 from the introduced namespace-scope function to the namespace.
473
474 2022-10-11 Patrick Palka <ppalka@redhat.com>
475
476 PR c++/99377
477 * module.cc (lazy_load_binding): Clear processing_template_decl.
478 (lazy_load_pendings): Likewise.
479
480 2022-10-10 Nathan Sidwell <nathan@acm.org>
481
482 * mangle.cc (write_prefix): Add VAR_DECL & FIELD_DECL to
483 substitution table under abi=18. Note possible mismatch.
484
485 2022-10-10 Marek Polacek <polacek@redhat.com>
486
487 PR c++/106937
488 * error.cc: Include "attribs.h".
489 (dump_type_prefix): Print only GNU attributes here.
490 (dump_type_suffix): Print standard attributes here.
491
492 2022-10-08 Jason Merrill <jason@redhat.com>
493
494 * cp-tree.h (TARGET_EXPR_ELIDING_P): New.
495 (unsafe_copy_elision_p, set_target_expr_eliding)
496 (cp_build_init_expr): Declare.
497 * call.cc (unsafe_copy_elision_p): No longer static.
498 (build_over_call, build_special_member_call)
499 (build_new_method_call): Use cp_build_init_expr.
500 * coroutines.cc (expand_one_await_expression)
501 (build_actor_fn, flatten_await_stmt, handle_nested_conditionals)
502 (await_statement_walker, morph_fn_to_coro): Use cp_build_init_expr.
503 * cp-gimplify.cc (cp_gimplify_init_expr)
504 (cp_gimplify_expr): Check TARGET_EXPR_ELIDING_P.
505 (cp_fold_r): Propagate it.
506 (cp_fold): Use cp_build_init_expr.
507 * decl.cc (check_initializer): Use cp_build_init_expr.
508 * except.cc (build_throw): Use cp_build_init_expr.
509 * init.cc (get_nsdmi): Call set_target_expr_eliding.
510 (perform_member_init, expand_default_init, expand_aggr_init_1)
511 (build_new_1, build_vec_init): Use cp_build_init_expr.
512 * method.cc (do_build_copy_constructor): Use cp_build_init_expr.
513 * semantics.cc (simplify_aggr_init_expr, finalize_nrv_r)
514 (finish_omp_reduction_clause): Use cp_build_init_expr.
515 * tree.cc (build_target_expr): Call set_target_expr_eliding.
516 (bot_manip): Copy TARGET_EXPR_ELIDING_P.
517 * typeck.cc (cp_build_modify_expr): Call set_target_expr_eliding.
518 (check_return_expr): Use cp_build_modify_expr.
519 * typeck2.cc (split_nonconstant_init_1)
520 (split_nonconstant_init): Use cp_build_init_expr.
521 (massage_init_elt): Call set_target_expr_eliding.
522 (process_init_constructor_record): Clear TARGET_EXPR_ELIDING_P on
523 unsafe copy elision.
524 (set_target_expr_eliding, cp_build_init_expr): New.
525
526 2022-10-07 Marek Polacek <polacek@redhat.com>
527
528 PR c++/107085
529 * call.cc (conv_binds_ref_to_temporary): New.
530 (ref_conv_binds_directly): Rename to...
531 (ref_conv_binds_to_temporary): ...this. Use
532 conv_binds_ref_to_temporary.
533 * cp-tree.h (ref_conv_binds_directly): Rename to...
534 (ref_conv_binds_to_temporary): ...this.
535 * method.cc (ref_xes_from_temporary): Use ref_conv_binds_to_temporary.
536 * parser.cc (warn_for_range_copy): Likewise.
537
538 2022-10-07 Qing Zhao <qing.zhao@oracle.com>
539
540 * module.cc (trees_out::core_bools): Stream out new bit
541 decl_not_flexarray.
542 (trees_in::core_bools): Stream in new bit decl_not_flexarray.
543
544 2022-10-07 Patrick Palka <ppalka@redhat.com>
545
546 * module.cc (trees_out::mark_class_def): Guard against
547 DECL_BIT_FIELD_REPRESENTATIVE not being a decl.
548
549 2022-10-07 Jason Merrill <jason@redhat.com>
550
551 * init.cc (expand_default_init): Also push the INIT_EXPR inside a
552 CLEANUP_POINT_EXPR.
553
554 2022-10-07 Patrick Palka <ppalka@redhat.com>
555
556 PR c++/104433
557 * module.cc (trees_out::core_bools): Don't override
558 DECL_EXTERNAL to true for static variables from an inline
559 function.
560
561 2022-10-07 Martin Liska <mliska@suse.cz>
562
563 * module.cc (enum module_state_counts): Use array size.
564 * name-lookup.cc (class namespace_limit_reached): Likewise.
565 (class module_state): Move up in the file.
566
567 2022-10-07 Jakub Jelinek <jakub@redhat.com>
568
569 * parser.cc (cp_parser_check_std_attribute): Only do checks if
570 attribute is a standard attribute or in gnu namespace and only
571 lookup other attributes in those namespaces.
572 * cp-gimplify.cc (lookup_hotness_attribute): Adjust function comment.
573 Only return true for standard attribute or gnu namespace attribute.
574 (remove_hotness_attribute): Only remove hotness attributes when
575 they are standard or in gnu namespace, implement it in a single
576 loop rather than former 4 now 8 remove_attribute calls.
577
578 2022-10-06 Jason Merrill <jason@redhat.com>
579
580 * coroutines.cc (expand_one_await_expression): Change conversion
581 to VIEW_CONVERT_EXPR.
582 * cp-gimplify.cc (cp_genericize_r) [CONVERT_EXPR]: Add assert.
583
584 2022-10-06 Joseph Myers <joseph@codesourcery.com>
585
586 * lex.cc (init_reswords): Handle D_EXT11.
587
588 2022-10-06 Patrick Palka <ppalka@redhat.com>
589
590 * pt.cc (optimize_specialization_lookup_p): Remove.
591 (retrieve_specialization): Assume the above returns false
592 and simplify accordingly.
593 (register_specialization): Likewise.
594
595 2022-10-06 Jakub Jelinek <jakub@redhat.com>
596
597 * parser.cc (cp_parser_omp_assumption_clauses): Emit IFN_ASSUME
598 call for holds clause on assume construct.
599
600 2022-10-06 Jakub Jelinek <jakub@redhat.com>
601
602 PR c++/106654
603 * cp-tree.h (process_stmt_assume_attribute): Implement C++23
604 P1774R8 - Portable assumptions. Declare.
605 (diagnose_failing_condition): Declare.
606 (find_failing_clause): Likewise.
607 * parser.cc (assume_attr): New enumerator.
608 (cp_parser_parenthesized_expression_list): Handle assume_attr.
609 Remove identifier variable, for id_attr push the identifier into
610 expression_list right away instead of inserting it before all the
611 others at the end.
612 (cp_parser_conditional_expression): New function.
613 (cp_parser_constant_expression): Use it.
614 (cp_parser_statement): Handle assume attribute.
615 (cp_parser_expression_statement): Likewise.
616 (cp_parser_gnu_attribute_list): Use assume_attr for assume
617 attribute.
618 (cp_parser_std_attribute): Likewise. Handle standard assume
619 attribute like gnu::assume.
620 * cp-gimplify.cc (process_stmt_assume_attribute): New function.
621 * constexpr.cc: Include fold-const.h.
622 (find_failing_clause_r, find_failing_clause): New functions,
623 moved from semantics.cc with ctx argument added and if non-NULL,
624 call cxx_eval_constant_expression rather than fold_non_dependent_expr.
625 (cxx_eval_internal_function): Handle IFN_ASSUME.
626 (potential_constant_expression_1): Likewise.
627 * pt.cc (tsubst_copy_and_build): Likewise.
628 * semantics.cc (diagnose_failing_condition): New function.
629 (find_failing_clause_r, find_failing_clause): Moved to constexpr.cc.
630 (finish_static_assert): Use it. Add auto_diagnostic_group.
631
632 2022-10-05 Jason Merrill <jason@redhat.com>
633
634 * tree.cc (lvalue_kind) [VIEW_CONVERT_EXPR]: Change prvalue to
635 xvalue.
636
637 2022-10-04 Jason Merrill <jason@redhat.com>
638
639 PR c++/107154
640 * cp-gimplify.cc (cp_genericize_init_expr): Use iloc_sentinel.
641 (cp_genericize_target_expr): Likewise.
642
643 2022-10-04 Patrick Palka <ppalka@redhat.com>
644
645 PR c++/107136
646 * Make-lang.in (CP_PLUGIN_HEADERS): Add cp-trait.def.
647
648 2022-10-04 Jakub Jelinek <jakub@redhat.com>
649
650 * cp-tree.h (struct omp_declare_target_attr): Rename to ...
651 (cp_omp_declare_target_attr): ... this. Add device_type member.
652 (omp_begin_assumes_data): Rename to ...
653 (cp_omp_begin_assumes_data): ... this.
654 (struct saved_scope): Change types of omp_declare_target_attribute
655 and omp_begin_assumes.
656 * parser.cc (cp_parser_omp_clause_device_type): Uncomment
657 check_no_duplicate_clause call.
658 (cp_parser_omp_all_clauses): Fix up pasto, c_name for OMP_CLAUSE_LINK
659 should be "link" rather than "to".
660 (cp_parser_omp_declare_target): Adjust for omp_declare_target_attr
661 to cp_omp_declare_target_attr changes, push -1 as device_type. Use
662 error_at rather than warning_at for declare target with only
663 device_type clauses.
664 (OMP_BEGIN_DECLARE_TARGET_CLAUSE_MASK): Define.
665 (cp_parser_omp_begin): Add begin declare target support. Adjust
666 for omp_begin_assumes_data to cp_omp_begin_assumes_data change.
667 (cp_parser_omp_end): Adjust for the
668 omp_declare_target_attr to cp_omp_declare_target_attr and
669 omp_begin_assumes_data to cp_omp_begin_assumes_data type changes,
670 adjust diagnostics wording and simplify format strings for easier
671 translations.
672 * semantics.cc (finish_translation_unit): Likewise.
673 * decl2.cc (cplus_decl_attributes): If device_type was present on
674 begin declare target, add "omp declare target host" and/or
675 "omp declare target nohost" attributes.
676
677 2022-10-03 Jakub Jelinek <jakub@redhat.com>
678
679 * cp-tree.h (BCS_STMT_EXPR): New enumerator.
680 * name-lookup.h (enum scope_kind): Add sk_stmt_expr.
681 * name-lookup.cc (begin_scope): Handle sk_stmt_expr like sk_block.
682 * semantics.cc (begin_compound_stmt): For BCS_STMT_EXPR use
683 sk_stmt_expr.
684 * parser.cc (cp_parser_statement_expr): Use BCS_STMT_EXPR instead of
685 BCS_NORMAL.
686 * decl.cc (struct named_label_entry): Add in_stmt_expr.
687 (poplevel_named_label_1): Handle sk_stmt_expr.
688 (check_previous_goto_1): Diagnose entering of statement expression.
689 (check_goto): Likewise.
690
691 2022-10-03 Patrick Palka <ppalka@redhat.com>
692
693 * constraint.cc (diagnose_trait_expr): Use CPTK_IS_SAME instead
694 of CPTK_IS_SAME_AS.
695 * cp-trait.def (IS_SAME_AS): Rename to ...
696 (IS_SAME): ... this.
697 * pt.cc (alias_ctad_tweaks): Use CPTK_IS_SAME instead of
698 CPTK_IS_SAME_AS.
699 * semantics.cc (trait_expr_value): Likewise.
700 (finish_trait_expr): Likewise.
701
702 2022-10-01 Patrick Palka <ppalka@redhat.com>
703
704 * semantics.cc (trait_expr_value): Make cp_trait_kind switch
705 statement exhaustive.
706 (finish_trait_expr): Likewise.
707 (finish_trait_type): Likewise.
708
709 2022-10-01 Jason Merrill <jason@redhat.com>
710
711 * init.cc (build_vec_init): Clear from_array for CONSTRUCTOR
712 initializer.
713
714 2022-10-01 Jason Merrill <jason@redhat.com>
715
716 * cp-gimplify.cc (cp_genericize_init): Also convert the result of
717 split_nonconstant_init to void.
718
719 2022-09-30 Patrick Palka <ppalka@redhat.com>
720
721 * constraint.cc (diagnose_trait_expr): Likewise.
722 * cp-objcp-common.cc (names_builtin_p): Likewise.
723 * cp-tree.h (enum cp_trait_kind): Likewise.
724 * cxx-pretty-print.cc (pp_cxx_trait): Likewise.
725 * parser.cc (cp_keyword_starts_decl_specifier_p): Likewise.
726 (cp_parser_primary_expression): Likewise.
727 (cp_parser_trait): Likewise.
728 (cp_parser_simple_type_specifier): Likewise.
729 * cp-trait.def: New file.
730
731 2022-09-30 Jason Merrill <jason@redhat.com>
732
733 * cp-gimplify.cc (cp_fold_r) [TARGET_EXPR]: Collapse
734 TARGET_EXPR within TARGET_EXPR.
735 * constexpr.cc (cxx_eval_outermost_constant_expr): Avoid
736 adding redundant TARGET_EXPR.
737 * cp-tree.h (target_expr_needs_replace): VEC_INIT_EXPR doesn't.
738
739 2022-09-29 Patrick Palka <ppalka@redhat.com>
740
741 PR c++/102576
742 * pt.cc (listify): Use lookup_qualified_name instead of
743 get_namespace_binding.
744
745 2022-09-29 Jason Merrill <jason@redhat.com>
746
747 * class.cc (check_methods): Call constraints_satisfied_p.
748
749 2022-09-29 Jason Merrill <jason@redhat.com>
750
751 * constexpr.cc (potential_constant_expression_1): Look into
752 DECL_INITIAL. Use location wrappers.
753
754 2022-09-29 Jason Merrill <jason@redhat.com>
755
756 PR c++/93046
757 * call.cc (build_conditional_expr): For a?:c extension, treat
758 a reused class prvalue as an xvalue.
759
760 2022-09-29 Jason Merrill <jason@redhat.com>
761
762 * call.cc (build_conditional_expr): Set TARGET_EXPR_NO_ELIDE on the
763 outer TARGET_EXPR.
764
765 2022-09-29 Patrick Palka <ppalka@redhat.com>
766
767 * constraint.cc (diagnose_trait_expr): Handle CPTK_REMOVE_CV,
768 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
769 * cp-objcp-common.cc (names_builtin_p): Likewise.
770 * cp-tree.h (enum cp_trait_kind): Add CPTK_REMOVE_CV,
771 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
772 * cxx-pretty-print.cc (pp_cxx_trait): Handle CPTK_REMOVE_CV,
773 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
774 * parser.cc (cp_keyword_starts_decl_specifier_p): Return true
775 for RID_REMOVE_CV, RID_REMOVE_REFERENCE and RID_REMOVE_CVREF.
776 (cp_parser_trait): Handle RID_REMOVE_CV, RID_REMOVE_REFERENCE
777 and RID_REMOVE_CVREF.
778 (cp_parser_simple_type_specifier): Likewise.
779 * semantics.cc (finish_trait_type): Likewise.
780
781 2022-09-29 Patrick Palka <ppalka@redhat.com>
782
783 * cp-objcp-common.cc (cp_common_init_ts): Replace
784 UNDERLYING_TYPE with TRAIT_TYPE.
785 * cp-tree.def (TRAIT_TYPE): Define.
786 (UNDERLYING_TYPE): Remove.
787 * cp-tree.h (TRAIT_TYPE_KIND_RAW): Define.
788 (TRAIT_TYPE_KIND): Define.
789 (TRAIT_TYPE_TYPE1): Define.
790 (TRAIT_TYPE_TYPE2): Define.
791 (WILDCARD_TYPE_P): Return true for TRAIT_TYPE.
792 (finish_trait_type): Declare.
793 * cxx-pretty-print.cc (cxx_pretty_printer::primary_expression):
794 Adjust after renaming pp_cxx_trait_expression.
795 (cxx_pretty_printer::simple_type_specifier) <case TRAIT_TYPE>:
796 New.
797 (cxx_pretty_printer::type_id): Replace UNDERLYING_TYPE with
798 TRAIT_TYPE.
799 (pp_cxx_trait_expression): Rename to ...
800 (pp_cxx_trait): ... this. Handle TRAIT_TYPE as well. Correct
801 pretty printing of the trailing arguments.
802 * cxx-pretty-print.h (pp_cxx_trait_expression): Rename to ...
803 (pp_cxx_trait_type): ... this.
804 * error.cc (dump_type) <case UNDERLYING_TYPE>: Remove.
805 <case TRAIT_TYPE>: New.
806 (dump_type_prefix): Replace UNDERLYING_WITH with TRAIT_TYPE.
807 (dump_type_suffix): Likewise.
808 * mangle.cc (write_type) <case UNDERLYING_TYPE>: Remove.
809 <case TRAIT_TYPE>: New.
810 * module.cc (trees_out::type_node) <case UNDERLYING_TYPE>:
811 Remove.
812 <case TRAIT_TYPE>: New.
813 (trees_in::tree_node): Likewise.
814 * parser.cc (cp_parser_primary_expression): Adjust after
815 renaming cp_parser_trait_expr.
816 (cp_parser_trait_expr): Rename to ...
817 (cp_parser_trait): ... this. Call finish_trait_type for traits
818 that yield a type.
819 (cp_parser_simple_type_specifier): Adjust after renaming
820 cp_parser_trait_expr.
821 * pt.cc (for_each_template_parm_r) <case UNDERLYING_TYPE>:
822 Remove.
823 <case TRAIT_TYPE>: New.
824 (tsubst): Likewise.
825 (unify): Replace UNDERLYING_TYPE with TRAIT_TYPE.
826 (dependent_type_p_r): Likewise.
827 * semantics.cc (finish_underlying_type): Don't return
828 UNDERLYING_TYPE anymore when processing_template_decl.
829 (finish_trait_type): Define.
830 * tree.cc (strip_typedefs) <case UNDERLYING_TYPE>: Remove.
831 <case TRAIT_TYPE>: New.
832 (cp_walk_subtrees): Likewise.
833 * typeck.cc (structural_comptypes): Likewise.
834
835 2022-09-29 Nathan Sidwell <nathan@acm.org>
836
837 PR c++/100616
838 * module.cc (enum tree_tag): Add tt_nttp_var.
839 (trees_out::decl_node): Handle NTTP objects.
840 (trees_in::tree_node): Handle tt_nttp_var.
841 (depset::hash::add_binding_entry): Skip NTTP objects.
842
843 2022-09-28 Eugene Rozenfeld <erozen@microsoft.com>
844
845 * module.cc (write_location): Write discriminator.
846 (read_location): Read discriminator.
847
848 2022-09-28 Nathan Sidwell <nathan@acm.org>
849
850 * cp-tree.h (DECL_NTTP_OBJECT_P): New.
851 (template_parm_object_p): Delete.
852 (build_template_parm_object): Declare.
853 * cxx-pretty-print.cc (pp_cx_template_argument_list): Use DECL_NTTP_OBJECT_P.
854 * error.cc (dump_simple_decl): Likewise.
855 * mangle.cc (write_template_arg): Likewise.
856 * pt.cc (template_parm_object_p): Delete.
857 (create_template_parm_object): Separated out checking from ...
858 (get_template_parm_object): ... this, new external entry point.
859
860 2022-09-27 Marek Polacek <polacek@redhat.com>
861
862 PR c++/101165
863 PR c++/106882
864 * call.cc (reference_binding): Check clk_implicit_rval in C++20 only.
865 * cp-tree.h (unparenthesized_id_or_class_member_access_p): Declare.
866 * pt.cc (unparenthesized_id_or_class_member_access_p): New function,
867 broken out of...
868 (do_auto_deduction): ...here. Use it. In C++23, maybe call
869 treat_lvalue_as_rvalue_p.
870 * tree.cc (xvalue_p): Check & clk_rvalueref, not == clk_rvalueref.
871 * typeck.cc (check_return_expr): Allow implicit move for functions
872 returning a reference as well, or when the return value type is not
873 a scalar type.
874
875 2022-09-27 Marek Polacek <polacek@redhat.com>
876
877 * constraint.cc (diagnose_trait_expr): Say "nothrow" without quotes
878 rather than in quotes.
879
880 2022-09-27 Jonathan Wakely <jwakely@redhat.com>
881
882 PR c++/107049
883 * method.cc (is_convertible_helper): Use access check sentinel.
884
885 2022-09-27 Jakub Jelinek <jakub@redhat.com>
886
887 PR c++/106651
888 * cp-tree.h (LAMBDA_EXPR_STATIC_P): Implement C++23
889 P1169R4 - static operator(). Define.
890 * parser.cc (CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR): Document
891 that it also allows static.
892 (cp_parser_lambda_declarator_opt): Handle static lambda specifier.
893 (cp_parser_decl_specifier_seq): Allow RID_STATIC for
894 CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
895 * decl.cc (grok_op_properties): If operator() isn't a method,
896 use a different error wording, if it is static member function,
897 allow it (for C++20 and older with a pedwarn unless it is
898 a lambda function or template instantiation).
899 * call.cc (joust): Don't ICE if one candidate is static member
900 function and the other is an indirect call. If the parameter
901 conversion on the other candidate is user defined conversion,
902 ellipsis or bad conversion, make static member function candidate
903 a winner for that parameter.
904 * lambda.cc (maybe_add_lambda_conv_op): Handle static lambdas.
905 * error.cc (dump_lambda_function): Print static for static lambdas.
906
907 2022-09-27 Jakub Jelinek <jakub@redhat.com>
908
909 * cp-tree.h (struct omp_begin_assumes_data): New type.
910 (struct saved_scope): Add omp_begin_assumes member.
911 * parser.cc: Include bitmap.h.
912 (cp_parser_omp_assumption_clauses, cp_parser_omp_assume,
913 cp_parser_omp_assumes, cp_parser_omp_begin): New functions.
914 (cp_parser_omp_end_declare_target): Rename to ...
915 (cp_parser_omp_end): ... this. Handle also end assumes.
916 (cp_parser_omp_construct): Handle PRAGMA_OMP_ASSUME.
917 (cp_parser_pragma): Handle PRAGMA_OMP_ASSUME, PRAGMA_OMP_ASSUMES
918 and PRAGMA_OMP_BEGIN. Handle PRAGMA_OMP_END rather than
919 PRAGMA_OMP_END_DECLARE_TARGET and call cp_parser_omp_end
920 for it rather than cp_parser_omp_end_declare_target.
921 * pt.cc (apply_late_template_attributes): Also temporarily clear
922 omp_begin_assumes.
923 * semantics.cc (finish_translation_unit): Also diagnose
924 #pragma omp begin assumes without corresponding
925 #pragma omp end assumes.
926
927 2022-09-27 Jakub Jelinek <jakub@redhat.com>
928
929 * parser.cc (cp_parser_lambda_declarator_opt): Don't diagnose
930 conflicting specifiers here.
931 (cp_storage_class_name): New variable.
932 (cp_parser_decl_specifier_seq): When setting conflicting_specifiers_p
933 for the first time, diagnose which exact specifiers conflict.
934 (cp_parser_set_storage_class): Likewise. Move storage_class
935 computation earlier.
936 * decl.cc (grokdeclarator): Don't diagnose conflicting specifiers
937 here, just return error_mark_node.
938
939 2022-09-27 Jakub Jelinek <jakub@redhat.com>
940
941 PR c++/106652
942 PR c++/85518
943 * cp-tree.h (cp_compare_floating_point_conversion_ranks): Implement
944 P1467R9 - Extended floating-point types and standard names except
945 for std::bfloat16_t for now. Declare.
946 (extended_float_type_p): New inline function.
947 * mangle.cc (write_builtin_type): Mangle float{16,32,64,128}_type_node
948 as DF{16,32,64,128}_. Mangle float{32,64,128}x_type_node as
949 DF{32,64,128}x. Remove FIXED_POINT_TYPE mangling that conflicts
950 with that.
951 * typeck2.cc (check_narrowing): If one of ftype or type is extended
952 floating-point type, compare floating-point conversion ranks.
953 * parser.cc (cp_keyword_starts_decl_specifier_p): Handle
954 CASE_RID_FLOATN_NX.
955 (cp_parser_simple_type_specifier): Likewise and diagnose missing
956 _Float<N> or _Float<N>x support if not supported by target.
957 * typeck.cc (cp_compare_floating_point_conversion_ranks): New function.
958 (cp_common_type): If both types are REAL_TYPE and one or both are
959 extended floating-point types, select common type based on comparison
960 of floating-point conversion ranks and subranks.
961 (cp_build_binary_op): Diagnose operation with floating point arguments
962 with unordered conversion ranks.
963 * call.cc (standard_conversion): For floating-point conversion, if
964 either from or to are extended floating-point types, set conv->bad_p
965 for implicit conversion from larger to smaller conversion rank or
966 with unordered conversion ranks.
967 (convert_like_internal): Emit a pedwarn on such conversions.
968 (build_conditional_expr): Diagnose operation with floating point
969 arguments with unordered conversion ranks.
970 (convert_arg_to_ellipsis): Don't promote extended floating-point types
971 narrower than double to double.
972 (compare_ics): Implement P1467R9 [over.ics.rank]/4 changes.
973
974 2022-09-26 Marek Polacek <polacek@redhat.com>
975
976 PR c++/106656
977 * typeck2.cc (array_string_literal_compatible_p): Allow
978 initializing arrays of char or unsigned char by a UTF-8 string literal.
979
980 2022-09-26 Marek Polacek <polacek@redhat.com>
981
982 PR c++/106784
983 * method.cc (is_convertible_helper): New.
984 (is_convertible): Use it.
985 (is_nothrow_convertible): Likewise.
986
987 2022-09-26 Patrick Palka <ppalka@redhat.com>
988
989 PR c++/107033
990 * module.cc (trees_in::decl_value): In the MK_partial case for
991 a variable template partial specialization, pass decl_p=true to
992 add_mergeable_specialization, and set spec to the VAR_DECL not
993 the TEMPLATE_DECL.
994 * pt.cc (add_mergeable_specialization): For a variable template
995 partial specialization, set the TREE_TYPE of the new
996 DECL_TEMPLATE_SPECIALIZATIONS node to the TREE_TYPE of the
997 VAR_DECL not the VAR_DECL itself.
998
999 2022-09-23 Marek Polacek <polacek@redhat.com>
1000
1001 PR c++/106784
1002 * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONVERTIBLE
1003 and CPTK_IS_NOTHROW_CONVERTIBLE.
1004 * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_CONVERTIBLE
1005 RID_IS_NOTHROW_CONVERTIBLE.
1006 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_CONVERTIBLE and
1007 CPTK_IS_NOTHROW_CONVERTIBLE.
1008 (is_convertible): Declare.
1009 (is_nothrow_convertible): Likewise.
1010 * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
1011 CPTK_IS_CONVERTIBLE and CPTK_IS_NOTHROW_CONVERTIBLE.
1012 * method.cc (is_convertible): New.
1013 (is_nothrow_convertible): Likewise.
1014 * parser.cc (cp_parser_primary_expression): Handle RID_IS_CONVERTIBLE
1015 and RID_IS_NOTHROW_CONVERTIBLE.
1016 (cp_parser_trait_expr): Likewise.
1017 * semantics.cc (trait_expr_value): Handle CPTK_IS_CONVERTIBLE and
1018 CPTK_IS_NOTHROW_CONVERTIBLE.
1019 (finish_trait_expr): Likewise.
1020
1021 2022-09-23 Marek Polacek <polacek@redhat.com>
1022
1023 PR c++/106983
1024 * typeck2.cc (split_nonconstant_init_1): Check TYPE_P.
1025
1026 2022-09-22 Patrick Palka <ppalka@redhat.com>
1027
1028 PR c++/106826
1029 * module.cc (trees_out::decl_value): Use get_template_info in
1030 the MK_partial case to handle both VAR_DECL and TYPE_DECL.
1031 (trees_out::key_mergeable): Likewise.
1032 (trees_in::key_mergeable): Likewise.
1033 (has_definition): Consider DECL_INITIAL of a partial variable
1034 template specialization.
1035 (depset::hash::make_dependency): Handle partial variable template
1036 specializations too.
1037
1038 2022-09-20 Patrick Palka <ppalka@redhat.com>
1039
1040 * decl.cc (cp_finish_decl): After updating the deduced type of a
1041 VAR_DECL, also update the corresponding TEMPLATE_DECL if there
1042 is one.
1043
1044 2022-09-20 Patrick Palka <ppalka@redhat.com>
1045
1046 PR c++/106761
1047 * module.cc (trees_out::type_node) <case TYPE_PACK_EXPANSION>:
1048 Stream PACK_EXPANSION_EXTRA_ARGS.
1049 (trees_in::tree_node) <case TYPE_PACK_EXPANSION>: Likewise.
1050
1051 2022-09-17 Patrick Palka <ppalka@redhat.com>
1052
1053 * module.cc (friend_from_decl_list): Don't consider
1054 CLASSTYPE_TEMPLATE_INFO for a TYPENAME_TYPE friend.
1055 (trees_in::read_class_def): Don't add to
1056 CLASSTYPE_BEFRIENDING_CLASSES for a TYPENAME_TYPE friend.
1057
1058 2022-09-16 Patrick Palka <ppalka@redhat.com>
1059
1060 PR c++/92505
1061 * constexpr.cc (cxx_eval_component_reference): Check non_constant_p
1062 sooner. In C++14 or later, reject a DECL_MUTABLE_P member access
1063 only if CONSTRUCTOR_MUTABLE_POISION is also set.
1064
1065 2022-09-16 Jason Merrill <jason@redhat.com>
1066
1067 PR c++/106858
1068 * parser.cc (cp_parser_omp_var_list_no_open): Pass the
1069 initial token location down.
1070 * semantics.cc (finish_omp_clauses): Check
1071 invalid_nonstatic_memfn_p.
1072 * typeck.cc (invalid_nonstatic_memfn_p): Handle null TREE_TYPE.
1073
1074 2022-09-15 Richard Biener <rguenther@suse.de>
1075
1076 * decl.cc (cxx_init_decl_processing): Inline last
1077 build_void_list_node call.
1078 (build_void_list_node): Remove.
1079
1080 2022-09-14 Julian Brown <julian@codesourcery.com>
1081
1082 * semantics.cc (finish_omp_clauses): Likewise.
1083
1084 2022-09-13 Patrick Palka <ppalka@redhat.com>
1085
1086 * cp-tree.h (mark_used): Remove single-parameter overload. Add
1087 default argument to the two-parameter overload.
1088 * decl2.cc (mark_used): Likewise.
1089
1090 2022-09-13 Patrick Palka <ppalka@redhat.com>
1091
1092 * cp-tree.h (cxx_constant_value): Define two-parameter version
1093 that omits the object parameter.
1094 * decl.cc (build_explicit_specifier): Omit NULL_TREE object
1095 argument to cxx_constant_value.
1096 * except.cc (build_noexcept_spec): Likewise.
1097 * pt.cc (expand_integer_pack): Likewise.
1098 (fold_targs_r): Likewise.
1099 * semantics.cc (finish_if_stmt_cond): Likewise.
1100
1101 2022-09-13 Patrick Palka <ppalka@redhat.com>
1102
1103 * decl.cc (build_explicit_specifier): Pass complain to
1104 cxx_constant_value.
1105 * except.cc (build_noexcept_spec): Likewise.
1106 * pt.cc (expand_integer_pack): Likewise.
1107 (tsubst_function_decl): Propagate error_mark_node returned
1108 from build_explicit_specifier.
1109
1110 2022-09-12 Patrick Palka <ppalka@redhat.com>
1111
1112 * call.cc (build_conditional_expr): Adjust calls to
1113 '_sfinae'-suffixed functions.
1114 (build_temp): Likewise.
1115 (convert_like_internal): Likewise.
1116 (convert_arg_to_ellipsis): Likewise.
1117 (build_over_call): Likewise.
1118 (build_cxx_call): Likewise.
1119 (build_new_method_call): Likewise.
1120 * constexpr.cc (cxx_eval_outermost_constant_expr): Likewise.
1121 (cxx_constant_value_sfinae): Rename to ...
1122 (cxx_constant_value): ... this. Document its default arguments.
1123 (fold_non_dependent_expr): Adjust function comment.
1124 * cp-tree.h (instantiate_non_dependent_expr_sfinae): Rename to ...
1125 (instantiate_non_dependent_expr): ... this. Give its 'complain'
1126 parameter a default argument.
1127 (get_target_expr_sfinae, get_target_expr): Likewise.
1128 (require_complete_type_sfinae, require_complete_type): Likewise.
1129 (abstract_virtuals_error_sfinae, abstract_virtuals_error):
1130 Likewise.
1131 (cxx_constant_value_sfinae, cxx_constant_value): Likewise.
1132 * cvt.cc (build_up_reference): Adjust calls to '_sfinae'-suffixed
1133 functions.
1134 (ocp_convert): Likewise.
1135 * decl.cc (build_explicit_specifier): Likewise.
1136 * except.cc (build_noexcept_spec): Likewise.
1137 * init.cc (build_new_1): Likewise.
1138 * pt.cc (expand_integer_pack): Likewise.
1139 (instantiate_non_dependent_expr_internal): Adjust function
1140 comment.
1141 (instantiate_non_dependent_expr): Rename to ...
1142 (instantiate_non_dependent_expr_sfinae): ... this. Document its
1143 default argument.
1144 (tsubst_init): Adjust calls to '_sfinae'-suffixed functions.
1145 (fold_targs_r): Likewise.
1146 * semantics.cc (finish_compound_literal): Likewise.
1147 (finish_decltype_type): Likewise.
1148 (cp_build_bit_cast): Likewise.
1149 * tree.cc (build_cplus_new): Likewise.
1150 (get_target_expr): Rename to ...
1151 (get_target_expr_sfinae): ... this. Document its default
1152 argument.
1153 * typeck.cc (require_complete_type): Rename to ...
1154 (require_complete_type_sfinae): ... this. Document its default
1155 argument.
1156 (cp_build_array_ref): Adjust calls to '_sfinae'-suffixed
1157 functions.
1158 (convert_arguments): Likewise.
1159 (cp_build_binary_op): Likewise.
1160 (build_static_cast_1): Likewise.
1161 (cp_build_modify_expr): Likewise.
1162 (convert_for_initialization): Likewise.
1163 * typeck2.cc (abstract_virtuals_error): Rename to ...
1164 (abstract_virtuals_error_sfinae): ... this. Document its default
1165 argument.
1166 (build_functional_cast_1): Adjust calls to '_sfinae'-suffixed
1167 functions.
1168
1169 2022-09-12 Patrick Palka <ppalka@redhat.com>
1170
1171 PR c++/101906
1172 * pt.cc (tsubst_template_args): Set cp_evaluated here.
1173 (tsubst_aggr_type): Not here.
1174
1175 2022-09-12 Jason Merrill <jason@redhat.com>
1176
1177 PR c++/106893
1178 PR c++/90451
1179 * decl.cc (cp_finish_decl): Call mark_single_function.
1180
1181 2022-09-12 Jason Merrill <jason@redhat.com>
1182
1183 PR c++/93259
1184 * pt.cc (type_dependent_expression_p): Treat a compound
1185 literal of array-of-unknown-bound type like a variable.
1186
1187 2022-09-12 Jason Merrill <jason@redhat.com>
1188
1189 PR c++/106567
1190 * lambda.cc (type_deducible_expression_p): Check
1191 array_of_unknown_bound_p.
1192
1193 2022-09-12 Jonathan Wakely <jwakely@redhat.com>
1194
1195 PR c++/86491
1196 * decl2.cc (constrain_class_visibility): Adjust wording of
1197 -Wsubobject-linkage for cases where anonymous
1198 namespaces aren't used.
1199 * tree.cc (decl_anon_ns_mem_p): Now only true for actual anonymous
1200 namespace members, rename old semantics to...
1201 (decl_internal_context_p): ...this.
1202 * cp-tree.h, name-lookup.cc, pt.cc: Adjust.
1203
1204 2022-09-08 Jonathan Wakely <jwakely@redhat.com>
1205
1206 PR c++/106838
1207 * class.cc (type_has_virtual_destructor): Return false for
1208 union types.
1209 * semantics.cc (check_trait_type): Add KIND parameter to support
1210 different sets of requirements.
1211 (finish_trait_expr): Pass KIND argument for relevant traits.
1212
1213 2022-09-08 Patrick Palka <ppalka@redhat.com>
1214
1215 PR c++/99130
1216 * decl2.cc (maybe_instantiate_decl): Adjust function comment.
1217 Check VAR_OR_FUNCTION_DECL_P. Pull out the disjunction into ...
1218 (mark_used): ... here, removing the decl_maybe_constant_var_p
1219 part of it.
1220
1221 2022-09-07 Jason Merrill <jason@redhat.com>
1222
1223 PR c++/106793
1224 * decl.cc (grokdeclarator): Improve placeholder diagnostics.
1225 * parser.cc (cp_parser_type_id_1): Add fixit.
1226
1227 2022-09-07 Arsen Arsenović <arsen@aarsen.me>
1228
1229 PR c++/106188
1230 PR c++/106713
1231 * coroutines.cc (coro_rewrite_function_body): Ensure we have a
1232 BIND_EXPR wrapping the function body.
1233
1234 2022-09-07 Jakub Jelinek <jakub@redhat.com>
1235
1236 PR c++/106829
1237 * semantics.cc (finish_omp_target_clauses): If current_function_decl
1238 isn't a nonstatic member function, don't set data.current_object to
1239 non-NULL.
1240
1241 2022-09-06 Jason Merrill <jason@redhat.com>
1242
1243 * decl.cc (grok_op_properties): Return sooner for C++23 op[].
1244
1245 2022-09-06 Jakub Jelinek <jakub@redhat.com>
1246
1247 * parser.cc (cp_parser_omp_clause_doacross_sink): Don't verify val
1248 in omp_cur_iteration - 1 has integer_type_node type.
1249
1250 2022-09-06 Jakub Jelinek <jakub@redhat.com>
1251
1252 * pt.cc (tsubst_expr) <case OMP_ORDERED>: If OMP_BODY was NULL, keep
1253 it NULL after instantiation too.
1254
1255 2022-09-03 Jakub Jelinek <jakub@redhat.com>
1256
1257 * parser.cc (cp_parser_omp_clause_name): Handle doacross.
1258 (cp_parser_omp_clause_depend_sink): Renamed to ...
1259 (cp_parser_omp_clause_doacross_sink): ... this. Add depend_p
1260 argument. Handle parsing of doacross(sink:omp_cur_iteration-1). Use
1261 OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
1262 OMP_CLAUSE_DEPEND_SINK_NEGATIVE, build OMP_CLAUSE_DOACROSS instead
1263 of OMP_CLAUSE_DEPEND and set OMP_CLAUSE_DOACROSS_DEPEND flag on it.
1264 (cp_parser_omp_clause_depend): Use OMP_CLAUSE_DOACROSS_SINK and
1265 OMP_CLAUSE_DOACROSS_SOURCE instead of OMP_CLAUSE_DEPEND_SINK and
1266 OMP_CLAUSE_DEPEND_SOURCE, build OMP_CLAUSE_DOACROSS for depend(source)
1267 and set OMP_CLAUSE_DOACROSS_DEPEND on it.
1268 (cp_parser_omp_clause_doacross): New function.
1269 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DOACROSS.
1270 (cp_parser_omp_depobj): Use OMP_CLAUSE_DEPEND_INVALID instead of
1271 OMP_CLAUSE_DEPEND_SOURCE.
1272 (cp_parser_omp_for_loop): Don't diagnose here linear clause together
1273 with ordered with argument.
1274 (cp_parser_omp_simd): Don't diagnose ordered clause with argument on
1275 for simd.
1276 (OMP_ORDERED_DEPEND_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DOACROSS.
1277 (cp_parser_omp_ordered): Handle also doacross and adjust for it
1278 diagnostic wording.
1279 * pt.cc (tsubst_omp_clause_decl): Use
1280 OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
1281 OMP_CLAUSE_DEPEND_SINK_NEGATIVE.
1282 (tsubst_omp_clauses): Handle OMP_CLAUSE_DOACROSS.
1283 (tsubst_expr): Use OMP_CLAUSE_DEPEND_INVALID instead of
1284 OMP_CLAUSE_DEPEND_SOURCE.
1285 * semantics.cc (cp_finish_omp_clause_depend_sink): Rename to ...
1286 (cp_finish_omp_clause_doacross_sink): ... this.
1287 (finish_omp_clauses): Handle OMP_CLAUSE_DOACROSS. Don't handle
1288 OMP_CLAUSE_DEPEND_SOURCE and OMP_CLAUSE_DEPEND_SINK.
1289
1290 2022-09-02 David Malcolm <dmalcolm@redhat.com>
1291
1292 PR c/90885
1293 * cp-tree.h (class cp_expr): Add bitfield m_decimal. Clear it in
1294 existing ctors. Add ctor that allows specifying its value.
1295 (cp_expr::decimal_p): New accessor.
1296 * parser.cc (cp_parser_expression_stack_entry::flags): New field.
1297 (cp_parser_primary_expression): Set m_decimal of cp_expr when
1298 handling numbers.
1299 (cp_parser_binary_expression): Extract flags from token when
1300 populating stack. Call check_for_xor_used_as_pow.
1301
1302 2022-09-01 Marek Polacek <polacek@redhat.com>
1303
1304 * cp-tree.h (maybe_strip_ref_conversion): Remove.
1305
1306 2022-08-30 Ulrich Drepper <drepper@gmail.com>
1307
1308 * Make-lang.in: Add rule to rebuild std-name-hint.h from
1309 std-name-hint.gperf.
1310 * name-lookup.cc (get_std_name_hint): Remove hints array.
1311 Use gperf-generated class std_name_hint_lookup.
1312 Include "std-name-hint.h".
1313 * std-name-hint.gperf: New file.
1314 * std-name-hint.h: New file. Generated from the .gperf file.
1315
1316 2022-08-30 Marek Polacek <polacek@redhat.com>
1317
1318 PR c++/106759
1319 * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_NOTHROW_ASSIGNABLE
1320 and RID_IS_NOTHROW_CONSTRUCTIBLE.
1321
1322 2022-08-29 Marek Polacek <polacek@redhat.com>
1323
1324 PR c++/106712
1325 * decl.cc (grokdeclarator): Reverse the order of arguments to
1326 attr_chainon.
1327
1328 2022-08-26 Marek Polacek <polacek@redhat.com>
1329
1330 PR c++/81159
1331 * typeck.cc (maybe_warn_self_move): New.
1332 (cp_build_modify_expr): Call maybe_warn_self_move.
1333
1334 2022-08-25 Marek Polacek <polacek@redhat.com>
1335
1336 * cp-tree.h (enum cp_tree_index): Remove CTI_NULLPTR, CTI_NULLPTR_TYPE.
1337 Move it to c_tree_index.
1338 (nullptr_node): No longer define here.
1339 (nullptr_type_node): Likewise.
1340 (NULLPTR_TYPE_P): Likewise.
1341 * decl.cc (cxx_init_decl_processing): Only keep C++-specific nullptr
1342 initialization; move the shared code to c_common_nodes_and_builtins.
1343
1344 2022-08-25 Jason Merrill <jason@redhat.com>
1345
1346 * call.cc (unsafe_return_slot_p): Return 2 for *this in a
1347 constructor.
1348
1349 2022-08-23 Marek Polacek <polacek@redhat.com>
1350
1351 * typeck.cc (maybe_warn_pessimizing_move): Don't warn about
1352 redundant std::move when the expression was wrapped in { }.
1353
1354 2022-08-17 Marek Polacek <polacek@redhat.com>
1355
1356 PR c++/90428
1357 * typeck.cc (can_do_rvo_p): Rename to ...
1358 (can_elide_copy_prvalue_p): ... this.
1359 (maybe_warn_pessimizing_move): Extend the
1360 -Wredundant-move warning to warn about std::move on a
1361 const-qualified object.
1362
1363 2022-08-17 Marek Polacek <polacek@redhat.com>
1364
1365 PR c++/89780
1366 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Maybe suppress
1367 -Wpessimizing-move.
1368 * typeck.cc (maybe_warn_pessimizing_move): Don't issue warnings
1369 if they are suppressed.
1370 (check_return_expr): Disable -Wpessimizing-move when returning
1371 a dependent expression.
1372
1373 2022-08-17 Marek Polacek <polacek@redhat.com>
1374
1375 PR c++/106276
1376 * call.cc (build_over_call): Call maybe_warn_pessimizing_move.
1377 * cp-tree.h (maybe_warn_pessimizing_move): Declare.
1378 * decl.cc (build_aggr_init_full_exprs): Call
1379 maybe_warn_pessimizing_move.
1380 * typeck.cc (maybe_warn_pessimizing_move): Handle TREE_LIST and
1381 CONSTRUCTOR. Add a bool parameter and use it. Adjust a diagnostic
1382 message.
1383 (check_return_expr): Adjust the call to maybe_warn_pessimizing_move.
1384
1385 2022-08-17 Tobias Burnus <tobias@codesourcery.com>
1386 Chung-Lin Tang <cltang@codesourcery.com>
1387
1388 PR c++/104493
1389 * cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Remove.
1390 * cp-tree.h (cp_omp_mappable_type, cp_omp_emit_unmappable_type_notes):
1391 Remove.
1392 * decl2.cc (cp_omp_mappable_type_1, cp_omp_mappable_type,
1393 cp_omp_emit_unmappable_type_notes): Remove.
1394 (cplus_decl_attributes): Call omp_mappable_type instead of
1395 removed langhook.
1396 * decl.cc (cp_finish_decl): Likewise; call cxx_incomplete_type_inform
1397 in lieu of cp_omp_emit_unmappable_type_notes.
1398 * semantics.cc (finish_omp_clauses): Likewise.
1399
1400 2022-08-16 Tom Honermann <tom@honermann.net>
1401
1402 PR c++/106423
1403 * parser.cc (cp_lexer_saving_tokens): Add comment regarding
1404 diagnostic requirements.
1405
1406 2022-08-16 Jakub Jelinek <jakub@redhat.com>
1407
1408 * typeck.cc (cp_build_modify_expr): Implement
1409 P2327R1 - De-deprecating volatile compound operations. Don't warn
1410 for |=, &= or ^= with volatile lhs.
1411 * expr.cc (mark_use) <case MODIFY_EXPR>: Adjust warning wording,
1412 leave out simple.
1413
1414 2022-08-15 Marek Polacek <polacek@redhat.com>
1415
1416 PR c++/106276
1417 * typeck.cc (can_do_rvo_p): New.
1418 (maybe_warn_pessimizing_move): Warn when moving a temporary object
1419 in a return statement prevents copy elision.
1420
1421 2022-08-11 Marek Polacek <polacek@redhat.com>
1422
1423 PR middle-end/102633
1424 * decl.cc (cp_finish_decl): Call suppress_warning.
1425
1426 2022-08-07 Jakub Jelinek <jakub@redhat.com>
1427
1428 PR c++/88174
1429 * constexpr.cc (cxx_eval_store_expression): Handle REALPART_EXPR
1430 and IMAGPART_EXPR. Change ctors from releasing_vec to
1431 auto_vec<tree *>, adjust all uses. For !preeval, update ctors
1432 vector.
1433
1434 2022-07-31 Lewis Hyatt <lhyatt@gmail.com>
1435
1436 PR c++/66290
1437 * parser.cc (cp_lexer_new_main): Rename global done_lexing to
1438 override_libcpp_locations.
1439
1440 2022-07-31 Jason Merrill <jason@redhat.com>
1441
1442 PR c++/106369
1443 * constexpr.cc (reduced_constant_expression_p): Return false
1444 if a CONSTRUCTOR initializes an empty field.
1445
1446 2022-07-29 Jakub Jelinek <jakub@redhat.com>
1447
1448 PR c++/106448
1449 * parser.cc (cp_parser_omp_atomic): For simple cast followed by
1450 CPP_QUERY token, don't try cp_parser_binary_operation if compare
1451 is true.
1452
1453 2022-07-26 Marek Polacek <polacek@redhat.com>
1454
1455 PR c++/106311
1456 * pt.cc (redeclare_class_template): Check DECL_P before accessing
1457 DECL_SOURCE_LOCATION.
1458
1459 2022-07-26 Jason Merrill <jason@redhat.com>
1460
1461 PR c++/106230
1462 * semantics.cc (finish_for_stmt): Check stmts_are_full_exprs_p.
1463
1464 2022-07-25 Jason Merrill <jason@redhat.com>
1465
1466 PR c++/87729
1467 * class.cc (warn_hidden): Remove shortcut.
1468
1469 2022-07-22 Patrick Palka <ppalka@redhat.com>
1470
1471 PR c++/106366
1472 * pt.cc (do_class_deduction): Don't consider TYPE_HAS_LIST_CTOR
1473 when setting try_list_ctor. Reset args even when try_list_ctor
1474 is true and there are no list candidates. Call resolve_args on
1475 the reset args. Rename try_list_ctor to try_list_cand.
1476
1477 2022-07-22 Martin Liska <mliska@suse.cz>
1478
1479 PR other/106370
1480 * init.cc (sort_mem_initializers): Remove continue as last stmt
1481 in a loop.
1482
1483 2022-07-21 Jason Merrill <jason@redhat.com>
1484
1485 PR c++/106361
1486 * decl.cc (move_fn_p): Remove assert.
1487
1488 2022-07-21 Jason Merrill <jason@redhat.com>
1489
1490 DR 2084
1491 PR c++/98423
1492 * method.cc (walk_field_subobs): Fix DMI in union case.
1493
1494 2022-07-19 Patrick Palka <ppalka@redhat.com>
1495
1496 PR c++/94894
1497 PR c++/105766
1498 PR c++/106201
1499 * call.cc (enum conversion_kind): Add ck_deferred_bad enumerator.
1500 (has_next): Return false for it.
1501 (reference_binding): Return a ck_deferred_bad conversion instead
1502 of an actual bad conversion when LOOKUP_SHORTCUT_BAD_CONVS is set.
1503 Remove now obsolete early exit for the incomplete TO case.
1504 (implicit_conversion_1): Don't mask out LOOKUP_SHORTCUT_BAD_CONVS.
1505 (add_function_candidate): Set LOOKUP_SHORTCUT_BAD_CONVS iff
1506 shortcut_bad_convs.
1507 (missing_conversion_p): Also return true for a ck_deferred_bad
1508 conversion.
1509 * cp-tree.h (LOOKUP_SHORTCUT_BAD_CONVS): Define.
1510
1511 2022-07-19 Jonathan Wakely <jwakely@redhat.com>
1512
1513 * cp-objcp-common.cc (names_builtin_p): Return true for
1514 RID_REF_CONSTRUCTS_FROM_TEMPORARY and
1515 RID_REF_CONVERTS_FROM_TEMPORARY.
1516
1517 2022-07-15 Marek Polacek <polacek@redhat.com>
1518
1519 PR c++/104477
1520 * call.cc (ref_conv_binds_directly_p): Rename to ...
1521 (ref_conv_binds_directly): ... this. Add a new bool parameter. Change
1522 the return type to tristate.
1523 * constraint.cc (diagnose_trait_expr): Handle
1524 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1525 * cp-tree.h: Include "tristate.h".
1526 (enum cp_trait_kind): Add CPTK_REF_CONSTRUCTS_FROM_TEMPORARY
1527 and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1528 (ref_conv_binds_directly_p): Rename to ...
1529 (ref_conv_binds_directly): ... this.
1530 (ref_xes_from_temporary): Declare.
1531 * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
1532 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1533 * method.cc (ref_xes_from_temporary): New.
1534 * parser.cc (cp_parser_primary_expression): Handle
1535 RID_REF_CONSTRUCTS_FROM_TEMPORARY and RID_REF_CONVERTS_FROM_TEMPORARY.
1536 (cp_parser_trait_expr): Likewise.
1537 (warn_for_range_copy): Adjust to call ref_conv_binds_directly.
1538 * semantics.cc (trait_expr_value): Handle
1539 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1540 (finish_trait_expr): Likewise.
1541
1542 2022-07-13 Patrick Palka <ppalka@redhat.com>
1543
1544 PR c++/105912
1545 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Guard against
1546 NULL_TREE extract_call_expr result.
1547
1548 2022-07-13 Patrick Palka <ppalka@redhat.com>
1549
1550 PR c++/105842
1551 * constraint.cc (satisfy_declaration_constraints): Refine early
1552 exit test for argument dependence.
1553 * cp-tree.h (uses_outer_template_parms_in_constraints): Declare.
1554 * pt.cc (template_class_depth): Handle TI_TEMPLATE being a
1555 FIELD_DECL.
1556 (usse_outer_template_parms): Factor out constraint dependence
1557 test into ...
1558 (uses_outer_template_parms_in_constraints): ... here.
1559 (type_dependent_expression_p): Use it for FUNCTION_DECL.
1560
1561 2022-07-07 Patrick Palka <ppalka@redhat.com>
1562
1563 PR c++/105956
1564 * pt.cc (template_arg_to_parm): Define.
1565 (tsubst_argument_pack): Try to reuse the corresponding
1566 ARGUMENT_PACK from 'args' when substituting into a generic
1567 ARGUMENT_PACK for a variadic template parameter.
1568 (tsubst_template_args): Move variable declarations closer to
1569 their first use. Replace 'orig_t' with 'r'. Rename 'need_new'
1570 to 'const_subst_p'. Heuristically detect if the substituted
1571 elements are identical to that of a level from 'args' and avoid
1572 allocating a new TREE_VEC if so. Add sanity check for the
1573 length of the new TREE_VEC, and remove dead ARGUMENT_PACK_P test.
1574 (tsubst_decl) <case TYPE_DECL, case VAR_DECL>: Revert
1575 r13-1045-gcb7fd1ea85feea change for avoiding substitution into
1576 DECL_TI_ARGS, but still avoid coercion in this case.
1577
1578 2022-07-07 Jason Merrill <jason@redhat.com>
1579
1580 PR c++/87729
1581 * class.cc (warn_hidden): Ignore [cd]tors.
1582
1583 2022-07-06 Lewis Hyatt <lhyatt@gmail.com>
1584
1585 PR c++/53431
1586 * parser.cc (cp_parser_pragma_kind): Move earlier in the file.
1587 (cp_lexer_handle_early_pragma): New function.
1588 (cp_lexer_new_main): Support parsing and handling early pragmas.
1589 (c_parse_file): Adapt to changes in cp_lexer_new_main.
1590
1591 2022-07-06 Jason Merrill <jason@redhat.com>
1592
1593 PR c++/106179
1594 PR c++/106024
1595 * parser.cc (cp_parser_lookup_name): Remove :: requirement
1596 for using unqualified lookup result.
1597
1598 2022-07-05 Nathan Sidwell <nathan@acm.org>
1599
1600 * module.cc
1601 (struct ord_loc_info, ord_loc_traits): New.
1602 (ord_loc_tabke, ord_loc_remap): New globals.
1603 (struct location_map_info): Delete.
1604 (struct module_state_config): Rename ordinary_loc_align to
1605 loc_range_bits.
1606 (module_for_ordinary_loc): Adjust.
1607 (module_state::note_location): Note ordinary locations,
1608 return bool.
1609 (module_state::write_location): Adjust ordinary location
1610 streaming.
1611 (module_state::read_location): Likewise.
1612 (module_state::write_init_maps): Allocate ord_loc_table.
1613 (module_state::write_prepare_maps): Reimplement ordinary
1614 map preparation.
1615 (module_state::read_prepare_maps): Adjust.
1616 (module_state::write_ordinary_maps): Reimplement.
1617 (module_state::write_macro_maps): Adjust.
1618 (module_state::read_ordinary_maps): Reimplement.
1619 (module_state::write_macros): Adjust.
1620 (module_state::write_config): Adjust.
1621 (module_state::read_config): Adjust.
1622 (module_state::write_begin): Adjust.
1623 (module_state::read_initial): Adjust.
1624
1625 2022-07-04 Tobias Burnus <tobias@codesourcery.com>
1626 Chung-Lin Tang <cltang@codesourcery.com>
1627 Thomas Schwinge <thomas@codesourcery.com>
1628
1629 * parser.cc (cp_parser_omp_target_data,
1630 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1631 cp_parser_omp_target_update): Set OMP_REQUIRES_TARGET_USED.
1632 (cp_parser_omp_requires): Remove sorry.
1633
1634 2022-07-01 Lewis Hyatt <lhyatt@gmail.com>
1635
1636 * parser.cc (cp_token_is_module_directive): New function
1637 refactoring common code.
1638 (cp_parser_skip_to_closing_parenthesis_1): Use the new function.
1639 (cp_parser_skip_to_end_of_statement): Likewise.
1640 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
1641 (cp_parser_declaration): Likewise.
1642
1643 2022-07-01 Marek Polacek <polacek@redhat.com>
1644
1645 PR c++/105550
1646 * constexpr.cc (cxx_eval_conditional_expression): Strip TARGET_EXPRs.
1647
1648 2022-07-01 Tobias Burnus <tobias@codesourcery.com>
1649
1650 * parser.cc (cp_parser_omp_target_enter_data,
1651 cp_parser_omp_target_exit_data): Accept tofrom
1652 map-type modifier but use 'to' / 'from' internally.
1653
1654 2022-07-01 Marek Polacek <polacek@redhat.com>
1655
1656 PR c++/106111
1657 * parser.cc (cp_lexer_get_preprocessor_token): Also warn about
1658 RID_ALIGNOF, RID_ALIGNAS, RID_THREAD.
1659
1660 2022-07-01 Jason Merrill <jason@redhat.com>
1661
1662 PR c++/105779
1663 * call.cc (resolve_args): Use complain.
1664
1665 2022-07-01 Jason Merrill <jason@redhat.com>
1666
1667 * parser.cc (missing_template_diag): Split out...
1668 (cp_parser_id_expression): ...from here.
1669
1670 2022-07-01 Jason Merrill <jason@redhat.com>
1671
1672 PR c++/106024
1673 * parser.cc (missing_template_diag): Factor out...
1674 (cp_parser_id_expression): ...from here.
1675 (cp_parser_lookup_name): Don't look in dependent object_type.
1676
1677 2022-06-30 Nathan Sidwell <nathan@acm.org>
1678
1679 * module.cc (module_state::write_define): Drop located param.
1680 (module_state::read_define): Likewise.
1681 (module_state::prepare_macros): New, broken out of ...
1682 (module_state::write_macros): ... here. Adjust.
1683 (module_state::write_begin): Adjust.
1684
1685 2022-06-29 Nathan Sidwell <nathan@acm.org>
1686
1687 * module.cc (macro_info, macro_traits, macro_table,
1688 macro_remap): Rename to ...
1689 (macro_loc_info, macro_loc_traits, macro_loc_table,
1690 macro_loc_remap): ... these. Update all uses.
1691 (module_state::write_prepare_maps): Remove unneeded macro checking.
1692 (module_state::write_begin): Free macro_loc_remap.
1693
1694 2022-06-27 Sergei Trofimovich <siarheit@google.com>
1695
1696 PR c++/106102
1697 * mapper-client.cc: Include <memory> via "system.h".
1698 * mapper-resolver.cc: Ditto.
1699 * module.cc: Ditto.
1700
1701 2022-06-27 David Malcolm <dmalcolm@redhat.com>
1702
1703 * cxx-pretty-print.h: Add "final" and "override" to various vfunc
1704 implementations, removing redundant "virtual" as appropriate.
1705 * module.cc: Likewise.
1706
1707 2022-06-24 Jason Merrill <jason@redhat.com>
1708
1709 PR c++/87729
1710 PR c++/20423
1711 * class.cc (warn_hidden): Handle -Woverloaded-virtual=1.
1712
1713 2022-06-24 Alexandre Oliva <oliva@adacore.com>
1714
1715 * g++spec.cc (lang_specific_driver): Implement -nostdlib++.
1716
1717 2022-06-23 Jason Merrill <jason@redhat.com>
1718
1719 PR c++/105925
1720 * call.cc (build_aggr_conv): Don't depend on
1721 CONSTRUCTOR_IS_DESIGNATED_INIT.
1722
1723 2022-06-23 Jason Merrill <jason@redhat.com>
1724
1725 PR c++/105925
1726 * decl.cc (reshape_init_array_1): Set
1727 CONSTRUCTOR_IS_DESIGNATED_INIT here.
1728 (reshape_init_class): And here.
1729 (reshape_init): Not here.
1730
1731 2022-06-23 Patrick Palka <ppalka@redhat.com>
1732
1733 PR c++/105931
1734 * expr.cc (fold_for_warn): Don't fold when in an unevaluated
1735 context.
1736
1737 2022-06-23 Patrick Palka <ppalka@redhat.com>
1738
1739 PR c++/105982
1740 * pt.cc (lookup_template_class): After calling complete_type for
1741 the substituted context, check the table again iff the type was
1742 previously incomplete and complete_type made it complete.
1743
1744 2022-06-23 Jason Merrill <jason@redhat.com>
1745
1746 PR c++/94554
1747 * pt.cc (dependent_operand_p): Split out from...
1748 (tsubst_copy_and_build): ...here.
1749 (tsubst_expr) [IF_STMT]: Use it.
1750 * semantics.cc (finish_if_stmt_cond): Keep the pre-conversion
1751 condition in the template tree.
1752
1753 2022-06-23 Jason Merrill <jason@redhat.com>
1754
1755 PR c++/105885
1756 * pt.cc (tsubst_copy_and_build): Also suppress -Waddress for
1757 comparison of dependent operands.
1758
1759 2022-06-23 Nathan Sidwell <nathan@acm.org>
1760
1761 * module.cc (struct macro_info): New.
1762 (struct macro_traits): New.
1763 (macro_remap, macro_table): New globals.
1764 (depset::hash::find_dependencies): Note namespace location.
1765 (module_for_macro_loc): Adjust.
1766 (module_state::note_location): New.
1767 (module_state::Write_location): Note location when not
1768 streaming. Adjust macro location streaming.
1769 (module_state::read_location): Adjust macro location
1770 streaming.
1771 (module_state::write_init_maps): New.
1772 (module_state::write_prepare_maps): Reimplement macro map
1773 preparation.
1774 (module_state::write_macro_maps): Reimplement.
1775 (module_state::read_macro_maps): Likewise.
1776 (module_state::write_begin): Adjust.
1777
1778 2022-06-23 Jason Merrill <jason@redhat.com>
1779
1780 * pt.cc (type_unification_real): An auto tparm can't
1781 be affected by other deductions.
1782
1783 2022-06-23 Jason Merrill <jason@redhat.com>
1784
1785 PR c++/105964
1786 * pt.cc (type_dependent_expression_p): Look through BASELINK.
1787
1788 2022-06-22 Jason Merrill <jason@redhat.com>
1789
1790 PR c++/105908
1791 * name-lookup.cc (outer_binding): Strip BASELINK.
1792
1793 2022-06-22 Nathan Sidwell <nathan@acm.org>
1794
1795 * module.cc (struct duplicate_hash): Remove.
1796 (duplicate_hash_map): Adjust.
1797
1798 2022-06-22 Jason Merrill <jason@redhat.com>
1799
1800 PR c++/104642
1801 * constexpr.cc (cxx_eval_builtin_function_call): Handle
1802 unreachable/trap earlier.
1803 * cp-gimplify.cc (cp_maybe_instrument_return): Use
1804 build_builtin_unreachable.
1805
1806 2022-06-18 Jakub Jelinek <jakub@redhat.com>
1807
1808 * cp-ubsan.cc (cp_ubsan_instrument_vptr_p): Use
1809 flag_sanitize_trap & SANITIZE_VPTR instead of
1810 flag_sanitize_undefined_trap_on_error.
1811
1812 2022-06-17 Jakub Jelinek <jakub@redhat.com>
1813
1814 PR c++/106001
1815 * typeck.cc (build_x_shufflevector): Use fold_non_dependent_expr
1816 instead of maybe_constant_value.
1817
1818 2022-06-16 Nathan Sidwell <nathan@acm.org>
1819
1820 * decl2.cc (finish_objects): Add startp parameter, adjust.
1821 (generate_ctor_or_dtor_function): Detect empty fn, and don't
1822 generate unnecessary code. Remove objc startup here ...
1823 (c_parse_final_cleanyps): ... do it here.
1824
1825 2022-06-16 Martin Liska <mliska@suse.cz>
1826
1827 * decl2.cc (struct priority_map_traits): Remove unused param.
1828
1829 2022-06-15 Nathan Sidwell <nathan@acm.org>
1830
1831 * module.cc (module_state::write_readme): Use less confusing
1832 importable unit names.
1833
1834 2022-06-14 Nathan Sidwell <nathan@acm.org>
1835
1836 * cp-tree.h (fini_modules): Add has_inits parm.
1837 * decl2.cc (c_parse_final_cleanups): Check for
1838 inits, adjust fini_modules flags.
1839 * module.cc (module_state): Rename call_init_p to
1840 active_init_p.
1841 (module_state::write_config): Write active_init.
1842 (module_state::read_config): Read it.
1843 (module_determine_import_inits): Clear active_init_p
1844 of covered inits.
1845 (late_finish_module): Add has_init parm. Record it.
1846 (fini_modules): Adjust.
1847
1848 2022-06-13 Nathan Sidwell <nathan@acm.org>
1849
1850 * module.cc (module_state::write): Separate to ...
1851 (module_state::write_begin, module_state::write_end): ...
1852 these.
1853 (module_state::write_readme): Drop extensions parameter.
1854 (struct module_processing_cookie): Add more fields.
1855 (finish_module_processing): Adjust state writing call.
1856 (late_finish_module): Call write_end.
1857
1858 2022-06-10 Patrick Palka <ppalka@redhat.com>
1859
1860 PR c++/65328
1861 * decl.cc (typename_hasher::hash): Add extra overloads.
1862 Use iterative_hash_object instead of htab_hash_pointer.
1863 Hash TYPENAME_TYPE_FULLNAME instead of TYPE_IDENTIFIER.
1864 (build_typename_type): Use typename_hasher::hash.
1865 * pt.cc (spec_hasher::hash): Add two-parameter overload.
1866 Set comparing_specializations around the call to
1867 hash_tmpl_and_args.
1868 (iterative_hash_template_arg) <case TYPENAME_TYPE>:
1869 When comparing_specializations, hash the TYPE_CONTEXT
1870 and TYPENAME_TYPE_FULLNAME.
1871 (tsubst_function_decl): Use spec_hasher::hash instead of
1872 hash_tmpl_and_args.
1873 (tsubst_template_decl): Likewise.
1874 (tsubst_decl): Likewise.
1875
1876 2022-06-10 Patrick Palka <ppalka@redhat.com>
1877
1878 * pt.cc (instantiate_template): Don't substitute the context
1879 of the most general template if that of the partially
1880 instantiated template is already non-dependent.
1881
1882 2022-06-10 Patrick Palka <ppalka@redhat.com>
1883
1884 * pt.cc (lookup_template_class): Remove dead stores to
1885 context parameter. Don't substitute the context of the
1886 most general template if that of the partially instantiated
1887 template is already non-dependent. Check the specializations
1888 table again after completing the context of a nested dependent
1889 specialization.
1890 (tsubst_aggr_type) <case RECORD_TYPE>: Don't substitute
1891 TYPE_CONTEXT or pass it to lookup_template_class.
1892 (tsubst_decl) <case TYPE_DECL, case TYPE_DECL>: Avoid substituting
1893 the TREE_TYPE for DECL_SELF_REFERENCE_P. Avoid template argument
1894 substitution or coercion in some cases.
1895
1896 2022-06-10 Nathan Sidwell <nathan@acm.org>
1897
1898 * cp-tree.h (fini_modules): Add some parameters.
1899 (finish_module_processing): Return an opaque pointer.
1900 * decl2.cc (c_parse_final_cleanups): Propagate a cookie from
1901 finish_module_processing to fini_modules.
1902 * module.cc (struct module_processing_cookie): New.
1903 (finish_module_processing): Return a heap-allocated cookie.
1904 (late_finish_module): New. Finish out the module writing.
1905 (fini_modules): Adjust.
1906
1907 2022-06-10 Nathan Sidwell <nathan@acm.org>
1908
1909 * cp-tree.h (module_has_import_init): Rename to ...
1910 (module_determined_import_inits): ... here.
1911 * decl2.cc (start_objects): Do not handle module initializers
1912 here.
1913 (c_parse_final_cleanups): Generate a separate module
1914 initializer calling function and add it to the list. Shrink
1915 the c-lang region.
1916 * module.cc (num_init_calls_needed): Delete.
1917 (module_has_import_init): Rename to ...
1918 (module_determined_import_inits): ... here. Do the
1919 calculation here ...
1920 (finish_module_processing): ... rather than here.
1921 (module_add_import_initializers): Reformat.
1922
1923 2022-06-09 Jakub Jelinek <jakub@redhat.com>
1924
1925 PR c++/105871
1926 * constexpr.cc (cxx_eval_bit_field_ref): For BIT_FIELD_REF with
1927 non-integral result type use fold_ternary too like for BIT_FIELD_REFs
1928 from VECTOR_CST. If fold_ternary returns NULL, diagnose non-constant
1929 expression, set *non_constant_p and return t, instead of returning
1930 NULL.
1931
1932 2022-06-09 Nathan Sidwell <nathan@acm.org>
1933
1934 * cp-tree.h (module_initializer_kind): Replace with ...
1935 (module_global_init_needed, module_has_import_inits): ...
1936 these.
1937 * decl2.cc (start_objects): Add has_body parm. Reorganize
1938 module initializer creation.
1939 (generate_ctor_or_dtor_function): Adjust.
1940 (c_parse_final_cleanups): Adjust.
1941 (vtv_start_verification_constructor_init_function): Adjust.
1942 * module.cc (module_initializer_kind): Replace with ...
1943 (module_global_init_needed, module_has_import_inits): ...
1944 these.
1945
1946 2022-06-08 Jason Merrill <jason@redhat.com>
1947
1948 PR c++/105852
1949 * decl.cc (duplicate_decls): Change non-templated friend
1950 check to an assert.
1951 * pt.cc (tsubst_function_decl): Don't set DECL_TEMPLATE_INFO
1952 on non-templated friends.
1953 (tsubst_friend_function): Adjust.
1954
1955 2022-06-08 Jason Merrill <jason@redhat.com>
1956
1957 PR c++/105852
1958 PR c++/105761
1959 * decl.cc (duplicate_decls): Avoid copying template info
1960 from non-templated friend even if newdecl isn't a definition.
1961 Correct handling of DECL_UNIQUE_FRIEND_P on templates.
1962 * pt.cc (non_templated_friend_p): New.
1963 * cp-tree.h (non_templated_friend_p): Declare it.
1964
1965 2022-06-08 Nathan Sidwell <nathan@acm.org>
1966
1967 * decl2.cc (struct priority_info_s, priority_info): Delete.
1968 (priority_map_traits, priority_map_t): New.
1969 (static_init_fini_fns): New.
1970 (INITIALIZE_P_IDENTIFIER, PRIORITY_IDENTIFIER): Delete.
1971 (initialize_p_decl, priority_decl): Delete.
1972 (ssdf_decls, priority_info_map): Delete.
1973 (start_static_storage_duration_function): Rename to ...
1974 (start_partial_init_fini_fn): ... here. Create a void arg fn.
1975 Add it to the slot in the appropriate static_init_fini_fns
1976 hash table.
1977 (finish_static_storage_duration_function): Rename to ...
1978 (finish_partial_init_fini_fn): ... here.
1979 (get_priority_info): Delete.
1980 (one_static_initialization_or_destruction): Assert not
1981 trivial dtor.
1982 (do_static_initialization_or_destruction): Rename to ...
1983 (emit_partial_init_fini_fn) ... here. Start & finish the fn.
1984 Simply init/fini each var.
1985 (partition_vars_for_init_fini): Partition vars according to
1986 priority and add to init and/or fini list.
1987 (generate_ctor_or_dtor_function): Start and finish the function.
1988 Do santitizer calls here.
1989 (generate_ctor_and_dtor_functions_for_priority): Delete.
1990 (c_parse_final_cleanups): Reimplement global init/fini
1991 processing.
1992
1993 2022-06-07 Jakub Jelinek <jakub@redhat.com>
1994
1995 * parser.cc (cp_parser_omp_clause_linear): Parse OpenMP 5.2
1996 style linear clause modifiers. Set
1997 OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER flag on the clauses when
1998 old style modifiers are used.
1999 * semantics.cc (finish_omp_clauses): Only reject linear clause
2000 with val modifier on simd or for if the old style modifiers are
2001 used.
2002
2003 2022-06-07 Roger Sayle <roger@nextmovesoftware.com>
2004
2005 PR c++/96442
2006 * decl.cc (start_enum): When emitting a "must be integral" error,
2007 set ENUM_UNDERLYING_TYPE to integer_type_node, to avoid an ICE
2008 downstream in build_enumeration.
2009
2010 2022-06-06 Patrick Palka <ppalka@redhat.com>
2011
2012 PR c++/53164
2013 PR c++/105848
2014 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Look through an
2015 ADDR_EXPR callee when calling mark_used.
2016
2017 2022-06-04 Marek Polacek <polacek@redhat.com>
2018
2019 PR c++/102399
2020 PR c++/69585
2021 * parser.cc (cp_parser_attributes_opt): Accept GNU attributes
2022 followed by [[]] attributes and vice versa.
2023
2024 2022-06-03 Patrick Palka <ppalka@redhat.com>
2025
2026 PR c++/105756
2027 * typeck.cc (cp_build_binary_op): Don't fold operands
2028 when c_inhibit_evaluation_warnings.
2029
2030 2022-06-03 Jason Merrill <jason@redhat.com>
2031
2032 PR c++/105761
2033 * decl.cc (duplicate_decls): Don't copy DECL_TEMPLATE_INFO
2034 from a hidden friend.
2035
2036 2022-06-03 Patrick Palka <ppalka@redhat.com>
2037
2038 PR c++/105637
2039 * tree.cc (maybe_dummy_object): When returning a dummy
2040 object, respect the cv-quals of 'this' if available.
2041
2042 2022-06-03 Patrick Palka <ppalka@redhat.com>
2043
2044 PR c++/100374
2045 * pt.cc (determine_specialization): Compare overall constraints
2046 not just the trailing constraints.
2047 (tsubst_each_template_parm_constraints): Define.
2048 (tsubst_friend_function): Use it.
2049 (tsubst_friend_class): Use it.
2050 (tsubst_template_parm): Don't substitute TEMPLATE_PARM_CONSTRAINTS.
2051
2052 2022-06-03 Patrick Palka <ppalka@redhat.com>
2053
2054 PR c++/105797
2055 * pt.cc (for_each_template_parm_r) <case FUNCTION_DECL, VAR_DECL>:
2056 Don't walk DECL_CONTEXT.
2057 <case PARM_DECL>: Likewise. Walk TREE_TYPE.
2058 <case CONST_DECL>: Simplify.
2059 (any_template_parm_r) <case PARM_DECL>: Don't walk TREE_TYPE.
2060
2061 2022-06-02 Marek Polacek <polacek@redhat.com>
2062
2063 * constexpr.cc (potential_constant_expression_1): Treat
2064 {,VEC_}NEW_EXPR and {,VEC_}DELETE_EXPRas potentially constant in C++20.
2065
2066 2022-06-02 Marek Polacek <polacek@redhat.com>
2067
2068 PR c++/105803
2069 * pt.cc (value_dependent_expression_p): Handle {,VEC_}NEW_EXPR
2070 in the switch.
2071
2072 2022-06-02 David Malcolm <dmalcolm@redhat.com>
2073
2074 * cp-lang.cc (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
2075 (cp_get_sarif_source_language): New.
2076
2077 2022-06-02 Jason Merrill <jason@redhat.com>
2078
2079 PR c++/105795
2080 * constexpr.cc (init_subob_ctx): Clear ctx->ctor for empty subob.
2081 (cxx_eval_store_expression): Likewise.
2082 (cxx_eval_bare_aggregate): Handle null ctx->ctor.
2083
2084 2022-06-02 Jason Merrill <jason@redhat.com>
2085
2086 PR c++/105795
2087 * constexpr.cc (cxx_eval_bare_aggregate): Always call
2088 init_subob_ctx.
2089
2090 2022-06-01 Jason Merrill <jason@redhat.com>
2091
2092 PR c++/105734
2093 * parser.cc (cp_parser_postfix_dot_deref_expression): Use typeof
2094 if the expression has auto type.
2095
2096 2022-06-01 Jason Merrill <jason@redhat.com>
2097
2098 PR c++/105779
2099 * call.cc (resolve_args): Call mark_single_function here.
2100 * pt.cc (unify_one_argument): Not here.
2101
2102 2022-06-01 Nathan Sidwell <nathan@acm.org>
2103
2104 * decl2.cc (fix_temporary_vars_context_r): Use data argument
2105 for new context.
2106 (one_static_initialization_or_destruction): Adjust tree walk
2107 call. Refactor guard generation.
2108
2109 2022-06-01 Nathan Sidwell <nathan@acm.org>
2110
2111 * decl2.cc (ssdf_decl): Delete global.
2112 (start_static_storage_duration_function): Use some RAII.
2113 (do_static_initialization_or_destruction): Likewise.
2114 (c_parse_final_cleanups): Likewise. Avoid rechecking 'vars'.
2115
2116 2022-06-01 Nathan Sidwell <nathan@acm.org>
2117
2118 * decl2.cc (start_objects): Replace 'method_type' parameter
2119 with 'initp' boolean, rename and retype 'priority' parameter.
2120 (finish_objects): Likewise. Do not expand here.
2121 (one_static_initialization_or_destruction): Move 'initp'
2122 parameter first.
2123 (do_static_initialization_or_destruction): Likewise.
2124 (generate_ctor_or_dtor_function): Rename 'initp' parameter.
2125 Adjust start_objects/finish_obects calls and expand here.
2126 (generate_ctor_and_dtor_functions_for_priority): Adjust calls.
2127 (c_parse_final_cleanups): Likewise.
2128 (vtv_start_verification_constructor_init): Adjust.
2129 (vtv_finish_verification_constructor_init): Use finish_objects.
2130
2131 2022-05-31 Patrick Palka <ppalka@redhat.com>
2132
2133 PR c++/105758
2134 * call.cc (build_over_call): Use z_candidate::conversion_path
2135 and ::access_path instead of TYPE_BINFO when building the
2136 BASELINK for the templated form.
2137
2138 2022-05-31 Patrick Palka <ppalka@redhat.com>
2139
2140 * parser.cc: Use auto_timevar instead of timevar_push/pop.
2141 Remove wrapper functions.
2142 * pt.cc: Likewise.
2143
2144 2022-05-31 Patrick Palka <ppalka@redhat.com>
2145
2146 * cp-tree.h (cp_build_qualified_type_real): Rename to ...
2147 (cp_build_qualified_type): ... this. Give its last parameter
2148 a default argument. Remove macro of the same name.
2149 * decl.cc (grokdeclarator): Adjust accordingly.
2150 * pt.cc (tsubst_aggr_type): Likewise.
2151 (rebuild_function_or_method_type): Likewise.
2152 (tsubst): Likewise.
2153 (maybe_dependent_member_ref): Likewise.
2154 (unify): Likewise.
2155 * tree.cc (cp_build_qualified_type_real): Rename to ...
2156 (cp_build_qualified_type): ... this. Adjust accordingly.
2157
2158 2022-05-31 Jason Merrill <jason@redhat.com>
2159
2160 * Make-lang.in (c++.tags): Just look at *.cc.
2161
2162 2022-05-31 Patrick Palka <ppalka@redhat.com>
2163
2164 * cp-tree.h (comp_template_args): Change return type to bool.
2165 * pt.cc (comp_template_args): Document default arguments.
2166 Change return type to bool and adjust returns accordingly.
2167
2168 2022-05-31 Patrick Palka <ppalka@redhat.com>
2169
2170 * decl.cc (grokvardecl): Use current_template_constraints.
2171 (grokdeclarator): Likewise.
2172 (xref_tag): Likewise.
2173 * semantics.cc (finish_template_template_parm): Likewise.
2174
2175 2022-05-31 Jakub Jelinek <jakub@redhat.com>
2176
2177 * parser.cc (OMP_SCOPE_CLAUSE_MASK): Add firstprivate and allocate
2178 clauses.
2179
2180 2022-05-30 Marek Polacek <polacek@redhat.com>
2181
2182 PR c++/99080
2183 * pt.cc (type_dependent_expression_p): Assert !TYPE_P.
2184 * semantics.cc (finish_id_expression_1): Handle UNBOUND_CLASS_TEMPLATE
2185 specifically.
2186
2187 2022-05-28 Jakub Jelinek <jakub@redhat.com>
2188
2189 * parser.cc (handle_omp_declare_target_clause): If OMP_CLAUSE_LINK was
2190 seen first, use "%<to%>" or "%<enter%>" depending on
2191 OMP_CLAUSE_ENTER_TO of the current clause, otherwise use
2192 "%<to%> or %<enter%>" wording.
2193
2194 2022-05-28 Jason Merrill <jason@redhat.com>
2195
2196 PR c++/105652
2197 * pt.cc (tsubst_lambda_expr): Don't let a namespace-scope lambda
2198 instantiate into a class-scope lambda.
2199
2200 2022-05-27 Marek Polacek <polacek@redhat.com>
2201
2202 PR c++/105725
2203 * parser.cc (class_decl_loc_t::add): Check CLASS_TYPE_P.
2204
2205 2022-05-27 Jakub Jelinek <jakub@redhat.com>
2206
2207 * parser.cc (cp_parser_omp_clause_name): Parse enter clause.
2208 (cp_parser_omp_all_clauses): For to clause on declare target, use
2209 OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of
2210 OMP_CLAUSE_TO_DECLARE clause. Handle PRAGMA_OMP_CLAUSE_ENTER.
2211 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause.
2212 (cp_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of
2213 OMP_CLAUSE_TO_DECLARE.
2214 * semantics.cc (finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead
2215 of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause
2216 name in diagnostics instead of
2217 omp_clause_code_name[OMP_CLAUSE_CODE (c)].
2218
2219 2022-05-26 Marek Polacek <polacek@redhat.com>
2220
2221 PR c++/105569
2222 * typeck.cc (warn_for_null_address): Improve the warning when
2223 the POINTER_PLUS_EXPR's base is of reference type.
2224
2225 2022-05-26 Patrick Palka <ppalka@redhat.com>
2226
2227 PR c++/96363
2228 * decl.cc (shadow_tag): Use the return value of
2229 maybe_process_partial_specialization.
2230 * parser.cc (cp_parser_single_declaration): Call shadow_tag
2231 before associate_classtype_constraints.
2232 * pt.cc (maybe_new_partial_specialization): Change return type
2233 to bool. Take 'type' argument by mutable reference. Set 'type'
2234 to point to the correct constrained specialization when
2235 appropriate.
2236 (maybe_process_partial_specialization): Adjust accordingly.
2237
2238 2022-05-25 Marek Polacek <polacek@redhat.com>
2239
2240 PR c++/96637
2241 * cp-tree.h (attr_chainon): Declare.
2242 * decl.cc (start_decl): Use attr_chainon.
2243 (grokdeclarator): Likewise.
2244 * parser.cc (cp_parser_statement): No longer static.
2245
2246 2022-05-25 Jason Merrill <jason@redhat.com>
2247
2248 PR c++/105655
2249 * pt.cc (build_template_decl): Add assert.
2250 (tsubst_function_decl): Don't return a template.
2251
2252 2022-05-25 Jason Merrill <jason@redhat.com>
2253
2254 PR c++/105623
2255 * decl2.cc (mark_used): Copy type from fn to BASELINK.
2256 * pt.cc (unify_one_argument): Call mark_single_function.
2257
2258 2022-05-25 Jason Merrill <jason@redhat.com>
2259
2260 * constexpr.cc (cxx_eval_call_expression): Check for
2261 heap vars in the result.
2262
2263 2022-05-25 Jason Merrill <jason@redhat.com>
2264
2265 * constexpr.cc (maybe_constant_init_1): Only pass false for
2266 strict when initializing a variable of static duration.
2267
2268 2022-05-25 Marek Polacek <polacek@redhat.com>
2269
2270 PR c++/100252
2271 * typeck2.cc (potential_prvalue_result_of): New.
2272 (replace_placeholders_for_class_temp_r): New.
2273 (digest_nsdmi_init): Call it.
2274
2275 2022-05-24 Jason Merrill <jason@redhat.com>
2276
2277 * constexpr.cc (cxx_fold_indirect_ref): Add default arg.
2278 (cxx_eval_call_expression): Call it.
2279 (cxx_fold_indirect_ref_1): Handle null empty_base.
2280
2281 2022-05-24 Jason Merrill <jason@redhat.com>
2282
2283 * constexpr.cc (enum value_cat): New. Change all 'lval' parameters
2284 from int to value_cat. Change most false to vc_prvalue, most true
2285 to vc_glvalue, cases where the return value is ignored to
2286 vc_discard.
2287 (cxx_eval_statement_list): Only vc_prvalue for stmt-expr result.
2288 (cxx_eval_store_expression): Only build _REF for vc_glvalue.
2289 (cxx_eval_array_reference, cxx_eval_component_reference)
2290 (cxx_eval_indirect_ref, cxx_eval_constant_expression): Likewise.
2291
2292 2022-05-24 Jason Merrill <jason@redhat.com>
2293
2294 PR c++/105622
2295 * constexpr.cc (cxx_eval_store_expression): Adjust assert.
2296 Use initialized_type.
2297
2298 2022-05-24 Patrick Palka <ppalka@redhat.com>
2299
2300 * cp-tree.h (any_template_arguments_need_structural_equality_p):
2301 Declare.
2302 * pt.cc (struct ctp_hasher): Define.
2303 (ctp_table): Define.
2304 (canonical_type_parameter): Use it.
2305 (process_template_parm): Set TYPE_CANONICAL for
2306 TEMPLATE_TEMPLATE_PARM too.
2307 (lookup_template_class_1): Remove now outdated comment for the
2308 any_template_arguments_need_structural_equality_p test.
2309 (tsubst) <case TEMPLATE_TEMPLATE_PARM, etc>: Don't specifically
2310 clear TYPE_CANONICAL for ttps. Set TYPE_CANONICAL on the
2311 substituted type later.
2312 (any_template_arguments_need_structural_equality_p): Return
2313 true for any_targ_node. Don't return true just because a
2314 template argument uses structural equality. Add comment for
2315 the PARM_DECL special case.
2316 (rewrite_template_parm): Set TYPE_CANONICAL on the rewritten
2317 parm's type later.
2318 * tree.cc (bind_template_template_parm): Set TYPE_CANONICAL
2319 when safe to do so.
2320 * typeck.cc (structural_comptypes) [check_alias]: Increment
2321 processing_template_decl before checking
2322 dependent_alias_template_spec_p.
2323
2324 2022-05-24 Jakub Jelinek <jakub@redhat.com>
2325
2326 PR c/105378
2327 * parser.cc (OMP_TASKWAIT_CLAUSE_MASK): Add nowait clause.
2328
2329 2022-05-20 David Malcolm <dmalcolm@redhat.com>
2330
2331 * cxx-pretty-print.h: Replace uses of "FINAL" and "OVERRIDE" with
2332 "final" and "override".
2333 * error.cc: Likewise.
2334
2335 2022-05-18 Marek Polacek <polacek@redhat.com>
2336
2337 PR c++/105634
2338 * call.cc (maybe_warn_class_memaccess): Avoid % by zero.
2339
2340 2022-05-17 Jason Merrill <jason@redhat.com>
2341
2342 PR c++/102307
2343 * decl.cc (check_initializer): Use build_cplus_new in case of
2344 constexpr failure.
2345
2346 2022-05-17 Jakub Jelinek <jakub@redhat.com>
2347
2348 * parser.cc (cp_parser_omp_clause_depend): Parse
2349 inoutset depend-kind.
2350 (cp_parser_omp_depobj): Likewise.
2351 * cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle
2352 OMP_CLAUSE_DEPEND_INOUTSET.
2353
2354 2022-05-16 Martin Liska <mliska@suse.cz>
2355
2356 * module.cc (depset::entity_kind_name): Use ARRAY_SIZE.
2357 * name-lookup.cc (get_std_name_hint): Likewise.
2358 * parser.cc (cp_parser_new): Likewise.
2359
2360 2022-05-16 Marcel Vollweiler <marcel@codesourcery.com>
2361
2362 * pt.cc (tsubst_omp_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR.
2363 * semantics.cc (finish_omp_clauses): Added template decl processing.
2364
2365 2022-05-15 Jason Merrill <jason@redhat.com>
2366
2367 PR c++/100502
2368 PR c++/58993
2369 * friend.cc (is_friend): Hidden friends count as members.
2370 * search.cc (friend_accessible_p): Likewise.
2371
2372 2022-05-15 Jason Merrill <jason@redhat.com>
2373
2374 * parser.cc (cp_parser_template_name): Look through
2375 injected-class-name.
2376
2377 2022-05-15 Jason Merrill <jason@redhat.com>
2378
2379 PR c++/105589
2380 PR c++/105191
2381 PR c++/92385
2382 * init.cc (build_value_init): Handle class in template.
2383
2384 2022-05-13 Nathan Sidwell <nathan@acm.org>
2385
2386 * mangle.cc (maybe_write_module): Check external linkage.
2387
2388 2022-05-13 Richard Biener <rguenther@suse.de>
2389
2390 * constexpr.cc: Remove gimple-fold.h include.
2391
2392 2022-05-12 Patrick Palka <ppalka@redhat.com>
2393
2394 * cp-tree.h (TMPL_ARGS_LEVEL): Assert LEVEL is 1 when
2395 TMPL_ARGS_HAVE_MULTIPLE_LEVELS is false.
2396 * pt.cc (try_class_unification): Correctly copy multidimensional
2397 targs. Free the copy of targs.
2398 (unify_pack_expansion): Fix level comparison.
2399
2400 2022-05-12 Nathan Sidwell <nathan@acm.org>
2401
2402 * parser.cc (cp_parser_linkage_specification): Implement
2403 global module attachment semantics.
2404
2405 2022-05-12 Jakub Jelinek <jakub@redhat.com>
2406
2407 * lex.cc (init_reswords): Register omp_all_memory as keyword
2408 if flag_openmp.
2409 * parser.cc (cp_parser_primary_expression): Diagnose uses of
2410 omp_all_memory in postfix expressions.
2411 (cp_parser_omp_var_list_no_open): Handle omp_all_memory in depend
2412 clause.
2413 * semantics.cc (finish_omp_clauses): Handle omp_all_memory
2414 keyword in depend clause as null_pointer_node, diagnose invalid
2415 uses.
2416 * pt.cc (tsubst_omp_clause_decl): Pass through omp_all_memory.
2417
2418 2022-05-11 Patrick Palka <ppalka@redhat.com>
2419
2420 * constraint.cc (tsubst_parameter_mapping): Convert loop over
2421 TREE_VEC into a range-based for loop using tree_vec_range.
2422 * pt.cc (iterative_hash_template_arg): Likewise.
2423 (template_parms_level_to_args): Likewise.
2424 (deducible_template_args): Likewise.
2425 (check_undeduced_parms): Likewise.
2426 (dependent_type_p_r): Likewise.
2427 (value_dependent_expression_p) <case NONTYPE_ARGUMENT_PACK>:
2428 Likewise.
2429 (dependent_template_arg_p): Likewise.
2430 * tree.cc (cp_walk_subtrees) <case NONTYPE_ARGUMENT_PACK>:
2431 Likewise.
2432
2433 2022-05-11 Jason Merrill <jason@redhat.com>
2434
2435 PR c++/105541
2436 * cp-tree.h (TMPL_ARGS_DEPTH): 0 for null args.
2437 * parser.cc (cp_parser_enclosed_template_argument_list):
2438 Use 0-length TREE_VEC for <>.
2439
2440 2022-05-11 Jason Merrill <jason@redhat.com>
2441
2442 PR bootstrap/105567
2443 * typeck.cc (check_return_expr): Don't mess with ctor return value
2444 while parsing a template.
2445
2446 2022-05-11 Nathan Sidwell <nathan@acm.org>
2447
2448 * cp-tree.h (DECL_MODULE_ATTACH_P): New.
2449 (struct lang_decl_base): Add module_attach_p flag.
2450 * decl.cc (duplicate_decls): Rework module redeclaration
2451 checking.
2452 * module.cc (trees_out::lang_decl_bools): Write attach flag.
2453 (trees_in::lang_decl_bools): ... and read it back.
2454 (trees_out::decl_value): Rework module attachment handling.
2455 (trees_in::decl_value): Rename local var to reflect meaning.
2456 (trees_in::key_mergeable): Likewise.
2457 (get_originating_module): Use DECL_MODULE_ATTACH_P. No need
2458 to special-case mangling.
2459 (module_may_redeclare): Reimplement.
2460 (set_originating_module): Deal with attachment.
2461 * name-lookup.cc (maybe_record_mergeable_decl): Deal with
2462 attachment.
2463 (mergeable_namespace_slots): Likewise.
2464 (do_nonmember_using_decl): Likewise.
2465 * name-lookup.h (mergeable_namespace_slots): Adjust parm
2466 meaning.
2467 * ptree.cc (cxx_print_decl): Adjust purview & attach printing.
2468
2469 2022-05-11 Martin Liska <mliska@suse.cz>
2470
2471 PR target/105355
2472 * lang-specs.h: Use Separate syntax.
2473
2474 2022-05-10 Patrick Palka <ppalka@redhat.com>
2475
2476 * coroutines.cc (instantiate_coro_traits): Adjust accordingly.
2477 * cp-tree.def: Remove mention of SET_PACK_EXPANSION_PATTERN.
2478 * cp-tree.h (SET_PACK_EXPANSION_PATTERN): Remove.
2479 (SET_ARGUMENT_PACK_ARGS): Remove.
2480 * module.cc (trees_in::tree_node): Adjust accordingly.
2481 * parser.cc (make_char_string_pack): Likewise.
2482 (make_string_pack): Likewise.
2483 * pt.cc (make_pack_expansion): Likewise.
2484 (template_parm_to_arg): Likewise.
2485 (coerce_template_parameter_pack): Likewise.
2486 (extract_fnparm_pack): Likewise.
2487 (extract_locals_r): Likewise.
2488 (make_argument_pack): Likewise.
2489 (tsubst_argument_pack): Likewise.
2490 (lookup_init_capture_pack): Likewise.
2491 (type_unification_real): Likewise.
2492 (unify_pack_expansion): Likewise.
2493 (tsubst_initializer_list): Likewise.
2494
2495 2022-05-10 Patrick Palka <ppalka@redhat.com>
2496
2497 * cp-tree.h (PACK_EXPANSION_CHECK): Define.
2498 (PACK_EXPANSION_PATTERN): Use PACK_EXPANSION_CHECK.
2499 (SET_PACK_EXPANSION_PATTERN): Likewise.
2500 (PACK_EXPANSION_PARAMETER_PACKS): Likewise.
2501 (PACK_EXPANSION_EXTRA_ARGS): Likewise.
2502 (PACK_EXPANSION_LOCAL_P): Likewise.
2503 (PACK_EXPANSION_SIZEOF_P): Likewise.
2504 (PACK_EXPANSION_AUTO_P): Likewise.
2505 (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): Likewise.
2506 (ARGUMENT_PACK_CHECK): Define.
2507 (ARGUMENT_PACK_ARGS): Use ARGUMENT_PACK_CHECK.
2508 (SET_ARGUMENT_PACK_ARGS): Likewise.
2509 * parser.cc (cp_parser_sizeof_pack): Check for error_mark_node
2510 before setting PACK_EXPANSION_SIZEOF_P.
2511
2512 2022-05-10 Nathan Sidwell <nathan@acm.org>
2513
2514 * cp-tree.h (enum module_kind_bits): Disambiguate purview,
2515 attach, named module vs header-unit.
2516 (global_purview_p, not_module_p): Delete.
2517 (named_module_p): New.
2518 (header_module_p, module_purview_p): Adjust.
2519 (module_attach_p, named_module_purview_p): New.
2520 * decl.cc (duplicate_decls): Adjust.
2521 * module.cc (declare_module, preprocessed_module): Adjust.
2522 * name-lookup.cc (init_global_partition): Adjust.
2523 (get_fixed_binding_slot, pushdecl): Adjust.
2524 * parser.cc (cp_parser_module_declaration): Adjust.
2525 (cp_parser_import_declaration, cp_parser_declaration): Adjust.
2526
2527 2022-05-10 Jason Merrill <jason@redhat.com>
2528
2529 PR c++/105529
2530 * decl.cc (maybe_return_this): Replace...
2531 (finish_constructor_body, finish_destructor_body): ...these.
2532 (finish_function_body): Call it.
2533 * optimize.cc (build_delete_destructor_body): Call it.
2534 * cp-tree.h (maybe_return_this): Declare.
2535
2536 2022-05-09 Marek Polacek <polacek@redhat.com>
2537
2538 PR c++/103539
2539 * parser.cc (cp_parser_statement): Constify the in_compound parameter.
2540 Create a modifiable copy. Allow labels at the end of compound
2541 statements.
2542
2543 2022-05-09 Patrick Palka <ppalka@redhat.com>
2544
2545 PR c++/105491
2546 * call.cc (field_in_pset): Adjust after next_initializable_field
2547 renaming.
2548 (build_aggr_conv): Likewise.
2549 (convert_like_internal): Likewise.
2550 (type_has_extended_temps): Likewise.
2551 * class.cc (default_init_uninitialized_part): Likewise.
2552 (finish_struct): Likewise.
2553 * constexpr.cc (cx_check_missing_mem_inits): Likewise.
2554 (reduced_constant_expression_p): Use next_subobject_field
2555 instead.
2556 * cp-gimplify.cc (get_source_location_impl_type): Adjust after
2557 next_initializable_field renaming.
2558 (fold_builtin_source_location): Likewise.
2559 * cp-tree.h (next_initializable_field): Rename to ...
2560 (next_aggregate_field): ... this.
2561 (next_subobject_field): Declare.
2562 * decl.cc (next_aggregate_field): Renamed from ...
2563 (next_initializable_field): ... this. Skip over vptr fields
2564 again.
2565 (next_subobject_field): Define.
2566 (reshape_init_class): Adjust after next_initializable_field
2567 renaming.
2568 * init.cc (build_value_init_noctor): Likewise.
2569 (emit_mem_initializers): Likewise.
2570 * lambda.cc (build_capture_proxy): Likewise.
2571 * method.cc (build_comparison_op): Likewise.
2572 * pt.cc (maybe_aggr_guide): Likewise.
2573 * tree.cc (structural_type_p): Likewise.
2574 * typeck2.cc (split_nonconstant_init_1): Likewise.
2575 (digest_init_r): Likewise.
2576
2577 2022-05-09 Nathan Sidwell <nathan@acm.org>
2578
2579 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Renamed from
2580 DECL_MODULE_ATTACHMENTS_P.
2581 (struct lane_decl_base): Rename module_attached_p to
2582 module_keyed_decls_p.
2583 (maybe_key_decl): Renamed from maybe_attach_decl.
2584 * lambda.cc (record_lambda_scope): Adjust.
2585 * lex.cc (cxx_dup_lang_specific_decl): Adjust.
2586 * module.cc (keyed_map_t, keyed_table): Renamed from attached_map_t,
2587 attached_table.
2588 (enum merge_kind): Rename MK_attached to MK_keyed.
2589 (trees_out::lang_decl_bools): Adjust.
2590 (trees_in::lang_decl_bools): Adjust.
2591 (trees_in::decl_value): Adjust.
2592 (trees_out::get_merge_kind): Adjust.
2593 (trees_out::key_mergeable): Adjust.
2594 (trees_in::key_mergeable): Adjust.
2595 (maybe_key_decl): Rename from maybe_attach_decl.
2596 (direct_import): Adjust.
2597 (fini_modules): Adjust.
2598
2599 2022-05-09 Martin Liska <mliska@suse.cz>
2600
2601 * cp-gimplify.cc (cp_genericize_r): Use {,UN}LIKELY
2602 macros.
2603 * parser.cc (cp_finalize_omp_declare_simd): Likewise.
2604 (cp_finalize_oacc_routine): Likewise.
2605
2606 2022-05-07 Marek Polacek <polacek@redhat.com>
2607
2608 PR c++/101833
2609 PR c++/47634
2610 * tree.cc (maybe_adjust_arg_pos_for_attribute): New.
2611
2612 2022-05-06 Jason Merrill <jason@redhat.com>
2613
2614 * error.cc (decl_to_string): Add show_color parameter.
2615 (subst_to_string): Likewise.
2616 (cp_printer): Pass it.
2617 (type_to_string): Set pp_show_color.
2618 (dump_function_name): Use "fnname" color.
2619 (dump_template_bindings): Use "targs" color.
2620 (struct colorize_guard): New.
2621 (reinit_cxx_pp): Clear pp_show_color.
2622
2623 2022-05-06 Jason Merrill <jason@redhat.com>
2624
2625 PR c++/105245
2626 PR c++/100111
2627 * constexpr.cc (cxx_eval_store_expression): Reorganize empty base
2628 handling.
2629
2630 2022-05-05 Marek Polacek <polacek@redhat.com>
2631
2632 PR c++/64679
2633 * parser.cc (cp_parser_parameter_declaration_clause): Maintain
2634 a vector of parameters that haven't been pushed yet. Push them at the
2635 end of a valid parameter-declaration-clause.
2636 (cp_parser_parameter_declaration_list): Take a new auto_vec parameter.
2637 Do not pushdecl while parsing tentatively when pushdecl-ing a parameter
2638 would result in a hard error.
2639 (cp_parser_cache_defarg): Adjust the call to
2640 cp_parser_parameter_declaration_list.
2641
2642 2022-05-05 Richard Biener <rguenther@suse.de>
2643
2644 * module.cc (trees_in::core_vals): Remove separate allocation
2645 for REAL_CST.
2646
2647 2022-05-04 Jason Merrill <jason@redhat.com>
2648
2649 PR c++/104470
2650 * pt.cc (maybe_dependent_member_ref): Handle types.
2651 (tsubst, tsubst_copy): Use it.
2652 (tsubst_aggr_type, instantiate_alias_template): Don't handle
2653 tf_dguide here.
2654
2655 2022-05-04 Patrick Palka <ppalka@redhat.com>
2656
2657 PR c++/105476
2658 * pt.cc (maybe_aggr_guide): Set processing_template_decl when
2659 partially instantiating the guide's parameter list.
2660
2661 2022-05-04 Marek Polacek <polacek@redhat.com>
2662
2663 PR c++/64679
2664 * parser.cc (cp_parser_init_declarator): Properly handle a series of
2665 operator() calls, they are not part of an init-declarator.
2666
2667 2022-05-04 Jason Merrill <jason@redhat.com>
2668
2669 * decl.cc (reshape_init): Shortcut already-reshaped init.
2670 (reshape_init_class): Assert not getting one here.
2671
2672 2022-05-04 Jason Merrill <jason@redhat.com>
2673
2674 * error.cc (cp_print_error_function): Use %qD.
2675 (function_category): Use %qD.
2676
2677 2022-05-04 Marek Polacek <polacek@redhat.com>
2678
2679 PR c++/105436
2680 * parser.cc (cp_parser_next_token_ends_template_argument_p): Don't
2681 return true for CPP_GREATER_EQ.
2682
2683 2022-05-04 Jason Merrill <jason@redhat.com>
2684
2685 * cp-tree.h (struct language_function): Remove x_cdtor_label.
2686 (cdtor_label, LABEL_DECL_CDTOR): Remove.
2687 * constexpr.cc (returns): Don't check LABEL_DECL_CDTOR.
2688 (cxx_eval_constant_expression): Don't call returns.
2689 * decl.cc (check_goto): Don't check cdtor_label.
2690 (start_preparsed_function): And don't set it.
2691 (finish_constructor_body, finish_destructor_body): Remove.
2692 (finish_function_body): Don't call them.
2693 * typeck.cc (check_return_expr): Handle cdtor_returns_this here.
2694 * semantics.cc (finish_return_stmt): Not here.
2695
2696 2022-05-04 Jakub Jelinek <jakub@redhat.com>
2697
2698 * lambda.cc: Include decl.h.
2699 (maybe_add_lambda_conv_op): Temporarily override deprecated_state to
2700 UNAVAILABLE_DEPRECATED_SUPPRESS.
2701
2702 2022-05-03 Patrick Palka <ppalka@redhat.com>
2703
2704 PR c++/105351
2705 * cp-tree.h (finish_non_static_data_member): Add defaulted
2706 complain parameter.
2707 * pt.cc (tsubst_copy_and_build): Pass complain to
2708 finish_non_static_data_member.
2709 * semantics.cc (finish_non_static_data_member): Respect complain
2710 parameter.
2711 (finish_qualified_id_expr): Pass complain to
2712 finish_non_static_data_member.
2713
2714 2022-05-02 Jason Merrill <jason@redhat.com>
2715
2716 * pt.cc (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Copy location.
2717 (do_auto_deduction): Use expr location.
2718
2719 2022-05-02 Jason Merrill <jason@redhat.com>
2720
2721 * class.cc (maybe_note_name_used_in_class): Note in all enclosing
2722 classes. Remember location of use.
2723 (note_name_declared_in_class): Adjust.
2724
2725 2022-05-02 Marek Polacek <polacek@redhat.com>
2726
2727 * cp-tree.h (uses_template_parms): Adjust declaration.
2728 * pt.cc (uses_template_parms): Return bool. Use a RAII sentinel.
2729
2730 2022-05-02 Richard Biener <rguenther@suse.de>
2731
2732 * constexpr.cc (fold_simple_1): Use CASE_CONVERT.
2733 * cp-gimplify.cc (cp_fold): Likewise.
2734 * pt.cc (tsubst_copy): Likewise.
2735
2736 2022-04-29 Jason Merrill <jason@redhat.com>
2737
2738 PR c++/91618
2739 PR c++/96604
2740 * friend.cc (do_friend): Call check_explicit_specialization here.
2741 * decl.cc (grokdeclarator): Not here.
2742 * decl2.cc (check_classfn): Or here.
2743
2744 2022-04-29 Jason Merrill <jason@redhat.com>
2745
2746 PR c++/104470
2747 * cp-tree.h (enum tsubst_flags): Add tf_dguide.
2748 * pt.cc (tsubst_aggr_type): Check it.
2749 (tsubst_baselink, tsubst_copy): Check it.
2750 (maybe_dependent_member_ref): Check it.
2751 (instantiate_alias_template): Handle it.
2752 (build_deduction_guide): Set it.
2753
2754 2022-04-29 Jason Merrill <jason@redhat.com>
2755
2756 PR c++/82980
2757 * lambda.cc (type_deducible_expression_p): Allow more types.
2758
2759 2022-04-29 Jason Merrill <jason@redhat.com>
2760
2761 * decl.cc (cp_finish_decl): Only consider auto for vars.
2762
2763 2022-04-29 Marek Polacek <polacek@redhat.com>
2764
2765 PR c++/67048
2766 * parser.cc (cp_parser_enum_specifier): Warn about empty unnamed enum
2767 only when it's followed by a semicolon.
2768
2769 2022-04-29 Jason Merrill <jason@redhat.com>
2770
2771 PR c++/80351
2772 * decl.cc (cp_finish_decl): Check completeness of deduced type.
2773
2774 2022-04-29 Jason Merrill <jason@redhat.com>
2775
2776 PR c++/102987
2777 * error.cc (dump_decl) [USING_DECL]: Respect flags.
2778
2779 2022-04-29 Jason Merrill <jason@redhat.com>
2780
2781 * error.cc (dump_decl): Check TFF_UNQUALIFIED_NAME.
2782
2783 2022-04-29 Jakub Jelinek <jakub@redhat.com>
2784
2785 PR c++/104319
2786 * parser.cc (cp_parser_template_argument): Treat >= like C++98 >>
2787 after a type id by setting maybe_type_id and aborting tentative
2788 parse.
2789 (cp_parser_enclosed_template_argument_list): Handle
2790 CPP_GREATER_EQ like misspelled CPP_GREATER CPP_RQ and
2791 CPP_RSHIFT_EQ like misspelled CPP_GREATER CPP_GREATER_EQ
2792 or CPP_RSHIFT CPP_EQ or CPP_GREATER CPP_GREATER CPP_EQ.
2793 (cp_parser_next_token_ends_template_argument_p): Return true
2794 also for CPP_GREATER_EQ and CPP_RSHIFT_EQ.
2795
2796 2022-04-29 Iain Sandoe <iain@sandoe.co.uk>
2797
2798 PR c++/105426
2799 * coroutines.cc (register_local_var_uses): Allow promotion of unnamed
2800 temporaries to coroutine frame copies.
2801
2802 2022-04-29 Jason Merrill <jason@redhat.com>
2803
2804 * semantics.cc (check_trait_type): Don't check completeness
2805 of element type of array of unknown bound.
2806
2807 2022-04-29 Jason Merrill <jason@redhat.com>
2808
2809 PR c++/102651
2810 PR c++/49387
2811 * rtti.cc (get_tinfo_decl_direct): Don't complete_type.
2812 (emit_tinfo_decl): Update tdesc type if needed.
2813
2814 2022-04-29 Zhao Wei Liew <zhaoweiliew@gmail.com>
2815
2816 PR c++/25689
2817 * call.cc (extract_call_expr): Return a NULL_TREE on failure
2818 instead of asserting.
2819 (build_new_method_call): Suppress -Wparentheses diagnostic for
2820 MODIFY_EXPR.
2821 * semantics.cc (is_assignment_op_expr_p): Add function to check
2822 if an expression is a call to an op= operator expression.
2823 (maybe_convert_cond): Handle the case of a op= operator expression
2824 for the -Wparentheses diagnostic.
2825
2826 2022-04-28 Patrick Palka <ppalka@redhat.com>
2827
2828 PR c++/105425
2829 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Treat
2830 DEPENDENT_OPERATOR_TYPE like an empty type.
2831
2832 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
2833
2834 PR c++/104051
2835 * coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
2836 non-target expression inputs.
2837
2838 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
2839
2840 PR c++/105301
2841 * coroutines.cc (coro_promise_type_found_p): Account for possible
2842 mutliple overloads of the promise return_value() method.
2843
2844 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
2845
2846 PR c++/105287
2847 * coroutines.cc (maybe_promote_temps): Ensure generated temporaries
2848 are added to the bind expr.
2849 (add_var_to_bind): Fix local var naming to use portable punctuation.
2850 (register_local_var_uses): Do not add synthetic names to unnamed
2851 temporaries.
2852
2853 2022-04-28 Nathan Sidwell <nathan@acm.org>
2854 Iain Sandoe <iain@sandoe.co.uk>
2855
2856 PR c++/103868
2857 * coroutines.cc (finish_co_await_expr): Do not process non-dependent
2858 coroutine expressions at template definition time.
2859 (finish_co_yield_expr): Likewise.
2860 (finish_co_return_stmt): Likewise.
2861
2862 2022-04-28 Marek Polacek <polacek@redhat.com>
2863
2864 PR c++/90107
2865 * parser.cc (cp_parser_class_specifier_1): Accept :: after a class
2866 definition.
2867
2868 2022-04-27 Jason Merrill <jason@redhat.com>
2869
2870 * tree.cc (strip_typedefs): Add default argument comments.
2871
2872 2022-04-27 Marek Polacek <polacek@redhat.com>
2873
2874 PR c++/105398
2875 * pt.cc (uses_template_parms): Return false for any NAMESPACE_DECL.
2876
2877 2022-04-26 Jason Merrill <jason@redhat.com>
2878
2879 PR c++/102629
2880 * pt.cc (gen_elem_of_pack_expansion_instantiation): Clear
2881 TEMPLATE_TYPE_PARAMETER_PACK on auto.
2882
2883 2022-04-26 Patrick Palka <ppalka@redhat.com>
2884
2885 PR c++/105386
2886 * semantics.cc (finish_decltype_type): Pass tf_decltype to
2887 instantiate_non_dependent_expr_sfinae.
2888
2889 2022-04-26 Jason Merrill <jason@redhat.com>
2890
2891 PR c++/104624
2892 * pt.cc (check_for_bare_parameter_packs): Check for lambda
2893 function parameter pack.
2894
2895 2022-04-26 Patrick Palka <ppalka@redhat.com>
2896
2897 PR c++/105289
2898 PR c++/86193
2899 * pt.cc (process_partial_specialization): Downgrade "partial
2900 specialization isn't more specialized" diagnostic from permerror
2901 to an on-by-default pedwarn.
2902 (unify) <case TEMPLATE_PARM_INDEX>: When substituting into the
2903 NTTP type a second time, use the original type not the
2904 substituted type.
2905
2906 2022-04-25 Marek Polacek <polacek@redhat.com>
2907
2908 PR c++/105353
2909 * typeck.cc (build_x_shufflevector): Use
2910 instantiation_dependent_expression_p except for the first two
2911 arguments.
2912
2913 2022-04-21 Marek Polacek <polacek@redhat.com>
2914
2915 * constexpr.cc (cxx_eval_logical_expression): Remove unused
2916 parameter.
2917 (cxx_eval_constant_expression) <case TRUTH_ANDIF_EXPR>,
2918 <case TRUTH_OR_EXPR>: Adjust calls to cxx_eval_logical_expression.
2919
2920 2022-04-21 Marek Polacek <polacek@redhat.com>
2921
2922 PR c++/105321
2923 * constexpr.cc (cxx_eval_logical_expression): Always pass false for lval
2924 to cxx_eval_constant_expression.
2925
2926 2022-04-20 Ed Catmur <ed@catmur.uk>
2927
2928 PR c++/104996
2929 * call.cc (compare_ics): When comparing list-initialization
2930 sequences, do not return early.
2931
2932 2022-04-19 Jakub Jelinek <jakub@redhat.com>
2933
2934 PR c++/105256
2935 * typeck2.cc (process_init_constructor_array,
2936 process_init_constructor_record, process_init_constructor_union): Move
2937 CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag from CONSTRUCTOR elements to the
2938 containing CONSTRUCTOR.
2939
2940 2022-04-15 Marek Polacek <polacek@redhat.com>
2941
2942 PR c++/105268
2943 * parser.cc (cp_parser_placeholder_type_specifier): Return
2944 error_mark_node when trying to build up a constrained parameter in
2945 a default argument.
2946
2947 2022-04-15 Jason Merrill <jason@redhat.com>
2948
2949 PR c++/102804
2950 * decl.cc (grokdeclarator): Drop typedef used with 'unsigned'.
2951
2952 2022-04-15 Jason Merrill <jason@redhat.com>
2953
2954 PR c++/102987
2955 * error.cc (dump_expr): Handle USING_DECL.
2956 [VIEW_CONVERT_EXPR]: Just look through location wrapper.
2957
2958 2022-04-14 Jason Merrill <jason@redhat.com>
2959
2960 PR c++/104646
2961 * constexpr.cc (maybe_save_constexpr_fundef): Don't do extra
2962 checks for defaulted ctors.
2963
2964 2022-04-14 Jason Merrill <jason@redhat.com>
2965
2966 PR c++/82980
2967 * lambda.cc (type_deducible_expression_p): New.
2968 (lambda_capture_field_type): Check it.
2969
2970 2022-04-14 Jason Merrill <jason@redhat.com>
2971
2972 PR c++/65211
2973 * pt.cc (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.
2974
2975 2022-04-14 Jason Merrill <jason@redhat.com>
2976
2977 PR c++/97219
2978 * name-lookup.cc (dependent_local_decl_p): New.
2979 * cp-tree.h (dependent_local_decl_p): Declare.
2980 * semantics.cc (finish_call_expr): Use it.
2981 * pt.cc (tsubst_arg_types): Also substitute default args
2982 for local externs.
2983
2984 2022-04-14 Jason Merrill <jason@redhat.com>
2985
2986 PR c++/101698
2987 * pt.cc (tsubst_baselink): Also check dependent optype.
2988
2989 2022-04-14 Jason Merrill <jason@redhat.com>
2990
2991 PR c++/101442
2992 * decl.cc (cp_finish_decl): Don't pass decl to push_cleanup.
2993 * init.cc (perform_member_init): Likewise.
2994 * semantics.cc (push_cleanup): Adjust comment.
2995
2996 2022-04-13 Jason Merrill <jason@redhat.com>
2997
2998 PR c++/105245
2999 PR c++/100111
3000 * constexpr.cc (cxx_eval_store_expression): Build a CONSTRUCTOR
3001 as needed in empty base handling.
3002
3003 2022-04-13 Jakub Jelinek <jakub@redhat.com>
3004
3005 PR c++/105233
3006 * decl2.cc (cp_check_const_attributes): For aligned attribute
3007 pass manifestly_const_eval=true to fold_non_dependent_expr.
3008
3009 2022-04-13 Marek Polacek <polacek@redhat.com>
3010
3011 PR c++/97296
3012 * call.cc (direct_reference_binding): strip_top_quals when creating
3013 a ck_qual.
3014
3015 2022-04-12 Jason Merrill <jason@redhat.com>
3016
3017 PR c++/104669
3018 * decl.cc (decls_match): Compare versions even if not recording.
3019 (duplicate_decls): Propagate attributes to alias.
3020 * decl2.cc (find_last_decl): Give up if versioned.
3021
3022 2022-04-12 Jason Merrill <jason@redhat.com>
3023
3024 PR c++/102071
3025 * init.cc (build_new_1): Check array_p for alignment.
3026
3027 2022-04-12 Patrick Palka <ppalka@redhat.com>
3028
3029 PR c++/103105
3030 * pt.cc (build_extra_args): Call preserve_args.
3031
3032 2022-04-12 Jason Merrill <jason@redhat.com>
3033
3034 PR c++/104142
3035 * decl.cc (check_initializer): Check TREE_SIDE_EFFECTS.
3036
3037 2022-04-12 Jason Merrill <jason@redhat.com>
3038
3039 PR c++/105223
3040 PR c++/92918
3041 * class.cc (finish_struct): Always using op=.
3042
3043 2022-04-11 Jason Merrill <jason@redhat.com>
3044
3045 PR c++/98249
3046 * call.cc (build_operator_new_call): Just look in ::.
3047
3048 2022-04-11 Alexandre Oliva <oliva@adacore.com>
3049
3050 * constexpr.cc (cxx_eval_call_expression): Disregard dtor
3051 result.
3052
3053 2022-04-11 Alexandre Oliva <oliva@adacore.com>
3054
3055 * semantics.cc (set_cleanup_locs): Propagate locus to call
3056 wrapped in cast-to-void.
3057
3058 2022-04-11 Jason Merrill <jason@redhat.com>
3059
3060 PR c++/100370
3061 * init.cc (warn_placement_new_too_small): Check deref.
3062
3063 2022-04-09 Jason Merrill <jason@redhat.com>
3064
3065 PR c++/105191
3066 PR c++/92385
3067 * tree.cc (build_vec_init_elt): Do {}-init for aggregates.
3068 * constexpr.cc (cxx_eval_vec_init): Only treat {} as value-init
3069 for non-aggregate types.
3070 (build_vec_init_expr): Also check constancy of explicit
3071 initializer elements.
3072
3073 2022-04-09 Jason Merrill <jason@redhat.com>
3074
3075 PR c++/91618
3076 PR c++/96604
3077 * name-lookup.cc (set_decl_namespace): Set
3078 DECL_IMPLICIT_INSTANTIATION if no non-template match.
3079 * pt.cc (check_explicit_specialization): Check it.
3080 * decl2.cc (check_classfn): Call it.
3081
3082 2022-04-07 Patrick Palka <ppalka@redhat.com>
3083
3084 PR c++/99479
3085 * name-lookup.cc (name_lookup::using_queue): Change to an
3086 auto_vec (with 16 elements of internal storage).
3087 (name_lookup::queue_namespace): Change return type to void,
3088 take queue parameter by reference and adjust function body
3089 accordingly.
3090 (name_lookup::do_queue_usings): Inline into ...
3091 (name_lookup::queue_usings): ... here. As in queue_namespace.
3092 (name_lookup::search_unqualified): Don't make queue static,
3093 remove length variable, and adjust function body accordingly.
3094
3095 2022-04-07 Jakub Jelinek <jakub@redhat.com>
3096
3097 PR tree-optimization/102586
3098 * cp-objcp-common.h (cp_classtype_as_base): Declare.
3099 (LANG_HOOKS_CLASSTYPE_AS_BASE): Redefine.
3100 * cp-objcp-common.cc (cp_classtype_as_base): New function.
3101
3102 2022-04-07 Jason Merrill <jason@redhat.com>
3103
3104 PR c++/101051
3105 * decl.cc (grokdeclarator): Reject conversion with trailing return
3106 sooner.
3107
3108 2022-04-07 Jason Merrill <jason@redhat.com>
3109
3110 PR c++/101717
3111 * lambda.cc (lambda_expr_this_capture): Check all enclosing
3112 lambdas for completeness.
3113
3114 2022-04-07 Jason Merrill <jason@redhat.com>
3115
3116 PR c++/105187
3117 * typeck2.cc (store_init_value): Allow TREE_HAS_CONSTRUCTOR for
3118 vectors.
3119
3120 2022-04-06 Jakub Jelinek <jakub@redhat.com>
3121
3122 PR c++/104668
3123 * decl2.cc (splice_template_attributes): Return NULL if *p is
3124 error_mark_node.
3125 (cplus_decl_attributes): Return early if attributes is
3126 error_mark_node. Don't check that later.
3127
3128 2022-04-06 Patrick Palka <ppalka@redhat.com>
3129
3130 PR c++/105143
3131 * pt.cc (do_class_deduction): Check complain before attempting
3132 to issue a -Wctad-maybe-unsupported warning.
3133
3134 2022-04-06 Jason Merrill <jason@redhat.com>
3135
3136 PR c++/104702
3137 * init.cc (build_vec_init): Use a reference for the result.
3138
3139 2022-04-06 Jason Merrill <jason@redhat.com>
3140
3141 PR c++/100608
3142 * name-lookup.cc (check_local_shadow): Use -Wshadow=local
3143 if exactly one of 'old' and 'decl' is a type.
3144
3145 2022-04-05 Jason Merrill <jason@redhat.com>
3146
3147 PR c++/103852
3148 DR 1286
3149 * pt.cc (do_class_deduction): Pedwarn for renaming alias in C++17.
3150
3151 2022-04-05 Jason Merrill <jason@redhat.com>
3152
3153 PR c++/101677
3154 * name-lookup.h (struct cp_binding_level): Add requires_expression
3155 bit-field.
3156 * parser.cc (cp_parser_requires_expression): Set it.
3157 (synthesize_implicit_template_parm): Check it.
3158
3159 2022-04-04 Jason Merrill <jason@redhat.com>
3160
3161 PR c++/101894
3162 * decl.cc (duplicate_decls): Copy DECL_FRIEND_CONTEXT.
3163
3164 2022-04-04 Jason Merrill <jason@redhat.com>
3165
3166 PR c++/103852
3167 DR 1286
3168 * pt.cc (get_underlying_template): Compare default template args.
3169
3170 2022-04-03 Benno Evers <benno.evers@tenzir.com>
3171 Iain Sandoe <iain@sandoe.co.uk>
3172
3173 PR c++/103328
3174 * coroutines.cc (morph_fn_to_coro): Reset
3175 current_binding_level->blocks.
3176
3177 2022-04-01 Jason Merrill <jason@redhat.com>
3178
3179 Revert:
3180 2022-03-31 Jason Merrill <jason@redhat.com>
3181
3182 PR c++/96645
3183 * parser.cc (cp_parser_early_parsing_nsdmi): New.
3184 (cp_parser_member_declaration): Call it.
3185
3186 2022-04-01 Jason Merrill <jason@redhat.com>
3187
3188 Revert:
3189 2022-03-24 Jason Merrill <jason@redhat.com>
3190
3191 PR c++/96645
3192 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
3193 * class.cc (type_has_default_ctor_to_be_synthesized): New.
3194 (type_has_non_user_provided_default_constructor_1): Support it.
3195 (type_has_non_user_provided_default_constructor): Now a wrapper.
3196 * method.cc (complain_about_unparsed_dmi): New.
3197 (constructible_expr): Call it.
3198
3199 2022-04-01 Patrick Palka <ppalka@redhat.com>
3200
3201 PR c++/105110
3202 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Drop cv-quals from
3203 the argument type of an NTTP before deducing from it.
3204
3205 2022-03-31 Jason Merrill <jason@redhat.com>
3206
3207 PR c++/96645
3208 * parser.cc (cp_parser_early_parsing_nsdmi): New.
3209 (cp_parser_member_declaration): Call it.
3210
3211 2022-03-30 Patrick Palka <ppalka@redhat.com>
3212
3213 PR c++/100474
3214 * constraint.cc (diagnose_trait_expr): Handle all remaining
3215 traits appropriately. Remove default case.
3216
3217 2022-03-30 Marek Polacek <polacek@redhat.com>
3218
3219 PR c++/93280
3220 PR c++/104583
3221 * init.cc (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor.
3222
3223 2022-03-30 Jakub Jelinek <jakub@redhat.com>
3224
3225 PR c++/105092
3226 * pt.cc (tsubst_omp_clause_decl): When handling iterators, set
3227 DECL_CONTEXT of the iterator var to current_function_decl and
3228 call pushdecl.
3229
3230 2022-03-30 Jakub Jelinek <jakub@redhat.com>
3231
3232 PR c++/105061
3233 * parser.cc (cp_parser_template_introduction): If member_p, temporarily
3234 clear parser->colon_corrects_to_scope_p around tentative parsing of
3235 nested name specifier.
3236
3237 2022-03-28 Jason Merrill <jason@redhat.com>
3238
3239 * pt.cc (determine_specialization): Add comment.
3240
3241 2022-03-28 Patrick Palka <ppalka@redhat.com>
3242
3243 PR c++/105067
3244 * pt.cc (finish_concept_definition): Check that a concept is
3245 declared with exactly one template parameter list.
3246
3247 2022-03-28 Patrick Palka <ppalka@redhat.com>
3248
3249 PR c++/105064
3250 * constraint.cc (maybe_substitute_reqs_for): Don't assume
3251 DECL_TEMPLATE_INFO is available.
3252
3253 2022-03-28 Jason Merrill <jason@redhat.com>
3254
3255 PR c++/105003
3256 PR c++/104008
3257 PR c++/102869
3258 * pt.cc (complex_alias_template_r): walk_tree callback, replacing
3259 uses_all_template_parms_r, complex_pack_expansion_r.
3260 (complex_alias_template_p): Adjust.
3261 * tree.cc (strip_typedefs): Revert r12-7710 change.
3262
3263 2022-03-28 Jason Merrill <jason@redhat.com>
3264
3265 PR c++/102071
3266 * init.cc (build_new_1): Include cookie in alignment. Omit
3267 constexpr wrapper from alloc_call.
3268
3269 2022-03-28 Jason Merrill <jason@redhat.com>
3270
3271 PR c++/103291
3272 * name-lookup.cc (push_local_extern_decl_alias): Call
3273 determine_visibility.
3274
3275 2022-03-28 Jason Merrill <jason@redhat.com>
3276
3277 PR c++/102123
3278 * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting
3279 a type template reference.
3280
3281 2022-03-28 Jason Merrill <jason@redhat.com>
3282
3283 PR c++/103968
3284 * pt.cc (value_dependent_expression_p): Check
3285 has_value_dependent_address for conversion to reference.
3286
3287 2022-03-28 Jason Merrill <jason@redhat.com>
3288
3289 PR c++/103943
3290 * pt.cc (tsubst_qualified_id): Handle getting SCOPE_REF from
3291 tsubst_baselink.
3292 (instantiation_dependent_scope_ref_p): Check dependent_scope_p.
3293
3294 2022-03-28 Jason Merrill <jason@redhat.com>
3295
3296 PR c++/102045
3297 * call.cc (make_base_init_ok): Call make_used.
3298
3299 2022-03-28 Jason Merrill <jason@redhat.com>
3300
3301 PR c++/104847
3302 * mangle.cc (write_expression): Don't write a union designator when
3303 undigested.
3304
3305 2022-03-28 Jason Merrill <jason@redhat.com>
3306
3307 PR c++/99445
3308 PR c++/103769
3309 * tree.cc (strip_typedefs): Use build_distinct_type_copy.
3310
3311 2022-03-26 Patrick Palka <ppalka@redhat.com>
3312
3313 PR c++/105050
3314 * constexpr.cc (potential_constant_expression_1) <case IF_STMT>:
3315 Clarify error message when a if-stmt is non-constant because its
3316 branches are non-constant.
3317
3318 2022-03-26 Patrick Palka <ppalka@redhat.com>
3319
3320 PR c++/103455
3321 * call.cc (add_builtin_candidate) <case MEMBER_REF>: Test
3322 CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
3323
3324 2022-03-26 Jakub Jelinek <jakub@redhat.com>
3325
3326 * parser.cc (cp_parser_postfix_expression)
3327 <case RID_BILTIN_CONVERTVECTOR, case RID_BUILTIN_BIT_CAST>: Don't
3328 return cp_build_{vec,convert,bit_cast} result right away, instead
3329 set postfix_expression to it and break.
3330
3331 2022-03-25 Marek Polacek <polacek@redhat.com>
3332
3333 PR c++/104944
3334 * typeck.cc (cxx_sizeof_or_alignof_type): Diagnose alignof(void).
3335 (cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with
3336 complain == true.
3337
3338 2022-03-24 Marek Polacek <polacek@redhat.com>
3339
3340 PR c++/104284
3341 * decl.cc (check_initializer): Don't call build_aggr_init in
3342 a template.
3343
3344 2022-03-24 Jason Merrill <jason@redhat.com>
3345
3346 PR c++/96645
3347 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
3348 * class.cc (type_has_default_ctor_to_be_synthesized): New.
3349 (type_has_non_user_provided_default_constructor_1): Support it.
3350 (type_has_non_user_provided_default_constructor): Now a wrapper.
3351 * method.cc (complain_about_unparsed_dmi): New.
3352 (constructible_expr): Call it.
3353
3354 2022-03-24 Marek Polacek <polacek@redhat.com>
3355
3356 PR c++/102990
3357 * typeck2.cc (massage_init_elt): Avoid folding CONSTRUCTORs.
3358
3359 2022-03-24 Patrick Palka <ppalka@redhat.com>
3360
3361 PR c++/104620
3362 * call.cc (build_over_call): Use cxx_constant_value_sfinae
3363 instead of cxx_constant_value to evaluate a consteval call.
3364 * constexpr.cc (cxx_constant_value_sfinae): Add decl parameter
3365 and pass it to cxx_eval_outermost_constant_expr.
3366 * cp-tree.h (cxx_constant_value_sfinae): Add decl parameter.
3367 * pt.cc (fold_targs_r): Pass NULL_TREE as decl parameter to
3368 cxx_constant_value_sfinae.
3369
3370 2022-03-24 Jakub Jelinek <jakub@redhat.com>
3371
3372 PR c++/104994
3373 * constexpr.cc (cxx_eval_constant_expression): Don't diagnose passing
3374 through extern thread_local declarations. Change wording from
3375 declaration to definition.
3376 (potential_constant_expression_1): Don't diagnose extern thread_local
3377 declarations. Change wording from declared to defined.
3378 * decl.cc (start_decl): Likewise.
3379
3380 2022-03-23 Jason Merrill <jason@redhat.com>
3381
3382 PR c++/103337
3383 * decl.cc (reshape_single_init): New.
3384 (reshape_init_class): Use it.
3385
3386 2022-03-23 Jason Merrill <jason@redhat.com>
3387
3388 PR c++/105006
3389 * name-lookup.cc (lookup_using_decl): Check that scope is
3390 a dependent type before looking for dependent using.
3391
3392 2022-03-23 Jason Merrill <jason@redhat.com>
3393
3394 PR c++/105006
3395 * name-lookup.cc (lookup_using_decl): Set DECL_DEPENDENT_P if lookup
3396 finds a dependent using.
3397
3398 2022-03-21 Jason Merrill <jason@redhat.com>
3399
3400 PR c++/58646
3401 * init.cc (build_vec_init): Check for vla element type.
3402
3403 2022-03-21 Jason Merrill <jason@redhat.com>
3404
3405 PR c++/103337
3406 PR c++/102740
3407 PR c++/103299
3408 PR c++/102538
3409 * decl.cc (reshape_init_class): Avoid looking for designator
3410 after we found it.
3411 (reshape_init_r): Keep looking for designator.
3412
3413 2022-03-21 Jason Merrill <jason@redhat.com>
3414
3415 PR c++/101767
3416 * decl.cc (reshape_init_class): Back out of anon struct
3417 if a designator doesn't match.
3418
3419 2022-03-18 Jason Merrill <jason@redhat.com>
3420
3421 PR c++/92918
3422 PR c++/104476
3423 * class.cc (add_method): Avoid adding the same used function twice.
3424 (handle_using_decl): Don't add_method.
3425 (finish_struct): Don't using op= if we have one already.
3426 (maybe_push_used_methods): New.
3427 * semantics.cc (finish_member_declaration): Call it.
3428 * name-lookup.cc (diagnose_name_conflict): No longer static.
3429 (push_class_level_binding): Revert 92918 patch, limit
3430 to dependent using.
3431 * cp-tree.h: Adjust.
3432
3433 2022-03-18 Jakub Jelinek <jakub@redhat.com>
3434
3435 PR c++/104568
3436 * init.cc (build_new_constexpr_heap_type): Remove FULL_SIZE
3437 argument and its handling, instead add ITYPE2 argument. Only
3438 support COOKIE_SIZE != NULL.
3439 (build_new_1): If size is 0, change it to 0 * outer_nelts if
3440 outer_nelts is non-NULL. Pass type rather than elt_type to
3441 maybe_wrap_new_for_constexpr.
3442 * constexpr.cc (build_new_constexpr_heap_type): New function.
3443 (cxx_eval_constant_expression) <case CONVERT_EXPR>:
3444 If elt_size is zero sized type, try to recover outer_nelts from
3445 the size argument to operator new/new[] and pass that as
3446 arg_size to build_new_constexpr_heap_type. Pass ctx,
3447 non_constant_p and overflow_p to that call too.
3448
3449 2022-03-18 Marek Polacek <polacek@redhat.com>
3450
3451 PR c++/104008
3452 * tree.cc (strip_typedefs): Don't strip an alias template when
3453 doing so would result in losing a parameter pack.
3454
3455 2022-03-16 Patrick Palka <ppalka@redhat.com>
3456
3457 * search.cc (lookup_member): Simplify by handling all values
3458 of protect together in the ambiguous case. Don't modify protect.
3459
3460 2022-03-16 Patrick Palka <ppalka@redhat.com>
3461
3462 PR c++/96780
3463 * cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls to
3464 std::move/forward and other cast-like functions into simple
3465 casts.
3466
3467 2022-03-15 Patrick Palka <ppalka@redhat.com>
3468
3469 PR c++/103177
3470 * search.cc (lookup_field_info::errstr): Remove this data
3471 member.
3472 (lookup_field_r): Don't set errstr.
3473 (lookup_member): Check ambiguity before checking access.
3474 Simplify accordingly after errstr removal. Exit early upon
3475 error or empty result.
3476
3477 2022-03-15 Jakub Jelinek <jakub@redhat.com>
3478
3479 PR c++/104623
3480 * parser.cc (cp_parser_skip_to_pragma_eol): Don't purge any tokens.
3481
3482 2022-03-14 Jakub Jelinek <jakub@redhat.com>
3483
3484 PR tree-optimization/102586
3485 * call.cc (build_cxx_call): Diagnose __builtin_clear_padding where
3486 first argument's type is pointer to non-trivially-copyable type unless
3487 it is address of a variable or parameter.
3488
3489 2022-03-12 Patrick Palka <ppalka@redhat.com>
3490
3491 PR c++/104641
3492 * cp-tree.h (tsubst_flags::tf_tst_ok): New flag.
3493 * decl.cc (make_typename_type): Allow a typename-specifier to
3494 resolve to a template when tf_tst_ok, in which case return
3495 a CTAD placeholder for the template.
3496 * pt.cc (tsubst_decl) <case VAR_DECL>: Set tf_tst_ok when
3497 substituting the type.
3498 (tsubst): Clear tf_tst_ok and remember if it was set.
3499 <case TYPENAME_TYPE>: Pass tf_tst_ok to make_typename_type
3500 appropriately.
3501 (tsubst_copy) <case CAST_EXPR>: Set tf_tst_ok when substituting
3502 the type.
3503 (tsubst_copy_and_build) <case CAST_EXPR>: Likewise.
3504 <case CONSTRUCTOR>: Likewise.
3505
3506 2022-03-12 Patrick Palka <ppalka@redhat.com>
3507
3508 PR c++/104622
3509 * call.cc (missing_conversion_p): Define.
3510 (add_candidates): Use it.
3511 * pt.cc (check_non_deducible_conversion): Change type of strict
3512 parameter to unification_kind_t and directly test for DEDUCE_CALL.
3513
3514 2022-03-12 Patrick Palka <ppalka@redhat.com>
3515
3516 PR c++/104527
3517 * constraint.cc (normalize_atom): Set
3518 ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P appropriately.
3519 (get_mapped_args): Make static, adjust parameters. Always
3520 return a vector whose depth corresponds to the template depth of
3521 the context of the atomic constraint expression. Micro-optimize
3522 by passing false as exact to safe_grow_cleared and by collapsing
3523 a multi-level depth-one argument vector.
3524 (satisfy_atom): Adjust call to get_mapped_args and
3525 diagnose_atomic_constraint.
3526 (diagnose_atomic_constraint): Replace map parameter with an args
3527 parameter.
3528 * cp-tree.h (ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P): Define.
3529 (get_mapped_args): Remove declaration.
3530
3531 2022-03-12 Patrick Palka <ppalka@redhat.com>
3532 Jason Merrill <jason@redhat.com>
3533
3534 PR c++/98644
3535 * constexpr.cc (mark_non_constant): Define, split out from ...
3536 (cxx_eval_outermost_constant_expr): ... here.
3537 (maybe_constant_value): Use it.
3538
3539 2022-03-12 Patrick Palka <ppalka@redhat.com>
3540
3541 * semantics.cc (finish_unary_fold_expr): Use input_location
3542 instead of UNKNOWN_LOCATION.
3543 (finish_binary_fold_expr): Likewise.
3544
3545 2022-03-12 Thomas Schwinge <thomas@codesourcery.com>
3546
3547 PR other/65095
3548 * semantics.cc (handle_omp_array_sections_1)
3549 (cp_oacc_check_attachments): Call 'user_omp_clause_code_name'
3550 instead of 'c_omp_map_clause_name'.
3551
3552 2022-03-10 Marek Polacek <polacek@redhat.com>
3553
3554 PR c++/104608
3555 * parser.cc (cp_parser_template_name): Repeat lookup of
3556 TYPE_DECLs.
3557
3558 2022-03-10 Marek Polacek <polacek@redhat.com>
3559
3560 PR c++/104752
3561 * semantics.cc (finish_compound_literal): Disallow auto{x} for
3562 is_constrained_auto.
3563 * typeck2.cc (build_functional_cast_1): Likewise.
3564
3565 2022-03-10 Marek Polacek <polacek@redhat.com>
3566
3567 PR c++/104846
3568 * decl.cc (grokdeclarator): Check FUNC_OR_METHOD_TYPE_P before giving
3569 data member errors.
3570
3571 2022-03-10 Jakub Jelinek <jakub@redhat.com>
3572
3573 PR c++/103460
3574 * decl.cc (grok_op_properties): Allow variadic operator[] for
3575 C++23.
3576
3577 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
3578
3579 PR c++/95999
3580 * decl.cc (finish_enum_value_list): If VALUE isn't an INTEGER_CST
3581 consider it to be zero (i.e. treat it like error_mark_node).
3582 (build_enumerator): Likewise, if PREV_VALUE isn't an INTEGER_CST,
3583 set VALUE to error_mark_node.
3584
3585 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
3586
3587 PR c++/39751
3588 * parser.cc (cp_parser_late_parsing_for_member): Confirm the token
3589 stream hasn't been purged before processing DECL_PENDING_INLINE.
3590
3591 2022-03-09 Patrick Palka <ppalka@redhat.com>
3592
3593 PR c++/104823
3594 * except.cc (build_noexcept_spec): Strengthen dependence check
3595 to instantiation_dependent_expression_p.
3596 * parser.cc (cp_parser_parenthesized_expression_list_elt):
3597 Remove fold_expr_p parameter, and don't call
3598 instantiate_non_dependent_expr.
3599 (cp_parser_parenthesized_expression_list): Adjust accordingly.
3600 * pt.cc (expand_integer_pack): Strengthen dependence check
3601 to instantiation_dependent_expression_p.
3602 (instantiate_non_dependent_expr_internal): Adjust comment.
3603 (instantiate_non_dependent_expr_sfinae): Likewise. Drop
3604 the potentially-constant check, and relax and turn the
3605 dependence check into a checking assert.
3606 (instantiate_non_dependent_or_null): Adjust comment.
3607 * semantics.cc (finish_decltype_type): Keep
3608 processing_template_decl cleared after calling
3609 instantiate_non_dependent_expr_sfinae.
3610
3611 2022-03-09 Patrick Palka <ppalka@redhat.com>
3612
3613 PR c++/102137
3614 PR c++/87820
3615 * cp-tree.h (is_copy_initialization): Declare.
3616 * decl.cc (cp_finish_decl): Set LOOKUP_ONLYCONVERTING
3617 when is_copy_initialization is true.
3618 * init.cc (build_aggr_init): Split out copy-initialization
3619 check into ...
3620 (is_copy_initialization): ... here.
3621 * pt.cc (instantiate_decl): Pass 0 instead of
3622 LOOKUP_ONLYCONVERTING as flags to cp_finish_decl.
3623
3624 2022-03-09 Patrick Palka <ppalka@redhat.com>
3625
3626 PR c++/65396
3627 * cp-tree.h (merge_default_template_args): Declare.
3628 * decl.cc (merge_default_template_args): Define, factored out
3629 from redeclare_class_template.
3630 (duplicate_decls): Use it when merging member function template
3631 and free function declarations.
3632 * pt.cc (redeclare_class_template): Factor out default argument
3633 merging logic into merge_default_template_args. Improve location
3634 of a note when there's a template parameter kind mismatch.
3635
3636 2022-03-09 Jakub Jelinek <jakub@redhat.com>
3637
3638 PR c/104711
3639 * constexpr.cc (cxx_eval_check_shift_p): Use TYPE_OVERFLOW_WRAPS
3640 instead of TYPE_UNSIGNED.
3641 * typeck.cc (cp_build_binary_op): Don't emit
3642 -Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
3643
3644 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
3645
3646 PR c++/96440
3647 * decl.cc (start_decl): Defend against prefix_attributes being
3648 error_mark_node.
3649
3650 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
3651
3652 PR c++/96437
3653 * parser.cc (synthesize_implicit_template_parm): Check that
3654 TREE_VALUE (new_parm) isn't error_mark_node before setting its
3655 DECL_VIRTUAL_P.
3656
3657 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
3658
3659 PR c++/96329
3660 * parser.cc (cp_parser_linkage_specification): Treat the case where
3661 linkage is error_mark_node as "invalid linkage-specification".
3662
3663 2022-03-08 Marek Polacek <polacek@redhat.com>
3664
3665 PR c++/104108
3666 * pt.cc (convert_nontype_argument): Recompute
3667 value_dependent_expression_p after build_converted_constant_expr.
3668
3669 2022-03-08 Marek Polacek <polacek@redhat.com>
3670
3671 * decl2.cc (is_late_template_attribute): Do not defer attribute
3672 unavailable.
3673 * pt.cc (tsubst_enum): Set TREE_UNAVAILABLE.
3674
3675 2022-03-08 Jakub Jelinek <jakub@redhat.com>
3676
3677 PR c++/104806
3678 * search.cc (lookup_field_fuzzy_info::fuzzy_lookup_field): Ignore
3679 identifiers with space at the end.
3680
3681 2022-03-07 Jason Merrill <jason@redhat.com>
3682
3683 PR c++/104618
3684 * decl2.cc (mark_single_function): Look through parens and location
3685 wrapper.
3686 * typeck.cc (cp_build_addr_expr_1): Not here.
3687
3688 2022-03-07 Jakub Jelinek <jakub@redhat.com>
3689
3690 * parser.cc (cp_parser_omp_clause_map): Add missing space in string
3691 literal.
3692
3693 2022-03-07 Jakub Jelinek <jakub@redhat.com>
3694
3695 * cvt.cc: Fix up duplicated word issue in a comment.
3696 * pt.cc: Likewise.
3697 * module.cc: Likewise.
3698 * coroutines.cc: Likewise.
3699
3700 2022-03-04 Nathan Sidwell <nathan@acm.org>
3701
3702 * mangle.cc (is_std_substitution): Check global module.
3703 (is_std_substitution_char): Return bool.
3704
3705 2022-03-04 Nathan Sidwell <nathan@acm.org>
3706
3707 * cp-tree.h (mangle_identifier): Replace with ...
3708 (mangle_module_component): ... this.
3709 * mangle.cc (dump_substitution_candidates): Adjust.
3710 (add_substitution): Likewise.
3711 (find_substitution): Likewise.
3712 (unmangled_name_p): Likewise.
3713 (mangle_module_substitution): Reimplement.
3714 (mangle_module_component): New.
3715 (write_module, maybe_write_module): Adjust.
3716 (write_name): Drop modules here.
3717 (write_unqualified): Do them here instead.
3718 (mangle_global_init): Adjust.
3719 * module.cc (module_state::mangle): Adjust.
3720 (mangle_module): Likewise.
3721 (get_originating_module): Adjust.
3722
3723 2022-02-28 Marek Polacek <polacek@redhat.com>
3724
3725 PR c++/104682
3726 * cp-tree.h (build_enumerator): Adjust.
3727 * decl.cc (finish_enum): Make it return the new decl.
3728 * pt.cc (tsubst_enum): Propagate TREE_DEPRECATED and TREE_UNAVAILABLE.
3729
3730 2022-02-28 Marek Polacek <polacek@redhat.com>
3731
3732 PR c++/104667
3733 * decl2.cc (is_late_template_attribute): Cope with a decl without
3734 a type.
3735
3736 2022-02-27 Jason Merrill <jason@redhat.com>
3737
3738 PR c++/104618
3739 * typeck.cc (cp_build_addr_expr_1): Also
3740 maybe_undo_parenthesized_ref.
3741
3742 2022-02-24 Martin Liska <mliska@suse.cz>
3743
3744 * pt.cc (defarg_insts_for): Use braces for subobject.
3745
3746 2022-02-18 Patrick Palka <ppalka@redhat.com>
3747
3748 PR c++/94944
3749 * pt.cc (maybe_instantiate_noexcept): For non-static member
3750 functions, set current_class_ptr/ref to the specialized 'this'
3751 instead.
3752
3753 2022-02-17 Jason Merrill <jason@redhat.com>
3754
3755 PR c++/104539
3756 * pt.cc (mark_decl_instantiated): Don't clear DECL_COMDAT.
3757
3758 2022-02-17 Jason Merrill <jason@redhat.com>
3759
3760 PR c++/90451
3761 * decl2.cc (mark_single_function): New.
3762 * cp-tree.h: Declare it.
3763 * typeck.cc (cp_build_addr_expr_1): mark_used when making a PMF.
3764 * semantics.cc (finish_qualified_id_expr): Not here.
3765 (finish_id_expression_1): Or here.
3766 (finish_decltype_type): Call mark_single_function.
3767 * cvt.cc (convert_to_void): And here.
3768 * pt.cc (convert_nontype_argument): And here.
3769 * init.cc (build_offset_ref): Adjust assert.
3770
3771 2022-02-17 Patrick Palka <ppalka@redhat.com>
3772
3773 PR c++/104565
3774 * semantics.cc (finish_compound_literal): Don't perform
3775 non-dependent expr folding before calling check_narrowing.
3776
3777 2022-02-16 Patrick Palka <ppalka@redhat.com>
3778
3779 PR c++/104507
3780 * constexpr.cc (potential_constant_expression_1)
3781 <case NON_DEPENDENT_EXPR>: Return false instead of recursing.
3782 Assert tf_error isn't set.
3783
3784 2022-02-15 Jason Merrill <jason@redhat.com>
3785
3786 PR c++/104107
3787 PR c++/95036
3788 * pt.cc (coerce_template_template_parms): Take full parms.
3789 Avoid adding too much of outer_args.
3790 (coerce_template_template_parm): Adjust.
3791 (template_template_parm_bindings_ok_p): Adjust.
3792 (convert_template_argument): Adjust.
3793
3794 2022-02-14 Jakub Jelinek <jakub@redhat.com>
3795
3796 PR c++/104513
3797 * constexpr.cc (potential_constant_expression_1) <case GOTO_EXPR>:
3798 Don't punt if returns (target).
3799
3800 2022-02-11 Jakub Jelinek <jakub@redhat.com>
3801
3802 PR c++/104472
3803 * constexpr.cc (cxx_eval_internal_function) <case IFN_VEC_CONVERT>:
3804 Only return fold_const_call result if it is non-NULL. Otherwise
3805 fall through into the default: case to return t, set *non_constant_p
3806 and emit diagnostics if needed.
3807
3808 2022-02-10 Jason Merrill <jason@redhat.com>
3809
3810 * module.cc (depset::hash::add_specializations): Use
3811 STRIP_TEMPLATE.
3812
3813 2022-02-10 Tobias Burnus <tobias@codesourcery.com>
3814
3815 PR c++/102204
3816 * decl2.cc (cp_omp_mappable_type_1): Remove check for virtual
3817 members as those are permitted since OpenMP 5.0.
3818
3819 2022-02-10 Patrick Palka <ppalka@redhat.com>
3820
3821 * pt.cc (filter_memfn_lookup): Handle dependent USING_DECL
3822 better.
3823
3824 2022-02-10 Marcel Vollweiler <marcel@codesourcery.com>
3825
3826 * parser.cc (cp_parser_omp_clause_name): Parse 'has_device_addr' clause.
3827 (cp_parser_omp_var_list_no_open): Handle array sections.
3828 (cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
3829 case.
3830 (cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK.
3831 * semantics.cc (handle_omp_array_sections): Handle clause restrictions.
3832 (finish_omp_clauses): Handle array sections.
3833
3834 2022-02-09 Patrick Palka <ppalka@redhat.com>
3835
3836 PR c++/104432
3837 * call.cc (build_new_method_call): When a non-dependent call
3838 resolves to a specialization of a member template, always build
3839 the pruned overload set using the member template, not the
3840 specialization.
3841 * pt.cc (filter_memfn_lookup): New parameter newtype. Simplify
3842 and correct how members from the new lookup set are matched to
3843 those from the old one.
3844 (tsubst_baselink): Pass binfo_type as newtype to
3845 filter_memfn_lookup.
3846
3847 2022-02-09 Jason Merrill <jason@redhat.com>
3848
3849 PR c++/103752
3850 * module.cc (trees_out::core_vals): Stream explicit specifier.
3851 (trees_in::core_vals): Likewise.
3852 * pt.cc (store_explicit_specifier): No longer static.
3853 (tsubst_function_decl): Clear DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
3854 * cp-tree.h (lookup_explicit_specifier): Declare.
3855
3856 2022-02-09 Jason Merrill <jason@redhat.com>
3857
3858 PR c++/96876
3859 * typeck2.cc (split_nonconstant_init_1): Push cleanups for
3860 preceding members with constant initialization.
3861 (maybe_push_temp_cleanup): Do nothing if -fno-exceptions.
3862
3863 2022-02-08 Jakub Jelinek <jakub@redhat.com>
3864
3865 PR c++/104379
3866 * name-lookup.cc (check_local_shadow): When diagnosing shadowing
3867 of a member or global declaration, add warning suppression for
3868 the decl and don't warn again on it.
3869
3870 2022-02-08 Jakub Jelinek <jakub@redhat.com>
3871
3872 PR c++/104403
3873 * constexpr.cc (cxx_eval_constant_expression): Don't assert DECL_EXPRs
3874 of TREE_STATIC vars may only appear in -std=c++23.
3875
3876 2022-02-08 Patrick Palka <ppalka@redhat.com>
3877
3878 PR c++/80951
3879 * pt.cc (uses_deducible_template_parms): Consider the
3880 noexcept-spec of a function type.
3881
3882 2022-02-08 Patrick Palka <ppalka@redhat.com>
3883
3884 PR c++/104410
3885 * constraint.cc (satisfaction_value): Relax assert to accept
3886 cv-qualified bool.
3887
3888 2022-02-08 Patrick Palka <ppalka@redhat.com>
3889
3890 PR c++/103706
3891 * pt.cc (preserve_args): New function.
3892 (tsubst_lambda_expr): Use it when setting LAMBDA_EXPR_REGEN_INFO.
3893
3894 2022-02-08 Patrick Palka <ppalka@redhat.com>
3895
3896 PR c++/103706
3897 * constraint.cc (satisfy_declaration_constraints): Use
3898 lambda_regenerating_args instead.
3899 * cp-tree.h (lambda_regenerating_args): Declare.
3900 * pt.cc (lambda_regenerating_args): Define, split out from
3901 satisfy_declaration_constraints.
3902 (do_auto_deduction): Use lambda_regenerating_args to obtain the
3903 full set of outer template arguments for satisfaction when
3904 inside a lambda.
3905
3906 2022-02-06 Patrick Palka <ppalka@redhat.com>
3907
3908 PR c++/96242
3909 * decl2.cc (mark_used): Directly synthesize a DECL_MAYBE_DELETED
3910 fn by calling maybe_synthesize_method instead of relying on
3911 maybe_instantiate_noexcept. Move call to m_i_n after the
3912 DECL_DELETED_FN handling.
3913 * pt.cc (maybe_instantiate_noexcept): Restrict DECL_MAYBE_DELETED
3914 fn synthesis to only those with an implicit noexcept-spec, and
3915 return !DECL_DELETED_FN instead of !DECL_MAYBE_DELETED afterwards.
3916
3917 2022-02-06 Jakub Jelinek <jakub@redhat.com>
3918
3919 PR c++/89074
3920 PR c++/104033
3921 * constexpr.cc (cxx_eval_binary_expression): Temporarily set
3922 folding_cxx_constexpr.
3923
3924 2022-02-05 Jason Merrill <jason@redhat.com>
3925
3926 PR c++/104300
3927 PR c++/92385
3928 * cp-tree.h (get_vec_init_expr): New.
3929 (target_expr_needs_replace): New.
3930 * cp-gimplify.cc (cp_gimplify_init_expr): Use it.
3931 (struct cp_fold_data): New.
3932 (cp_fold_r): Only genericize inits at end of fn.
3933 (cp_fold_function): Here.
3934 (cp_fully_fold_init): Not here.
3935 * init.cc (build_vec_init): Use get_vec_init_expr.
3936 * tree.cc (build_vec_init_expr): Likewise.
3937 * typeck2.cc (split_nonconstant_init_1): Likewise.
3938 (process_init_constructor): Wrap VEC_INIT_EXPR in
3939 TARGET_EXPR.
3940
3941 2022-02-05 Jason Merrill <jason@redhat.com>
3942
3943 * pt.cc (iterative_hash_template_arg): Add comment.
3944
3945 2022-02-03 Patrick Palka <ppalka@redhat.com>
3946
3947 PR c++/104079
3948 * pt.cc (value_dependent_noexcept_spec_p): New predicate split
3949 out from ...
3950 (dependent_type_p_r): ... here.
3951 (instantiation_dependent_r): Use value_dependent_noexcept_spec_p
3952 to consider dependence of a noexcept-spec before C++17.
3953 * tree.cc (fixup_deferred_exception_variants): Clear
3954 TYPE_DEPENDENT_P_VALID.
3955
3956 2022-02-03 Jason Merrill <jason@redhat.com>
3957
3958 PR c++/104302
3959 * decl.cc (maybe_deduce_size_from_array_init): Give up
3960 on type-dependent init.
3961 (cp_complete_array_type): Only call reshape_init for character
3962 array.
3963
3964 2022-02-01 Jason Merrill <jason@redhat.com>
3965
3966 PR c++/103186
3967 * pt.cc (defarg_inst): Use tree_vec_map_cache_hasher.
3968 (defarg_insts_for): New.
3969 (tsubst_default_argument): Adjust.
3970
3971 2022-01-31 Marek Polacek <polacek@redhat.com>
3972
3973 PR c++/102414
3974 PR c++/101874
3975 * decl.cc (create_array_type_for_decl): Use template_placeholder_p.
3976 Sorry on a variable-length array of auto.
3977
3978 2022-01-31 Marek Polacek <polacek@redhat.com>
3979
3980 PR c++/102434
3981 * class.cc (finish_struct): Don't allow union initializer_list.
3982
3983 2022-01-31 Patrick Palka <ppalka@redhat.com>
3984
3985 PR c++/104294
3986 * pt.cc (ctor_deduction_guides_for): Correct computation of
3987 outer_args.
3988
3989 2022-01-31 Patrick Palka <ppalka@redhat.com>
3990
3991 PR c++/104291
3992 * pt.cc (for_each_template_parm_r) <case CONSTRUCTOR>: Clear
3993 walk_subtrees if !include_nondeduced_p. Simplify given that
3994 cp_walk_subtrees already walks TYPE_PTRMEMFUNC_FN_TYPE_RAW.
3995
3996 2022-01-28 Patrick Palka <ppalka@redhat.com>
3997 Jason Merrill <jason@redhat.com>
3998
3999 PR c++/92752
4000 * typeck.cc (build_ptrmemfunc): Cast a nullptr constant to the
4001 unqualified pointer type not the qualified one.
4002
4003 2022-01-28 Patrick Palka <ppalka@redhat.com>
4004
4005 PR c++/103341
4006 * decl.cc (cp_finish_decl): Pass the template arguments of a
4007 variable template specialization or a templated static data
4008 member to do_auto_deduction when the auto is constrained.
4009
4010 2022-01-28 Jason Merrill <jason@redhat.com>
4011
4012 PR c++/100198
4013 PR c++/100030
4014 PR c++/100282
4015 * parser.cc (cp_parser_enumerator_definition): Sorry on parameter
4016 pack in lambda.
4017 (cp_parser_class_head): And in class attributes.
4018 * pt.cc (check_for_bare_parameter_packs): Sorry instead of error
4019 in lambda.
4020
4021 2022-01-27 Jason Merrill <jason@redhat.com>
4022
4023 PR c++/104245
4024 PR c++/51344
4025 * decl2.cc (save_template_attributes): Take late attrs as parm.
4026 (cplus_decl_attributes): Call it after decl_attributes,
4027 splice_template_attributes before.
4028
4029 2022-01-27 Patrick Palka <ppalka@redhat.com>
4030
4031 PR c++/99895
4032 * call.cc (build_over_call): For a non-dependent member call,
4033 build up a CALL_EXPR using a COMPONENT_REF callee, as in
4034 build_new_method_call.
4035 * pt.cc (build_non_dependent_expr): Don't wrap PARM_DECL either.
4036 * tree.cc (build_min_non_dep_op_overload): Adjust accordingly
4037 after the build_over_call change.
4038
4039 2022-01-27 Patrick Palka <ppalka@redhat.com>
4040
4041 PR c++/92944
4042 PR c++/103678
4043 * parser.cc (cp_parser_class_head): Update 'type' with the result
4044 of maybe_process_partial_specialization in the
4045 nested_name_specifier branch. Refactor nearby code to accomodate
4046 that maybe_process_partial_specialization returns a _TYPE, not a
4047 TYPE_DECL, and eliminate local variable 'class_type' in passing.
4048
4049 2022-01-27 Marek Polacek <polacek@redhat.com>
4050
4051 PR c++/101988
4052 * decl.cc (create_array_type_for_decl): Reject forming an array of
4053 placeholder for a deduced class type.
4054
4055 2022-01-26 Jason Merrill <jason@redhat.com>
4056
4057 PR c++/104206
4058 PR c++/101072
4059 * semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
4060
4061 2022-01-26 Jakub Jelinek <jakub@redhat.com>
4062
4063 PR c++/104226
4064 * constexpr.cc (init_subob_ctx): For vector ctors containing
4065 vector elements, ensure appending to the same ctor instead of
4066 creating another one.
4067
4068 2022-01-26 Marek Polacek <polacek@redhat.com>
4069
4070 PR target/104213
4071 * decl.cc (finish_constructor_body): Suppress -Wuse-after-free.
4072 (finish_destructor_body): Likewise.
4073 * optimize.cc (build_delete_destructor_body): Likewise.
4074
4075 2022-01-26 Jason Merrill <jason@redhat.com>
4076
4077 PR c++/104235
4078 * parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.
4079
4080 2022-01-26 Jason Merrill <jason@redhat.com>
4081
4082 PR c++/103057
4083 * pt.cc (tsubst_aggr_type): Call tsubst for alias template
4084 specialization.
4085
4086 2022-01-25 Patrick Palka <ppalka@redhat.com>
4087
4088 PR c++/101532
4089 PR c++/104225
4090 * decl2.cc (mark_used): Don't consider maybe_instantiate_noexcept
4091 on a deleted function.
4092
4093 2022-01-25 Jason Merrill <jason@redhat.com>
4094
4095 PR c++/59950
4096 * call.cc (build_over_call): Use cp_build_indirect_ref.
4097
4098 2022-01-24 Patrick Palka <ppalka@redhat.com>
4099
4100 PR c++/104197
4101 * pt.cc (make_auto_1): Use -1 as a placeholder default argument
4102 for level.
4103
4104 2022-01-24 Patrick Palka <ppalka@redhat.com>
4105
4106 PR c++/104173
4107 * typeck.cc (build_class_member_access_expr): Extend
4108 unary_complex_lvalue result adjustment to preserve all
4109 rvalues, not just xvalues.
4110
4111 2022-01-23 Will Wray <wjwray@gmail.com>
4112
4113 PR c++/55227
4114 * decl.cc (reshape_init_r): Only call has_designator_check when
4115 first_initializer_p or for the inner constructor element.
4116 (cp_complete_array_type): Call reshape_init on braced-init-list.
4117
4118 2022-01-23 Jason Merrill <jason@redhat.com>
4119
4120 PR c++/104182
4121 * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing
4122 has set DECL_INITIAL on a TARGET_EXPR slot.
4123 * tree.cc (is_local_temp): Don't check DECL_CONTEXT.
4124
4125 2022-01-23 Jason Merrill <jason@redhat.com>
4126
4127 PR c++/101072
4128 * cp-tree.h (build_implicit_conv_flags): Declare.
4129 * call.cc (build_implicit_conv_flags): Split out from...
4130 (perform_implicit_conversion_flags): ...here.
4131 * decl.cc (check_initializer): Use it.
4132 * pt.cc (tsubst_copy_and_build): Remove TARGET_EXPR handling.
4133 * semantics.cc (finish_compound_literal): Don't treat
4134 scalar values like CONSTRUCTORs.
4135
4136 2022-01-21 Jason Merrill <jason@redhat.com>
4137
4138 * semantics.cc (find_failing_clause): Return expr if not
4139 decomposable.
4140 (finish_static_assert): Show constant values in failing
4141 comparison.
4142
4143 2022-01-21 Jason Merrill <jason@redhat.com>
4144
4145 PR c++/104084
4146 PR c++/20040
4147 * init.cc (build_new_1): Only pull out TARGET_EXPR_INITIAL if
4148 alloc_expr is a TARGET_EXPR.
4149
4150 2022-01-21 Marek Polacek <polacek@redhat.com>
4151
4152 PR c++/101715
4153 * tree.cc (fixup_deferred_exception_variants): Remove duplicate
4154 variants after parsing the exception specifications.
4155
4156 2022-01-21 Jason Merrill <jason@redhat.com>
4157
4158 PR c++/104139
4159 PR c++/103681
4160 * class.cc (end_of_class): Use base_binfo.
4161
4162 2022-01-20 Jason Merrill <jason@redhat.com>
4163
4164 PR c++/101405
4165 * decl.cc (reshape_init_class): Reject designator for a member of
4166 another class.
4167
4168 2022-01-20 Patrick Palka <ppalka@redhat.com>
4169
4170 PR c++/91911
4171 PR c++/103672
4172 * pt.cc (keep_template_parm): Punt on a level 0 template parm.
4173 (tsubst_decl) <case VAR_DECL>: Remove !CHECKING_P safeguard.
4174 (tsubst) <case TEMPLATE_TYPE_PARM>: Handle CTAD placeholders
4175 specially.
4176 (make_auto_1): Add defaulted 'level' parameter.
4177 (make_template_placeholder): Pass 0 as 'level' to make_auto_1.
4178
4179 2022-01-20 Patrick Palka <ppalka@redhat.com>
4180
4181 * decl.cc (grokdeclarator): Diagnose a CTAD placeholder as
4182 function return type even when !funcdecl_p.
4183
4184 2022-01-20 Martin Liska <mliska@suse.cz>
4185
4186 PR c++/104134
4187 * error.cc (dump_aggr_type): Partially disable the warning.
4188
4189 2022-01-20 Jason Merrill <jason@redhat.com>
4190
4191 PR c++/102300
4192 * parser.cc (cp_parser_template_name): Use dependent_scope_p.
4193
4194 2022-01-19 David Malcolm <dmalcolm@redhat.com>
4195
4196 * cp-lang.cc (selftest::run_cp_tests): Update calls for .c to .cc
4197 renaming.
4198 * cp-tree.h (cp_pt_c_tests): Rename to...
4199 (cp_pt_cc_tests): ...this.
4200 (cp_tree_c_tests): Rename to...
4201 (cp_tree_cc_tests): ...this.
4202 * pt.cc (cp_pt_c_tests): Rename to...
4203 (cp_pt_cc_tests): ...this.
4204 * tree.cc (cp_tree_c_tests): Rename to...
4205 (cp_tree_cc_tests): ...this.
4206
4207 2022-01-19 Jason Merrill <jason@redhat.com>
4208
4209 * parser.cc (saved_token_sentinel::rollback): Use
4210 cp_lexer_previous_token.
4211
4212 2022-01-18 Jakub Jelinek <jakub@redhat.com>
4213
4214 PR c++/104055
4215 * constexpr.cc (cxx_eval_outermost_constant_expr): If t is a
4216 TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
4217 than get_target_expr_sfinae with tf_no_cleanup, and don't set
4218 TREE_CONSTANT.
4219
4220 2022-01-18 Jason Merrill <jason@redhat.com>
4221 Jakub Jelinek <jakub@redhat.com>
4222
4223 PR c++/104025
4224 * parser.cc (saved_token_sentinel::rollback): Call
4225 cp_lexer_set_source_position.
4226 (~saved_token_sentinel): Call rollback.
4227
4228 2022-01-18 Patrick Palka <ppalka@redhat.com>
4229
4230 PR c++/104074
4231 * pt.cc (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
4232 that we return false for DEPENDENT_OPERATOR_TYPE too.
4233
4234 2022-01-17 Martin Liska <mliska@suse.cz>
4235
4236 * Make-lang.in: Rename .c names to .cc.
4237 * config-lang.in: Likewise.
4238 * constexpr.cc (cxx_eval_constant_expression): Likewise.
4239 * coroutines.cc (morph_fn_to_coro): Likewise.
4240 * cp-gimplify.cc (cp_gimplify_expr): Likewise.
4241 * cp-lang.cc (struct lang_hooks): Likewise.
4242 (get_template_argument_pack_elems_folded): Likewise.
4243 * cp-objcp-common.cc (cp_tree_size): Likewise.
4244 (cp_unit_size_without_reusable_padding): Likewise.
4245 (pop_file_scope): Likewise.
4246 (cp_pushdecl): Likewise.
4247 * cp-objcp-common.h (GCC_CP_OBJCP_COMMON): Likewise.
4248 (cxx_simulate_record_decl): Likewise.
4249 * cp-tree.h (struct named_label_entry): Likewise.
4250 (current_function_return_value): Likewise.
4251 (more_aggr_init_expr_args_p): Likewise.
4252 (get_function_version_dispatcher): Likewise.
4253 (common_enclosing_class): Likewise.
4254 (strip_fnptr_conv): Likewise.
4255 (current_decl_namespace): Likewise.
4256 (do_aggregate_paren_init): Likewise.
4257 (cp_check_const_attributes): Likewise.
4258 (qualified_name_lookup_error): Likewise.
4259 (generic_targs_for): Likewise.
4260 (mark_exp_read): Likewise.
4261 (is_global_friend): Likewise.
4262 (maybe_reject_flexarray_init): Likewise.
4263 (module_token_lang): Likewise.
4264 (handle_module_option): Likewise.
4265 (literal_integer_zerop): Likewise.
4266 (build_extra_args): Likewise.
4267 (build_if_nonnull): Likewise.
4268 (maybe_check_overriding_exception_spec): Likewise.
4269 (finish_omp_target_clauses): Likewise.
4270 (maybe_warn_zero_as_null_pointer_constant): Likewise.
4271 (cxx_print_error_function): Likewise.
4272 (decl_in_std_namespace_p): Likewise.
4273 (merge_exception_specifiers): Likewise.
4274 (mangle_module_global_init): Likewise.
4275 (cxx_block_may_fallthru): Likewise.
4276 (fold_builtin_source_location): Likewise.
4277 (enum cp_oracle_request): Likewise.
4278 (subsumes): Likewise.
4279 (cp_finish_injected_record_type): Likewise.
4280 (vtv_build_vtable_verify_fndecl): Likewise.
4281 (cp_tree_c_finish_parsing): Likewise.
4282 * cvt.cc (diagnose_ref_binding): Likewise.
4283 (convert_to_void): Likewise.
4284 (convert_force): Likewise.
4285 (type_promotes_to): Likewise.
4286 * decl.cc (make_unbound_class_template_raw): Likewise.
4287 (cxx_init_decl_processing): Likewise.
4288 (check_class_member_definition_namespace): Likewise.
4289 (cxx_maybe_build_cleanup): Likewise.
4290 * decl2.cc (maybe_emit_vtables): Likewise.
4291 * error.cc (dump_function_name): Likewise.
4292 * init.cc (is_class_type): Likewise.
4293 (build_new_1): Likewise.
4294 * lang-specs.h: Likewise.
4295 * method.cc (make_alias_for_thunk): Likewise.
4296 * module.cc (specialization_add): Likewise.
4297 (module_state::read_cluster): Likewise.
4298 * name-lookup.cc (check_extern_c_conflict): Likewise.
4299 * name-lookup.h (struct cxx_binding): Likewise.
4300 * parser.cc (cp_parser_identifier): Likewise.
4301 * parser.h (struct cp_parser): Likewise.
4302 * pt.cc (has_value_dependent_address): Likewise.
4303 (push_tinst_level_loc): Likewise.
4304 * semantics.cc (finish_omp_clauses): Likewise.
4305 (finish_omp_atomic): Likewise.
4306 * tree.cc (cp_save_expr): Likewise.
4307 (cp_free_lang_data): Likewise.
4308 * typeck.cc (cp_common_type): Likewise.
4309 (strip_array_domain): Likewise.
4310 (rationalize_conditional_expr): Likewise.
4311 (check_return_expr): Likewise.
4312 * vtable-class-hierarchy.cc: Likewise.
4313
4314 2022-01-17 Martin Liska <mliska@suse.cz>
4315
4316 * call.c: Moved to...
4317 * call.cc: ...here.
4318 * class.c: Moved to...
4319 * class.cc: ...here.
4320 * constexpr.c: Moved to...
4321 * constexpr.cc: ...here.
4322 * cp-gimplify.c: Moved to...
4323 * cp-gimplify.cc: ...here.
4324 * cp-lang.c: Moved to...
4325 * cp-lang.cc: ...here.
4326 * cp-objcp-common.c: Moved to...
4327 * cp-objcp-common.cc: ...here.
4328 * cp-ubsan.c: Moved to...
4329 * cp-ubsan.cc: ...here.
4330 * cvt.c: Moved to...
4331 * cvt.cc: ...here.
4332 * cxx-pretty-print.c: Moved to...
4333 * cxx-pretty-print.cc: ...here.
4334 * decl.c: Moved to...
4335 * decl.cc: ...here.
4336 * decl2.c: Moved to...
4337 * decl2.cc: ...here.
4338 * dump.c: Moved to...
4339 * dump.cc: ...here.
4340 * error.c: Moved to...
4341 * error.cc: ...here.
4342 * except.c: Moved to...
4343 * except.cc: ...here.
4344 * expr.c: Moved to...
4345 * expr.cc: ...here.
4346 * friend.c: Moved to...
4347 * friend.cc: ...here.
4348 * g++spec.c: Moved to...
4349 * g++spec.cc: ...here.
4350 * init.c: Moved to...
4351 * init.cc: ...here.
4352 * lambda.c: Moved to...
4353 * lambda.cc: ...here.
4354 * lex.c: Moved to...
4355 * lex.cc: ...here.
4356 * mangle.c: Moved to...
4357 * mangle.cc: ...here.
4358 * method.c: Moved to...
4359 * method.cc: ...here.
4360 * name-lookup.c: Moved to...
4361 * name-lookup.cc: ...here.
4362 * optimize.c: Moved to...
4363 * optimize.cc: ...here.
4364 * parser.c: Moved to...
4365 * parser.cc: ...here.
4366 * pt.c: Moved to...
4367 * pt.cc: ...here.
4368 * ptree.c: Moved to...
4369 * ptree.cc: ...here.
4370 * rtti.c: Moved to...
4371 * rtti.cc: ...here.
4372 * search.c: Moved to...
4373 * search.cc: ...here.
4374 * semantics.c: Moved to...
4375 * semantics.cc: ...here.
4376 * tree.c: Moved to...
4377 * tree.cc: ...here.
4378 * typeck.c: Moved to...
4379 * typeck.cc: ...here.
4380 * typeck2.c: Moved to...
4381 * typeck2.cc: ...here.
4382 * vtable-class-hierarchy.c: Moved to...
4383 * vtable-class-hierarchy.cc: ...here.
4384
4385 2022-01-17 Jakub Jelinek <jakub@redhat.com>
4386
4387 PR c++/104031
4388 * cp-gimplify.c (cp_genericize_target_expr): Set DECL_CONTEXT of
4389 TARGET_EXPR_SLOT to current_function_decl if it was NULL.
4390
4391 2022-01-17 Andrew Stubbs <ams@codesourcery.com>
4392
4393 * parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.
4394
4395 2022-01-14 Chung-Lin Tang <cltang@codesourcery.com>
4396
4397 PR c++/103705
4398 * semantics.c (finish_omp_clauses): Also continue peeling off of
4399 outer node for ARRAY_REFs.
4400
4401 2022-01-14 Jakub Jelinek <jakub@redhat.com>
4402
4403 PR c++/103991
4404 * cp-objcp-common.c (cxx_block_may_fallthru) <case IF_STMT>: For
4405 IF_STMT_CONSTEXPR_P with constant false or true condition only
4406 check if the taken clause may fall through.
4407 * cp-gimplify.c (genericize_if_stmt): For consteval if, revert
4408 to r12-5638^ behavior if then_ block can't fall through. For
4409 constexpr if, revert to r12-5638^ behavior.
4410
4411 2022-01-13 Anthony Sharp <anthonysharp15@gmail.com>
4412 Jason Merrill <jason@redhat.com>
4413
4414 PR c++/70417
4415 * parser.c (cp_parser_id_expression): Handle
4416 -Wmissing-template-keyword.
4417 (struct saved_token_sentinel): Add modes to control what happens
4418 on destruction.
4419 (cp_parser_statement): Adjust.
4420 (cp_parser_skip_entire_template_parameter_list): New function that
4421 skips an entire template parameter list.
4422 (cp_parser_require_end_of_template_parameter_list): Rename old
4423 cp_parser_skip_to_end_of_template_parameter_list.
4424 (cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
4425 called from one of the above two functions.
4426 (cp_parser_lambda_declarator_opt)
4427 (cp_parser_explicit_template_declaration)
4428 (cp_parser_enclosed_template_argument_list): Adjust.
4429
4430 2022-01-12 Jakub Jelinek <jakub@redhat.com>
4431 Jason Merrill <jason@redhat.com>
4432
4433 PR c++/103480
4434 * tree.c (move): If expr is xvalue_p, just return expr without
4435 build_static_cast.
4436
4437 2022-01-11 Jakub Jelinek <jakub@redhat.com>
4438
4439 PR c++/101597
4440 * class.c (build_vfn_ref): Build OBJ_TYPE_REF with INTEGER_CST
4441 OBJ_TYPE_REF_TOKEN with type equal to OBJ_TYPE_REF_OBJECT type.
4442 * error.c (resolve_virtual_fun_from_obj_type_ref): Use type of
4443 OBJ_TYPE_REF_TOKEN rather than type of OBJ_TYPE_REF_OBJECT as
4444 obj_type.
4445
4446 2022-01-11 Patrick Palka <ppalka@redhat.com>
4447
4448 PR c++/103831
4449 * call.c (build_new_method_call): Consider dependent bases only
4450 if 'this' is available.
4451
4452 2022-01-11 Olivier Hainque <hainque@adacore.com>
4453
4454 * decl.c (cxx_init_decl_processing): Move code possibly
4455 altering flag_weak before code testing it.
4456
4457 2022-01-10 Patrick Palka <ppalka@redhat.com>
4458
4459 PR c++/103879
4460 * constexpr.c (cxx_fold_indirect_ref): Split out object/offset
4461 canonicalization step into a local lambda. Strengthen it to
4462 absorb more components at position 0. Use it before both calls
4463 to cxx_fold_indirect_ref_1.
4464
4465 2022-01-10 Patrick Palka <ppalka@redhat.com>
4466
4467 PR c++/103783
4468 * call.c (cand_parms_match): Skip over 'this' when given one
4469 static and one non-static member function.
4470
4471 2022-01-10 Jakub Jelinek <jakub@redhat.com>
4472
4473 PR c++/103912
4474 * semantics.c (expand_or_defer_fn): For immediate functions, set
4475 node->body_removed to true and clear analyzed, definition and
4476 force_output.
4477 * decl2.c (c_parse_final_cleanups): Ignore immediate functions for
4478 expand_or_defer_fn.
4479
4480 2022-01-08 Jakub Jelinek <jakub@redhat.com>
4481
4482 PR c++/89074
4483 * constexpr.c (cxx_maybe_fold_addr_pointer_plus): New function.
4484 (cxx_eval_binary_expression): Use it.
4485
4486 2022-01-08 Jason Merrill <jason@redhat.com>
4487
4488 PR c++/103946
4489 * init.c (build_vec_init): Remove assert.
4490 * tree.c (build_vec_init_expr): Likewise.
4491
4492 2022-01-08 Jason Merrill <jason@redhat.com>
4493
4494 PR c++/100588
4495 * call.c (build_op_delete_call): Ignore destroying delete
4496 if alloc_fn.
4497
4498 2022-01-07 Jason Merrill <jason@redhat.com>
4499
4500 PR c++/20040
4501 * init.c (build_new_1): Also build pointer cleanup if
4502 TYPE_GETS_DELETE.
4503 * cp-tree.h (TYPE_GETS_VEC_DELETE): New.
4504
4505 2022-01-07 Jason Merrill <jason@redhat.com>
4506
4507 PR c++/103936
4508 PR c++/65591
4509 * cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling.
4510
4511 2022-01-07 Jason Merrill <jason@redhat.com>
4512
4513 PR c++/103711
4514 * init.c (perform_target_ctor): Select destructor by in_chrg.
4515
4516 2022-01-07 Jason Merrill <jason@redhat.com>
4517
4518 PR c++/61611
4519 * except.c (in_nested_catch): New.
4520 (expand_end_catch_block): Check it.
4521
4522 2022-01-07 Jason Merrill <jason@redhat.com>
4523
4524 PR c++/33799
4525 PR c++/102191
4526 * except.c (maybe_splice_retval_cleanup): Check
4527 current_binding_level.
4528 * semantics.c (do_poplevel): Call it here.
4529 * parser.c (cp_parser_compound_statement): Not here.
4530
4531 2022-01-07 Jason Merrill <jason@redhat.com>
4532
4533 PR c++/53868
4534 * decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
4535 cleanups from set_up_extended_ref_temp.
4536 (wrap_temporary_cleanups): Ignore array cleanups.
4537 (initialize_local_var): Don't check for array here.
4538 * cp-tree.h (BIND_EXPR_VEC_DTOR): New.
4539 * init.c (build_vec_delete_1): Set it.
4540
4541 2022-01-07 Jason Merrill <jason@redhat.com>
4542
4543 PR c++/66451
4544 * init.c (build_vec_delete_1): Handle throwing dtor.
4545 (build_vec_init): Tell it we're in a cleanup already.
4546
4547 2022-01-07 Jason Merrill <jason@redhat.com>
4548
4549 * typeck2.c (split_nonconstant_init_1): Don't cleanup the last elt.
4550 (split_nonconstant_init): Adjust.
4551
4552 2022-01-07 Jason Merrill <jason@redhat.com>
4553
4554 PR c++/66139
4555 PR c++/52320
4556 * constexpr.c (replace_decl): Rename from replace_result_decl.
4557 * cp-tree.h (replace_decl): Declare it.
4558 * cp-gimplify.c (cp_gimplify_init_expr): Call it.
4559 (cp_gimplify_expr): Don't handle VEC_INIT_EXPR.
4560 (cp_genericize_init, cp_genericize_init_expr)
4561 (cp_genericize_target_expr): New.
4562 (cp_fold_r): Call them.
4563 * tree.c (build_array_copy): Add a TARGET_EXPR.
4564 * typeck2.c (digest_init_r): Look through a TARGET_EXPR.
4565
4566 2022-01-07 Jason Merrill <jason@redhat.com>
4567
4568 PR c++/94041
4569 * decl.c (initialize_local_var): Fix comment.
4570 * init.c (build_new_1): Do stabilize array init.
4571 (build_vec_init): Use TARGET_EXPR for cleanup. Initialization
4572 of an element from an explicit initializer is not a
4573 full-expression.
4574 * tree.c (expand_vec_init_expr): Pass flags through.
4575 * typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
4576 (split_nonconstant_init): Handle array cleanups.
4577 * cp-tree.h: Adjust.
4578
4579 2022-01-07 Jason Merrill <jason@redhat.com>
4580
4581 PR c++/94041
4582 * decl.c (check_initializer): Remove obsolete comment.
4583 (wrap_cleanups_r): Don't wrap CLEANUP_EH_ONLY.
4584 (initialize_local_var): Change assert to test.
4585 * typeck2.c (maybe_push_temp_cleanup): New.
4586 (split_nonconstant_init_1): Use it.
4587 (split_nonconstant_init): Clear cleanup flags.
4588
4589 2022-01-07 Jason Merrill <jason@redhat.com>
4590
4591 PR c++/92385
4592 * typeck2.c (PICFLAG_VEC_INIT): New.
4593 (process_init_constructor_array): Set it.
4594 (process_init_constructor): Handle it.
4595 (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
4596 * init.c (build_vec_init): Likewise.
4597 * cp-gimplify.c (cp_gimplify_expr): Factor out...
4598 * tree.c (expand_vec_init_expr): ...this function.
4599 (build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P.
4600 (build_vec_init_expr): Likewise.
4601 * constexpr.c (cxx_eval_vec_init): Likewise.
4602 (reduced_constant_expression_p): Check arrays before C++20.
4603 * cp-tree.h (expand_vec_init_expr): Declare.
4604
4605 2022-01-07 Jason Merrill <jason@redhat.com>
4606
4607 * init.c (build_new_1): Remove preevaluation code.
4608
4609 2022-01-05 Nathan Sidwell <nathan@acm.org>
4610
4611 * pt.c (instantiate_class_template_1): Process attribute((used)) set
4612 in class's context.
4613
4614 2022-01-05 Nathan Sidwell <nathan@acm.org>
4615
4616 * init.c (build_new_1): Check complain before alignment warning.
4617
4618 2022-01-04 Jason Merrill <jason@redhat.com>
4619
4620 * cp-tree.h (class releasing_vec): Add begin/end fns.
4621
4622 2022-01-04 Jason Merrill <jason@redhat.com>
4623
4624 * init.c: Include -*- C++ -*- on first line.
4625
4626 2022-01-03 Marek Polacek <polacek@redhat.com>
4627
4628 PR c++/103758
4629 * parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
4630 with %qD.
4631
4632 2022-01-03 Marek Polacek <polacek@redhat.com>
4633
4634 * parser.c (make_char_string_pack): Add a cast to const unsigned
4635 char *.
4636
4637 2022-01-03 Jakub Jelinek <jakub@redhat.com>
4638
4639 PR c++/103600
4640 * rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
4641 to DECL_TINFO_P VAR_DECLs.
4642
4643 2022-01-02 Jason Merrill <jason@redhat.com>
4644
4645 * init.c (build_vec_init): Append the decrement to elt_init.
4646
4647 2022-01-02 Jason Merrill <jason@redhat.com>
4648
4649 * decl.c (wrap_cleanups_r): Don't wrap if noexcept.
4650
4651 \f
4652 Copyright (C) 2022 Free Software Foundation, Inc.
4653
4654 Copying and distribution of this file, with or without modification,
4655 are permitted in any medium without royalty provided the copyright
4656 notice and this notice are preserved.