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