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