]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/cp/ChangeLog
Daily bump.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
1 2022-07-01 Lewis Hyatt <lhyatt@gmail.com>
2
3 * parser.cc (cp_token_is_module_directive): New function
4 refactoring common code.
5 (cp_parser_skip_to_closing_parenthesis_1): Use the new function.
6 (cp_parser_skip_to_end_of_statement): Likewise.
7 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
8 (cp_parser_declaration): Likewise.
9
10 2022-07-01 Marek Polacek <polacek@redhat.com>
11
12 PR c++/105550
13 * constexpr.cc (cxx_eval_conditional_expression): Strip TARGET_EXPRs.
14
15 2022-07-01 Tobias Burnus <tobias@codesourcery.com>
16
17 * parser.cc (cp_parser_omp_target_enter_data,
18 cp_parser_omp_target_exit_data): Accept tofrom
19 map-type modifier but use 'to' / 'from' internally.
20
21 2022-07-01 Marek Polacek <polacek@redhat.com>
22
23 PR c++/106111
24 * parser.cc (cp_lexer_get_preprocessor_token): Also warn about
25 RID_ALIGNOF, RID_ALIGNAS, RID_THREAD.
26
27 2022-07-01 Jason Merrill <jason@redhat.com>
28
29 PR c++/105779
30 * call.cc (resolve_args): Use complain.
31
32 2022-07-01 Jason Merrill <jason@redhat.com>
33
34 * parser.cc (missing_template_diag): Split out...
35 (cp_parser_id_expression): ...from here.
36
37 2022-07-01 Jason Merrill <jason@redhat.com>
38
39 PR c++/106024
40 * parser.cc (missing_template_diag): Factor out...
41 (cp_parser_id_expression): ...from here.
42 (cp_parser_lookup_name): Don't look in dependent object_type.
43
44 2022-06-30 Nathan Sidwell <nathan@acm.org>
45
46 * module.cc (module_state::write_define): Drop located param.
47 (module_state::read_define): Likewise.
48 (module_state::prepare_macros): New, broken out of ...
49 (module_state::write_macros): ... here. Adjust.
50 (module_state::write_begin): Adjust.
51
52 2022-06-29 Nathan Sidwell <nathan@acm.org>
53
54 * module.cc (macro_info, macro_traits, macro_table,
55 macro_remap): Rename to ...
56 (macro_loc_info, macro_loc_traits, macro_loc_table,
57 macro_loc_remap): ... these. Update all uses.
58 (module_state::write_prepare_maps): Remove unneeded macro checking.
59 (module_state::write_begin): Free macro_loc_remap.
60
61 2022-06-27 Sergei Trofimovich <siarheit@google.com>
62
63 PR c++/106102
64 * mapper-client.cc: Include <memory> via "system.h".
65 * mapper-resolver.cc: Ditto.
66 * module.cc: Ditto.
67
68 2022-06-27 David Malcolm <dmalcolm@redhat.com>
69
70 * cxx-pretty-print.h: Add "final" and "override" to various vfunc
71 implementations, removing redundant "virtual" as appropriate.
72 * module.cc: Likewise.
73
74 2022-06-24 Jason Merrill <jason@redhat.com>
75
76 PR c++/87729
77 PR c++/20423
78 * class.cc (warn_hidden): Handle -Woverloaded-virtual=1.
79
80 2022-06-24 Alexandre Oliva <oliva@adacore.com>
81
82 * g++spec.cc (lang_specific_driver): Implement -nostdlib++.
83
84 2022-06-23 Jason Merrill <jason@redhat.com>
85
86 PR c++/105925
87 * call.cc (build_aggr_conv): Don't depend on
88 CONSTRUCTOR_IS_DESIGNATED_INIT.
89
90 2022-06-23 Jason Merrill <jason@redhat.com>
91
92 PR c++/105925
93 * decl.cc (reshape_init_array_1): Set
94 CONSTRUCTOR_IS_DESIGNATED_INIT here.
95 (reshape_init_class): And here.
96 (reshape_init): Not here.
97
98 2022-06-23 Patrick Palka <ppalka@redhat.com>
99
100 PR c++/105931
101 * expr.cc (fold_for_warn): Don't fold when in an unevaluated
102 context.
103
104 2022-06-23 Patrick Palka <ppalka@redhat.com>
105
106 PR c++/105982
107 * pt.cc (lookup_template_class): After calling complete_type for
108 the substituted context, check the table again iff the type was
109 previously incomplete and complete_type made it complete.
110
111 2022-06-23 Jason Merrill <jason@redhat.com>
112
113 PR c++/94554
114 * pt.cc (dependent_operand_p): Split out from...
115 (tsubst_copy_and_build): ...here.
116 (tsubst_expr) [IF_STMT]: Use it.
117 * semantics.cc (finish_if_stmt_cond): Keep the pre-conversion
118 condition in the template tree.
119
120 2022-06-23 Jason Merrill <jason@redhat.com>
121
122 PR c++/105885
123 * pt.cc (tsubst_copy_and_build): Also suppress -Waddress for
124 comparison of dependent operands.
125
126 2022-06-23 Nathan Sidwell <nathan@acm.org>
127
128 * module.cc (struct macro_info): New.
129 (struct macro_traits): New.
130 (macro_remap, macro_table): New globals.
131 (depset::hash::find_dependencies): Note namespace location.
132 (module_for_macro_loc): Adjust.
133 (module_state::note_location): New.
134 (module_state::Write_location): Note location when not
135 streaming. Adjust macro location streaming.
136 (module_state::read_location): Adjust macro location
137 streaming.
138 (module_state::write_init_maps): New.
139 (module_state::write_prepare_maps): Reimplement macro map
140 preparation.
141 (module_state::write_macro_maps): Reimplement.
142 (module_state::read_macro_maps): Likewise.
143 (module_state::write_begin): Adjust.
144
145 2022-06-23 Jason Merrill <jason@redhat.com>
146
147 * pt.cc (type_unification_real): An auto tparm can't
148 be affected by other deductions.
149
150 2022-06-23 Jason Merrill <jason@redhat.com>
151
152 PR c++/105964
153 * pt.cc (type_dependent_expression_p): Look through BASELINK.
154
155 2022-06-22 Jason Merrill <jason@redhat.com>
156
157 PR c++/105908
158 * name-lookup.cc (outer_binding): Strip BASELINK.
159
160 2022-06-22 Nathan Sidwell <nathan@acm.org>
161
162 * module.cc (struct duplicate_hash): Remove.
163 (duplicate_hash_map): Adjust.
164
165 2022-06-22 Jason Merrill <jason@redhat.com>
166
167 PR c++/104642
168 * constexpr.cc (cxx_eval_builtin_function_call): Handle
169 unreachable/trap earlier.
170 * cp-gimplify.cc (cp_maybe_instrument_return): Use
171 build_builtin_unreachable.
172
173 2022-06-18 Jakub Jelinek <jakub@redhat.com>
174
175 * cp-ubsan.cc (cp_ubsan_instrument_vptr_p): Use
176 flag_sanitize_trap & SANITIZE_VPTR instead of
177 flag_sanitize_undefined_trap_on_error.
178
179 2022-06-17 Jakub Jelinek <jakub@redhat.com>
180
181 PR c++/106001
182 * typeck.cc (build_x_shufflevector): Use fold_non_dependent_expr
183 instead of maybe_constant_value.
184
185 2022-06-16 Nathan Sidwell <nathan@acm.org>
186
187 * decl2.cc (finish_objects): Add startp parameter, adjust.
188 (generate_ctor_or_dtor_function): Detect empty fn, and don't
189 generate unnecessary code. Remove objc startup here ...
190 (c_parse_final_cleanyps): ... do it here.
191
192 2022-06-16 Martin Liska <mliska@suse.cz>
193
194 * decl2.cc (struct priority_map_traits): Remove unused param.
195
196 2022-06-15 Nathan Sidwell <nathan@acm.org>
197
198 * module.cc (module_state::write_readme): Use less confusing
199 importable unit names.
200
201 2022-06-14 Nathan Sidwell <nathan@acm.org>
202
203 * cp-tree.h (fini_modules): Add has_inits parm.
204 * decl2.cc (c_parse_final_cleanups): Check for
205 inits, adjust fini_modules flags.
206 * module.cc (module_state): Rename call_init_p to
207 active_init_p.
208 (module_state::write_config): Write active_init.
209 (module_state::read_config): Read it.
210 (module_determine_import_inits): Clear active_init_p
211 of covered inits.
212 (late_finish_module): Add has_init parm. Record it.
213 (fini_modules): Adjust.
214
215 2022-06-13 Nathan Sidwell <nathan@acm.org>
216
217 * module.cc (module_state::write): Separate to ...
218 (module_state::write_begin, module_state::write_end): ...
219 these.
220 (module_state::write_readme): Drop extensions parameter.
221 (struct module_processing_cookie): Add more fields.
222 (finish_module_processing): Adjust state writing call.
223 (late_finish_module): Call write_end.
224
225 2022-06-10 Patrick Palka <ppalka@redhat.com>
226
227 PR c++/65328
228 * decl.cc (typename_hasher::hash): Add extra overloads.
229 Use iterative_hash_object instead of htab_hash_pointer.
230 Hash TYPENAME_TYPE_FULLNAME instead of TYPE_IDENTIFIER.
231 (build_typename_type): Use typename_hasher::hash.
232 * pt.cc (spec_hasher::hash): Add two-parameter overload.
233 Set comparing_specializations around the call to
234 hash_tmpl_and_args.
235 (iterative_hash_template_arg) <case TYPENAME_TYPE>:
236 When comparing_specializations, hash the TYPE_CONTEXT
237 and TYPENAME_TYPE_FULLNAME.
238 (tsubst_function_decl): Use spec_hasher::hash instead of
239 hash_tmpl_and_args.
240 (tsubst_template_decl): Likewise.
241 (tsubst_decl): Likewise.
242
243 2022-06-10 Patrick Palka <ppalka@redhat.com>
244
245 * pt.cc (instantiate_template): Don't substitute the context
246 of the most general template if that of the partially
247 instantiated template is already non-dependent.
248
249 2022-06-10 Patrick Palka <ppalka@redhat.com>
250
251 * pt.cc (lookup_template_class): Remove dead stores to
252 context parameter. Don't substitute the context of the
253 most general template if that of the partially instantiated
254 template is already non-dependent. Check the specializations
255 table again after completing the context of a nested dependent
256 specialization.
257 (tsubst_aggr_type) <case RECORD_TYPE>: Don't substitute
258 TYPE_CONTEXT or pass it to lookup_template_class.
259 (tsubst_decl) <case TYPE_DECL, case TYPE_DECL>: Avoid substituting
260 the TREE_TYPE for DECL_SELF_REFERENCE_P. Avoid template argument
261 substitution or coercion in some cases.
262
263 2022-06-10 Nathan Sidwell <nathan@acm.org>
264
265 * cp-tree.h (fini_modules): Add some parameters.
266 (finish_module_processing): Return an opaque pointer.
267 * decl2.cc (c_parse_final_cleanups): Propagate a cookie from
268 finish_module_processing to fini_modules.
269 * module.cc (struct module_processing_cookie): New.
270 (finish_module_processing): Return a heap-allocated cookie.
271 (late_finish_module): New. Finish out the module writing.
272 (fini_modules): Adjust.
273
274 2022-06-10 Nathan Sidwell <nathan@acm.org>
275
276 * cp-tree.h (module_has_import_init): Rename to ...
277 (module_determined_import_inits): ... here.
278 * decl2.cc (start_objects): Do not handle module initializers
279 here.
280 (c_parse_final_cleanups): Generate a separate module
281 initializer calling function and add it to the list. Shrink
282 the c-lang region.
283 * module.cc (num_init_calls_needed): Delete.
284 (module_has_import_init): Rename to ...
285 (module_determined_import_inits): ... here. Do the
286 calculation here ...
287 (finish_module_processing): ... rather than here.
288 (module_add_import_initializers): Reformat.
289
290 2022-06-09 Jakub Jelinek <jakub@redhat.com>
291
292 PR c++/105871
293 * constexpr.cc (cxx_eval_bit_field_ref): For BIT_FIELD_REF with
294 non-integral result type use fold_ternary too like for BIT_FIELD_REFs
295 from VECTOR_CST. If fold_ternary returns NULL, diagnose non-constant
296 expression, set *non_constant_p and return t, instead of returning
297 NULL.
298
299 2022-06-09 Nathan Sidwell <nathan@acm.org>
300
301 * cp-tree.h (module_initializer_kind): Replace with ...
302 (module_global_init_needed, module_has_import_inits): ...
303 these.
304 * decl2.cc (start_objects): Add has_body parm. Reorganize
305 module initializer creation.
306 (generate_ctor_or_dtor_function): Adjust.
307 (c_parse_final_cleanups): Adjust.
308 (vtv_start_verification_constructor_init_function): Adjust.
309 * module.cc (module_initializer_kind): Replace with ...
310 (module_global_init_needed, module_has_import_inits): ...
311 these.
312
313 2022-06-08 Jason Merrill <jason@redhat.com>
314
315 PR c++/105852
316 * decl.cc (duplicate_decls): Change non-templated friend
317 check to an assert.
318 * pt.cc (tsubst_function_decl): Don't set DECL_TEMPLATE_INFO
319 on non-templated friends.
320 (tsubst_friend_function): Adjust.
321
322 2022-06-08 Jason Merrill <jason@redhat.com>
323
324 PR c++/105852
325 PR c++/105761
326 * decl.cc (duplicate_decls): Avoid copying template info
327 from non-templated friend even if newdecl isn't a definition.
328 Correct handling of DECL_UNIQUE_FRIEND_P on templates.
329 * pt.cc (non_templated_friend_p): New.
330 * cp-tree.h (non_templated_friend_p): Declare it.
331
332 2022-06-08 Nathan Sidwell <nathan@acm.org>
333
334 * decl2.cc (struct priority_info_s, priority_info): Delete.
335 (priority_map_traits, priority_map_t): New.
336 (static_init_fini_fns): New.
337 (INITIALIZE_P_IDENTIFIER, PRIORITY_IDENTIFIER): Delete.
338 (initialize_p_decl, priority_decl): Delete.
339 (ssdf_decls, priority_info_map): Delete.
340 (start_static_storage_duration_function): Rename to ...
341 (start_partial_init_fini_fn): ... here. Create a void arg fn.
342 Add it to the slot in the appropriate static_init_fini_fns
343 hash table.
344 (finish_static_storage_duration_function): Rename to ...
345 (finish_partial_init_fini_fn): ... here.
346 (get_priority_info): Delete.
347 (one_static_initialization_or_destruction): Assert not
348 trivial dtor.
349 (do_static_initialization_or_destruction): Rename to ...
350 (emit_partial_init_fini_fn) ... here. Start & finish the fn.
351 Simply init/fini each var.
352 (partition_vars_for_init_fini): Partition vars according to
353 priority and add to init and/or fini list.
354 (generate_ctor_or_dtor_function): Start and finish the function.
355 Do santitizer calls here.
356 (generate_ctor_and_dtor_functions_for_priority): Delete.
357 (c_parse_final_cleanups): Reimplement global init/fini
358 processing.
359
360 2022-06-07 Jakub Jelinek <jakub@redhat.com>
361
362 * parser.cc (cp_parser_omp_clause_linear): Parse OpenMP 5.2
363 style linear clause modifiers. Set
364 OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER flag on the clauses when
365 old style modifiers are used.
366 * semantics.cc (finish_omp_clauses): Only reject linear clause
367 with val modifier on simd or for if the old style modifiers are
368 used.
369
370 2022-06-07 Roger Sayle <roger@nextmovesoftware.com>
371
372 PR c++/96442
373 * decl.cc (start_enum): When emitting a "must be integral" error,
374 set ENUM_UNDERLYING_TYPE to integer_type_node, to avoid an ICE
375 downstream in build_enumeration.
376
377 2022-06-06 Patrick Palka <ppalka@redhat.com>
378
379 PR c++/53164
380 PR c++/105848
381 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Look through an
382 ADDR_EXPR callee when calling mark_used.
383
384 2022-06-04 Marek Polacek <polacek@redhat.com>
385
386 PR c++/102399
387 PR c++/69585
388 * parser.cc (cp_parser_attributes_opt): Accept GNU attributes
389 followed by [[]] attributes and vice versa.
390
391 2022-06-03 Patrick Palka <ppalka@redhat.com>
392
393 PR c++/105756
394 * typeck.cc (cp_build_binary_op): Don't fold operands
395 when c_inhibit_evaluation_warnings.
396
397 2022-06-03 Jason Merrill <jason@redhat.com>
398
399 PR c++/105761
400 * decl.cc (duplicate_decls): Don't copy DECL_TEMPLATE_INFO
401 from a hidden friend.
402
403 2022-06-03 Patrick Palka <ppalka@redhat.com>
404
405 PR c++/105637
406 * tree.cc (maybe_dummy_object): When returning a dummy
407 object, respect the cv-quals of 'this' if available.
408
409 2022-06-03 Patrick Palka <ppalka@redhat.com>
410
411 PR c++/100374
412 * pt.cc (determine_specialization): Compare overall constraints
413 not just the trailing constraints.
414 (tsubst_each_template_parm_constraints): Define.
415 (tsubst_friend_function): Use it.
416 (tsubst_friend_class): Use it.
417 (tsubst_template_parm): Don't substitute TEMPLATE_PARM_CONSTRAINTS.
418
419 2022-06-03 Patrick Palka <ppalka@redhat.com>
420
421 PR c++/105797
422 * pt.cc (for_each_template_parm_r) <case FUNCTION_DECL, VAR_DECL>:
423 Don't walk DECL_CONTEXT.
424 <case PARM_DECL>: Likewise. Walk TREE_TYPE.
425 <case CONST_DECL>: Simplify.
426 (any_template_parm_r) <case PARM_DECL>: Don't walk TREE_TYPE.
427
428 2022-06-02 Marek Polacek <polacek@redhat.com>
429
430 * constexpr.cc (potential_constant_expression_1): Treat
431 {,VEC_}NEW_EXPR and {,VEC_}DELETE_EXPRas potentially constant in C++20.
432
433 2022-06-02 Marek Polacek <polacek@redhat.com>
434
435 PR c++/105803
436 * pt.cc (value_dependent_expression_p): Handle {,VEC_}NEW_EXPR
437 in the switch.
438
439 2022-06-02 David Malcolm <dmalcolm@redhat.com>
440
441 * cp-lang.cc (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
442 (cp_get_sarif_source_language): New.
443
444 2022-06-02 Jason Merrill <jason@redhat.com>
445
446 PR c++/105795
447 * constexpr.cc (init_subob_ctx): Clear ctx->ctor for empty subob.
448 (cxx_eval_store_expression): Likewise.
449 (cxx_eval_bare_aggregate): Handle null ctx->ctor.
450
451 2022-06-02 Jason Merrill <jason@redhat.com>
452
453 PR c++/105795
454 * constexpr.cc (cxx_eval_bare_aggregate): Always call
455 init_subob_ctx.
456
457 2022-06-01 Jason Merrill <jason@redhat.com>
458
459 PR c++/105734
460 * parser.cc (cp_parser_postfix_dot_deref_expression): Use typeof
461 if the expression has auto type.
462
463 2022-06-01 Jason Merrill <jason@redhat.com>
464
465 PR c++/105779
466 * call.cc (resolve_args): Call mark_single_function here.
467 * pt.cc (unify_one_argument): Not here.
468
469 2022-06-01 Nathan Sidwell <nathan@acm.org>
470
471 * decl2.cc (fix_temporary_vars_context_r): Use data argument
472 for new context.
473 (one_static_initialization_or_destruction): Adjust tree walk
474 call. Refactor guard generation.
475
476 2022-06-01 Nathan Sidwell <nathan@acm.org>
477
478 * decl2.cc (ssdf_decl): Delete global.
479 (start_static_storage_duration_function): Use some RAII.
480 (do_static_initialization_or_destruction): Likewise.
481 (c_parse_final_cleanups): Likewise. Avoid rechecking 'vars'.
482
483 2022-06-01 Nathan Sidwell <nathan@acm.org>
484
485 * decl2.cc (start_objects): Replace 'method_type' parameter
486 with 'initp' boolean, rename and retype 'priority' parameter.
487 (finish_objects): Likewise. Do not expand here.
488 (one_static_initialization_or_destruction): Move 'initp'
489 parameter first.
490 (do_static_initialization_or_destruction): Likewise.
491 (generate_ctor_or_dtor_function): Rename 'initp' parameter.
492 Adjust start_objects/finish_obects calls and expand here.
493 (generate_ctor_and_dtor_functions_for_priority): Adjust calls.
494 (c_parse_final_cleanups): Likewise.
495 (vtv_start_verification_constructor_init): Adjust.
496 (vtv_finish_verification_constructor_init): Use finish_objects.
497
498 2022-05-31 Patrick Palka <ppalka@redhat.com>
499
500 PR c++/105758
501 * call.cc (build_over_call): Use z_candidate::conversion_path
502 and ::access_path instead of TYPE_BINFO when building the
503 BASELINK for the templated form.
504
505 2022-05-31 Patrick Palka <ppalka@redhat.com>
506
507 * parser.cc: Use auto_timevar instead of timevar_push/pop.
508 Remove wrapper functions.
509 * pt.cc: Likewise.
510
511 2022-05-31 Patrick Palka <ppalka@redhat.com>
512
513 * cp-tree.h (cp_build_qualified_type_real): Rename to ...
514 (cp_build_qualified_type): ... this. Give its last parameter
515 a default argument. Remove macro of the same name.
516 * decl.cc (grokdeclarator): Adjust accordingly.
517 * pt.cc (tsubst_aggr_type): Likewise.
518 (rebuild_function_or_method_type): Likewise.
519 (tsubst): Likewise.
520 (maybe_dependent_member_ref): Likewise.
521 (unify): Likewise.
522 * tree.cc (cp_build_qualified_type_real): Rename to ...
523 (cp_build_qualified_type): ... this. Adjust accordingly.
524
525 2022-05-31 Jason Merrill <jason@redhat.com>
526
527 * Make-lang.in (c++.tags): Just look at *.cc.
528
529 2022-05-31 Patrick Palka <ppalka@redhat.com>
530
531 * cp-tree.h (comp_template_args): Change return type to bool.
532 * pt.cc (comp_template_args): Document default arguments.
533 Change return type to bool and adjust returns accordingly.
534
535 2022-05-31 Patrick Palka <ppalka@redhat.com>
536
537 * decl.cc (grokvardecl): Use current_template_constraints.
538 (grokdeclarator): Likewise.
539 (xref_tag): Likewise.
540 * semantics.cc (finish_template_template_parm): Likewise.
541
542 2022-05-31 Jakub Jelinek <jakub@redhat.com>
543
544 * parser.cc (OMP_SCOPE_CLAUSE_MASK): Add firstprivate and allocate
545 clauses.
546
547 2022-05-30 Marek Polacek <polacek@redhat.com>
548
549 PR c++/99080
550 * pt.cc (type_dependent_expression_p): Assert !TYPE_P.
551 * semantics.cc (finish_id_expression_1): Handle UNBOUND_CLASS_TEMPLATE
552 specifically.
553
554 2022-05-28 Jakub Jelinek <jakub@redhat.com>
555
556 * parser.cc (handle_omp_declare_target_clause): If OMP_CLAUSE_LINK was
557 seen first, use "%<to%>" or "%<enter%>" depending on
558 OMP_CLAUSE_ENTER_TO of the current clause, otherwise use
559 "%<to%> or %<enter%>" wording.
560
561 2022-05-28 Jason Merrill <jason@redhat.com>
562
563 PR c++/105652
564 * pt.cc (tsubst_lambda_expr): Don't let a namespace-scope lambda
565 instantiate into a class-scope lambda.
566
567 2022-05-27 Marek Polacek <polacek@redhat.com>
568
569 PR c++/105725
570 * parser.cc (class_decl_loc_t::add): Check CLASS_TYPE_P.
571
572 2022-05-27 Jakub Jelinek <jakub@redhat.com>
573
574 * parser.cc (cp_parser_omp_clause_name): Parse enter clause.
575 (cp_parser_omp_all_clauses): For to clause on declare target, use
576 OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of
577 OMP_CLAUSE_TO_DECLARE clause. Handle PRAGMA_OMP_CLAUSE_ENTER.
578 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause.
579 (cp_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of
580 OMP_CLAUSE_TO_DECLARE.
581 * semantics.cc (finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead
582 of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause
583 name in diagnostics instead of
584 omp_clause_code_name[OMP_CLAUSE_CODE (c)].
585
586 2022-05-26 Marek Polacek <polacek@redhat.com>
587
588 PR c++/105569
589 * typeck.cc (warn_for_null_address): Improve the warning when
590 the POINTER_PLUS_EXPR's base is of reference type.
591
592 2022-05-26 Patrick Palka <ppalka@redhat.com>
593
594 PR c++/96363
595 * decl.cc (shadow_tag): Use the return value of
596 maybe_process_partial_specialization.
597 * parser.cc (cp_parser_single_declaration): Call shadow_tag
598 before associate_classtype_constraints.
599 * pt.cc (maybe_new_partial_specialization): Change return type
600 to bool. Take 'type' argument by mutable reference. Set 'type'
601 to point to the correct constrained specialization when
602 appropriate.
603 (maybe_process_partial_specialization): Adjust accordingly.
604
605 2022-05-25 Marek Polacek <polacek@redhat.com>
606
607 PR c++/96637
608 * cp-tree.h (attr_chainon): Declare.
609 * decl.cc (start_decl): Use attr_chainon.
610 (grokdeclarator): Likewise.
611 * parser.cc (cp_parser_statement): No longer static.
612
613 2022-05-25 Jason Merrill <jason@redhat.com>
614
615 PR c++/105655
616 * pt.cc (build_template_decl): Add assert.
617 (tsubst_function_decl): Don't return a template.
618
619 2022-05-25 Jason Merrill <jason@redhat.com>
620
621 PR c++/105623
622 * decl2.cc (mark_used): Copy type from fn to BASELINK.
623 * pt.cc (unify_one_argument): Call mark_single_function.
624
625 2022-05-25 Jason Merrill <jason@redhat.com>
626
627 * constexpr.cc (cxx_eval_call_expression): Check for
628 heap vars in the result.
629
630 2022-05-25 Jason Merrill <jason@redhat.com>
631
632 * constexpr.cc (maybe_constant_init_1): Only pass false for
633 strict when initializing a variable of static duration.
634
635 2022-05-25 Marek Polacek <polacek@redhat.com>
636
637 PR c++/100252
638 * typeck2.cc (potential_prvalue_result_of): New.
639 (replace_placeholders_for_class_temp_r): New.
640 (digest_nsdmi_init): Call it.
641
642 2022-05-24 Jason Merrill <jason@redhat.com>
643
644 * constexpr.cc (cxx_fold_indirect_ref): Add default arg.
645 (cxx_eval_call_expression): Call it.
646 (cxx_fold_indirect_ref_1): Handle null empty_base.
647
648 2022-05-24 Jason Merrill <jason@redhat.com>
649
650 * constexpr.cc (enum value_cat): New. Change all 'lval' parameters
651 from int to value_cat. Change most false to vc_prvalue, most true
652 to vc_glvalue, cases where the return value is ignored to
653 vc_discard.
654 (cxx_eval_statement_list): Only vc_prvalue for stmt-expr result.
655 (cxx_eval_store_expression): Only build _REF for vc_glvalue.
656 (cxx_eval_array_reference, cxx_eval_component_reference)
657 (cxx_eval_indirect_ref, cxx_eval_constant_expression): Likewise.
658
659 2022-05-24 Jason Merrill <jason@redhat.com>
660
661 PR c++/105622
662 * constexpr.cc (cxx_eval_store_expression): Adjust assert.
663 Use initialized_type.
664
665 2022-05-24 Patrick Palka <ppalka@redhat.com>
666
667 * cp-tree.h (any_template_arguments_need_structural_equality_p):
668 Declare.
669 * pt.cc (struct ctp_hasher): Define.
670 (ctp_table): Define.
671 (canonical_type_parameter): Use it.
672 (process_template_parm): Set TYPE_CANONICAL for
673 TEMPLATE_TEMPLATE_PARM too.
674 (lookup_template_class_1): Remove now outdated comment for the
675 any_template_arguments_need_structural_equality_p test.
676 (tsubst) <case TEMPLATE_TEMPLATE_PARM, etc>: Don't specifically
677 clear TYPE_CANONICAL for ttps. Set TYPE_CANONICAL on the
678 substituted type later.
679 (any_template_arguments_need_structural_equality_p): Return
680 true for any_targ_node. Don't return true just because a
681 template argument uses structural equality. Add comment for
682 the PARM_DECL special case.
683 (rewrite_template_parm): Set TYPE_CANONICAL on the rewritten
684 parm's type later.
685 * tree.cc (bind_template_template_parm): Set TYPE_CANONICAL
686 when safe to do so.
687 * typeck.cc (structural_comptypes) [check_alias]: Increment
688 processing_template_decl before checking
689 dependent_alias_template_spec_p.
690
691 2022-05-24 Jakub Jelinek <jakub@redhat.com>
692
693 PR c/105378
694 * parser.cc (OMP_TASKWAIT_CLAUSE_MASK): Add nowait clause.
695
696 2022-05-20 David Malcolm <dmalcolm@redhat.com>
697
698 * cxx-pretty-print.h: Replace uses of "FINAL" and "OVERRIDE" with
699 "final" and "override".
700 * error.cc: Likewise.
701
702 2022-05-18 Marek Polacek <polacek@redhat.com>
703
704 PR c++/105634
705 * call.cc (maybe_warn_class_memaccess): Avoid % by zero.
706
707 2022-05-17 Jason Merrill <jason@redhat.com>
708
709 PR c++/102307
710 * decl.cc (check_initializer): Use build_cplus_new in case of
711 constexpr failure.
712
713 2022-05-17 Jakub Jelinek <jakub@redhat.com>
714
715 * parser.cc (cp_parser_omp_clause_depend): Parse
716 inoutset depend-kind.
717 (cp_parser_omp_depobj): Likewise.
718 * cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle
719 OMP_CLAUSE_DEPEND_INOUTSET.
720
721 2022-05-16 Martin Liska <mliska@suse.cz>
722
723 * module.cc (depset::entity_kind_name): Use ARRAY_SIZE.
724 * name-lookup.cc (get_std_name_hint): Likewise.
725 * parser.cc (cp_parser_new): Likewise.
726
727 2022-05-16 Marcel Vollweiler <marcel@codesourcery.com>
728
729 * pt.cc (tsubst_omp_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR.
730 * semantics.cc (finish_omp_clauses): Added template decl processing.
731
732 2022-05-15 Jason Merrill <jason@redhat.com>
733
734 PR c++/100502
735 PR c++/58993
736 * friend.cc (is_friend): Hidden friends count as members.
737 * search.cc (friend_accessible_p): Likewise.
738
739 2022-05-15 Jason Merrill <jason@redhat.com>
740
741 * parser.cc (cp_parser_template_name): Look through
742 injected-class-name.
743
744 2022-05-15 Jason Merrill <jason@redhat.com>
745
746 PR c++/105589
747 PR c++/105191
748 PR c++/92385
749 * init.cc (build_value_init): Handle class in template.
750
751 2022-05-13 Nathan Sidwell <nathan@acm.org>
752
753 * mangle.cc (maybe_write_module): Check external linkage.
754
755 2022-05-13 Richard Biener <rguenther@suse.de>
756
757 * constexpr.cc: Remove gimple-fold.h include.
758
759 2022-05-12 Patrick Palka <ppalka@redhat.com>
760
761 * cp-tree.h (TMPL_ARGS_LEVEL): Assert LEVEL is 1 when
762 TMPL_ARGS_HAVE_MULTIPLE_LEVELS is false.
763 * pt.cc (try_class_unification): Correctly copy multidimensional
764 targs. Free the copy of targs.
765 (unify_pack_expansion): Fix level comparison.
766
767 2022-05-12 Nathan Sidwell <nathan@acm.org>
768
769 * parser.cc (cp_parser_linkage_specification): Implement
770 global module attachment semantics.
771
772 2022-05-12 Jakub Jelinek <jakub@redhat.com>
773
774 * lex.cc (init_reswords): Register omp_all_memory as keyword
775 if flag_openmp.
776 * parser.cc (cp_parser_primary_expression): Diagnose uses of
777 omp_all_memory in postfix expressions.
778 (cp_parser_omp_var_list_no_open): Handle omp_all_memory in depend
779 clause.
780 * semantics.cc (finish_omp_clauses): Handle omp_all_memory
781 keyword in depend clause as null_pointer_node, diagnose invalid
782 uses.
783 * pt.cc (tsubst_omp_clause_decl): Pass through omp_all_memory.
784
785 2022-05-11 Patrick Palka <ppalka@redhat.com>
786
787 * constraint.cc (tsubst_parameter_mapping): Convert loop over
788 TREE_VEC into a range-based for loop using tree_vec_range.
789 * pt.cc (iterative_hash_template_arg): Likewise.
790 (template_parms_level_to_args): Likewise.
791 (deducible_template_args): Likewise.
792 (check_undeduced_parms): Likewise.
793 (dependent_type_p_r): Likewise.
794 (value_dependent_expression_p) <case NONTYPE_ARGUMENT_PACK>:
795 Likewise.
796 (dependent_template_arg_p): Likewise.
797 * tree.cc (cp_walk_subtrees) <case NONTYPE_ARGUMENT_PACK>:
798 Likewise.
799
800 2022-05-11 Jason Merrill <jason@redhat.com>
801
802 PR c++/105541
803 * cp-tree.h (TMPL_ARGS_DEPTH): 0 for null args.
804 * parser.cc (cp_parser_enclosed_template_argument_list):
805 Use 0-length TREE_VEC for <>.
806
807 2022-05-11 Jason Merrill <jason@redhat.com>
808
809 PR bootstrap/105567
810 * typeck.cc (check_return_expr): Don't mess with ctor return value
811 while parsing a template.
812
813 2022-05-11 Nathan Sidwell <nathan@acm.org>
814
815 * cp-tree.h (DECL_MODULE_ATTACH_P): New.
816 (struct lang_decl_base): Add module_attach_p flag.
817 * decl.cc (duplicate_decls): Rework module redeclaration
818 checking.
819 * module.cc (trees_out::lang_decl_bools): Write attach flag.
820 (trees_in::lang_decl_bools): ... and read it back.
821 (trees_out::decl_value): Rework module attachment handling.
822 (trees_in::decl_value): Rename local var to reflect meaning.
823 (trees_in::key_mergeable): Likewise.
824 (get_originating_module): Use DECL_MODULE_ATTACH_P. No need
825 to special-case mangling.
826 (module_may_redeclare): Reimplement.
827 (set_originating_module): Deal with attachment.
828 * name-lookup.cc (maybe_record_mergeable_decl): Deal with
829 attachment.
830 (mergeable_namespace_slots): Likewise.
831 (do_nonmember_using_decl): Likewise.
832 * name-lookup.h (mergeable_namespace_slots): Adjust parm
833 meaning.
834 * ptree.cc (cxx_print_decl): Adjust purview & attach printing.
835
836 2022-05-11 Martin Liska <mliska@suse.cz>
837
838 PR target/105355
839 * lang-specs.h: Use Separate syntax.
840
841 2022-05-10 Patrick Palka <ppalka@redhat.com>
842
843 * coroutines.cc (instantiate_coro_traits): Adjust accordingly.
844 * cp-tree.def: Remove mention of SET_PACK_EXPANSION_PATTERN.
845 * cp-tree.h (SET_PACK_EXPANSION_PATTERN): Remove.
846 (SET_ARGUMENT_PACK_ARGS): Remove.
847 * module.cc (trees_in::tree_node): Adjust accordingly.
848 * parser.cc (make_char_string_pack): Likewise.
849 (make_string_pack): Likewise.
850 * pt.cc (make_pack_expansion): Likewise.
851 (template_parm_to_arg): Likewise.
852 (coerce_template_parameter_pack): Likewise.
853 (extract_fnparm_pack): Likewise.
854 (extract_locals_r): Likewise.
855 (make_argument_pack): Likewise.
856 (tsubst_argument_pack): Likewise.
857 (lookup_init_capture_pack): Likewise.
858 (type_unification_real): Likewise.
859 (unify_pack_expansion): Likewise.
860 (tsubst_initializer_list): Likewise.
861
862 2022-05-10 Patrick Palka <ppalka@redhat.com>
863
864 * cp-tree.h (PACK_EXPANSION_CHECK): Define.
865 (PACK_EXPANSION_PATTERN): Use PACK_EXPANSION_CHECK.
866 (SET_PACK_EXPANSION_PATTERN): Likewise.
867 (PACK_EXPANSION_PARAMETER_PACKS): Likewise.
868 (PACK_EXPANSION_EXTRA_ARGS): Likewise.
869 (PACK_EXPANSION_LOCAL_P): Likewise.
870 (PACK_EXPANSION_SIZEOF_P): Likewise.
871 (PACK_EXPANSION_AUTO_P): Likewise.
872 (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): Likewise.
873 (ARGUMENT_PACK_CHECK): Define.
874 (ARGUMENT_PACK_ARGS): Use ARGUMENT_PACK_CHECK.
875 (SET_ARGUMENT_PACK_ARGS): Likewise.
876 * parser.cc (cp_parser_sizeof_pack): Check for error_mark_node
877 before setting PACK_EXPANSION_SIZEOF_P.
878
879 2022-05-10 Nathan Sidwell <nathan@acm.org>
880
881 * cp-tree.h (enum module_kind_bits): Disambiguate purview,
882 attach, named module vs header-unit.
883 (global_purview_p, not_module_p): Delete.
884 (named_module_p): New.
885 (header_module_p, module_purview_p): Adjust.
886 (module_attach_p, named_module_purview_p): New.
887 * decl.cc (duplicate_decls): Adjust.
888 * module.cc (declare_module, preprocessed_module): Adjust.
889 * name-lookup.cc (init_global_partition): Adjust.
890 (get_fixed_binding_slot, pushdecl): Adjust.
891 * parser.cc (cp_parser_module_declaration): Adjust.
892 (cp_parser_import_declaration, cp_parser_declaration): Adjust.
893
894 2022-05-10 Jason Merrill <jason@redhat.com>
895
896 PR c++/105529
897 * decl.cc (maybe_return_this): Replace...
898 (finish_constructor_body, finish_destructor_body): ...these.
899 (finish_function_body): Call it.
900 * optimize.cc (build_delete_destructor_body): Call it.
901 * cp-tree.h (maybe_return_this): Declare.
902
903 2022-05-09 Marek Polacek <polacek@redhat.com>
904
905 PR c++/103539
906 * parser.cc (cp_parser_statement): Constify the in_compound parameter.
907 Create a modifiable copy. Allow labels at the end of compound
908 statements.
909
910 2022-05-09 Patrick Palka <ppalka@redhat.com>
911
912 PR c++/105491
913 * call.cc (field_in_pset): Adjust after next_initializable_field
914 renaming.
915 (build_aggr_conv): Likewise.
916 (convert_like_internal): Likewise.
917 (type_has_extended_temps): Likewise.
918 * class.cc (default_init_uninitialized_part): Likewise.
919 (finish_struct): Likewise.
920 * constexpr.cc (cx_check_missing_mem_inits): Likewise.
921 (reduced_constant_expression_p): Use next_subobject_field
922 instead.
923 * cp-gimplify.cc (get_source_location_impl_type): Adjust after
924 next_initializable_field renaming.
925 (fold_builtin_source_location): Likewise.
926 * cp-tree.h (next_initializable_field): Rename to ...
927 (next_aggregate_field): ... this.
928 (next_subobject_field): Declare.
929 * decl.cc (next_aggregate_field): Renamed from ...
930 (next_initializable_field): ... this. Skip over vptr fields
931 again.
932 (next_subobject_field): Define.
933 (reshape_init_class): Adjust after next_initializable_field
934 renaming.
935 * init.cc (build_value_init_noctor): Likewise.
936 (emit_mem_initializers): Likewise.
937 * lambda.cc (build_capture_proxy): Likewise.
938 * method.cc (build_comparison_op): Likewise.
939 * pt.cc (maybe_aggr_guide): Likewise.
940 * tree.cc (structural_type_p): Likewise.
941 * typeck2.cc (split_nonconstant_init_1): Likewise.
942 (digest_init_r): Likewise.
943
944 2022-05-09 Nathan Sidwell <nathan@acm.org>
945
946 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Renamed from
947 DECL_MODULE_ATTACHMENTS_P.
948 (struct lane_decl_base): Rename module_attached_p to
949 module_keyed_decls_p.
950 (maybe_key_decl): Renamed from maybe_attach_decl.
951 * lambda.cc (record_lambda_scope): Adjust.
952 * lex.cc (cxx_dup_lang_specific_decl): Adjust.
953 * module.cc (keyed_map_t, keyed_table): Renamed from attached_map_t,
954 attached_table.
955 (enum merge_kind): Rename MK_attached to MK_keyed.
956 (trees_out::lang_decl_bools): Adjust.
957 (trees_in::lang_decl_bools): Adjust.
958 (trees_in::decl_value): Adjust.
959 (trees_out::get_merge_kind): Adjust.
960 (trees_out::key_mergeable): Adjust.
961 (trees_in::key_mergeable): Adjust.
962 (maybe_key_decl): Rename from maybe_attach_decl.
963 (direct_import): Adjust.
964 (fini_modules): Adjust.
965
966 2022-05-09 Martin Liska <mliska@suse.cz>
967
968 * cp-gimplify.cc (cp_genericize_r): Use {,UN}LIKELY
969 macros.
970 * parser.cc (cp_finalize_omp_declare_simd): Likewise.
971 (cp_finalize_oacc_routine): Likewise.
972
973 2022-05-07 Marek Polacek <polacek@redhat.com>
974
975 PR c++/101833
976 PR c++/47634
977 * tree.cc (maybe_adjust_arg_pos_for_attribute): New.
978
979 2022-05-06 Jason Merrill <jason@redhat.com>
980
981 * error.cc (decl_to_string): Add show_color parameter.
982 (subst_to_string): Likewise.
983 (cp_printer): Pass it.
984 (type_to_string): Set pp_show_color.
985 (dump_function_name): Use "fnname" color.
986 (dump_template_bindings): Use "targs" color.
987 (struct colorize_guard): New.
988 (reinit_cxx_pp): Clear pp_show_color.
989
990 2022-05-06 Jason Merrill <jason@redhat.com>
991
992 PR c++/105245
993 PR c++/100111
994 * constexpr.cc (cxx_eval_store_expression): Reorganize empty base
995 handling.
996
997 2022-05-05 Marek Polacek <polacek@redhat.com>
998
999 PR c++/64679
1000 * parser.cc (cp_parser_parameter_declaration_clause): Maintain
1001 a vector of parameters that haven't been pushed yet. Push them at the
1002 end of a valid parameter-declaration-clause.
1003 (cp_parser_parameter_declaration_list): Take a new auto_vec parameter.
1004 Do not pushdecl while parsing tentatively when pushdecl-ing a parameter
1005 would result in a hard error.
1006 (cp_parser_cache_defarg): Adjust the call to
1007 cp_parser_parameter_declaration_list.
1008
1009 2022-05-05 Richard Biener <rguenther@suse.de>
1010
1011 * module.cc (trees_in::core_vals): Remove separate allocation
1012 for REAL_CST.
1013
1014 2022-05-04 Jason Merrill <jason@redhat.com>
1015
1016 PR c++/104470
1017 * pt.cc (maybe_dependent_member_ref): Handle types.
1018 (tsubst, tsubst_copy): Use it.
1019 (tsubst_aggr_type, instantiate_alias_template): Don't handle
1020 tf_dguide here.
1021
1022 2022-05-04 Patrick Palka <ppalka@redhat.com>
1023
1024 PR c++/105476
1025 * pt.cc (maybe_aggr_guide): Set processing_template_decl when
1026 partially instantiating the guide's parameter list.
1027
1028 2022-05-04 Marek Polacek <polacek@redhat.com>
1029
1030 PR c++/64679
1031 * parser.cc (cp_parser_init_declarator): Properly handle a series of
1032 operator() calls, they are not part of an init-declarator.
1033
1034 2022-05-04 Jason Merrill <jason@redhat.com>
1035
1036 * decl.cc (reshape_init): Shortcut already-reshaped init.
1037 (reshape_init_class): Assert not getting one here.
1038
1039 2022-05-04 Jason Merrill <jason@redhat.com>
1040
1041 * error.cc (cp_print_error_function): Use %qD.
1042 (function_category): Use %qD.
1043
1044 2022-05-04 Marek Polacek <polacek@redhat.com>
1045
1046 PR c++/105436
1047 * parser.cc (cp_parser_next_token_ends_template_argument_p): Don't
1048 return true for CPP_GREATER_EQ.
1049
1050 2022-05-04 Jason Merrill <jason@redhat.com>
1051
1052 * cp-tree.h (struct language_function): Remove x_cdtor_label.
1053 (cdtor_label, LABEL_DECL_CDTOR): Remove.
1054 * constexpr.cc (returns): Don't check LABEL_DECL_CDTOR.
1055 (cxx_eval_constant_expression): Don't call returns.
1056 * decl.cc (check_goto): Don't check cdtor_label.
1057 (start_preparsed_function): And don't set it.
1058 (finish_constructor_body, finish_destructor_body): Remove.
1059 (finish_function_body): Don't call them.
1060 * typeck.cc (check_return_expr): Handle cdtor_returns_this here.
1061 * semantics.cc (finish_return_stmt): Not here.
1062
1063 2022-05-04 Jakub Jelinek <jakub@redhat.com>
1064
1065 * lambda.cc: Include decl.h.
1066 (maybe_add_lambda_conv_op): Temporarily override deprecated_state to
1067 UNAVAILABLE_DEPRECATED_SUPPRESS.
1068
1069 2022-05-03 Patrick Palka <ppalka@redhat.com>
1070
1071 PR c++/105351
1072 * cp-tree.h (finish_non_static_data_member): Add defaulted
1073 complain parameter.
1074 * pt.cc (tsubst_copy_and_build): Pass complain to
1075 finish_non_static_data_member.
1076 * semantics.cc (finish_non_static_data_member): Respect complain
1077 parameter.
1078 (finish_qualified_id_expr): Pass complain to
1079 finish_non_static_data_member.
1080
1081 2022-05-02 Jason Merrill <jason@redhat.com>
1082
1083 * pt.cc (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Copy location.
1084 (do_auto_deduction): Use expr location.
1085
1086 2022-05-02 Jason Merrill <jason@redhat.com>
1087
1088 * class.cc (maybe_note_name_used_in_class): Note in all enclosing
1089 classes. Remember location of use.
1090 (note_name_declared_in_class): Adjust.
1091
1092 2022-05-02 Marek Polacek <polacek@redhat.com>
1093
1094 * cp-tree.h (uses_template_parms): Adjust declaration.
1095 * pt.cc (uses_template_parms): Return bool. Use a RAII sentinel.
1096
1097 2022-05-02 Richard Biener <rguenther@suse.de>
1098
1099 * constexpr.cc (fold_simple_1): Use CASE_CONVERT.
1100 * cp-gimplify.cc (cp_fold): Likewise.
1101 * pt.cc (tsubst_copy): Likewise.
1102
1103 2022-04-29 Jason Merrill <jason@redhat.com>
1104
1105 PR c++/91618
1106 PR c++/96604
1107 * friend.cc (do_friend): Call check_explicit_specialization here.
1108 * decl.cc (grokdeclarator): Not here.
1109 * decl2.cc (check_classfn): Or here.
1110
1111 2022-04-29 Jason Merrill <jason@redhat.com>
1112
1113 PR c++/104470
1114 * cp-tree.h (enum tsubst_flags): Add tf_dguide.
1115 * pt.cc (tsubst_aggr_type): Check it.
1116 (tsubst_baselink, tsubst_copy): Check it.
1117 (maybe_dependent_member_ref): Check it.
1118 (instantiate_alias_template): Handle it.
1119 (build_deduction_guide): Set it.
1120
1121 2022-04-29 Jason Merrill <jason@redhat.com>
1122
1123 PR c++/82980
1124 * lambda.cc (type_deducible_expression_p): Allow more types.
1125
1126 2022-04-29 Jason Merrill <jason@redhat.com>
1127
1128 * decl.cc (cp_finish_decl): Only consider auto for vars.
1129
1130 2022-04-29 Marek Polacek <polacek@redhat.com>
1131
1132 PR c++/67048
1133 * parser.cc (cp_parser_enum_specifier): Warn about empty unnamed enum
1134 only when it's followed by a semicolon.
1135
1136 2022-04-29 Jason Merrill <jason@redhat.com>
1137
1138 PR c++/80351
1139 * decl.cc (cp_finish_decl): Check completeness of deduced type.
1140
1141 2022-04-29 Jason Merrill <jason@redhat.com>
1142
1143 PR c++/102987
1144 * error.cc (dump_decl) [USING_DECL]: Respect flags.
1145
1146 2022-04-29 Jason Merrill <jason@redhat.com>
1147
1148 * error.cc (dump_decl): Check TFF_UNQUALIFIED_NAME.
1149
1150 2022-04-29 Jakub Jelinek <jakub@redhat.com>
1151
1152 PR c++/104319
1153 * parser.cc (cp_parser_template_argument): Treat >= like C++98 >>
1154 after a type id by setting maybe_type_id and aborting tentative
1155 parse.
1156 (cp_parser_enclosed_template_argument_list): Handle
1157 CPP_GREATER_EQ like misspelled CPP_GREATER CPP_RQ and
1158 CPP_RSHIFT_EQ like misspelled CPP_GREATER CPP_GREATER_EQ
1159 or CPP_RSHIFT CPP_EQ or CPP_GREATER CPP_GREATER CPP_EQ.
1160 (cp_parser_next_token_ends_template_argument_p): Return true
1161 also for CPP_GREATER_EQ and CPP_RSHIFT_EQ.
1162
1163 2022-04-29 Iain Sandoe <iain@sandoe.co.uk>
1164
1165 PR c++/105426
1166 * coroutines.cc (register_local_var_uses): Allow promotion of unnamed
1167 temporaries to coroutine frame copies.
1168
1169 2022-04-29 Jason Merrill <jason@redhat.com>
1170
1171 * semantics.cc (check_trait_type): Don't check completeness
1172 of element type of array of unknown bound.
1173
1174 2022-04-29 Jason Merrill <jason@redhat.com>
1175
1176 PR c++/102651
1177 PR c++/49387
1178 * rtti.cc (get_tinfo_decl_direct): Don't complete_type.
1179 (emit_tinfo_decl): Update tdesc type if needed.
1180
1181 2022-04-29 Zhao Wei Liew <zhaoweiliew@gmail.com>
1182
1183 PR c++/25689
1184 * call.cc (extract_call_expr): Return a NULL_TREE on failure
1185 instead of asserting.
1186 (build_new_method_call): Suppress -Wparentheses diagnostic for
1187 MODIFY_EXPR.
1188 * semantics.cc (is_assignment_op_expr_p): Add function to check
1189 if an expression is a call to an op= operator expression.
1190 (maybe_convert_cond): Handle the case of a op= operator expression
1191 for the -Wparentheses diagnostic.
1192
1193 2022-04-28 Patrick Palka <ppalka@redhat.com>
1194
1195 PR c++/105425
1196 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Treat
1197 DEPENDENT_OPERATOR_TYPE like an empty type.
1198
1199 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
1200
1201 PR c++/104051
1202 * coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
1203 non-target expression inputs.
1204
1205 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
1206
1207 PR c++/105301
1208 * coroutines.cc (coro_promise_type_found_p): Account for possible
1209 mutliple overloads of the promise return_value() method.
1210
1211 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
1212
1213 PR c++/105287
1214 * coroutines.cc (maybe_promote_temps): Ensure generated temporaries
1215 are added to the bind expr.
1216 (add_var_to_bind): Fix local var naming to use portable punctuation.
1217 (register_local_var_uses): Do not add synthetic names to unnamed
1218 temporaries.
1219
1220 2022-04-28 Nathan Sidwell <nathan@acm.org>
1221 Iain Sandoe <iain@sandoe.co.uk>
1222
1223 PR c++/103868
1224 * coroutines.cc (finish_co_await_expr): Do not process non-dependent
1225 coroutine expressions at template definition time.
1226 (finish_co_yield_expr): Likewise.
1227 (finish_co_return_stmt): Likewise.
1228
1229 2022-04-28 Marek Polacek <polacek@redhat.com>
1230
1231 PR c++/90107
1232 * parser.cc (cp_parser_class_specifier_1): Accept :: after a class
1233 definition.
1234
1235 2022-04-27 Jason Merrill <jason@redhat.com>
1236
1237 * tree.cc (strip_typedefs): Add default argument comments.
1238
1239 2022-04-27 Marek Polacek <polacek@redhat.com>
1240
1241 PR c++/105398
1242 * pt.cc (uses_template_parms): Return false for any NAMESPACE_DECL.
1243
1244 2022-04-26 Jason Merrill <jason@redhat.com>
1245
1246 PR c++/102629
1247 * pt.cc (gen_elem_of_pack_expansion_instantiation): Clear
1248 TEMPLATE_TYPE_PARAMETER_PACK on auto.
1249
1250 2022-04-26 Patrick Palka <ppalka@redhat.com>
1251
1252 PR c++/105386
1253 * semantics.cc (finish_decltype_type): Pass tf_decltype to
1254 instantiate_non_dependent_expr_sfinae.
1255
1256 2022-04-26 Jason Merrill <jason@redhat.com>
1257
1258 PR c++/104624
1259 * pt.cc (check_for_bare_parameter_packs): Check for lambda
1260 function parameter pack.
1261
1262 2022-04-26 Patrick Palka <ppalka@redhat.com>
1263
1264 PR c++/105289
1265 PR c++/86193
1266 * pt.cc (process_partial_specialization): Downgrade "partial
1267 specialization isn't more specialized" diagnostic from permerror
1268 to an on-by-default pedwarn.
1269 (unify) <case TEMPLATE_PARM_INDEX>: When substituting into the
1270 NTTP type a second time, use the original type not the
1271 substituted type.
1272
1273 2022-04-25 Marek Polacek <polacek@redhat.com>
1274
1275 PR c++/105353
1276 * typeck.cc (build_x_shufflevector): Use
1277 instantiation_dependent_expression_p except for the first two
1278 arguments.
1279
1280 2022-04-21 Marek Polacek <polacek@redhat.com>
1281
1282 * constexpr.cc (cxx_eval_logical_expression): Remove unused
1283 parameter.
1284 (cxx_eval_constant_expression) <case TRUTH_ANDIF_EXPR>,
1285 <case TRUTH_OR_EXPR>: Adjust calls to cxx_eval_logical_expression.
1286
1287 2022-04-21 Marek Polacek <polacek@redhat.com>
1288
1289 PR c++/105321
1290 * constexpr.cc (cxx_eval_logical_expression): Always pass false for lval
1291 to cxx_eval_constant_expression.
1292
1293 2022-04-20 Ed Catmur <ed@catmur.uk>
1294
1295 PR c++/104996
1296 * call.cc (compare_ics): When comparing list-initialization
1297 sequences, do not return early.
1298
1299 2022-04-19 Jakub Jelinek <jakub@redhat.com>
1300
1301 PR c++/105256
1302 * typeck2.cc (process_init_constructor_array,
1303 process_init_constructor_record, process_init_constructor_union): Move
1304 CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag from CONSTRUCTOR elements to the
1305 containing CONSTRUCTOR.
1306
1307 2022-04-15 Marek Polacek <polacek@redhat.com>
1308
1309 PR c++/105268
1310 * parser.cc (cp_parser_placeholder_type_specifier): Return
1311 error_mark_node when trying to build up a constrained parameter in
1312 a default argument.
1313
1314 2022-04-15 Jason Merrill <jason@redhat.com>
1315
1316 PR c++/102804
1317 * decl.cc (grokdeclarator): Drop typedef used with 'unsigned'.
1318
1319 2022-04-15 Jason Merrill <jason@redhat.com>
1320
1321 PR c++/102987
1322 * error.cc (dump_expr): Handle USING_DECL.
1323 [VIEW_CONVERT_EXPR]: Just look through location wrapper.
1324
1325 2022-04-14 Jason Merrill <jason@redhat.com>
1326
1327 PR c++/104646
1328 * constexpr.cc (maybe_save_constexpr_fundef): Don't do extra
1329 checks for defaulted ctors.
1330
1331 2022-04-14 Jason Merrill <jason@redhat.com>
1332
1333 PR c++/82980
1334 * lambda.cc (type_deducible_expression_p): New.
1335 (lambda_capture_field_type): Check it.
1336
1337 2022-04-14 Jason Merrill <jason@redhat.com>
1338
1339 PR c++/65211
1340 * pt.cc (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.
1341
1342 2022-04-14 Jason Merrill <jason@redhat.com>
1343
1344 PR c++/97219
1345 * name-lookup.cc (dependent_local_decl_p): New.
1346 * cp-tree.h (dependent_local_decl_p): Declare.
1347 * semantics.cc (finish_call_expr): Use it.
1348 * pt.cc (tsubst_arg_types): Also substitute default args
1349 for local externs.
1350
1351 2022-04-14 Jason Merrill <jason@redhat.com>
1352
1353 PR c++/101698
1354 * pt.cc (tsubst_baselink): Also check dependent optype.
1355
1356 2022-04-14 Jason Merrill <jason@redhat.com>
1357
1358 PR c++/101442
1359 * decl.cc (cp_finish_decl): Don't pass decl to push_cleanup.
1360 * init.cc (perform_member_init): Likewise.
1361 * semantics.cc (push_cleanup): Adjust comment.
1362
1363 2022-04-13 Jason Merrill <jason@redhat.com>
1364
1365 PR c++/105245
1366 PR c++/100111
1367 * constexpr.cc (cxx_eval_store_expression): Build a CONSTRUCTOR
1368 as needed in empty base handling.
1369
1370 2022-04-13 Jakub Jelinek <jakub@redhat.com>
1371
1372 PR c++/105233
1373 * decl2.cc (cp_check_const_attributes): For aligned attribute
1374 pass manifestly_const_eval=true to fold_non_dependent_expr.
1375
1376 2022-04-13 Marek Polacek <polacek@redhat.com>
1377
1378 PR c++/97296
1379 * call.cc (direct_reference_binding): strip_top_quals when creating
1380 a ck_qual.
1381
1382 2022-04-12 Jason Merrill <jason@redhat.com>
1383
1384 PR c++/104669
1385 * decl.cc (decls_match): Compare versions even if not recording.
1386 (duplicate_decls): Propagate attributes to alias.
1387 * decl2.cc (find_last_decl): Give up if versioned.
1388
1389 2022-04-12 Jason Merrill <jason@redhat.com>
1390
1391 PR c++/102071
1392 * init.cc (build_new_1): Check array_p for alignment.
1393
1394 2022-04-12 Patrick Palka <ppalka@redhat.com>
1395
1396 PR c++/103105
1397 * pt.cc (build_extra_args): Call preserve_args.
1398
1399 2022-04-12 Jason Merrill <jason@redhat.com>
1400
1401 PR c++/104142
1402 * decl.cc (check_initializer): Check TREE_SIDE_EFFECTS.
1403
1404 2022-04-12 Jason Merrill <jason@redhat.com>
1405
1406 PR c++/105223
1407 PR c++/92918
1408 * class.cc (finish_struct): Always using op=.
1409
1410 2022-04-11 Jason Merrill <jason@redhat.com>
1411
1412 PR c++/98249
1413 * call.cc (build_operator_new_call): Just look in ::.
1414
1415 2022-04-11 Alexandre Oliva <oliva@adacore.com>
1416
1417 * constexpr.cc (cxx_eval_call_expression): Disregard dtor
1418 result.
1419
1420 2022-04-11 Alexandre Oliva <oliva@adacore.com>
1421
1422 * semantics.cc (set_cleanup_locs): Propagate locus to call
1423 wrapped in cast-to-void.
1424
1425 2022-04-11 Jason Merrill <jason@redhat.com>
1426
1427 PR c++/100370
1428 * init.cc (warn_placement_new_too_small): Check deref.
1429
1430 2022-04-09 Jason Merrill <jason@redhat.com>
1431
1432 PR c++/105191
1433 PR c++/92385
1434 * tree.cc (build_vec_init_elt): Do {}-init for aggregates.
1435 * constexpr.cc (cxx_eval_vec_init): Only treat {} as value-init
1436 for non-aggregate types.
1437 (build_vec_init_expr): Also check constancy of explicit
1438 initializer elements.
1439
1440 2022-04-09 Jason Merrill <jason@redhat.com>
1441
1442 PR c++/91618
1443 PR c++/96604
1444 * name-lookup.cc (set_decl_namespace): Set
1445 DECL_IMPLICIT_INSTANTIATION if no non-template match.
1446 * pt.cc (check_explicit_specialization): Check it.
1447 * decl2.cc (check_classfn): Call it.
1448
1449 2022-04-07 Patrick Palka <ppalka@redhat.com>
1450
1451 PR c++/99479
1452 * name-lookup.cc (name_lookup::using_queue): Change to an
1453 auto_vec (with 16 elements of internal storage).
1454 (name_lookup::queue_namespace): Change return type to void,
1455 take queue parameter by reference and adjust function body
1456 accordingly.
1457 (name_lookup::do_queue_usings): Inline into ...
1458 (name_lookup::queue_usings): ... here. As in queue_namespace.
1459 (name_lookup::search_unqualified): Don't make queue static,
1460 remove length variable, and adjust function body accordingly.
1461
1462 2022-04-07 Jakub Jelinek <jakub@redhat.com>
1463
1464 PR tree-optimization/102586
1465 * cp-objcp-common.h (cp_classtype_as_base): Declare.
1466 (LANG_HOOKS_CLASSTYPE_AS_BASE): Redefine.
1467 * cp-objcp-common.cc (cp_classtype_as_base): New function.
1468
1469 2022-04-07 Jason Merrill <jason@redhat.com>
1470
1471 PR c++/101051
1472 * decl.cc (grokdeclarator): Reject conversion with trailing return
1473 sooner.
1474
1475 2022-04-07 Jason Merrill <jason@redhat.com>
1476
1477 PR c++/101717
1478 * lambda.cc (lambda_expr_this_capture): Check all enclosing
1479 lambdas for completeness.
1480
1481 2022-04-07 Jason Merrill <jason@redhat.com>
1482
1483 PR c++/105187
1484 * typeck2.cc (store_init_value): Allow TREE_HAS_CONSTRUCTOR for
1485 vectors.
1486
1487 2022-04-06 Jakub Jelinek <jakub@redhat.com>
1488
1489 PR c++/104668
1490 * decl2.cc (splice_template_attributes): Return NULL if *p is
1491 error_mark_node.
1492 (cplus_decl_attributes): Return early if attributes is
1493 error_mark_node. Don't check that later.
1494
1495 2022-04-06 Patrick Palka <ppalka@redhat.com>
1496
1497 PR c++/105143
1498 * pt.cc (do_class_deduction): Check complain before attempting
1499 to issue a -Wctad-maybe-unsupported warning.
1500
1501 2022-04-06 Jason Merrill <jason@redhat.com>
1502
1503 PR c++/104702
1504 * init.cc (build_vec_init): Use a reference for the result.
1505
1506 2022-04-06 Jason Merrill <jason@redhat.com>
1507
1508 PR c++/100608
1509 * name-lookup.cc (check_local_shadow): Use -Wshadow=local
1510 if exactly one of 'old' and 'decl' is a type.
1511
1512 2022-04-05 Jason Merrill <jason@redhat.com>
1513
1514 PR c++/103852
1515 DR 1286
1516 * pt.cc (do_class_deduction): Pedwarn for renaming alias in C++17.
1517
1518 2022-04-05 Jason Merrill <jason@redhat.com>
1519
1520 PR c++/101677
1521 * name-lookup.h (struct cp_binding_level): Add requires_expression
1522 bit-field.
1523 * parser.cc (cp_parser_requires_expression): Set it.
1524 (synthesize_implicit_template_parm): Check it.
1525
1526 2022-04-04 Jason Merrill <jason@redhat.com>
1527
1528 PR c++/101894
1529 * decl.cc (duplicate_decls): Copy DECL_FRIEND_CONTEXT.
1530
1531 2022-04-04 Jason Merrill <jason@redhat.com>
1532
1533 PR c++/103852
1534 DR 1286
1535 * pt.cc (get_underlying_template): Compare default template args.
1536
1537 2022-04-03 Benno Evers <benno.evers@tenzir.com>
1538 Iain Sandoe <iain@sandoe.co.uk>
1539
1540 PR c++/103328
1541 * coroutines.cc (morph_fn_to_coro): Reset
1542 current_binding_level->blocks.
1543
1544 2022-04-01 Jason Merrill <jason@redhat.com>
1545
1546 Revert:
1547 2022-03-31 Jason Merrill <jason@redhat.com>
1548
1549 PR c++/96645
1550 * parser.cc (cp_parser_early_parsing_nsdmi): New.
1551 (cp_parser_member_declaration): Call it.
1552
1553 2022-04-01 Jason Merrill <jason@redhat.com>
1554
1555 Revert:
1556 2022-03-24 Jason Merrill <jason@redhat.com>
1557
1558 PR c++/96645
1559 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
1560 * class.cc (type_has_default_ctor_to_be_synthesized): New.
1561 (type_has_non_user_provided_default_constructor_1): Support it.
1562 (type_has_non_user_provided_default_constructor): Now a wrapper.
1563 * method.cc (complain_about_unparsed_dmi): New.
1564 (constructible_expr): Call it.
1565
1566 2022-04-01 Patrick Palka <ppalka@redhat.com>
1567
1568 PR c++/105110
1569 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Drop cv-quals from
1570 the argument type of an NTTP before deducing from it.
1571
1572 2022-03-31 Jason Merrill <jason@redhat.com>
1573
1574 PR c++/96645
1575 * parser.cc (cp_parser_early_parsing_nsdmi): New.
1576 (cp_parser_member_declaration): Call it.
1577
1578 2022-03-30 Patrick Palka <ppalka@redhat.com>
1579
1580 PR c++/100474
1581 * constraint.cc (diagnose_trait_expr): Handle all remaining
1582 traits appropriately. Remove default case.
1583
1584 2022-03-30 Marek Polacek <polacek@redhat.com>
1585
1586 PR c++/93280
1587 PR c++/104583
1588 * init.cc (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor.
1589
1590 2022-03-30 Jakub Jelinek <jakub@redhat.com>
1591
1592 PR c++/105092
1593 * pt.cc (tsubst_omp_clause_decl): When handling iterators, set
1594 DECL_CONTEXT of the iterator var to current_function_decl and
1595 call pushdecl.
1596
1597 2022-03-30 Jakub Jelinek <jakub@redhat.com>
1598
1599 PR c++/105061
1600 * parser.cc (cp_parser_template_introduction): If member_p, temporarily
1601 clear parser->colon_corrects_to_scope_p around tentative parsing of
1602 nested name specifier.
1603
1604 2022-03-28 Jason Merrill <jason@redhat.com>
1605
1606 * pt.cc (determine_specialization): Add comment.
1607
1608 2022-03-28 Patrick Palka <ppalka@redhat.com>
1609
1610 PR c++/105067
1611 * pt.cc (finish_concept_definition): Check that a concept is
1612 declared with exactly one template parameter list.
1613
1614 2022-03-28 Patrick Palka <ppalka@redhat.com>
1615
1616 PR c++/105064
1617 * constraint.cc (maybe_substitute_reqs_for): Don't assume
1618 DECL_TEMPLATE_INFO is available.
1619
1620 2022-03-28 Jason Merrill <jason@redhat.com>
1621
1622 PR c++/105003
1623 PR c++/104008
1624 PR c++/102869
1625 * pt.cc (complex_alias_template_r): walk_tree callback, replacing
1626 uses_all_template_parms_r, complex_pack_expansion_r.
1627 (complex_alias_template_p): Adjust.
1628 * tree.cc (strip_typedefs): Revert r12-7710 change.
1629
1630 2022-03-28 Jason Merrill <jason@redhat.com>
1631
1632 PR c++/102071
1633 * init.cc (build_new_1): Include cookie in alignment. Omit
1634 constexpr wrapper from alloc_call.
1635
1636 2022-03-28 Jason Merrill <jason@redhat.com>
1637
1638 PR c++/103291
1639 * name-lookup.cc (push_local_extern_decl_alias): Call
1640 determine_visibility.
1641
1642 2022-03-28 Jason Merrill <jason@redhat.com>
1643
1644 PR c++/102123
1645 * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting
1646 a type template reference.
1647
1648 2022-03-28 Jason Merrill <jason@redhat.com>
1649
1650 PR c++/103968
1651 * pt.cc (value_dependent_expression_p): Check
1652 has_value_dependent_address for conversion to reference.
1653
1654 2022-03-28 Jason Merrill <jason@redhat.com>
1655
1656 PR c++/103943
1657 * pt.cc (tsubst_qualified_id): Handle getting SCOPE_REF from
1658 tsubst_baselink.
1659 (instantiation_dependent_scope_ref_p): Check dependent_scope_p.
1660
1661 2022-03-28 Jason Merrill <jason@redhat.com>
1662
1663 PR c++/102045
1664 * call.cc (make_base_init_ok): Call make_used.
1665
1666 2022-03-28 Jason Merrill <jason@redhat.com>
1667
1668 PR c++/104847
1669 * mangle.cc (write_expression): Don't write a union designator when
1670 undigested.
1671
1672 2022-03-28 Jason Merrill <jason@redhat.com>
1673
1674 PR c++/99445
1675 PR c++/103769
1676 * tree.cc (strip_typedefs): Use build_distinct_type_copy.
1677
1678 2022-03-26 Patrick Palka <ppalka@redhat.com>
1679
1680 PR c++/105050
1681 * constexpr.cc (potential_constant_expression_1) <case IF_STMT>:
1682 Clarify error message when a if-stmt is non-constant because its
1683 branches are non-constant.
1684
1685 2022-03-26 Patrick Palka <ppalka@redhat.com>
1686
1687 PR c++/103455
1688 * call.cc (add_builtin_candidate) <case MEMBER_REF>: Test
1689 CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
1690
1691 2022-03-26 Jakub Jelinek <jakub@redhat.com>
1692
1693 * parser.cc (cp_parser_postfix_expression)
1694 <case RID_BILTIN_CONVERTVECTOR, case RID_BUILTIN_BIT_CAST>: Don't
1695 return cp_build_{vec,convert,bit_cast} result right away, instead
1696 set postfix_expression to it and break.
1697
1698 2022-03-25 Marek Polacek <polacek@redhat.com>
1699
1700 PR c++/104944
1701 * typeck.cc (cxx_sizeof_or_alignof_type): Diagnose alignof(void).
1702 (cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with
1703 complain == true.
1704
1705 2022-03-24 Marek Polacek <polacek@redhat.com>
1706
1707 PR c++/104284
1708 * decl.cc (check_initializer): Don't call build_aggr_init in
1709 a template.
1710
1711 2022-03-24 Jason Merrill <jason@redhat.com>
1712
1713 PR c++/96645
1714 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
1715 * class.cc (type_has_default_ctor_to_be_synthesized): New.
1716 (type_has_non_user_provided_default_constructor_1): Support it.
1717 (type_has_non_user_provided_default_constructor): Now a wrapper.
1718 * method.cc (complain_about_unparsed_dmi): New.
1719 (constructible_expr): Call it.
1720
1721 2022-03-24 Marek Polacek <polacek@redhat.com>
1722
1723 PR c++/102990
1724 * typeck2.cc (massage_init_elt): Avoid folding CONSTRUCTORs.
1725
1726 2022-03-24 Patrick Palka <ppalka@redhat.com>
1727
1728 PR c++/104620
1729 * call.cc (build_over_call): Use cxx_constant_value_sfinae
1730 instead of cxx_constant_value to evaluate a consteval call.
1731 * constexpr.cc (cxx_constant_value_sfinae): Add decl parameter
1732 and pass it to cxx_eval_outermost_constant_expr.
1733 * cp-tree.h (cxx_constant_value_sfinae): Add decl parameter.
1734 * pt.cc (fold_targs_r): Pass NULL_TREE as decl parameter to
1735 cxx_constant_value_sfinae.
1736
1737 2022-03-24 Jakub Jelinek <jakub@redhat.com>
1738
1739 PR c++/104994
1740 * constexpr.cc (cxx_eval_constant_expression): Don't diagnose passing
1741 through extern thread_local declarations. Change wording from
1742 declaration to definition.
1743 (potential_constant_expression_1): Don't diagnose extern thread_local
1744 declarations. Change wording from declared to defined.
1745 * decl.cc (start_decl): Likewise.
1746
1747 2022-03-23 Jason Merrill <jason@redhat.com>
1748
1749 PR c++/103337
1750 * decl.cc (reshape_single_init): New.
1751 (reshape_init_class): Use it.
1752
1753 2022-03-23 Jason Merrill <jason@redhat.com>
1754
1755 PR c++/105006
1756 * name-lookup.cc (lookup_using_decl): Check that scope is
1757 a dependent type before looking for dependent using.
1758
1759 2022-03-23 Jason Merrill <jason@redhat.com>
1760
1761 PR c++/105006
1762 * name-lookup.cc (lookup_using_decl): Set DECL_DEPENDENT_P if lookup
1763 finds a dependent using.
1764
1765 2022-03-21 Jason Merrill <jason@redhat.com>
1766
1767 PR c++/58646
1768 * init.cc (build_vec_init): Check for vla element type.
1769
1770 2022-03-21 Jason Merrill <jason@redhat.com>
1771
1772 PR c++/103337
1773 PR c++/102740
1774 PR c++/103299
1775 PR c++/102538
1776 * decl.cc (reshape_init_class): Avoid looking for designator
1777 after we found it.
1778 (reshape_init_r): Keep looking for designator.
1779
1780 2022-03-21 Jason Merrill <jason@redhat.com>
1781
1782 PR c++/101767
1783 * decl.cc (reshape_init_class): Back out of anon struct
1784 if a designator doesn't match.
1785
1786 2022-03-18 Jason Merrill <jason@redhat.com>
1787
1788 PR c++/92918
1789 PR c++/104476
1790 * class.cc (add_method): Avoid adding the same used function twice.
1791 (handle_using_decl): Don't add_method.
1792 (finish_struct): Don't using op= if we have one already.
1793 (maybe_push_used_methods): New.
1794 * semantics.cc (finish_member_declaration): Call it.
1795 * name-lookup.cc (diagnose_name_conflict): No longer static.
1796 (push_class_level_binding): Revert 92918 patch, limit
1797 to dependent using.
1798 * cp-tree.h: Adjust.
1799
1800 2022-03-18 Jakub Jelinek <jakub@redhat.com>
1801
1802 PR c++/104568
1803 * init.cc (build_new_constexpr_heap_type): Remove FULL_SIZE
1804 argument and its handling, instead add ITYPE2 argument. Only
1805 support COOKIE_SIZE != NULL.
1806 (build_new_1): If size is 0, change it to 0 * outer_nelts if
1807 outer_nelts is non-NULL. Pass type rather than elt_type to
1808 maybe_wrap_new_for_constexpr.
1809 * constexpr.cc (build_new_constexpr_heap_type): New function.
1810 (cxx_eval_constant_expression) <case CONVERT_EXPR>:
1811 If elt_size is zero sized type, try to recover outer_nelts from
1812 the size argument to operator new/new[] and pass that as
1813 arg_size to build_new_constexpr_heap_type. Pass ctx,
1814 non_constant_p and overflow_p to that call too.
1815
1816 2022-03-18 Marek Polacek <polacek@redhat.com>
1817
1818 PR c++/104008
1819 * tree.cc (strip_typedefs): Don't strip an alias template when
1820 doing so would result in losing a parameter pack.
1821
1822 2022-03-16 Patrick Palka <ppalka@redhat.com>
1823
1824 * search.cc (lookup_member): Simplify by handling all values
1825 of protect together in the ambiguous case. Don't modify protect.
1826
1827 2022-03-16 Patrick Palka <ppalka@redhat.com>
1828
1829 PR c++/96780
1830 * cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls to
1831 std::move/forward and other cast-like functions into simple
1832 casts.
1833
1834 2022-03-15 Patrick Palka <ppalka@redhat.com>
1835
1836 PR c++/103177
1837 * search.cc (lookup_field_info::errstr): Remove this data
1838 member.
1839 (lookup_field_r): Don't set errstr.
1840 (lookup_member): Check ambiguity before checking access.
1841 Simplify accordingly after errstr removal. Exit early upon
1842 error or empty result.
1843
1844 2022-03-15 Jakub Jelinek <jakub@redhat.com>
1845
1846 PR c++/104623
1847 * parser.cc (cp_parser_skip_to_pragma_eol): Don't purge any tokens.
1848
1849 2022-03-14 Jakub Jelinek <jakub@redhat.com>
1850
1851 PR tree-optimization/102586
1852 * call.cc (build_cxx_call): Diagnose __builtin_clear_padding where
1853 first argument's type is pointer to non-trivially-copyable type unless
1854 it is address of a variable or parameter.
1855
1856 2022-03-12 Patrick Palka <ppalka@redhat.com>
1857
1858 PR c++/104641
1859 * cp-tree.h (tsubst_flags::tf_tst_ok): New flag.
1860 * decl.cc (make_typename_type): Allow a typename-specifier to
1861 resolve to a template when tf_tst_ok, in which case return
1862 a CTAD placeholder for the template.
1863 * pt.cc (tsubst_decl) <case VAR_DECL>: Set tf_tst_ok when
1864 substituting the type.
1865 (tsubst): Clear tf_tst_ok and remember if it was set.
1866 <case TYPENAME_TYPE>: Pass tf_tst_ok to make_typename_type
1867 appropriately.
1868 (tsubst_copy) <case CAST_EXPR>: Set tf_tst_ok when substituting
1869 the type.
1870 (tsubst_copy_and_build) <case CAST_EXPR>: Likewise.
1871 <case CONSTRUCTOR>: Likewise.
1872
1873 2022-03-12 Patrick Palka <ppalka@redhat.com>
1874
1875 PR c++/104622
1876 * call.cc (missing_conversion_p): Define.
1877 (add_candidates): Use it.
1878 * pt.cc (check_non_deducible_conversion): Change type of strict
1879 parameter to unification_kind_t and directly test for DEDUCE_CALL.
1880
1881 2022-03-12 Patrick Palka <ppalka@redhat.com>
1882
1883 PR c++/104527
1884 * constraint.cc (normalize_atom): Set
1885 ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P appropriately.
1886 (get_mapped_args): Make static, adjust parameters. Always
1887 return a vector whose depth corresponds to the template depth of
1888 the context of the atomic constraint expression. Micro-optimize
1889 by passing false as exact to safe_grow_cleared and by collapsing
1890 a multi-level depth-one argument vector.
1891 (satisfy_atom): Adjust call to get_mapped_args and
1892 diagnose_atomic_constraint.
1893 (diagnose_atomic_constraint): Replace map parameter with an args
1894 parameter.
1895 * cp-tree.h (ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P): Define.
1896 (get_mapped_args): Remove declaration.
1897
1898 2022-03-12 Patrick Palka <ppalka@redhat.com>
1899 Jason Merrill <jason@redhat.com>
1900
1901 PR c++/98644
1902 * constexpr.cc (mark_non_constant): Define, split out from ...
1903 (cxx_eval_outermost_constant_expr): ... here.
1904 (maybe_constant_value): Use it.
1905
1906 2022-03-12 Patrick Palka <ppalka@redhat.com>
1907
1908 * semantics.cc (finish_unary_fold_expr): Use input_location
1909 instead of UNKNOWN_LOCATION.
1910 (finish_binary_fold_expr): Likewise.
1911
1912 2022-03-12 Thomas Schwinge <thomas@codesourcery.com>
1913
1914 PR other/65095
1915 * semantics.cc (handle_omp_array_sections_1)
1916 (cp_oacc_check_attachments): Call 'user_omp_clause_code_name'
1917 instead of 'c_omp_map_clause_name'.
1918
1919 2022-03-10 Marek Polacek <polacek@redhat.com>
1920
1921 PR c++/104608
1922 * parser.cc (cp_parser_template_name): Repeat lookup of
1923 TYPE_DECLs.
1924
1925 2022-03-10 Marek Polacek <polacek@redhat.com>
1926
1927 PR c++/104752
1928 * semantics.cc (finish_compound_literal): Disallow auto{x} for
1929 is_constrained_auto.
1930 * typeck2.cc (build_functional_cast_1): Likewise.
1931
1932 2022-03-10 Marek Polacek <polacek@redhat.com>
1933
1934 PR c++/104846
1935 * decl.cc (grokdeclarator): Check FUNC_OR_METHOD_TYPE_P before giving
1936 data member errors.
1937
1938 2022-03-10 Jakub Jelinek <jakub@redhat.com>
1939
1940 PR c++/103460
1941 * decl.cc (grok_op_properties): Allow variadic operator[] for
1942 C++23.
1943
1944 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
1945
1946 PR c++/95999
1947 * decl.cc (finish_enum_value_list): If VALUE isn't an INTEGER_CST
1948 consider it to be zero (i.e. treat it like error_mark_node).
1949 (build_enumerator): Likewise, if PREV_VALUE isn't an INTEGER_CST,
1950 set VALUE to error_mark_node.
1951
1952 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
1953
1954 PR c++/39751
1955 * parser.cc (cp_parser_late_parsing_for_member): Confirm the token
1956 stream hasn't been purged before processing DECL_PENDING_INLINE.
1957
1958 2022-03-09 Patrick Palka <ppalka@redhat.com>
1959
1960 PR c++/104823
1961 * except.cc (build_noexcept_spec): Strengthen dependence check
1962 to instantiation_dependent_expression_p.
1963 * parser.cc (cp_parser_parenthesized_expression_list_elt):
1964 Remove fold_expr_p parameter, and don't call
1965 instantiate_non_dependent_expr.
1966 (cp_parser_parenthesized_expression_list): Adjust accordingly.
1967 * pt.cc (expand_integer_pack): Strengthen dependence check
1968 to instantiation_dependent_expression_p.
1969 (instantiate_non_dependent_expr_internal): Adjust comment.
1970 (instantiate_non_dependent_expr_sfinae): Likewise. Drop
1971 the potentially-constant check, and relax and turn the
1972 dependence check into a checking assert.
1973 (instantiate_non_dependent_or_null): Adjust comment.
1974 * semantics.cc (finish_decltype_type): Keep
1975 processing_template_decl cleared after calling
1976 instantiate_non_dependent_expr_sfinae.
1977
1978 2022-03-09 Patrick Palka <ppalka@redhat.com>
1979
1980 PR c++/102137
1981 PR c++/87820
1982 * cp-tree.h (is_copy_initialization): Declare.
1983 * decl.cc (cp_finish_decl): Set LOOKUP_ONLYCONVERTING
1984 when is_copy_initialization is true.
1985 * init.cc (build_aggr_init): Split out copy-initialization
1986 check into ...
1987 (is_copy_initialization): ... here.
1988 * pt.cc (instantiate_decl): Pass 0 instead of
1989 LOOKUP_ONLYCONVERTING as flags to cp_finish_decl.
1990
1991 2022-03-09 Patrick Palka <ppalka@redhat.com>
1992
1993 PR c++/65396
1994 * cp-tree.h (merge_default_template_args): Declare.
1995 * decl.cc (merge_default_template_args): Define, factored out
1996 from redeclare_class_template.
1997 (duplicate_decls): Use it when merging member function template
1998 and free function declarations.
1999 * pt.cc (redeclare_class_template): Factor out default argument
2000 merging logic into merge_default_template_args. Improve location
2001 of a note when there's a template parameter kind mismatch.
2002
2003 2022-03-09 Jakub Jelinek <jakub@redhat.com>
2004
2005 PR c/104711
2006 * constexpr.cc (cxx_eval_check_shift_p): Use TYPE_OVERFLOW_WRAPS
2007 instead of TYPE_UNSIGNED.
2008 * typeck.cc (cp_build_binary_op): Don't emit
2009 -Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
2010
2011 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
2012
2013 PR c++/96440
2014 * decl.cc (start_decl): Defend against prefix_attributes being
2015 error_mark_node.
2016
2017 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
2018
2019 PR c++/96437
2020 * parser.cc (synthesize_implicit_template_parm): Check that
2021 TREE_VALUE (new_parm) isn't error_mark_node before setting its
2022 DECL_VIRTUAL_P.
2023
2024 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
2025
2026 PR c++/96329
2027 * parser.cc (cp_parser_linkage_specification): Treat the case where
2028 linkage is error_mark_node as "invalid linkage-specification".
2029
2030 2022-03-08 Marek Polacek <polacek@redhat.com>
2031
2032 PR c++/104108
2033 * pt.cc (convert_nontype_argument): Recompute
2034 value_dependent_expression_p after build_converted_constant_expr.
2035
2036 2022-03-08 Marek Polacek <polacek@redhat.com>
2037
2038 * decl2.cc (is_late_template_attribute): Do not defer attribute
2039 unavailable.
2040 * pt.cc (tsubst_enum): Set TREE_UNAVAILABLE.
2041
2042 2022-03-08 Jakub Jelinek <jakub@redhat.com>
2043
2044 PR c++/104806
2045 * search.cc (lookup_field_fuzzy_info::fuzzy_lookup_field): Ignore
2046 identifiers with space at the end.
2047
2048 2022-03-07 Jason Merrill <jason@redhat.com>
2049
2050 PR c++/104618
2051 * decl2.cc (mark_single_function): Look through parens and location
2052 wrapper.
2053 * typeck.cc (cp_build_addr_expr_1): Not here.
2054
2055 2022-03-07 Jakub Jelinek <jakub@redhat.com>
2056
2057 * parser.cc (cp_parser_omp_clause_map): Add missing space in string
2058 literal.
2059
2060 2022-03-07 Jakub Jelinek <jakub@redhat.com>
2061
2062 * cvt.cc: Fix up duplicated word issue in a comment.
2063 * pt.cc: Likewise.
2064 * module.cc: Likewise.
2065 * coroutines.cc: Likewise.
2066
2067 2022-03-04 Nathan Sidwell <nathan@acm.org>
2068
2069 * mangle.cc (is_std_substitution): Check global module.
2070 (is_std_substitution_char): Return bool.
2071
2072 2022-03-04 Nathan Sidwell <nathan@acm.org>
2073
2074 * cp-tree.h (mangle_identifier): Replace with ...
2075 (mangle_module_component): ... this.
2076 * mangle.cc (dump_substitution_candidates): Adjust.
2077 (add_substitution): Likewise.
2078 (find_substitution): Likewise.
2079 (unmangled_name_p): Likewise.
2080 (mangle_module_substitution): Reimplement.
2081 (mangle_module_component): New.
2082 (write_module, maybe_write_module): Adjust.
2083 (write_name): Drop modules here.
2084 (write_unqualified): Do them here instead.
2085 (mangle_global_init): Adjust.
2086 * module.cc (module_state::mangle): Adjust.
2087 (mangle_module): Likewise.
2088 (get_originating_module): Adjust.
2089
2090 2022-02-28 Marek Polacek <polacek@redhat.com>
2091
2092 PR c++/104682
2093 * cp-tree.h (build_enumerator): Adjust.
2094 * decl.cc (finish_enum): Make it return the new decl.
2095 * pt.cc (tsubst_enum): Propagate TREE_DEPRECATED and TREE_UNAVAILABLE.
2096
2097 2022-02-28 Marek Polacek <polacek@redhat.com>
2098
2099 PR c++/104667
2100 * decl2.cc (is_late_template_attribute): Cope with a decl without
2101 a type.
2102
2103 2022-02-27 Jason Merrill <jason@redhat.com>
2104
2105 PR c++/104618
2106 * typeck.cc (cp_build_addr_expr_1): Also
2107 maybe_undo_parenthesized_ref.
2108
2109 2022-02-24 Martin Liska <mliska@suse.cz>
2110
2111 * pt.cc (defarg_insts_for): Use braces for subobject.
2112
2113 2022-02-18 Patrick Palka <ppalka@redhat.com>
2114
2115 PR c++/94944
2116 * pt.cc (maybe_instantiate_noexcept): For non-static member
2117 functions, set current_class_ptr/ref to the specialized 'this'
2118 instead.
2119
2120 2022-02-17 Jason Merrill <jason@redhat.com>
2121
2122 PR c++/104539
2123 * pt.cc (mark_decl_instantiated): Don't clear DECL_COMDAT.
2124
2125 2022-02-17 Jason Merrill <jason@redhat.com>
2126
2127 PR c++/90451
2128 * decl2.cc (mark_single_function): New.
2129 * cp-tree.h: Declare it.
2130 * typeck.cc (cp_build_addr_expr_1): mark_used when making a PMF.
2131 * semantics.cc (finish_qualified_id_expr): Not here.
2132 (finish_id_expression_1): Or here.
2133 (finish_decltype_type): Call mark_single_function.
2134 * cvt.cc (convert_to_void): And here.
2135 * pt.cc (convert_nontype_argument): And here.
2136 * init.cc (build_offset_ref): Adjust assert.
2137
2138 2022-02-17 Patrick Palka <ppalka@redhat.com>
2139
2140 PR c++/104565
2141 * semantics.cc (finish_compound_literal): Don't perform
2142 non-dependent expr folding before calling check_narrowing.
2143
2144 2022-02-16 Patrick Palka <ppalka@redhat.com>
2145
2146 PR c++/104507
2147 * constexpr.cc (potential_constant_expression_1)
2148 <case NON_DEPENDENT_EXPR>: Return false instead of recursing.
2149 Assert tf_error isn't set.
2150
2151 2022-02-15 Jason Merrill <jason@redhat.com>
2152
2153 PR c++/104107
2154 PR c++/95036
2155 * pt.cc (coerce_template_template_parms): Take full parms.
2156 Avoid adding too much of outer_args.
2157 (coerce_template_template_parm): Adjust.
2158 (template_template_parm_bindings_ok_p): Adjust.
2159 (convert_template_argument): Adjust.
2160
2161 2022-02-14 Jakub Jelinek <jakub@redhat.com>
2162
2163 PR c++/104513
2164 * constexpr.cc (potential_constant_expression_1) <case GOTO_EXPR>:
2165 Don't punt if returns (target).
2166
2167 2022-02-11 Jakub Jelinek <jakub@redhat.com>
2168
2169 PR c++/104472
2170 * constexpr.cc (cxx_eval_internal_function) <case IFN_VEC_CONVERT>:
2171 Only return fold_const_call result if it is non-NULL. Otherwise
2172 fall through into the default: case to return t, set *non_constant_p
2173 and emit diagnostics if needed.
2174
2175 2022-02-10 Jason Merrill <jason@redhat.com>
2176
2177 * module.cc (depset::hash::add_specializations): Use
2178 STRIP_TEMPLATE.
2179
2180 2022-02-10 Tobias Burnus <tobias@codesourcery.com>
2181
2182 PR c++/102204
2183 * decl2.cc (cp_omp_mappable_type_1): Remove check for virtual
2184 members as those are permitted since OpenMP 5.0.
2185
2186 2022-02-10 Patrick Palka <ppalka@redhat.com>
2187
2188 * pt.cc (filter_memfn_lookup): Handle dependent USING_DECL
2189 better.
2190
2191 2022-02-10 Marcel Vollweiler <marcel@codesourcery.com>
2192
2193 * parser.cc (cp_parser_omp_clause_name): Parse 'has_device_addr' clause.
2194 (cp_parser_omp_var_list_no_open): Handle array sections.
2195 (cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
2196 case.
2197 (cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK.
2198 * semantics.cc (handle_omp_array_sections): Handle clause restrictions.
2199 (finish_omp_clauses): Handle array sections.
2200
2201 2022-02-09 Patrick Palka <ppalka@redhat.com>
2202
2203 PR c++/104432
2204 * call.cc (build_new_method_call): When a non-dependent call
2205 resolves to a specialization of a member template, always build
2206 the pruned overload set using the member template, not the
2207 specialization.
2208 * pt.cc (filter_memfn_lookup): New parameter newtype. Simplify
2209 and correct how members from the new lookup set are matched to
2210 those from the old one.
2211 (tsubst_baselink): Pass binfo_type as newtype to
2212 filter_memfn_lookup.
2213
2214 2022-02-09 Jason Merrill <jason@redhat.com>
2215
2216 PR c++/103752
2217 * module.cc (trees_out::core_vals): Stream explicit specifier.
2218 (trees_in::core_vals): Likewise.
2219 * pt.cc (store_explicit_specifier): No longer static.
2220 (tsubst_function_decl): Clear DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
2221 * cp-tree.h (lookup_explicit_specifier): Declare.
2222
2223 2022-02-09 Jason Merrill <jason@redhat.com>
2224
2225 PR c++/96876
2226 * typeck2.cc (split_nonconstant_init_1): Push cleanups for
2227 preceding members with constant initialization.
2228 (maybe_push_temp_cleanup): Do nothing if -fno-exceptions.
2229
2230 2022-02-08 Jakub Jelinek <jakub@redhat.com>
2231
2232 PR c++/104379
2233 * name-lookup.cc (check_local_shadow): When diagnosing shadowing
2234 of a member or global declaration, add warning suppression for
2235 the decl and don't warn again on it.
2236
2237 2022-02-08 Jakub Jelinek <jakub@redhat.com>
2238
2239 PR c++/104403
2240 * constexpr.cc (cxx_eval_constant_expression): Don't assert DECL_EXPRs
2241 of TREE_STATIC vars may only appear in -std=c++23.
2242
2243 2022-02-08 Patrick Palka <ppalka@redhat.com>
2244
2245 PR c++/80951
2246 * pt.cc (uses_deducible_template_parms): Consider the
2247 noexcept-spec of a function type.
2248
2249 2022-02-08 Patrick Palka <ppalka@redhat.com>
2250
2251 PR c++/104410
2252 * constraint.cc (satisfaction_value): Relax assert to accept
2253 cv-qualified bool.
2254
2255 2022-02-08 Patrick Palka <ppalka@redhat.com>
2256
2257 PR c++/103706
2258 * pt.cc (preserve_args): New function.
2259 (tsubst_lambda_expr): Use it when setting LAMBDA_EXPR_REGEN_INFO.
2260
2261 2022-02-08 Patrick Palka <ppalka@redhat.com>
2262
2263 PR c++/103706
2264 * constraint.cc (satisfy_declaration_constraints): Use
2265 lambda_regenerating_args instead.
2266 * cp-tree.h (lambda_regenerating_args): Declare.
2267 * pt.cc (lambda_regenerating_args): Define, split out from
2268 satisfy_declaration_constraints.
2269 (do_auto_deduction): Use lambda_regenerating_args to obtain the
2270 full set of outer template arguments for satisfaction when
2271 inside a lambda.
2272
2273 2022-02-06 Patrick Palka <ppalka@redhat.com>
2274
2275 PR c++/96242
2276 * decl2.cc (mark_used): Directly synthesize a DECL_MAYBE_DELETED
2277 fn by calling maybe_synthesize_method instead of relying on
2278 maybe_instantiate_noexcept. Move call to m_i_n after the
2279 DECL_DELETED_FN handling.
2280 * pt.cc (maybe_instantiate_noexcept): Restrict DECL_MAYBE_DELETED
2281 fn synthesis to only those with an implicit noexcept-spec, and
2282 return !DECL_DELETED_FN instead of !DECL_MAYBE_DELETED afterwards.
2283
2284 2022-02-06 Jakub Jelinek <jakub@redhat.com>
2285
2286 PR c++/89074
2287 PR c++/104033
2288 * constexpr.cc (cxx_eval_binary_expression): Temporarily set
2289 folding_cxx_constexpr.
2290
2291 2022-02-05 Jason Merrill <jason@redhat.com>
2292
2293 PR c++/104300
2294 PR c++/92385
2295 * cp-tree.h (get_vec_init_expr): New.
2296 (target_expr_needs_replace): New.
2297 * cp-gimplify.cc (cp_gimplify_init_expr): Use it.
2298 (struct cp_fold_data): New.
2299 (cp_fold_r): Only genericize inits at end of fn.
2300 (cp_fold_function): Here.
2301 (cp_fully_fold_init): Not here.
2302 * init.cc (build_vec_init): Use get_vec_init_expr.
2303 * tree.cc (build_vec_init_expr): Likewise.
2304 * typeck2.cc (split_nonconstant_init_1): Likewise.
2305 (process_init_constructor): Wrap VEC_INIT_EXPR in
2306 TARGET_EXPR.
2307
2308 2022-02-05 Jason Merrill <jason@redhat.com>
2309
2310 * pt.cc (iterative_hash_template_arg): Add comment.
2311
2312 2022-02-03 Patrick Palka <ppalka@redhat.com>
2313
2314 PR c++/104079
2315 * pt.cc (value_dependent_noexcept_spec_p): New predicate split
2316 out from ...
2317 (dependent_type_p_r): ... here.
2318 (instantiation_dependent_r): Use value_dependent_noexcept_spec_p
2319 to consider dependence of a noexcept-spec before C++17.
2320 * tree.cc (fixup_deferred_exception_variants): Clear
2321 TYPE_DEPENDENT_P_VALID.
2322
2323 2022-02-03 Jason Merrill <jason@redhat.com>
2324
2325 PR c++/104302
2326 * decl.cc (maybe_deduce_size_from_array_init): Give up
2327 on type-dependent init.
2328 (cp_complete_array_type): Only call reshape_init for character
2329 array.
2330
2331 2022-02-01 Jason Merrill <jason@redhat.com>
2332
2333 PR c++/103186
2334 * pt.cc (defarg_inst): Use tree_vec_map_cache_hasher.
2335 (defarg_insts_for): New.
2336 (tsubst_default_argument): Adjust.
2337
2338 2022-01-31 Marek Polacek <polacek@redhat.com>
2339
2340 PR c++/102414
2341 PR c++/101874
2342 * decl.cc (create_array_type_for_decl): Use template_placeholder_p.
2343 Sorry on a variable-length array of auto.
2344
2345 2022-01-31 Marek Polacek <polacek@redhat.com>
2346
2347 PR c++/102434
2348 * class.cc (finish_struct): Don't allow union initializer_list.
2349
2350 2022-01-31 Patrick Palka <ppalka@redhat.com>
2351
2352 PR c++/104294
2353 * pt.cc (ctor_deduction_guides_for): Correct computation of
2354 outer_args.
2355
2356 2022-01-31 Patrick Palka <ppalka@redhat.com>
2357
2358 PR c++/104291
2359 * pt.cc (for_each_template_parm_r) <case CONSTRUCTOR>: Clear
2360 walk_subtrees if !include_nondeduced_p. Simplify given that
2361 cp_walk_subtrees already walks TYPE_PTRMEMFUNC_FN_TYPE_RAW.
2362
2363 2022-01-28 Patrick Palka <ppalka@redhat.com>
2364 Jason Merrill <jason@redhat.com>
2365
2366 PR c++/92752
2367 * typeck.cc (build_ptrmemfunc): Cast a nullptr constant to the
2368 unqualified pointer type not the qualified one.
2369
2370 2022-01-28 Patrick Palka <ppalka@redhat.com>
2371
2372 PR c++/103341
2373 * decl.cc (cp_finish_decl): Pass the template arguments of a
2374 variable template specialization or a templated static data
2375 member to do_auto_deduction when the auto is constrained.
2376
2377 2022-01-28 Jason Merrill <jason@redhat.com>
2378
2379 PR c++/100198
2380 PR c++/100030
2381 PR c++/100282
2382 * parser.cc (cp_parser_enumerator_definition): Sorry on parameter
2383 pack in lambda.
2384 (cp_parser_class_head): And in class attributes.
2385 * pt.cc (check_for_bare_parameter_packs): Sorry instead of error
2386 in lambda.
2387
2388 2022-01-27 Jason Merrill <jason@redhat.com>
2389
2390 PR c++/104245
2391 PR c++/51344
2392 * decl2.cc (save_template_attributes): Take late attrs as parm.
2393 (cplus_decl_attributes): Call it after decl_attributes,
2394 splice_template_attributes before.
2395
2396 2022-01-27 Patrick Palka <ppalka@redhat.com>
2397
2398 PR c++/99895
2399 * call.cc (build_over_call): For a non-dependent member call,
2400 build up a CALL_EXPR using a COMPONENT_REF callee, as in
2401 build_new_method_call.
2402 * pt.cc (build_non_dependent_expr): Don't wrap PARM_DECL either.
2403 * tree.cc (build_min_non_dep_op_overload): Adjust accordingly
2404 after the build_over_call change.
2405
2406 2022-01-27 Patrick Palka <ppalka@redhat.com>
2407
2408 PR c++/92944
2409 PR c++/103678
2410 * parser.cc (cp_parser_class_head): Update 'type' with the result
2411 of maybe_process_partial_specialization in the
2412 nested_name_specifier branch. Refactor nearby code to accomodate
2413 that maybe_process_partial_specialization returns a _TYPE, not a
2414 TYPE_DECL, and eliminate local variable 'class_type' in passing.
2415
2416 2022-01-27 Marek Polacek <polacek@redhat.com>
2417
2418 PR c++/101988
2419 * decl.cc (create_array_type_for_decl): Reject forming an array of
2420 placeholder for a deduced class type.
2421
2422 2022-01-26 Jason Merrill <jason@redhat.com>
2423
2424 PR c++/104206
2425 PR c++/101072
2426 * semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
2427
2428 2022-01-26 Jakub Jelinek <jakub@redhat.com>
2429
2430 PR c++/104226
2431 * constexpr.cc (init_subob_ctx): For vector ctors containing
2432 vector elements, ensure appending to the same ctor instead of
2433 creating another one.
2434
2435 2022-01-26 Marek Polacek <polacek@redhat.com>
2436
2437 PR target/104213
2438 * decl.cc (finish_constructor_body): Suppress -Wuse-after-free.
2439 (finish_destructor_body): Likewise.
2440 * optimize.cc (build_delete_destructor_body): Likewise.
2441
2442 2022-01-26 Jason Merrill <jason@redhat.com>
2443
2444 PR c++/104235
2445 * parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.
2446
2447 2022-01-26 Jason Merrill <jason@redhat.com>
2448
2449 PR c++/103057
2450 * pt.cc (tsubst_aggr_type): Call tsubst for alias template
2451 specialization.
2452
2453 2022-01-25 Patrick Palka <ppalka@redhat.com>
2454
2455 PR c++/101532
2456 PR c++/104225
2457 * decl2.cc (mark_used): Don't consider maybe_instantiate_noexcept
2458 on a deleted function.
2459
2460 2022-01-25 Jason Merrill <jason@redhat.com>
2461
2462 PR c++/59950
2463 * call.cc (build_over_call): Use cp_build_indirect_ref.
2464
2465 2022-01-24 Patrick Palka <ppalka@redhat.com>
2466
2467 PR c++/104197
2468 * pt.cc (make_auto_1): Use -1 as a placeholder default argument
2469 for level.
2470
2471 2022-01-24 Patrick Palka <ppalka@redhat.com>
2472
2473 PR c++/104173
2474 * typeck.cc (build_class_member_access_expr): Extend
2475 unary_complex_lvalue result adjustment to preserve all
2476 rvalues, not just xvalues.
2477
2478 2022-01-23 Will Wray <wjwray@gmail.com>
2479
2480 PR c++/55227
2481 * decl.cc (reshape_init_r): Only call has_designator_check when
2482 first_initializer_p or for the inner constructor element.
2483 (cp_complete_array_type): Call reshape_init on braced-init-list.
2484
2485 2022-01-23 Jason Merrill <jason@redhat.com>
2486
2487 PR c++/104182
2488 * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing
2489 has set DECL_INITIAL on a TARGET_EXPR slot.
2490 * tree.cc (is_local_temp): Don't check DECL_CONTEXT.
2491
2492 2022-01-23 Jason Merrill <jason@redhat.com>
2493
2494 PR c++/101072
2495 * cp-tree.h (build_implicit_conv_flags): Declare.
2496 * call.cc (build_implicit_conv_flags): Split out from...
2497 (perform_implicit_conversion_flags): ...here.
2498 * decl.cc (check_initializer): Use it.
2499 * pt.cc (tsubst_copy_and_build): Remove TARGET_EXPR handling.
2500 * semantics.cc (finish_compound_literal): Don't treat
2501 scalar values like CONSTRUCTORs.
2502
2503 2022-01-21 Jason Merrill <jason@redhat.com>
2504
2505 * semantics.cc (find_failing_clause): Return expr if not
2506 decomposable.
2507 (finish_static_assert): Show constant values in failing
2508 comparison.
2509
2510 2022-01-21 Jason Merrill <jason@redhat.com>
2511
2512 PR c++/104084
2513 PR c++/20040
2514 * init.cc (build_new_1): Only pull out TARGET_EXPR_INITIAL if
2515 alloc_expr is a TARGET_EXPR.
2516
2517 2022-01-21 Marek Polacek <polacek@redhat.com>
2518
2519 PR c++/101715
2520 * tree.cc (fixup_deferred_exception_variants): Remove duplicate
2521 variants after parsing the exception specifications.
2522
2523 2022-01-21 Jason Merrill <jason@redhat.com>
2524
2525 PR c++/104139
2526 PR c++/103681
2527 * class.cc (end_of_class): Use base_binfo.
2528
2529 2022-01-20 Jason Merrill <jason@redhat.com>
2530
2531 PR c++/101405
2532 * decl.cc (reshape_init_class): Reject designator for a member of
2533 another class.
2534
2535 2022-01-20 Patrick Palka <ppalka@redhat.com>
2536
2537 PR c++/91911
2538 PR c++/103672
2539 * pt.cc (keep_template_parm): Punt on a level 0 template parm.
2540 (tsubst_decl) <case VAR_DECL>: Remove !CHECKING_P safeguard.
2541 (tsubst) <case TEMPLATE_TYPE_PARM>: Handle CTAD placeholders
2542 specially.
2543 (make_auto_1): Add defaulted 'level' parameter.
2544 (make_template_placeholder): Pass 0 as 'level' to make_auto_1.
2545
2546 2022-01-20 Patrick Palka <ppalka@redhat.com>
2547
2548 * decl.cc (grokdeclarator): Diagnose a CTAD placeholder as
2549 function return type even when !funcdecl_p.
2550
2551 2022-01-20 Martin Liska <mliska@suse.cz>
2552
2553 PR c++/104134
2554 * error.cc (dump_aggr_type): Partially disable the warning.
2555
2556 2022-01-20 Jason Merrill <jason@redhat.com>
2557
2558 PR c++/102300
2559 * parser.cc (cp_parser_template_name): Use dependent_scope_p.
2560
2561 2022-01-19 David Malcolm <dmalcolm@redhat.com>
2562
2563 * cp-lang.cc (selftest::run_cp_tests): Update calls for .c to .cc
2564 renaming.
2565 * cp-tree.h (cp_pt_c_tests): Rename to...
2566 (cp_pt_cc_tests): ...this.
2567 (cp_tree_c_tests): Rename to...
2568 (cp_tree_cc_tests): ...this.
2569 * pt.cc (cp_pt_c_tests): Rename to...
2570 (cp_pt_cc_tests): ...this.
2571 * tree.cc (cp_tree_c_tests): Rename to...
2572 (cp_tree_cc_tests): ...this.
2573
2574 2022-01-19 Jason Merrill <jason@redhat.com>
2575
2576 * parser.cc (saved_token_sentinel::rollback): Use
2577 cp_lexer_previous_token.
2578
2579 2022-01-18 Jakub Jelinek <jakub@redhat.com>
2580
2581 PR c++/104055
2582 * constexpr.cc (cxx_eval_outermost_constant_expr): If t is a
2583 TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
2584 than get_target_expr_sfinae with tf_no_cleanup, and don't set
2585 TREE_CONSTANT.
2586
2587 2022-01-18 Jason Merrill <jason@redhat.com>
2588 Jakub Jelinek <jakub@redhat.com>
2589
2590 PR c++/104025
2591 * parser.cc (saved_token_sentinel::rollback): Call
2592 cp_lexer_set_source_position.
2593 (~saved_token_sentinel): Call rollback.
2594
2595 2022-01-18 Patrick Palka <ppalka@redhat.com>
2596
2597 PR c++/104074
2598 * pt.cc (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
2599 that we return false for DEPENDENT_OPERATOR_TYPE too.
2600
2601 2022-01-17 Martin Liska <mliska@suse.cz>
2602
2603 * Make-lang.in: Rename .c names to .cc.
2604 * config-lang.in: Likewise.
2605 * constexpr.cc (cxx_eval_constant_expression): Likewise.
2606 * coroutines.cc (morph_fn_to_coro): Likewise.
2607 * cp-gimplify.cc (cp_gimplify_expr): Likewise.
2608 * cp-lang.cc (struct lang_hooks): Likewise.
2609 (get_template_argument_pack_elems_folded): Likewise.
2610 * cp-objcp-common.cc (cp_tree_size): Likewise.
2611 (cp_unit_size_without_reusable_padding): Likewise.
2612 (pop_file_scope): Likewise.
2613 (cp_pushdecl): Likewise.
2614 * cp-objcp-common.h (GCC_CP_OBJCP_COMMON): Likewise.
2615 (cxx_simulate_record_decl): Likewise.
2616 * cp-tree.h (struct named_label_entry): Likewise.
2617 (current_function_return_value): Likewise.
2618 (more_aggr_init_expr_args_p): Likewise.
2619 (get_function_version_dispatcher): Likewise.
2620 (common_enclosing_class): Likewise.
2621 (strip_fnptr_conv): Likewise.
2622 (current_decl_namespace): Likewise.
2623 (do_aggregate_paren_init): Likewise.
2624 (cp_check_const_attributes): Likewise.
2625 (qualified_name_lookup_error): Likewise.
2626 (generic_targs_for): Likewise.
2627 (mark_exp_read): Likewise.
2628 (is_global_friend): Likewise.
2629 (maybe_reject_flexarray_init): Likewise.
2630 (module_token_lang): Likewise.
2631 (handle_module_option): Likewise.
2632 (literal_integer_zerop): Likewise.
2633 (build_extra_args): Likewise.
2634 (build_if_nonnull): Likewise.
2635 (maybe_check_overriding_exception_spec): Likewise.
2636 (finish_omp_target_clauses): Likewise.
2637 (maybe_warn_zero_as_null_pointer_constant): Likewise.
2638 (cxx_print_error_function): Likewise.
2639 (decl_in_std_namespace_p): Likewise.
2640 (merge_exception_specifiers): Likewise.
2641 (mangle_module_global_init): Likewise.
2642 (cxx_block_may_fallthru): Likewise.
2643 (fold_builtin_source_location): Likewise.
2644 (enum cp_oracle_request): Likewise.
2645 (subsumes): Likewise.
2646 (cp_finish_injected_record_type): Likewise.
2647 (vtv_build_vtable_verify_fndecl): Likewise.
2648 (cp_tree_c_finish_parsing): Likewise.
2649 * cvt.cc (diagnose_ref_binding): Likewise.
2650 (convert_to_void): Likewise.
2651 (convert_force): Likewise.
2652 (type_promotes_to): Likewise.
2653 * decl.cc (make_unbound_class_template_raw): Likewise.
2654 (cxx_init_decl_processing): Likewise.
2655 (check_class_member_definition_namespace): Likewise.
2656 (cxx_maybe_build_cleanup): Likewise.
2657 * decl2.cc (maybe_emit_vtables): Likewise.
2658 * error.cc (dump_function_name): Likewise.
2659 * init.cc (is_class_type): Likewise.
2660 (build_new_1): Likewise.
2661 * lang-specs.h: Likewise.
2662 * method.cc (make_alias_for_thunk): Likewise.
2663 * module.cc (specialization_add): Likewise.
2664 (module_state::read_cluster): Likewise.
2665 * name-lookup.cc (check_extern_c_conflict): Likewise.
2666 * name-lookup.h (struct cxx_binding): Likewise.
2667 * parser.cc (cp_parser_identifier): Likewise.
2668 * parser.h (struct cp_parser): Likewise.
2669 * pt.cc (has_value_dependent_address): Likewise.
2670 (push_tinst_level_loc): Likewise.
2671 * semantics.cc (finish_omp_clauses): Likewise.
2672 (finish_omp_atomic): Likewise.
2673 * tree.cc (cp_save_expr): Likewise.
2674 (cp_free_lang_data): Likewise.
2675 * typeck.cc (cp_common_type): Likewise.
2676 (strip_array_domain): Likewise.
2677 (rationalize_conditional_expr): Likewise.
2678 (check_return_expr): Likewise.
2679 * vtable-class-hierarchy.cc: Likewise.
2680
2681 2022-01-17 Martin Liska <mliska@suse.cz>
2682
2683 * call.c: Moved to...
2684 * call.cc: ...here.
2685 * class.c: Moved to...
2686 * class.cc: ...here.
2687 * constexpr.c: Moved to...
2688 * constexpr.cc: ...here.
2689 * cp-gimplify.c: Moved to...
2690 * cp-gimplify.cc: ...here.
2691 * cp-lang.c: Moved to...
2692 * cp-lang.cc: ...here.
2693 * cp-objcp-common.c: Moved to...
2694 * cp-objcp-common.cc: ...here.
2695 * cp-ubsan.c: Moved to...
2696 * cp-ubsan.cc: ...here.
2697 * cvt.c: Moved to...
2698 * cvt.cc: ...here.
2699 * cxx-pretty-print.c: Moved to...
2700 * cxx-pretty-print.cc: ...here.
2701 * decl.c: Moved to...
2702 * decl.cc: ...here.
2703 * decl2.c: Moved to...
2704 * decl2.cc: ...here.
2705 * dump.c: Moved to...
2706 * dump.cc: ...here.
2707 * error.c: Moved to...
2708 * error.cc: ...here.
2709 * except.c: Moved to...
2710 * except.cc: ...here.
2711 * expr.c: Moved to...
2712 * expr.cc: ...here.
2713 * friend.c: Moved to...
2714 * friend.cc: ...here.
2715 * g++spec.c: Moved to...
2716 * g++spec.cc: ...here.
2717 * init.c: Moved to...
2718 * init.cc: ...here.
2719 * lambda.c: Moved to...
2720 * lambda.cc: ...here.
2721 * lex.c: Moved to...
2722 * lex.cc: ...here.
2723 * mangle.c: Moved to...
2724 * mangle.cc: ...here.
2725 * method.c: Moved to...
2726 * method.cc: ...here.
2727 * name-lookup.c: Moved to...
2728 * name-lookup.cc: ...here.
2729 * optimize.c: Moved to...
2730 * optimize.cc: ...here.
2731 * parser.c: Moved to...
2732 * parser.cc: ...here.
2733 * pt.c: Moved to...
2734 * pt.cc: ...here.
2735 * ptree.c: Moved to...
2736 * ptree.cc: ...here.
2737 * rtti.c: Moved to...
2738 * rtti.cc: ...here.
2739 * search.c: Moved to...
2740 * search.cc: ...here.
2741 * semantics.c: Moved to...
2742 * semantics.cc: ...here.
2743 * tree.c: Moved to...
2744 * tree.cc: ...here.
2745 * typeck.c: Moved to...
2746 * typeck.cc: ...here.
2747 * typeck2.c: Moved to...
2748 * typeck2.cc: ...here.
2749 * vtable-class-hierarchy.c: Moved to...
2750 * vtable-class-hierarchy.cc: ...here.
2751
2752 2022-01-17 Jakub Jelinek <jakub@redhat.com>
2753
2754 PR c++/104031
2755 * cp-gimplify.c (cp_genericize_target_expr): Set DECL_CONTEXT of
2756 TARGET_EXPR_SLOT to current_function_decl if it was NULL.
2757
2758 2022-01-17 Andrew Stubbs <ams@codesourcery.com>
2759
2760 * parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.
2761
2762 2022-01-14 Chung-Lin Tang <cltang@codesourcery.com>
2763
2764 PR c++/103705
2765 * semantics.c (finish_omp_clauses): Also continue peeling off of
2766 outer node for ARRAY_REFs.
2767
2768 2022-01-14 Jakub Jelinek <jakub@redhat.com>
2769
2770 PR c++/103991
2771 * cp-objcp-common.c (cxx_block_may_fallthru) <case IF_STMT>: For
2772 IF_STMT_CONSTEXPR_P with constant false or true condition only
2773 check if the taken clause may fall through.
2774 * cp-gimplify.c (genericize_if_stmt): For consteval if, revert
2775 to r12-5638^ behavior if then_ block can't fall through. For
2776 constexpr if, revert to r12-5638^ behavior.
2777
2778 2022-01-13 Anthony Sharp <anthonysharp15@gmail.com>
2779 Jason Merrill <jason@redhat.com>
2780
2781 PR c++/70417
2782 * parser.c (cp_parser_id_expression): Handle
2783 -Wmissing-template-keyword.
2784 (struct saved_token_sentinel): Add modes to control what happens
2785 on destruction.
2786 (cp_parser_statement): Adjust.
2787 (cp_parser_skip_entire_template_parameter_list): New function that
2788 skips an entire template parameter list.
2789 (cp_parser_require_end_of_template_parameter_list): Rename old
2790 cp_parser_skip_to_end_of_template_parameter_list.
2791 (cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
2792 called from one of the above two functions.
2793 (cp_parser_lambda_declarator_opt)
2794 (cp_parser_explicit_template_declaration)
2795 (cp_parser_enclosed_template_argument_list): Adjust.
2796
2797 2022-01-12 Jakub Jelinek <jakub@redhat.com>
2798 Jason Merrill <jason@redhat.com>
2799
2800 PR c++/103480
2801 * tree.c (move): If expr is xvalue_p, just return expr without
2802 build_static_cast.
2803
2804 2022-01-11 Jakub Jelinek <jakub@redhat.com>
2805
2806 PR c++/101597
2807 * class.c (build_vfn_ref): Build OBJ_TYPE_REF with INTEGER_CST
2808 OBJ_TYPE_REF_TOKEN with type equal to OBJ_TYPE_REF_OBJECT type.
2809 * error.c (resolve_virtual_fun_from_obj_type_ref): Use type of
2810 OBJ_TYPE_REF_TOKEN rather than type of OBJ_TYPE_REF_OBJECT as
2811 obj_type.
2812
2813 2022-01-11 Patrick Palka <ppalka@redhat.com>
2814
2815 PR c++/103831
2816 * call.c (build_new_method_call): Consider dependent bases only
2817 if 'this' is available.
2818
2819 2022-01-11 Olivier Hainque <hainque@adacore.com>
2820
2821 * decl.c (cxx_init_decl_processing): Move code possibly
2822 altering flag_weak before code testing it.
2823
2824 2022-01-10 Patrick Palka <ppalka@redhat.com>
2825
2826 PR c++/103879
2827 * constexpr.c (cxx_fold_indirect_ref): Split out object/offset
2828 canonicalization step into a local lambda. Strengthen it to
2829 absorb more components at position 0. Use it before both calls
2830 to cxx_fold_indirect_ref_1.
2831
2832 2022-01-10 Patrick Palka <ppalka@redhat.com>
2833
2834 PR c++/103783
2835 * call.c (cand_parms_match): Skip over 'this' when given one
2836 static and one non-static member function.
2837
2838 2022-01-10 Jakub Jelinek <jakub@redhat.com>
2839
2840 PR c++/103912
2841 * semantics.c (expand_or_defer_fn): For immediate functions, set
2842 node->body_removed to true and clear analyzed, definition and
2843 force_output.
2844 * decl2.c (c_parse_final_cleanups): Ignore immediate functions for
2845 expand_or_defer_fn.
2846
2847 2022-01-08 Jakub Jelinek <jakub@redhat.com>
2848
2849 PR c++/89074
2850 * constexpr.c (cxx_maybe_fold_addr_pointer_plus): New function.
2851 (cxx_eval_binary_expression): Use it.
2852
2853 2022-01-08 Jason Merrill <jason@redhat.com>
2854
2855 PR c++/103946
2856 * init.c (build_vec_init): Remove assert.
2857 * tree.c (build_vec_init_expr): Likewise.
2858
2859 2022-01-08 Jason Merrill <jason@redhat.com>
2860
2861 PR c++/100588
2862 * call.c (build_op_delete_call): Ignore destroying delete
2863 if alloc_fn.
2864
2865 2022-01-07 Jason Merrill <jason@redhat.com>
2866
2867 PR c++/20040
2868 * init.c (build_new_1): Also build pointer cleanup if
2869 TYPE_GETS_DELETE.
2870 * cp-tree.h (TYPE_GETS_VEC_DELETE): New.
2871
2872 2022-01-07 Jason Merrill <jason@redhat.com>
2873
2874 PR c++/103936
2875 PR c++/65591
2876 * cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling.
2877
2878 2022-01-07 Jason Merrill <jason@redhat.com>
2879
2880 PR c++/103711
2881 * init.c (perform_target_ctor): Select destructor by in_chrg.
2882
2883 2022-01-07 Jason Merrill <jason@redhat.com>
2884
2885 PR c++/61611
2886 * except.c (in_nested_catch): New.
2887 (expand_end_catch_block): Check it.
2888
2889 2022-01-07 Jason Merrill <jason@redhat.com>
2890
2891 PR c++/33799
2892 PR c++/102191
2893 * except.c (maybe_splice_retval_cleanup): Check
2894 current_binding_level.
2895 * semantics.c (do_poplevel): Call it here.
2896 * parser.c (cp_parser_compound_statement): Not here.
2897
2898 2022-01-07 Jason Merrill <jason@redhat.com>
2899
2900 PR c++/53868
2901 * decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
2902 cleanups from set_up_extended_ref_temp.
2903 (wrap_temporary_cleanups): Ignore array cleanups.
2904 (initialize_local_var): Don't check for array here.
2905 * cp-tree.h (BIND_EXPR_VEC_DTOR): New.
2906 * init.c (build_vec_delete_1): Set it.
2907
2908 2022-01-07 Jason Merrill <jason@redhat.com>
2909
2910 PR c++/66451
2911 * init.c (build_vec_delete_1): Handle throwing dtor.
2912 (build_vec_init): Tell it we're in a cleanup already.
2913
2914 2022-01-07 Jason Merrill <jason@redhat.com>
2915
2916 * typeck2.c (split_nonconstant_init_1): Don't cleanup the last elt.
2917 (split_nonconstant_init): Adjust.
2918
2919 2022-01-07 Jason Merrill <jason@redhat.com>
2920
2921 PR c++/66139
2922 PR c++/52320
2923 * constexpr.c (replace_decl): Rename from replace_result_decl.
2924 * cp-tree.h (replace_decl): Declare it.
2925 * cp-gimplify.c (cp_gimplify_init_expr): Call it.
2926 (cp_gimplify_expr): Don't handle VEC_INIT_EXPR.
2927 (cp_genericize_init, cp_genericize_init_expr)
2928 (cp_genericize_target_expr): New.
2929 (cp_fold_r): Call them.
2930 * tree.c (build_array_copy): Add a TARGET_EXPR.
2931 * typeck2.c (digest_init_r): Look through a TARGET_EXPR.
2932
2933 2022-01-07 Jason Merrill <jason@redhat.com>
2934
2935 PR c++/94041
2936 * decl.c (initialize_local_var): Fix comment.
2937 * init.c (build_new_1): Do stabilize array init.
2938 (build_vec_init): Use TARGET_EXPR for cleanup. Initialization
2939 of an element from an explicit initializer is not a
2940 full-expression.
2941 * tree.c (expand_vec_init_expr): Pass flags through.
2942 * typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
2943 (split_nonconstant_init): Handle array cleanups.
2944 * cp-tree.h: Adjust.
2945
2946 2022-01-07 Jason Merrill <jason@redhat.com>
2947
2948 PR c++/94041
2949 * decl.c (check_initializer): Remove obsolete comment.
2950 (wrap_cleanups_r): Don't wrap CLEANUP_EH_ONLY.
2951 (initialize_local_var): Change assert to test.
2952 * typeck2.c (maybe_push_temp_cleanup): New.
2953 (split_nonconstant_init_1): Use it.
2954 (split_nonconstant_init): Clear cleanup flags.
2955
2956 2022-01-07 Jason Merrill <jason@redhat.com>
2957
2958 PR c++/92385
2959 * typeck2.c (PICFLAG_VEC_INIT): New.
2960 (process_init_constructor_array): Set it.
2961 (process_init_constructor): Handle it.
2962 (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
2963 * init.c (build_vec_init): Likewise.
2964 * cp-gimplify.c (cp_gimplify_expr): Factor out...
2965 * tree.c (expand_vec_init_expr): ...this function.
2966 (build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P.
2967 (build_vec_init_expr): Likewise.
2968 * constexpr.c (cxx_eval_vec_init): Likewise.
2969 (reduced_constant_expression_p): Check arrays before C++20.
2970 * cp-tree.h (expand_vec_init_expr): Declare.
2971
2972 2022-01-07 Jason Merrill <jason@redhat.com>
2973
2974 * init.c (build_new_1): Remove preevaluation code.
2975
2976 2022-01-05 Nathan Sidwell <nathan@acm.org>
2977
2978 * pt.c (instantiate_class_template_1): Process attribute((used)) set
2979 in class's context.
2980
2981 2022-01-05 Nathan Sidwell <nathan@acm.org>
2982
2983 * init.c (build_new_1): Check complain before alignment warning.
2984
2985 2022-01-04 Jason Merrill <jason@redhat.com>
2986
2987 * cp-tree.h (class releasing_vec): Add begin/end fns.
2988
2989 2022-01-04 Jason Merrill <jason@redhat.com>
2990
2991 * init.c: Include -*- C++ -*- on first line.
2992
2993 2022-01-03 Marek Polacek <polacek@redhat.com>
2994
2995 PR c++/103758
2996 * parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
2997 with %qD.
2998
2999 2022-01-03 Marek Polacek <polacek@redhat.com>
3000
3001 * parser.c (make_char_string_pack): Add a cast to const unsigned
3002 char *.
3003
3004 2022-01-03 Jakub Jelinek <jakub@redhat.com>
3005
3006 PR c++/103600
3007 * rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
3008 to DECL_TINFO_P VAR_DECLs.
3009
3010 2022-01-02 Jason Merrill <jason@redhat.com>
3011
3012 * init.c (build_vec_init): Append the decrement to elt_init.
3013
3014 2022-01-02 Jason Merrill <jason@redhat.com>
3015
3016 * decl.c (wrap_cleanups_r): Don't wrap if noexcept.
3017
3018 \f
3019 Copyright (C) 2022 Free Software Foundation, Inc.
3020
3021 Copying and distribution of this file, with or without modification,
3022 are permitted in any medium without royalty provided the copyright
3023 notice and this notice are preserved.