]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/cp/ChangeLog
Daily bump.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
1 2023-12-05 Jakub Jelinek <jakub@redhat.com>
2
3 PR c++/112795
4 * cp-tree.h (cp_check_pragma_unroll): Declare.
5 * semantics.cc (cp_check_pragma_unroll): New function.
6 * parser.cc (cp_parser_pragma_unroll): Use cp_check_pragma_unroll.
7 * pt.cc (tsubst_expr) <case ANNOTATE_EXPR>: Likewise.
8 (tsubst_stmt) <case RANGE_FOR_STMT>: Likwsie.
9
10 2023-12-05 Richard Sandiford <richard.sandiford@arm.com>
11
12 * tree.cc (cxx_gnu_attribute_table): Add extra braces to work
13 around PR 16333 in older compilers.
14
15 2023-12-05 Jakub Jelinek <jakub@redhat.com>
16
17 PR c++/110734
18 * parser.cc (cp_parser_block_declaration): Implement C++ DR 2262
19 - Attributes for asm-definition. Call cp_parser_asm_definition
20 even if RID_ASM token is only seen after sequence of standard
21 attributes.
22 (cp_parser_asm_definition): Parse standard attributes before
23 RID_ASM token and warn for them with -Wattributes.
24
25 2023-12-05 Marek Polacek <polacek@redhat.com>
26
27 PR c++/107687
28 PR c++/110997
29 * call.cc (in_immediate_context): No longer static.
30 * constexpr.cc (cxx_eval_call_expression): Adjust assert.
31 * cp-gimplify.cc (deferred_escalating_exprs): New vec.
32 (remember_escalating_expr): New.
33 (enum fold_flags): Remove ff_fold_immediate.
34 (immediate_escalating_function_p): New.
35 (unchecked_immediate_escalating_function_p): New.
36 (promote_function_to_consteval): New.
37 (cp_fold_immediate): Move above. Return non-null if any errors were
38 emitted.
39 (maybe_explain_promoted_consteval): New.
40 (cp_gimplify_expr) <case CALL_EXPR>: Assert we've handled all
41 immediate invocations.
42 (taking_address_of_imm_fn_error): New.
43 (cp_fold_immediate_r): Merge ADDR_EXPR and PTRMEM_CST cases. Implement
44 P2564 - promoting functions to consteval.
45 <case CALL_EXPR>: Implement P2564 - promoting functions to consteval.
46 (cp_fold_r): If an expression turns into a CALL_EXPR after cp_fold,
47 call cp_fold_immediate_r on the CALL_EXPR.
48 (cp_fold_function): Set DECL_ESCALATION_CHECKED_P if
49 deferred_escalating_exprs does not contain current_function_decl.
50 (process_and_check_pending_immediate_escalating_fns): New.
51 * cp-tree.h (struct lang_decl_fn): Add escalated_p bit-field.
52 (DECL_ESCALATION_CHECKED_P): New.
53 (immediate_invocation_p): Declare.
54 (process_pending_immediate_escalating_fns): Likewise.
55 * decl2.cc (c_parse_final_cleanups): Set at_eof to 2 after all
56 templates have been instantiated; and to 3 at the end of the function.
57 Call process_pending_immediate_escalating_fns.
58 * error.cc (dump_template_bindings): Check at_eof against an updated
59 value.
60 * module.cc (trees_out::lang_decl_bools): Stream escalated_p.
61 (trees_in::lang_decl_bools): Likewise.
62 * pt.cc (push_tinst_level_loc): Set at_eof to 3, not 2.
63 * typeck.cc (cp_build_addr_expr_1): Don't check
64 DECL_IMMEDIATE_FUNCTION_P.
65
66 2023-12-04 Jason Merrill <jason@redhat.com>
67
68 * constexpr.cc (potential_constant_expression_1): Fix
69 check for loading volatile lvalue.
70
71 2023-12-04 Jakub Jelinek <jakub@redhat.com>
72
73 PR c++/112795
74 * cp-tree.h (cp_convert_range_for): Change UNROLL type from
75 unsigned short to tree.
76 (finish_while_stmt_cond, finish_do_stmt, finish_for_cond): Likewise.
77 * parser.cc (cp_parser_statement): Pass NULL_TREE rather than 0 to
78 cp_parser_iteration_statement UNROLL argument.
79 (cp_parser_for, cp_parser_c_for): Change UNROLL type from
80 unsigned short to tree.
81 (cp_parser_range_for): Likewise. Set RANGE_FOR_UNROLL to just UNROLL
82 rather than build_int_cst from it.
83 (cp_convert_range_for, cp_parser_iteration_statement): Change UNROLL
84 type from unsigned short to tree.
85 (cp_parser_omp_loop_nest): Pass NULL_TREE rather than 0 to
86 cp_parser_range_for UNROLL argument.
87 (cp_parser_pragma_unroll): Return tree rather than unsigned short.
88 If parsed expression is type dependent, just return it, don't diagnose
89 issues with value if it is value dependent.
90 (cp_parser_pragma): Change UNROLL type from unsigned short to tree.
91 * semantics.cc (finish_while_stmt_cond): Change UNROLL type from
92 unsigned short to tree. Build ANNOTATE_EXPR with UNROLL as its last
93 operand rather than build_int_cst from it.
94 (finish_do_stmt, finish_for_cond): Likewise.
95 * pt.cc (tsubst_stmt) <case RANGE_FOR_STMT>: Change UNROLL type from
96 unsigned short to tree and set it to RECUR on RANGE_FOR_UNROLL (t).
97 (tsubst_expr) <case ANNOTATE_EXPR>: For annot_expr_unroll_kind repeat
98 checks on UNROLL value from cp_parser_pragma_unroll.
99
100 2023-12-02 Richard Sandiford <richard.sandiford@arm.com>
101
102 * cp-tree.h (cxx_attribute_table): Delete.
103 (cxx_gnu_attribute_table, std_attribute_table): Declare.
104 * cp-objcp-common.h (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Delete.
105 (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Delete.
106 (cp_objcp_attribute_table): New table.
107 (LANG_HOOKS_ATTRIBUTE_TABLE): Redefine.
108 * tree.cc (cxx_attribute_table): Replace with...
109 (cxx_gnu_attributes, cxx_gnu_attribute_table): ...these globals.
110 (std_attribute_table): Change type to scoped_attribute_specs, using...
111 (std_attributes): ...this as the underlying array.
112 (init_tree): Remove call to register_scoped_attributes.
113
114 2023-12-01 Jason Merrill <jason@redhat.com>
115
116 * mangle.cc (write_type): Mangle placeholder as its template.
117
118 2023-12-01 Jason Merrill <jason@redhat.com>
119
120 * cp-tree.h (TEMPLATE_ARGS_TYPE_CONSTRAINT_P): New.
121 (get_concept_check_template): Declare.
122 * constraint.cc (combine_constraint_expressions)
123 (finish_shorthand_constraint): Use UNKNOWN_LOCATION.
124 * pt.cc (convert_generic_types_to_packs): Likewise.
125 * mangle.cc (write_constraint_expression)
126 (write_tparms_constraints, write_type_constraint)
127 (template_parm_natural_p, write_requirement)
128 (write_requires_expr): New.
129 (write_encoding): Mangle trailing requires-clause.
130 (write_name): Pass parms to write_template_args.
131 (write_template_param_decl): Factor out from...
132 (write_closure_template_head): ...here.
133 (write_template_args): Mangle non-natural parms
134 and requires-clause.
135 (write_expression): Handle REQUIRES_EXPR.
136
137 2023-12-01 Jason Merrill <jason@redhat.com>
138
139 * semantics.cc (finish_non_static_data_member)
140 (finish_decltype_type, capture_decltype):
141 Handle deduced closure parameter.
142
143 2023-11-30 Marek Polacek <polacek@redhat.com>
144
145 PR c++/112744
146 * typeck.cc (finish_class_member_access_expr): When accessing
147 a static data member, use ba_any for lookup_base.
148
149 2023-11-30 Jakub Jelinek <jakub@redhat.com>
150
151 PR c++/110349
152 * cp-tree.h: Implement C++26 P2169R4 - Placeholder variables with no
153 name.
154 (OVL_NAME_INDEPENDENT_DECL_P): Define.
155 (add_capture): Add unsigned * argument.
156 (name_independent_decl_p): New inline function.
157 * name-lookup.cc (class name_lookup): Make ambiguous and
158 add_value members public.
159 (name_independent_linear_search): New function.
160 (get_class_binding_direct): Handle member_vec_binary_search
161 returning OVL_NAME_INDEPENDENT_DECL_P OVERLOAD. Use
162 name_independent_linear_search rather than fields_linear_search
163 for linear lookup of _ name if !want_type.
164 (member_name_cmp): Sort name-independent declarations first.
165 (member_vec_dedup): Handle name-independent declarations.
166 (pop_local_binding): Handle binding->value being a TREE_LIST for
167 ambiguous name-independent declarations.
168 (supplement_binding): Handle name-independent declarations.
169 (update_binding): Likewise.
170 (check_local_shadow): Return tree rather than void, normally
171 NULL_TREE but old for name-independent declarations which used
172 to conflict with outer scope declaration. Don't emit -Wshadow*
173 warnings for name-independent declarations.
174 (pushdecl): Handle name-independent declarations.
175 * search.cc (lookup_field_r): Handle nval being a TREE_LIST.
176 * lambda.cc (build_capture_proxy): Adjust for ___.<number>
177 names of members.
178 (add_capture): Add NAME_INDEPENDENT_CNT argument. Use ___.<number>
179 name rather than ___ for second and following capture with
180 _ name.
181 (add_default_capture): Adjust add_capture caller.
182 * decl.cc (poplevel): Don't warn about name-independent declarations.
183 (duplicate_decls): If in C++26 a _ named declaration conflicts with
184 earlier declarations, emit explaining note why the new declaration
185 is not name-independent.
186 (reshape_init_class): If field is a TREE_LIST, emit an ambiguity
187 error with list of candidates rather than error about non-existing
188 non-static data member.
189 * parser.cc (cp_parser_lambda_introducer): Adjust add_capture callers.
190 Allow name-independent capture redeclarations.
191 (cp_parser_decomposition_declaration): Set decl_specs.storage_class
192 to sc_static for static structured bindings.
193 * pt.cc (tsubst_lambda_expr): Adjust add_capture caller.
194
195 2023-11-30 Alexandre Oliva <oliva@adacore.com>
196
197 * decl.cc (finish_enum_value_list): Set TYPE_PACKED if
198 use_short_enum, and propagate it to variants.
199
200 2023-11-30 Jason Merrill <jason@redhat.com>
201
202 * cp-tree.h (LAMBDA_EXPR_MUTABLE_P): Remove.
203 * cp-tree.def: Remove documentation.
204 * lambda.cc (build_lambda_expr): Remove reference.
205 * parser.cc (cp_parser_lambda_declarator_opt): Likewise.
206 * pt.cc (tsubst_lambda_expr): Likewise.
207 * ptree.cc (cxx_print_lambda_node): Likewise.
208 * semantics.cc (capture_decltype): Get the object quals
209 from the object instead.
210
211 2023-11-29 Marek Polacek <polacek@redhat.com>
212
213 PR c++/106650
214 * constexpr.cc (cxx_eval_constant_expression) <case PARM_DECL>: Allow
215 reference to unknown/this as per P2280.
216 <case VAR_DECL>: Allow reference to unknown as per P2280.
217
218 2023-11-29 Patrick Palka <ppalka@redhat.com>
219
220 PR c++/112765
221 * pt.cc (tsubst_expr) <case MODOP_EXPR>: Look through implicit
222 INDIRECT_REF when propagating -Wparentheses warning suppression.
223 * semantics.cc (maybe_warn_unparenthesized_assignment): Replace
224 REFERENCE_REF_P handling with STRIP_REFERENCE_REF.
225 (finish_parenthesized_expr): Likewise.
226
227 2023-11-29 Jakub Jelinek <jakub@redhat.com>
228
229 * semantics.cc (finish_static_assert): Free buf on error return.
230
231 2023-11-29 Alexandre Oliva <oliva@adacore.com>
232
233 * decl.cc (maybe_prepare_return_this): Split out of...
234 (maybe_return_this): ... this.
235 * cp-tree.h (maybe_prepare_return_this): Declare.
236 * class.cc (build_clone): Call it.
237
238 2023-11-29 Alexandre Oliva <oliva@adacore.com>
239
240 * contracts.cc (check_postcondition_result): Cope with
241 cdtor_return_this.
242
243 2023-11-28 Jason Merrill <jason@redhat.com>
244
245 PR c++/94264
246 PR c++/53220
247 * call.cc (convert_like_internal): Remove obsolete comment.
248 * typeck.cc (decay_conversion): Allow array prvalue.
249 (maybe_warn_about_returning_address_of_local): Check
250 for returning pointer to temporary.
251
252 2023-11-28 Jakub Jelinek <jakub@redhat.com>
253
254 * cp-objcp-common.cc (cp_feature_table): Evaluate
255 __has_extension (cxx_init_captures) to 1 even for -std=c++11.
256
257 2023-11-27 Alex Coplan <alex.coplan@arm.com>
258 Iain Sandoe <iain@sandoe.co.uk>
259
260 PR c++/60512
261 * cp-lang.cc (c_family_register_lang_features): New.
262 * cp-objcp-common.cc (struct cp_feature_selector): New.
263 (cp_feature_selector::has_feature): New.
264 (struct cp_feature_info): New.
265 (cp_register_features): New.
266 * cp-objcp-common.h (cp_register_features): New.
267
268 2023-11-25 Nathaniel Shead <nathanieloshead@gmail.com>
269
270 * name-lookup.cc (check_can_export_using_decl): New.
271 (do_nonmember_using_decl): Use above to check if names can be
272 exported.
273
274 2023-11-25 Nathaniel Shead <nathanieloshead@gmail.com>
275
276 PR c++/102341
277 * decl.cc (duplicate_decls): Allow exporting a redeclaration of
278 a typedef.
279
280 2023-11-24 Tobias Burnus <tobias@codesourcery.com>
281
282 * parser.cc (cp_parser_omp_clause_dist_schedule,
283 cp_parser_omp_scan_loop_body, cp_parser_omp_assumption_clauses,
284 cp_parser_omp_depobj): Add OPT_Wopenmp to warning_at.
285 * semantics.cc (finish_omp_clauses): Likewise.
286
287 2023-11-24 Tobias Burnus <tobias@codesourcery.com>
288
289 * parser.cc (cp_parser_omp_depobj): Accept optionally an argument
290 to the destroy clause.
291
292 2023-11-24 Nathaniel Shead <nathanieloshead@gmail.com>
293
294 PR c++/99232
295 * decl.cc (grokvardecl): Don't mark variables attached to
296 modules as internal.
297
298 2023-11-24 Nathaniel Shead <nathanieloshead@gmail.com>
299
300 PR c++/107398
301 * module.cc (trees_out::get_merge_kind): Handle lambdas in class
302 scope.
303 (maybe_key_decl): Remove assertion and fix whitespace.
304
305 2023-11-24 Nathaniel Shead <nathanieloshead@gmail.com>
306
307 PR c++/98885
308 * decl.cc (duplicate_decls): Adjust error message.
309 (xref_tag): Adjust error message. Check exporting decl that is
310 already declared as non-exporting.
311
312 2023-11-23 Jakub Jelinek <jakub@redhat.com>
313
314 PR c++/110348
315 * parser.cc: Implement C++26 P2741R3 - user-generated static_assert
316 messages.
317 (cp_parser_static_assert): Parse message argument as
318 conditional-expression if it is not a pure string literal or
319 several of them concatenated followed by closing paren.
320 * semantics.cc (finish_static_assert): Handle message which is not
321 STRING_CST. For condition with bare parameter packs return early.
322 * pt.cc (tsubst_expr) <case STATIC_ASSERT>: Also tsubst_expr
323 message and make sure that if it wasn't originally STRING_CST, it
324 isn't after tsubst_expr either.
325
326 2023-11-22 Patrick Palka <ppalka@redhat.com>
327
328 PR c++/112633
329 * pt.cc (tsubst_aggr_type): Handle empty TYPE_TEMPLATE_INFO
330 in the entering_scope adjustment.
331
332 2023-11-22 Jason Merrill <jason@redhat.com>
333
334 * decl.cc (start_preparsed_function): Clarify ctype logic.
335
336 2023-11-20 Marc Poulhiès <dkm@kataplop.net>
337
338 * lambda.cc (compare_lambda_sig): Fix typo in variadic.
339
340 2023-11-20 Jason Merrill <jason@redhat.com>
341
342 * pt.cc (comp_template_parms): Just one level.
343 (template_parameter_lists_equivalent_p): Likewise.
344
345 2023-11-20 Jason Merrill <jason@redhat.com>
346
347 * cp-tree.h (DECL_TEMPLATE_PARM_CHECK): New.
348 (DECL_IMPLICIT_TEMPLATE_PARM_P): New.
349 (decl_template_parm_check): New.
350 * mangle.cc (write_closure_template_head): Use it.
351 * parser.cc (synthesize_implicit_template_parm): Likewise.
352 * pt.cc (template_parameters_equivalent_p): Likewise.
353
354 2023-11-19 Nathaniel Shead <nathanieloshead@gmail.com>
355
356 PR c++/99187
357 * cp-tree.h (enum cp_tree_index): Add CPTI_THREAD_ATEXIT.
358 (thread_atexit_node): New.
359 * decl.cc (get_thread_atexit_node): Cache in thread_atexit_node.
360
361 2023-11-19 David Malcolm <dmalcolm@redhat.com>
362
363 * mapper-client.cc: Include "rich-location.h".
364
365 2023-11-16 Jakub Jelinek <jakub@redhat.com>
366
367 PR c++/112365
368 * class.cc (layout_class_type): Don't
369 SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD on FIELD_DECLs with
370 error_mark_node type.
371
372 2023-11-16 Patrick Palka <ppalka@redhat.com>
373
374 PR c++/111703
375 PR c++/107939
376 * constexpr.cc (potential_constant_expression_1) <case CALL_EXPR>:
377 Fix FUNCTION_POINTER_TYPE_P test.
378
379 2023-11-16 Marek Polacek <polacek@redhat.com>
380
381 PR c++/112410
382 * parser.cc (cp_parser_direct_declarator): Maybe call
383 abort_fully_implicit_template if it turned out the parameter list was
384 ill-formed.
385
386 2023-11-15 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
387
388 * tree.cc (build_cplus_array_type): Revert using the macro
389 CAN_HAVE_LOCATION_P.
390
391 2023-11-15 Patrick Palka <ppalka@redhat.com>
392
393 PR c++/112515
394 * decl.cc (is_direct_enum_init): Check type-dependence of the
395 single element.
396
397 2023-11-15 Patrick Palka <ppalka@redhat.com>
398
399 PR c++/101043
400 * tree.cc (strip_typedefs_expr) <case TREE_LIST>: Handle
401 non-empty TREE_PURPOSE.
402
403 2023-11-15 Patrick Palka <ppalka@redhat.com>
404
405 PR c++/112427
406 * tree.cc (build_min_non_dep): Propagate TREE_SIDE_EFFECTS from
407 the original arguments.
408 (build_min_non_dep_call_vec): Likewise.
409 * typeck2.cc (build_m_component_ref): Use cp_convert, build2 and
410 cp_fully_fold instead of fold_build_pointer_plus and fold_convert.
411 Don't build the POINTER_PLUS_EXPR in a template context.
412
413 2023-11-15 Patrick Palka <ppalka@redhat.com>
414
415 PR c++/111703
416 PR c++/112269
417 * constexpr.cc (potential_constant_expression_1) <case VAR_DECL>:
418 Only consider var_in_maybe_constexpr_fn if 'now' is false.
419 <case INDIRECT_REF>: Likewise.
420
421 2023-11-15 Jakub Jelinek <jakub@redhat.com>
422
423 * typeck.cc: Implement C++26 P2864R2 - Remove Deprecated Arithmetic
424 Conversion on Enumerations From C++26.
425 (do_warn_enum_conversions): Return bool rather than void, add COMPLAIN
426 argument. Use pedwarn rather than warning_at for C++26 and remove
427 " is deprecated" part of the diagnostics in that case. For SFINAE
428 in C++26 return true on newly erroneous cases.
429 (cp_build_binary_op): For C++26 call do_warn_enum_conversions
430 unconditionally, pass complain argument to it and if it returns true,
431 return error_mark_node.
432 * call.cc (build_conditional_expr): Use pedwarn rather than warning_at
433 for C++26 and remove " is deprecated" part of the diagnostics in that
434 case and check for complain & tf_warning_or_error. Use emit_diagnostic
435 with cxx_dialect >= cxx26 ? DK_PEDWARN : DK_WARNING. For SFINAE in
436 C++26 return error_mark_node on newly erroneous cases.
437 (build_new_op): Use emit_diagnostic with cxx_dialect >= cxx26
438 ? DK_PEDWARN : DK_WARNING and complain & tf_warning_or_error check
439 for C++26. For SFINAE in C++26 return error_mark_node on newly
440 erroneous cases.
441
442 2023-11-14 Nathaniel Shead <nathanieloshead@gmail.com>
443
444 PR c++/103499
445 * module.cc (trees_out::decl_node): Write DECL_VINDEX for
446 virtual clones.
447 (trees_in::tree_node): Read DECL_VINDEX for virtual clones.
448
449 2023-11-14 Nathaniel Shead <nathanieloshead@gmail.com>
450
451 PR c++/106849
452 * name-lookup.cc (do_nonmember_using_decl): Handle
453 TEMPLATE_DECLs when checking module attachment.
454
455 2023-11-14 David Malcolm <dmalcolm@redhat.com>
456
457 * decl.cc (finish_function): Update call to
458 global_dc->m_option_enabled to use option_enabled_p.
459
460 2023-11-14 David Malcolm <dmalcolm@redhat.com>
461
462 * contracts.cc (build_comment): Use global_dc's file_cache.
463
464 2023-11-14 Jonathan Wakely <jwakely@redhat.com>
465
466 PR c++/111842
467 PR c++/112498
468 * call.cc (convert_like_internal): Use OPT_Wnarrowing for
469 pedwarns about illformed conversions involving extended
470 floating-point types. Clarify that ISO C++ requires these
471 diagnostics.
472
473 2023-11-14 Jakub Jelinek <jakub@redhat.com>
474
475 PR c/111309
476 * call.cc (magic_varargs_p): Return 4 for
477 BUILT_IN_{CLZ,CTZ,CLRSB,FFS,PARITY,POPCOUNT}G.
478 (build_over_call): Don't promote first argument of
479 BUILT_IN_{CLZ,CTZ,CLRSB,FFS,PARITY,POPCOUNT}G.
480 * cp-gimplify.cc (cp_gimplify_expr): For BUILT_IN_C{L,T}ZG use
481 c_gimplify_expr.
482
483 2023-11-10 Patrick Palka <ppalka@redhat.com>
484
485 PR c++/79620
486 * cp-tree.h (STRIP_REFERENCE_REF): Define.
487 * semantics.cc (outer_var_p): Assert REFERENCE_REF_P is false.
488 (finish_decltype_type): Look through implicit INDIRECT_REF when
489 deciding whether to call capture_decltype.
490
491 2023-11-10 Patrick Palka <ppalka@redhat.com>
492
493 PR c++/79378
494 PR c++/96917
495 * semantics.cc (finish_decltype_type): Handle an id-expression
496 naming a capture proxy specially.
497
498 2023-11-07 Kwok Cheung Yeung <kcy@codesourcery.com>
499
500 * cp-tree.h (cp_omp_declare_target_attr): Add indirect field.
501 * decl2.cc (cplus_decl_attributes): Add attribute for indirect
502 functions.
503 * parser.cc (cp_parser_omp_clause_name): Handle indirect clause.
504 (cp_parser_omp_clause_indirect): New.
505 (cp_parser_omp_all_clauses): Handle indirect clause.
506 (handle_omp_declare_target_clause): Add extra parameter. Add
507 indirect attribute for indirect functions.
508 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add indirect clause to mask.
509 (cp_parser_omp_declare_target): Handle indirect clause. Emit error
510 message if device_type or indirect clauses used alone. Emit error
511 if indirect clause used with device_type that is not 'any'.
512 (OMP_BEGIN_DECLARE_TARGET_CLAUSE_MASK): Add indirect clause to mask.
513 (cp_parser_omp_begin): Handle indirect clause.
514 * semantics.cc (finish_omp_clauses): Handle indirect clause.
515
516 2023-11-04 Jakub Jelinek <jakub@redhat.com>
517
518 * parser.h (struct cp_parser): Adjust comment on omp_attrs_forbidden_p
519 member.
520 * parser.cc (cp_parser_omp_section_scan): Allow __directive__ spelling.
521
522 2023-11-04 David Malcolm <dmalcolm@redhat.com>
523
524 * call.cc: Update for changes to diagnostic_context.
525 * class.cc: Likewise.
526 * decl.cc: Likewise.
527 * error.cc: Likewise.
528 * except.cc: Likewise.
529 * pt.cc: Likewise.
530
531 2023-11-02 Jason Merrill <jason@redhat.com>
532
533 * semantics.cc (nrv_data): Change visited to hash_set.
534 (finalize_nrv_r): Reorganize.
535
536 2023-11-02 Jason Merrill <jason@redhat.com>
537
538 PR c++/112301
539 PR c++/102191
540 PR c++/33799
541 * except.cc (maybe_splice_retval_cleanup): Clear
542 current_retval_sentinel when destroying retval.
543 * semantics.cc (nrv_data): Add in_nrv_cleanup.
544 (finalize_nrv): Set it.
545 (finalize_nrv_r): Fix handling of throwing cleanups.
546
547 2023-11-02 Jakub Jelinek <jakub@redhat.com>
548
549 PR c++/110342
550 * parser.cc: Implement C++26 P2361R6 - Unevaluated strings.
551 (uneval_string_attr): New enumerator.
552 (cp_parser_string_literal_common): Add UNEVAL argument. If true,
553 pass CPP_UNEVAL_STRING rather than CPP_STRING to
554 cpp_interpret_string_notranslate.
555 (cp_parser_string_literal, cp_parser_userdef_string_literal): Adjust
556 callers of cp_parser_string_literal_common.
557 (cp_parser_unevaluated_string_literal): New function.
558 (cp_parser_parenthesized_expression_list): Handle uneval_string_attr.
559 (cp_parser_linkage_specification): Use
560 cp_parser_unevaluated_string_literal for C++26.
561 (cp_parser_static_assert): Likewise.
562 (cp_parser_std_attribute): Use uneval_string_attr for standard
563 deprecated and nodiscard attributes.
564
565 2023-10-31 David Malcolm <dmalcolm@redhat.com>
566
567 * module.cc (ordinary_loc_of): Update for removal of
568 MACRO_MAP_EXPANSION_POINT_LOCATION.
569 (module_state::note_location): Update for renaming of field.
570 (module_state::write_macro_maps): Likewise.
571
572 2023-10-27 Patrick Palka <ppalka@redhat.com>
573
574 PR c++/111929
575 * init.cc (build_new_1): Remove unnecessary call to convert
576 on 'nelts'. Use build2 instead of fold_build2 for
577 'outer_nelts_checks'.
578
579 2023-10-27 Patrick Palka <ppalka@redhat.com>
580
581 * cp-tree.h (maybe_warn_unparenthesized_assignment): Declare.
582 * semantics.cc (is_assignment_op_expr_p): Generalize to return
583 true for any assignment operator expression, not just one that
584 has been resolved to an operator overload.
585 (maybe_warn_unparenthesized_assignment): Factored out from ...
586 (maybe_convert_cond): ... here.
587 (finish_parenthesized_expr): Mention
588 maybe_warn_unparenthesized_assignment.
589 * typeck.cc (convert_for_assignment): Replace -Wparentheses
590 warning logic with maybe_warn_unparenthesized_assignment.
591
592 2023-10-27 Lewis Hyatt <lhyatt@gmail.com>
593
594 PR preprocessor/87299
595 * parser.cc (cp_lexer_new_main): Call c_reset_target_pragmas ()
596 after preprocessing is complete, before starting compilation.
597
598 2023-10-26 liuhongt <hongtao.liu@intel.com>
599
600 * typeck.cc (build_vec_cmp): Pass type of arg0 to
601 truth_type_for.
602
603 2023-10-25 Jason Merrill <jason@redhat.com>
604
605 * cp-tree.def: Improve OFFSET_REF comment.
606 * cp-gimplify.cc (cp_fold_immediate): Add to comment.
607
608 2023-10-25 Thomas Schwinge <thomas@codesourcery.com>
609
610 * parser.cc (cp_parser_omp_clause_name): Return
611 'PRAGMA_OACC_CLAUSE_SELF' for "self".
612 (cp_parser_oacc_data_clause, OACC_UPDATE_CLAUSE_MASK): Adjust.
613 (cp_parser_oacc_all_clauses): Remove 'bool compute_p' formal
614 parameter, and instead locally determine whether we're called for
615 an OpenACC compute construct or OpenACC 'update' directive.
616 (cp_parser_oacc_compute): Adjust.
617
618 2023-10-25 Chung-Lin Tang <cltang@codesourcery.com>
619
620 * parser.cc (cp_parser_oacc_compute_clause_self): New function.
621 (cp_parser_oacc_all_clauses): Add new 'bool compute_p = false'
622 parameter, add parsing of self clause when compute_p is true.
623 (OACC_KERNELS_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_SELF.
624 (OACC_PARALLEL_CLAUSE_MASK): Likewise,
625 (OACC_SERIAL_CLAUSE_MASK): Likewise.
626 (cp_parser_oacc_compute): Adjust call to c_parser_oacc_all_clauses to
627 set compute_p argument to true.
628 * pt.cc (tsubst_omp_clauses): Add OMP_CLAUSE_SELF case.
629 * semantics.cc (c_finish_omp_clauses): Add OMP_CLAUSE_SELF case, merged
630 with OMP_CLAUSE_IF case.
631
632 2023-10-25 Marek Polacek <polacek@redhat.com>
633
634 PR c++/111895
635 * typeck.cc (build_static_cast_1): Call decay_conversion.
636
637 2023-10-24 Patrick Palka <ppalka@redhat.com>
638
639 PR c++/111929
640 * init.cc (build_new_1): Use convert, build2, build3 and
641 cp_fully_fold instead of fold_convert, size_binop and
642 fold_build3 when building up 'size'.
643
644 2023-10-24 Patrick Palka <ppalka@redhat.com>
645
646 PR c++/111919
647 * tree.cc (cp_stabilize_reference): Do nothing when
648 processing_template_decl.
649
650 2023-10-22 Patrick Palka <ppalka@redhat.com>
651
652 PR objc++/111920
653 * pt.cc (tsubst_expr) <case AT_ENCODE_EXPR>: Use tsubst instead
654 of tsubst_expr.
655
656 2023-10-20 Jason Merrill <jason@redhat.com>
657
658 * call.cc (implicit_conversion_1): Rename...
659 (implicit_conversion): ...to this. Remove the old wrapper.
660
661 2023-10-20 Jason Merrill <jason@redhat.com>
662
663 * call.cc (tourney): Only skip champ_compared_to_predecessor.
664
665 2023-10-20 Nathan Sidwell <nathan@acm.org>
666
667 PR c++/105322
668 * module.cc (trees_out::core_vals): Stream CONSTRUCTOR operands
669 after the type.
670 (trees_in::core_vals): Likewise.
671
672 2023-10-20 Patrick Palka <ppalka@redhat.com>
673
674 * cp-lang.cc (objcp_tsubst_copy_and_build): Rename to ...
675 (objcp_tsubst_expr): ... this.
676 * cp-objcp-common.h (objcp_tsubst_copy_and_build): Rename to ...
677 (objcp_tsubst_expr): ... this.
678 * cp-tree.h (tsubst_copy_and_build): Remove declaration.
679 * init.cc (maybe_instantiate_nsdmi_init): Use tsubst_expr
680 instead of tsubst_copy_and_build.
681 * pt.cc (expand_integer_pack): Likewise.
682 (instantiate_non_dependent_expr_internal): Likewise.
683 (instantiate_class_template): Use tsubst_stmt instead of
684 tsubst_expr for STATIC_ASSERT.
685 (tsubst_function_decl): Adjust tsubst_copy_and_build uses.
686 (tsubst_arg_types): Likewise.
687 (tsubst_exception_specification): Likewise.
688 (tsubst_tree_list): Likewise.
689 (tsubst): Likewise.
690 (tsubst_name): Likewise.
691 (tsubst_omp_clause_decl): Use tsubst_stmt instead of tsubst_expr.
692 (tsubst_omp_clauses): Likewise.
693 (tsubst_copy_asm_operands): Adjust tsubst_copy_and_build use.
694 (tsubst_omp_for_iterator): Use tsubst_stmt instead of tsubst_expr.
695 (tsubst_expr): Rename to ...
696 (tsubst_stmt): ... this.
697 <case CO_YIELD_EXPR, CO_AWAIT_EXPR>: Move to tsubst_expr.
698 (tsubst_omp_udr): Use tsubst_stmt instead of tsubst_expr.
699 (tsubst_non_call_postfix_expression): Adjust tsubst_copy_and_build
700 use.
701 (tsubst_lambda_expr): Likewise. Use tsubst_stmt instead of
702 tsubst_expr for the body of a lambda.
703 (tsubst_copy_and_build_call_args): Rename to ...
704 (tsubst_call_args): ... this. Adjust tsubst_copy_and_build use.
705 (tsubst_copy_and_build): Rename to tsubst_expr. Adjust
706 tsubst_copy_and_build and tsubst_copy_and_build_call_args use.
707 <case TRANSACTION_EXPR>: Use tsubst_stmt instead of tsubst_expr.
708 (maybe_instantiate_noexcept): Adjust tsubst_copy_and_build use.
709 (instantiate_body): Use tsubst_stmt instead of tsubst_expr for
710 substituting the function body.
711 (tsubst_initializer_list): Adjust tsubst_copy_and_build use.
712
713 2023-10-20 Patrick Palka <ppalka@redhat.com>
714
715 * cp-tree.h (enum tsubst_flags): Add tf_no_name_lookup.
716 * pt.cc (tsubst_pack_expansion): Use tsubst for substituting
717 BASES_TYPE.
718 (tsubst_decl) <case USING_DECL>: Use tsubst_name instead of
719 tsubst_copy.
720 (tsubst) <case TEMPLATE_TYPE_PARM>: Use tsubst_copy_and_build
721 instead of tsubst_copy for substituting
722 CLASS_PLACEHOLDER_TEMPLATE.
723 <case TYPENAME_TYPE>: Use tsubst_name instead of tsubst_copy for
724 substituting TYPENAME_TYPE_FULLNAME.
725 (tsubst_name): Define.
726 (tsubst_qualified_id): Use tsubst_name instead of tsubst_copy
727 for substituting the component name of a SCOPE_REF.
728 (tsubst_copy): Remove.
729 (tsubst_copy_and_build): Clear tf_no_name_lookup at the start,
730 and remember if it was set. Call maybe_dependent_member_ref if
731 tf_no_name_lookup was not set.
732 <case IDENTIFIER_NODE>: Don't do name lookup if tf_no_name_lookup
733 was set.
734 <case TEMPLATE_ID_EXPR>: If tf_no_name_lookup was set, use
735 tsubst_name instead of tsubst_copy_and_build to substitute the
736 template and don't finish the template-id.
737 <case BIT_NOT_EXPR>: Handle identifier and type operand (if
738 tf_no_name_lookup was set).
739 <case SCOPE_REF>: Avoid trying to resolve a SCOPE_REF if
740 tf_no_name_lookup was set by calling build_qualified_name directly
741 instead of tsubst_qualified_id.
742 <case SIZEOF_EXPR>: Handling of sizeof... copied from tsubst_copy.
743 <case CALL_EXPR>: Use tsubst_name instead of tsubst_copy to
744 substitute a TEMPLATE_ID_EXPR callee naming an unresolved template.
745 <case COMPONENT_REF>: Likewise to substitute the member.
746 <case FUNCTION_DECL>: Copied from tsubst_copy and merged with ...
747 <case VAR_DECL, PARM_DECL>: ... these. Initial handling copied
748 from tsubst_copy. Optimize local variable substitution by
749 trying retrieve_local_specialization before checking
750 uses_template_parms.
751 <case CONST_DECL>: Copied from tsubst_copy.
752 <case FIELD_DECL>: Likewise.
753 <case NAMESPACE_DECL>: Likewise.
754 <case OVERLOAD>: Likewise.
755 <case TEMPLATE_DECL>: Likewise.
756 <case TEMPLATE_PARM_INDEX>: Likewise.
757 <case TYPE_DECL>: Likewise.
758 <case CLEANUP_POINT_EXPR>: Likewise.
759 <case OFFSET_REF>: Likewise.
760 <case EXPR_PACK_EXPANSION>: Likewise.
761 <case NONTYPE_ARGUMENT_PACK>: Likewise.
762 <case *_CST>: Likewise.
763 <case *_*_FOLD_EXPR>: Likewise.
764 <case DEBUG_BEGIN_STMT>: Likewise.
765 <case CO_AWAIT_EXPR>: Likewise.
766 <case TRAIT_EXPR>: Use tsubst and tsubst_copy_and_build instead
767 of tsubst_copy.
768 <default>: Copied from tsubst_copy.
769 (tsubst_initializer_list): Use tsubst and tsubst_copy_and_build
770 instead of tsubst_copy.
771
772 2023-10-20 Patrick Palka <ppalka@redhat.com>
773
774 PR c++/106086
775 * parser.cc (cp_parser_postfix_expression): Consolidate three
776 calls to finish_call_expr, one to build_new_method_call and
777 one to build_min_nt_call_vec into one call to finish_call_expr.
778 Don't call maybe_generic_this_capture here.
779 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Remove
780 COMPONENT_REF callee handling.
781 (type_dependent_expression_p): Use t_d_object_e_p instead of
782 t_d_e_p for COMPONENT_REF and OFFSET_REF.
783 * semantics.cc (finish_call_expr): In the type-dependent case,
784 call maybe_generic_this_capture here instead.
785
786 2023-10-20 Patrick Palka <ppalka@redhat.com>
787
788 * call.cc (build_new_method_call): Remove calls to
789 build_non_dependent_expr and/or make_args_non_dependent.
790 * coroutines.cc (finish_co_return_stmt): Likewise.
791 * cp-tree.h (build_non_dependent_expr): Remove.
792 (make_args_non_dependent): Remove.
793 * decl2.cc (grok_array_decl): Remove calls to
794 build_non_dependent_expr and/or make_args_non_dependent.
795 (build_offset_ref_call_from_tree): Likewise.
796 * init.cc (build_new): Likewise.
797 * pt.cc (make_args_non_dependent): Remove.
798 (test_build_non_dependent_expr): Remove.
799 (cp_pt_cc_tests): Adjust.
800 * semantics.cc (finish_expr_stmt): Remove calls to
801 build_non_dependent_expr and/or make_args_non_dependent.
802 (finish_for_expr): Likewise.
803 (finish_call_expr): Likewise.
804 (finish_omp_atomic): Likewise.
805 * typeck.cc (finish_class_member_access_expr): Likewise.
806 (build_x_indirect_ref): Likewise.
807 (build_x_binary_op): Likewise.
808 (build_x_array_ref): Likewise.
809 (build_x_vec_perm_expr): Likewise.
810 (build_x_shufflevector): Likewise.
811 (build_x_unary_op): Likewise.
812 (cp_build_addressof): Likewise.
813 (build_x_conditional_expr): Likewise.
814 (build_x_compound_expr): Likewise.
815 (build_static_cast): Likewise.
816 (build_x_modify_expr): Likewise.
817 (check_return_expr): Likewise.
818 * typeck2.cc (build_x_arrow): Likewise.
819
820 2023-10-20 Patrick Palka <ppalka@redhat.com>
821
822 * class.cc (instantiate_type): Remove NON_DEPENDENT_EXPR
823 handling.
824 * constexpr.cc (cxx_eval_constant_expression): Likewise.
825 (potential_constant_expression_1): Likewise.
826 * coroutines.cc (coro_validate_builtin_call): Don't
827 expect ALIGNOF_EXPR to be wrapped in NON_DEPENDENT_EXPR.
828 * cp-objcp-common.cc (cp_common_init_ts): Remove
829 NON_DEPENDENT_EXPR handling.
830 * cp-tree.def (NON_DEPENDENT_EXPR): Remove.
831 * cp-tree.h (build_non_dependent_expr): Temporarily redefine as
832 the identity function.
833 * cvt.cc (maybe_warn_nodiscard): Handle type-dependent and
834 variable callee of CALL_EXPR.
835 * cxx-pretty-print.cc (cxx_pretty_printer::expression): Remove
836 NON_DEPENDENT_EXPR handling.
837 * error.cc (dump_decl): Likewise.
838 (dump_expr): Likewise.
839 * expr.cc (mark_use): Likewise.
840 (mark_exp_read): Likewise.
841 * pt.cc (build_non_dependent_expr): Remove.
842 * tree.cc (lvalue_kind): Remove NON_DEPENDENT_EXPR handling.
843 (cp_stabilize_reference): Likewise.
844 * typeck.cc (warn_for_null_address): Likewise.
845 (cp_build_binary_op): Handle type-dependent SIZEOF_EXPR operands.
846 (cp_build_unary_op) <case TRUTH_NOT_EXPR>: Don't fold inside a
847 template.
848
849 2023-10-20 Alexandre Oliva <oliva@adacore.com>
850
851 * decl.cc (push_throw_library_fn): Mark with ECF_XTHROW.
852 * except.cc (build_throw): Likewise __cxa_throw,
853 _ITM_cxa_throw, __cxa_rethrow.
854
855 2023-10-20 Nathaniel Shead <nathanieloshead@gmail.com>
856
857 PR c++/101631
858 PR c++/102286
859 * call.cc (build_over_call): Fold more indirect refs for trivial
860 assignment op.
861 * class.cc (type_has_non_deleted_trivial_default_ctor): Create.
862 * constexpr.cc (cxx_eval_call_expression): Start lifetime of
863 union member before entering constructor.
864 (cxx_eval_component_reference): Check against first member of
865 value-initialised union.
866 (cxx_eval_store_expression): Activate member for
867 value-initialised union. Check for accessing inactive union
868 member indirectly.
869 * cp-tree.h (type_has_non_deleted_trivial_default_ctor):
870 Forward declare.
871
872 2023-10-20 Nathaniel Shead <nathanieloshead@gmail.com>
873
874 * constexpr.cc (is_std_source_location_current): New.
875 (cxx_eval_constant_expression): Only ignore cast from void* for
876 specific cases and improve other diagnostics.
877
878 2023-10-19 Marek Polacek <polacek@redhat.com>
879
880 * cp-gimplify.cc (cp_fold_r): Don't call maybe_constant_value.
881
882 2023-10-19 Jason Merrill <jason@redhat.com>
883
884 * typeck2.cc (check_narrowing): Adjust.
885
886 2023-10-19 Jason Merrill <jason@redhat.com>
887
888 * parser.cc (cp_parser_primary_expression): Use G_.
889 (cp_parser_using_enum): Likewise.
890 * decl.cc (identify_goto): Likewise.
891
892 2023-10-18 Jason Merrill <jason@redhat.com>
893
894 * typeck2.cc (check_narrowing): Use permerror.
895
896 2023-10-17 Marek Polacek <polacek@redhat.com>
897
898 PR c++/111840
899 * parser.cc (cp_parser_simple_declaration): Do cp_parser_error
900 for FUNCTION_DECLs.
901
902 2023-10-17 Marek Polacek <polacek@redhat.com>
903
904 PR c++/111660
905 * cp-gimplify.cc (cp_fold_immediate_r) <case COND_EXPR>: Don't
906 handle it here.
907 (cp_fold_r): Handle COND_EXPR here.
908
909 2023-10-17 Jason Merrill <jason@redhat.com>
910
911 * mangle.cc (abi_check): New.
912 (write_prefix, write_unqualified_name, write_discriminator)
913 (write_type, write_member_name, write_expression)
914 (write_template_arg, write_template_param): Use it.
915 (start_mangling): Assign from {}.
916 * cp-tree.h: Update comment.
917
918 2023-10-17 Nathaniel Shead <nathanieloshead@gmail.com>
919
920 * constexpr.cc (cxx_eval_dynamic_cast_fn): Add missing
921 auto_diagnostic_group.
922 (cxx_eval_call_expression): Likewise.
923 (diag_array_subscript): Likewise.
924 (outside_lifetime_error): Likewise.
925 (potential_constant_expression_1): Likewise.
926
927 2023-10-16 Jason Merrill <jason@redhat.com>
928
929 * parser.cc (cp_parser_fold_expression): Track location range.
930 * semantics.cc (finish_unary_fold_expr)
931 (finish_left_unary_fold_expr, finish_right_unary_fold_expr)
932 (finish_binary_fold_expr): Add location parm.
933 * constraint.cc (finish_shorthand_constraint): Pass it.
934 * pt.cc (convert_generic_types_to_packs): Likewise.
935 * cp-tree.h: Adjust.
936
937 2023-10-16 Marek Polacek <polacek@redhat.com>
938
939 PR c++/111272
940 * constexpr.cc (explain_invalid_constexpr_fn): Also check the body of
941 a constructor in C++14 and up.
942
943 2023-10-14 Jakub Jelinek <jakub@redhat.com>
944
945 PR c/102989
946 * module.cc (trees_out::start, trees_in::start): Remove
947 TREE_INT_CST_OFFSET_NUNITS handling.
948
949 2023-10-10 Jason Merrill <jason@redhat.com>
950
951 PR c++/109422
952 * mangle.cc (write_template_param): Also mangle level.
953
954 2023-10-08 David Malcolm <dmalcolm@redhat.com>
955
956 * module.cc (module_state::read_location): Update for renaming of
957 get_combined_adhoc_loc.
958
959 2023-10-03 David Malcolm <dmalcolm@redhat.com>
960
961 * error.cc (print_instantiation_partial_context_line): Call
962 diagnostic_show_locus.
963
964 2023-10-03 David Malcolm <dmalcolm@redhat.com>
965
966 * error.cc: Update for "m_" prefixes to text_info fields.
967
968 2023-09-30 Eugene Rozenfeld <erozen@microsoft.com>
969
970 * Make-lang.in: Make create_fdas_for_cc1plus target not .PHONY
971
972 2023-09-28 Richard Sandiford <richard.sandiford@arm.com>
973
974 * constexpr.cc (cxx_fold_indirect_ref): Remove unused variables.
975
976 2023-09-22 Jason Merrill <jason@redhat.com>
977
978 PR c++/111357
979 * pt.cc (expand_integer_pack): Use IMPLICIT_CONV_EXPR.
980
981 2023-09-22 Jason Merrill <jason@redhat.com>
982
983 * constexpr.cc (free_constructor): Handle null ce->value.
984
985 2023-09-22 Jason Merrill <jason@redhat.com>
986
987 PR c++/111529
988 * parser.cc (cp_parser_lambda_declarator_opt): Don't suggest
989 -std=c++14 for lambda templates.
990 * pt.cc (tsubst_expr): Move ANNOTATE_EXPR handling...
991 (tsubst_copy_and_build): ...here.
992
993 2023-09-22 Patrick Palka <ppalka@redhat.com>
994
995 PR c++/111493
996 * decl2.cc (grok_array_decl): Guard diagnostic and backward
997 compatibility fallback code paths with tf_error.
998
999 2023-09-22 Patrick Palka <ppalka@redhat.com>
1000
1001 PR c++/111485
1002 * pt.cc (is_compatible_template_arg): New parameter 'args'.
1003 Add the outer template arguments 'args' to 'new_args'.
1004 (convert_template_argument): Pass 'args' to
1005 is_compatible_template_arg.
1006
1007 2023-09-20 Jakub Jelinek <jakub@redhat.com>
1008
1009 * parser.cc (cp_parser_postfix_expression): Parse
1010 __builtin_classify_type call with typename as argument.
1011 * pt.cc (tsubst_copy_and_build): Handle __builtin_classify_type
1012 with dependent typename as argument.
1013
1014 2023-09-20 Patrick Palka <ppalka@redhat.com>
1015
1016 PR c++/111471
1017 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
1018 <case VAR_DECL>: Handle class NTTP objects by printing
1019 their type and value.
1020 <case VIEW_CONVERT_EXPR>: Strip const VIEW_CONVERT_EXPR
1021 wrappers for class NTTPs.
1022 (pp_cxx_template_argument_list): Don't handle class NTTP
1023 objects here.
1024
1025 2023-09-20 Patrick Palka <ppalka@redhat.com>
1026
1027 * pt.cc (tsubst_function_decl): Don't bother computing 'argvec'
1028 when 'lambda_fntype' is set.
1029 (tsubst_template_decl): Make sure we return a TEMPLATE_DECL
1030 during specialization lookup. In the non-class non-function
1031 template case, use tsubst_decl directly with use_spec_table=false,
1032 update DECL_TI_ARGS and call register_specialization like
1033 tsubst_decl would have done if use_spec_table=true.
1034
1035 2023-09-20 Jakub Jelinek <jakub@redhat.com>
1036
1037 PR c++/111392
1038 * parser.h (struct cp_lexer): Add in_omp_decl_attribute member.
1039 * cp-tree.h (cp_maybe_parse_omp_decl): Declare.
1040 * parser.cc (cp_parser_handle_statement_omp_attributes): Diagnose
1041 omp::decl attribute on statements. Adjust diagnostic wording for
1042 omp::decl.
1043 (cp_parser_omp_directive_args): Add DECL_P argument, set TREE_PUBLIC
1044 to it on the DEFERRED_PARSE tree.
1045 (cp_parser_omp_sequence_args): Adjust caller.
1046 (cp_parser_std_attribute): Handle omp::decl attribute.
1047 (cp_parser_omp_var_list): If parser->lexer->in_omp_decl_attribute
1048 don't expect any arguments, instead create clause or TREE_LIST for
1049 that decl.
1050 (cp_parser_late_parsing_omp_declare_simd): Adjust diagnostic wording
1051 for omp::decl.
1052 (cp_maybe_parse_omp_decl): New function.
1053 (cp_parser_omp_declare_target): If
1054 parser->lexer->in_omp_decl_attribute and first token isn't name or
1055 comma invoke cp_parser_omp_var_list.
1056 * decl2.cc (cplus_decl_attributes): Adjust diagnostic wording for
1057 omp::decl. Handle omp::decl on declarations.
1058 * name-lookup.cc (finish_using_directive): Adjust diagnostic wording
1059 for omp::decl.
1060
1061 2023-09-19 Ben Boeckel <ben.boeckel@kitware.com>
1062
1063 * mapper-client.cc, mapper-client.h (open_module_client): Accept
1064 dependency tracking and track module mapper files as
1065 dependencies.
1066 * module.cc (make_mapper, get_mapper): Pass the dependency
1067 tracking class down.
1068
1069 2023-09-19 Ben Boeckel <ben.boeckel@kitware.com>
1070
1071 * module.cc (do_import): Report imported CMI files as
1072 dependencies.
1073
1074 2023-09-19 Ben Boeckel <ben.boeckel@kitware.com>
1075
1076 * module.cc (preprocessed_module): Pass whether the module is
1077 exported to dependency tracking.
1078
1079 2023-09-19 Javier Martinez <javier.martinez.bugzilla@gmail.com>
1080
1081 * class.cc (propagate_class_warmth_attribute): New function.
1082 (check_bases_and_members): propagate hot and cold attributes
1083 to all FUNCTION_DECL when the record is marked hot or cold.
1084 * cp-tree.h (maybe_propagate_warmth_attributes): New function.
1085 * decl2.cc (maybe_propagate_warmth_attributes): New function.
1086 * method.cc (lazily_declare_fn): propagate hot and cold
1087 attributes to lazily declared functions when the record is
1088 marked hot or cold.
1089
1090 2023-09-19 Patrick Palka <ppalka@redhat.com>
1091
1092 * ptree.cc (cxx_print_type): Remove TYPE_LANG_SPECIFIC
1093 test guarding TYPE_TEMPLATE_INFO.
1094
1095 2023-09-19 Jason Merrill <jason@redhat.com>
1096
1097 DR 2799
1098 * class.cc (add_implicit_default_ctor): Split out...
1099 (add_implicitly_declared_members): ...from here.
1100 Also call it when inheriting a default ctor.
1101
1102 2023-09-19 Marek Polacek <polacek@redhat.com>
1103
1104 * call.cc (build_over_call): Set ADDR_EXPR_DENOTES_CALL_P. Don't handle
1105 immediate_invocation_p here.
1106 * constexpr.cc (cxx_eval_call_expression): Use mce_true for
1107 DECL_IMMEDIATE_FUNCTION_P.
1108 (cxx_eval_conditional_expression): Call cp_fold_immediate.
1109 * cp-gimplify.cc (enum fold_flags): Add ff_fold_immediate.
1110 (maybe_replace_decl): Make static.
1111 (cp_fold_r): Expand immediate invocations.
1112 (cp_fold_immediate_r): New.
1113 (cp_fold_immediate): New.
1114 * cp-tree.h (ADDR_EXPR_DENOTES_CALL_P): Define.
1115 (cp_fold_immediate): Declare.
1116 * tree.cc (bot_replace): Don't handle immediate invocations here.
1117
1118 2023-09-19 Patrick Palka <ppalka@redhat.com>
1119
1120 PR c++/111419
1121 * cvt.cc (convert_to_void) <case INDIRECT_REF>: Only call
1122 complete_type if the type is volatile.
1123 <case VAR_DECL>: Likewise.
1124
1125 2023-09-19 Patrick Palka <ppalka@redhat.com>
1126
1127 PR c++/99631
1128 * semantics.cc (finish_decltype_type): For an NTTP object,
1129 return its type modulo cv-quals.
1130
1131 2023-09-18 Patrick Palka <ppalka@redhat.com>
1132
1133 PR c++/89231
1134 * pt.cc (try_class_unification): Strengthen TI_TEMPLATE equality
1135 test by not calling most_general_template. Only unify the
1136 innermost levels of template arguments.
1137 (unify) <case CLASS_TYPE>: Only unify the innermost levels of
1138 template arguments, and only if the template is primary.
1139
1140 2023-09-18 Patrick Palka <ppalka@redhat.com>
1141
1142 PR c++/63198
1143 PR c++/18474
1144 * semantics.cc (maybe_convert_cond): Look through implicit
1145 INDIRECT_REF when deciding whether to issue a -Wparentheses
1146 warning, and consider templated assignment expressions as well.
1147 (finish_parenthesized_expr): Look through implicit INDIRECT_REF
1148 when suppressing -Wparentheses warning.
1149 * typeck.cc (build_x_modify_expr): Check simple assignments
1150 ahead time too, not just compound assignments. Give the second
1151 operand of MODOP_EXPR a non-null type so that it's not considered
1152 always instantiation-dependent. Don't call suppress_warning.
1153
1154 2023-09-18 Patrick Palka <ppalka@redhat.com>
1155
1156 PR c++/108347
1157 * pt.cc (unify): Return unify_success for identical dependent
1158 DECL_P 'arg' and 'parm'.
1159 <case CONST_DECL>: Remove handling.
1160
1161 2023-09-18 Patrick Palka <ppalka@redhat.com>
1162
1163 * call.cc (add_template_candidate_real): Check arity even
1164 when there are no explicit template arguments. Combine the
1165 two adjacent '!obj' tests into one.
1166
1167 2023-09-18 Patrick Palka <ppalka@redhat.com>
1168
1169 * pt.cc (register_specialization): Remove now-unnecessary
1170 early exit for FUNCTION_DECL partial instantiation.
1171 (tsubst_template_decl): Pass use_spec_table=false to
1172 tsubst_function_decl. Set DECL_TI_ARGS of a non-lambda
1173 FUNCTION_DECL specialization to the full set of arguments.
1174 Simplify register_specialization call accordingly.
1175
1176 2023-09-18 Jason Merrill <jason@redhat.com>
1177
1178 * class.cc (check_subobject_offset): Use similar_type_p.
1179
1180 2023-09-12 Jason Merrill <jason@redhat.com>
1181
1182 PR c++/111357
1183 * pt.cc (expand_integer_pack): Convert argument to int.
1184
1185 2023-09-12 Jason Merrill <jason@redhat.com>
1186
1187 PR c++/107198
1188 * typeck2.cc (process_init_constructor_array): Use VEC_INIT_EXPR
1189 regardless of seen_error.
1190
1191 2023-09-08 Patrick Palka <ppalka@redhat.com>
1192
1193 PR c++/99599
1194 * pt.cc (check_non_deducible_conversions): Add bool parameter
1195 passed down to check_non_deducible_conversion.
1196 (fn_type_unification): Call check_non_deducible_conversions
1197 an extra time before satisfaction with noninst_only_p=true.
1198 (conversion_may_instantiate_p): Define.
1199 (check_non_deducible_conversion): Add bool parameter controlling
1200 whether to compute only conversions that are guaranteed to
1201 not induce template instantiation.
1202
1203 2023-09-07 Sandra Loosemore <sandra@codesourcery.com>
1204
1205 PR c++/111274
1206 * parser.cc (fixup_blocks_walker): Check for null BIND_EXPR_BLOCK.
1207
1208 2023-09-06 Jason Merrill <jason@redhat.com>
1209
1210 * class.cc (check_subobject_offset): Check
1211 same_type_ignoring_top_level_qualifiers_p.
1212
1213 2023-09-05 Marek Polacek <polacek@redhat.com>
1214
1215 PR c++/91483
1216 * constexpr.cc (verify_constant_explain_r): New.
1217 (verify_constant): Call it.
1218
1219 2023-09-05 Jakub Jelinek <jakub@redhat.com>
1220
1221 PR c++/52953
1222 * name-lookup.cc (check_local_shadow): Don't punt early for
1223 DECL_EXTERNAL decls, instead just disable the shadowing of namespace
1224 decls check for those and emit a pedwarn rather than error_at or
1225 permerror for those. Formatting fix.
1226
1227 2023-09-05 Jakub Jelinek <jakub@redhat.com>
1228
1229 PR c++/52953
1230 * name-lookup.h (struct cp_binding_level): Add artificial bit-field.
1231 Formatting fixes.
1232 * name-lookup.cc (check_local_shadow): Skip artificial bindings when
1233 checking if parameter scope is parent scope. Don't special case
1234 FUNCTION_NEEDS_BODY_BLOCK. Diagnose the in_function_try_handler
1235 cases in the b->kind == sk_function_parms test and verify no
1236 non-artificial intervening scopes. Add missing auto_diagnostic_group.
1237 * decl.cc (begin_function_body): Set
1238 current_binding_level->artificial.
1239 * semantics.cc (begin_function_try_block): Likewise.
1240
1241 2023-09-05 Patrick Palka <ppalka@redhat.com>
1242
1243 * parser.cc (cp_parser_parenthesized_expression_list_elt): Pass
1244 nullptr as non_constant_p to cp_parser_braced_list if our
1245 non_constant_p is null.
1246 (cp_parser_initializer_list): Likewise to
1247 cp_parser_initializer_clause. Avoid inspecting
1248 clause_non_constant_p if it's uninitialized.
1249
1250 2023-09-05 Patrick Palka <ppalka@redhat.com>
1251
1252 * call.cc (build_user_type_conversion): Free allocated
1253 conversions.
1254 (build_converted_constant_expr_internal): Use
1255 conversion_obstack_sentinel instead.
1256 (perform_dguide_overload_resolution): Likewise.
1257 (build_new_function_call): Likewise.
1258 (build_operator_new_call): Free allocated conversions.
1259 (build_op_call): Use conversion_obstack_sentinel instead.
1260 (build_conditional_expr): Use conversion_obstack_sentinel
1261 instead, and hoist it out to the outermost scope.
1262 (build_new_op): Use conversion_obstack_sentinel instead
1263 and set it up before the first goto. Remove second unneeded goto.
1264 (build_op_subscript): Use conversion_obstack_sentinel instead.
1265 (ref_conv_binds_to_temporary): Likewise.
1266 (build_new_method_call): Likewise.
1267 (can_convert_arg): Likewise.
1268 (can_convert_arg_bad): Likewise.
1269 (perform_implicit_conversion_flags): Likewise.
1270 (perform_direct_initialization_if_possible): Likewise.
1271 (initialize_reference): Likewise.
1272
1273 2023-09-01 Jakub Jelinek <jakub@redhat.com>
1274
1275 PR c++/111069
1276 * cp-tree.h (determine_local_discriminator): Add NAME argument with
1277 NULL_TREE default.
1278 (struct cp_decomp): New type.
1279 (cp_finish_decl): Add DECOMP argument defaulted to nullptr.
1280 (cp_maybe_mangle_decomp): Remove declaration.
1281 (cp_finish_decomp): Add cp_decomp * argument, remove tree and unsigned
1282 args.
1283 (cp_convert_range_for): Likewise.
1284 * decl.cc (determine_local_discriminator): Add NAME argument, use it
1285 if non-NULL, otherwise compute it the old way.
1286 (maybe_commonize_var): Don't return early for structured bindings.
1287 (cp_finish_decl): Add DECOMP argument, if non-NULL, call
1288 cp_maybe_mangle_decomp.
1289 (cp_maybe_mangle_decomp): Make it static with a forward declaration.
1290 Call determine_local_discriminator. Replace FIRST and COUNT arguments
1291 with DECOMP argument.
1292 (cp_finish_decomp): Replace FIRST and COUNT arguments with DECOMP
1293 argument.
1294 * mangle.cc (find_decomp_unqualified_name): Remove.
1295 (write_unqualified_name): Don't call find_decomp_unqualified_name.
1296 (mangle_decomp): Handle mangling of static function/block scope
1297 structured bindings. Don't call decl_mangling_context twice. Call
1298 check_abi_tags, call write_abi_tags for abi version >= 19 and emit
1299 -Wabi warnings if needed.
1300 (write_guarded_var_name): Handle structured bindings.
1301 (mangle_ref_init_variable): Use write_guarded_var_name.
1302 * parser.cc (cp_parser_range_for): Adjust do_range_for_auto_deduction
1303 and cp_convert_range_for callers.
1304 (do_range_for_auto_deduction): Replace DECOMP_FIRST_NAME and
1305 DECOMP_CNT arguments with DECOMP. Adjust cp_finish_decomp caller.
1306 (cp_convert_range_for): Replace DECOMP_FIRST_NAME and
1307 DECOMP_CNT arguments with DECOMP. Don't call cp_maybe_mangle_decomp,
1308 adjust cp_finish_decl and cp_finish_decomp callers.
1309 (cp_parser_decomposition_declaration): Don't call
1310 cp_maybe_mangle_decomp, adjust cp_finish_decl and cp_finish_decomp
1311 callers.
1312 (cp_convert_omp_range_for): Adjust do_range_for_auto_deduction
1313 and cp_finish_decomp callers.
1314 (cp_finish_omp_range_for): Don't call cp_maybe_mangle_decomp,
1315 adjust cp_finish_decl and cp_finish_decomp callers.
1316 * pt.cc (tsubst_omp_for_iterator): Adjust tsubst_decomp_names
1317 caller.
1318 (tsubst_decomp_names): Replace FIRST and CNT arguments with DECOMP.
1319 (tsubst_expr): Don't call cp_maybe_mangle_decomp, adjust
1320 tsubst_decomp_names, cp_finish_decl, cp_finish_decomp and
1321 cp_convert_range_for callers.
1322
1323 2023-08-30 Marek Polacek <polacek@redhat.com>
1324
1325 PR c++/91319
1326 * parser.cc (cp_parser_initializer_list): Set CONSTRUCTOR_IS_DIRECT_INIT
1327 when the designated initializer is of the .x{} form.
1328
1329 2023-08-30 Marek Polacek <polacek@redhat.com>
1330
1331 PR c++/111173
1332 * decl.cc (grokdeclarator): Disallow constinit on functions.
1333
1334 2023-08-29 Marek Polacek <polacek@redhat.com>
1335
1336 * call.cc (convert_like_internal): Show where the conversion function
1337 was declared.
1338 (maybe_show_nonconverting_candidate): New.
1339 * cp-tree.h (maybe_show_nonconverting_candidate): Declare.
1340 * typeck.cc (convert_for_assignment): Call it.
1341
1342 2023-08-25 Sandra Loosemore <sandra@codesourcery.com>
1343
1344 * cp-tree.h (cp_convert_omp_range_for): Adjust declaration.
1345 * parser.cc (struct omp_for_parse_data): New.
1346 (cp_parser_postfix_expression): Diagnose calls to OpenMP runtime
1347 in intervening code.
1348 (check_omp_intervening_code): New.
1349 (cp_parser_statement_seq_opt): Special-case nested loops, blocks,
1350 and other constructs for OpenMP loops.
1351 (cp_parser_iteration_statement): Reject loops in intervening code.
1352 (cp_parser_omp_for_loop_init): Expand comments and tweak the
1353 interface slightly to better distinguish input/output parameters.
1354 (cp_convert_omp_range_for): Likewise.
1355 (cp_parser_omp_loop_nest): New, split from cp_parser_omp_for_loop
1356 and largely rewritten. Add more comments.
1357 (insert_structured_blocks): New.
1358 (find_structured_blocks): New.
1359 (struct sit_data, substitute_in_tree_walker, substitute_in_tree):
1360 New.
1361 (fixup_blocks_walker): New.
1362 (cp_parser_omp_for_loop): Rewrite to use recursive descent instead
1363 of a loop. Add logic to reshuffle the bits of code collected
1364 during parsing so intervening code gets moved to the loop body.
1365 (cp_parser_omp_loop): Remove call to finish_omp_for_block, which
1366 is now redundant.
1367 (cp_parser_omp_simd): Likewise.
1368 (cp_parser_omp_for): Likewise.
1369 (cp_parser_omp_distribute): Likewise.
1370 (cp_parser_oacc_loop): Likewise.
1371 (cp_parser_omp_taskloop): Likewise.
1372 (cp_parser_pragma): Reject OpenMP pragmas in intervening code.
1373 * parser.h (struct cp_parser): Add omp_for_parse_state field.
1374 * pt.cc (tsubst_omp_for_iterator): Adjust call to
1375 cp_convert_omp_range_for.
1376 * semantics.cc (finish_omp_for): Try harder to preserve location
1377 of loop variable init expression for use in diagnostics.
1378 (struct fofb_data, finish_omp_for_block_walker): New.
1379 (finish_omp_for_block): Allow variables to be bound in a BIND_EXPR
1380 nested inside BIND instead of directly in BIND itself.
1381
1382 2023-08-25 Sandra Loosemore <sandra@codesourcery.com>
1383
1384 * constexpr.cc (cxx_eval_constant_expression): Handle
1385 OMP_STRUCTURED_BLOCK.
1386 * pt.cc (tsubst_expr): Likewise.
1387
1388 2023-08-25 Uros Bizjak <ubizjak@gmail.com>
1389
1390 * call.cc (build_conditional_expr):
1391 Rename TRUE/FALSE to true/false.
1392 (build_new_op): Ditto.
1393
1394 2023-08-22 Jason Merrill <jason@redhat.com>
1395
1396 * pt.cc (outer_template_args): Handle non-template argument.
1397 * constraint.cc (maybe_substitute_reqs_for): Pass decl to it.
1398 * cp-tree.h (outer_template_args): Adjust.
1399
1400 2023-08-22 Jason Merrill <jason@redhat.com>
1401
1402 PR c++/109751
1403 * cp-tree.h (member_like_constrained_friend_p): Declare.
1404 * decl.cc (member_like_constrained_friend_p): New.
1405 (function_requirements_equivalent_p): Check it.
1406 (duplicate_decls): Check it.
1407 (grokfndecl): Check friend template constraints.
1408 * mangle.cc (decl_mangling_context): Check it.
1409 (write_unqualified_name): Check it.
1410 * pt.cc (uses_outer_template_parms_in_constraints): Fix for friends.
1411 (tsubst_friend_function): Don't check satisfaction.
1412
1413 2023-08-22 Tobias Burnus <tobias@codesourcery.com>
1414
1415 * parser.cc (cp_parser_omp_clause_defaultmap): Parse
1416 'all' as category.
1417
1418 2023-08-15 Chung-Lin Tang <cltang@codesourcery.com>
1419 Thomas Schwinge <thomas@codesourcery.com>
1420
1421 * parser.cc (OACC_DATA_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_DEFAULT.
1422
1423 2023-08-14 gnaggnoyil <gnaggnoyil@gmail.com>
1424
1425 DR 2386
1426 PR c++/110216
1427 * decl.cc (get_tuple_size): Update implementation for DR 2386.
1428
1429 2023-08-14 Jason Merrill <jason@redhat.com>
1430
1431 * parser.cc (cp_parser_simple_type_specifier): Handle -std=c++14
1432 -fconcepts.
1433
1434 2023-08-12 Patrick Palka <ppalka@redhat.com>
1435 Jason Merrill <jason@redhat.com>
1436
1437 PR c++/106604
1438 * decl.cc (redeclaration_error_message): Remove special handling
1439 for deduction guides.
1440 (grokfndecl): Give deduction guides a dummy DECL_INITIAL.
1441
1442 2023-08-11 Patrick Palka <ppalka@redhat.com>
1443
1444 PR c++/110927
1445 * parser.cc (cp_parser_type_requirement): Pass
1446 check_dependency_p=true instead of =false.
1447
1448 2023-08-11 Patrick Palka <ppalka@redhat.com>
1449
1450 PR c++/71954
1451 * decl.cc (grokdeclarator): Pass 'dname' instead of
1452 'unqualified_id' as the name when building the VAR_DECL for a
1453 static data member. Call check_explicit_specialization for a
1454 TEMPLATE_ID_EXPR such member.
1455 * pt.cc (finish_member_template_decl): Return NULL_TREE
1456 instead of 'decl' when DECL_TEMPLATE_SPECIALIZATION is not
1457 set.
1458
1459 2023-08-11 Patrick Palka <ppalka@redhat.com>
1460
1461 * ptree.cc (cxx_print_decl): Check for DECL_LANG_SPECIFIC and
1462 TS_DECL_COMMON only when necessary. Print DECL_TEMPLATE_INFO
1463 for all decls that have it, not just VAR_DECL or FUNCTION_DECL.
1464 Also print DECL_USE_TEMPLATE.
1465 (cxx_print_type): Print TYPE_TEMPLATE_INFO.
1466 <case BOUND_TEMPLATE_TEMPLATE_PARM>: Don't print TYPE_TI_ARGS
1467 anymore.
1468 <case TEMPLATE_TYPE/TEMPLATE_PARM>: Print TEMPLATE_TYPE_PARM_INDEX
1469 instead of printing the index, level and original level
1470 individually.
1471
1472 2023-08-08 Marek Polacek <polacek@redhat.com>
1473
1474 * parser.cc (cp_parser_postfix_expression): Adjust the call to
1475 cp_parser_braced_list.
1476 (cp_parser_postfix_open_square_expression): Likewise.
1477 (cp_parser_new_initializer): Likewise.
1478 (cp_parser_assignment_expression): Adjust the call to
1479 cp_parser_initializer_clause.
1480 (cp_parser_lambda_introducer): Adjust the call to cp_parser_initializer.
1481 (cp_parser_range_for): Adjust the call to cp_parser_braced_list.
1482 (cp_parser_jump_statement): Likewise.
1483 (cp_parser_mem_initializer): Likewise.
1484 (cp_parser_template_argument): Likewise.
1485 (cp_parser_default_argument): Adjust the call to cp_parser_initializer.
1486 (cp_parser_initializer): Handle null is_direct_init and non_constant_p
1487 arguments.
1488 (cp_parser_initializer_clause): Handle null non_constant_p argument.
1489 (cp_parser_braced_list): Likewise.
1490 (cp_parser_initializer_list): Likewise.
1491 (cp_parser_member_declaration): Adjust the call to
1492 cp_parser_initializer_clause and cp_parser_initializer.
1493 (cp_parser_yield_expression): Adjust the call to cp_parser_braced_list.
1494 (cp_parser_functional_cast): Likewise.
1495 (cp_parser_late_parse_one_default_arg): Adjust the call to
1496 cp_parser_initializer.
1497 (cp_parser_omp_for_loop_init): Likewise.
1498 (cp_parser_omp_declare_reduction_exprs): Likewise.
1499
1500 2023-08-08 Nathaniel Shead <nathanieloshead@gmail.com>
1501
1502 PR c++/100482
1503 * parser.cc (cp_parser_decltype_expr): Report errors raised by
1504 finish_id_expression.
1505
1506 2023-08-04 Tamar Christina <tamar.christina@arm.com>
1507
1508 * cp-tree.h (RANGE_FOR_NOVECTOR): New.
1509 (cp_convert_range_for, finish_while_stmt_cond, finish_do_stmt,
1510 finish_for_cond): Add novector param.
1511 * init.cc (build_vec_init): Default novector to false.
1512 * method.cc (build_comparison_op): Likewise.
1513 * parser.cc (cp_parser_statement): Likewise.
1514 (cp_parser_for, cp_parser_c_for, cp_parser_range_for,
1515 cp_convert_range_for, cp_parser_iteration_statement,
1516 cp_parser_omp_for_loop, cp_parser_pragma): Support novector.
1517 (cp_parser_pragma_novector): New.
1518 * pt.cc (tsubst_expr): Likewise.
1519 * semantics.cc (finish_while_stmt_cond, finish_do_stmt,
1520 finish_for_cond): Likewise.
1521
1522 2023-08-01 Lewis Hyatt <lhyatt@gmail.com>
1523
1524 * parser.cc (c_init_preprocess): New function.
1525 (maybe_read_tokens_for_pragma_lex): New function.
1526 (pragma_lex): Support preprocess-only mode.
1527 (pragma_lex_discard_to_eol): New function.
1528
1529 2023-07-31 Chung-Lin Tang <cltang@codesourcery.com>
1530
1531 * parser.cc (cp_parser_oacc_host_data): Add checking requiring OpenACC
1532 host_data construct to have an use_device clause.
1533
1534 2023-07-28 Ng YongXiang <yongxiangng@gmail.com>
1535
1536 PR c++/110057
1537 PR ipa/83054
1538 * init.cc (build_vec_delete_1): Devirtualize array destruction.
1539
1540 2023-07-27 Patrick Palka <ppalka@redhat.com>
1541
1542 PR c++/110197
1543 * constexpr.cc (cxx_eval_array_reference): Allow synthesizing an
1544 empty subobject even if CONSTRUCTOR_NO_CLEARING is set.
1545 (cxx_eval_bare_aggregate): Set 'no_slot' to true more generally
1546 whenever new_ctx.ctor is set to NULL_TREE by init_subob_ctx,
1547 i.e. whenever initializing an subobject of empty type.
1548 (cxx_eval_vec_init_1): Define 'no_slot' as above and use it
1549 accordingly.
1550
1551 2023-07-27 Nathaniel Shead <nathanieloshead@gmail.com>
1552
1553 PR c++/103497
1554 * pt.cc (type_uses_auto): Check inside parameter packs.
1555
1556 2023-07-26 Patrick Palka <ppalka@redhat.com>
1557
1558 PR c++/110566
1559 PR c++/108179
1560 * pt.cc (reduce_template_parm_level): Set DECL_TEMPLATE_INFO
1561 on the DECL_TEMPLATE_RESULT of the new ttp.
1562 (add_defaults_to_ttp): Make a copy of the original ttp's
1563 DECL_TEMPLATE_RESULT, and update this copy's DECL_TEMPLATE_INFO
1564 as well.
1565 (coerce_template_template_parms): Make sure 'scope_args' has
1566 the right amount of levels for the ttp argument.
1567 (most_general_template): Handle template template parameters.
1568 (rewrite_template_parm): Set DECL_TEMPLATE_RESULT on the
1569 DECL_TEMPLATE_RESULT of the new ttp.
1570
1571 2023-07-26 Patrick Palka <ppalka@redhat.com>
1572
1573 PR c++/110566
1574 PR c++/108179
1575 * pt.cc (coerce_template_template_parms): Simplify by using
1576 DECL_INNERMOST_TEMPLATE_PARMS and removing redundant asserts.
1577 Always pass the parameters of the most general template to
1578 coerce_template_parms.
1579
1580 2023-07-26 Patrick Palka <ppalka@redhat.com>
1581
1582 PR c++/110809
1583 * pt.cc (unify) <case INTEGER_CST>: Generalize to handle
1584 REAL_CST as well.
1585
1586 2023-07-26 Marek Polacek <polacek@redhat.com>
1587
1588 * parser.cc (cp_parser_constant_expression): Allow non_constant_p to be
1589 nullptr even when allow_non_constant_p is true. Don't call
1590 _rvalue_constant_expression when not necessary. Move local variable
1591 declarations closer to their first use.
1592 (cp_parser_static_assert): Don't pass a dummy down to
1593 cp_parser_constant_expression.
1594
1595 2023-07-26 Jason Merrill <jason@redhat.com>
1596
1597 PR c++/106310
1598 * parser.cc (cp_parser_template_name): Skip non-member
1599 lookup after the template keyword.
1600 (cp_parser_lookup_name): Pass down template_keyword_p.
1601
1602 2023-07-26 Nathaniel Shead <nathanieloshead@gmail.com>
1603
1604 PR c++/96630
1605 PR c++/98675
1606 PR c++/70331
1607 * constexpr.cc (constexpr_global_ctx::is_outside_lifetime): New
1608 function.
1609 (constexpr_global_ctx::get_value): Don't return expired values.
1610 (constexpr_global_ctx::get_value_ptr): Likewise.
1611 (constexpr_global_ctx::remove_value): Mark value outside
1612 lifetime.
1613 (outside_lifetime_error): New function.
1614 (cxx_eval_call_expression): No longer track save_exprs.
1615 (cxx_eval_loop_expr): Likewise.
1616 (cxx_eval_constant_expression): Add checks for outside lifetime
1617 values. Remove local variables at end of bind exprs, and
1618 temporaries after cleanup points.
1619
1620 2023-07-26 Nathaniel Shead <nathanieloshead@gmail.com>
1621
1622 PR c++/110619
1623 * cp-gimplify.cc (cp_genericize_r): Transform RETURN_EXPRs to
1624 not return dangling pointers.
1625 * cp-tree.h (RETURN_EXPR_LOCAL_ADDR_P): New flag.
1626 (check_return_expr): Add a new parameter.
1627 * semantics.cc (finish_return_stmt): Set flag on RETURN_EXPR
1628 when referring to dangling pointer.
1629 * typeck.cc (check_return_expr): Disable transformation of
1630 dangling pointers, instead pass this information to caller.
1631
1632 2023-07-26 Nathaniel Shead <nathanieloshead@gmail.com>
1633
1634 * constexpr.cc (modifying_const_object_error): Find the source
1635 location of the const object's declaration.
1636 (cxx_eval_constant_expression): Update input_location to the
1637 location of the currently evaluated expression, if possible.
1638
1639 2023-07-25 Marek Polacek <polacek@redhat.com>
1640
1641 PR c++/108960
1642 * pt.cc (lookup_and_finish_template_variable): Don't clear tf_partial
1643 here.
1644 (instantiate_template): Reset all complain flags except
1645 tf_warning_or_error.
1646
1647 2023-07-25 Marek Polacek <polacek@redhat.com>
1648
1649 PR c++/110382
1650 * constexpr.cc (cxx_eval_array_reference): Create a new constructor
1651 only when we don't already have a matching one. Clear the object
1652 when the type is non-scalar.
1653
1654 2023-07-21 Marek Polacek <polacek@redhat.com>
1655
1656 PR c++/110106
1657 * constexpr.cc (potential_constant_expression_1): Try to complete the
1658 type when !processing_template_decl.
1659
1660 2023-07-20 Marek Polacek <polacek@redhat.com>
1661
1662 PR c++/110114
1663 * call.cc (implicit_conversion_1): Return early if the type isn't
1664 complete.
1665
1666 2023-07-19 Marek Polacek <polacek@redhat.com>
1667
1668 PR c++/110745
1669 * error.cc (dump_simple_decl): Print base class name.
1670
1671 2023-07-19 Marek Polacek <polacek@redhat.com>
1672
1673 PR c++/110064
1674 * typeck2.cc (process_init_constructor_record): Don't emit
1675 -Wmissing-field-initializers for empty classes.
1676
1677 2023-07-19 Patrick Palka <ppalka@redhat.com>
1678
1679 * pt.cc (type_unification_real): Test for PARM_DECL instead
1680 of TEMPLATE_PARM_INDEX to distinguish a type vs non-type
1681 template parameter pack.
1682 (type_targs_deducible_from): Likewise.
1683
1684 2023-07-19 Patrick Palka <ppalka@redhat.com>
1685
1686 * pt.cc (tsubst_function_decl): Add defaulted 'use_spec_table'
1687 flag parameter. Don't look up or insert into the specializations
1688 table if 'use_spec_table' is false.
1689 (tsubst_decl): Add defaulted 'use_spec_table' flag parameter.
1690 Check for error_mark_node.
1691 <case FUNCTION_DECL>: Pass 'use_spec_table' to
1692 tsubst_function_decl.
1693 <case TYPE/VAR_DECL>: Don't call coerce_template_parms.
1694 Don't look up or insert into the specializations table if
1695 'use_spec_table' is false. Exit earlier if the substituted
1696 type is erroneous and we're not complaining, and do so for
1697 alias specializations as well.
1698 (instantiate_template): Pass false as 'use_spec_table'
1699 to tsubst_decl. Call register_specialization afterwards.
1700
1701 2023-07-18 Jason Merrill <jason@redhat.com>
1702
1703 * constexpr.cc (cxx_eval_bit_cast): Check that the result of
1704 native_interpret_aggregate doesn't need more evaluation.
1705
1706 2023-07-18 Patrick Palka <ppalka@redhat.com>
1707
1708 * call.cc (add_template_conv_candidate): Don't check for
1709 non-empty 'candidates' here.
1710 (build_op_call): Check it here, before we've considered any
1711 conversion functions.
1712
1713 2023-07-18 Patrick Palka <ppalka@redhat.com>
1714
1715 PR c++/110535
1716 * call.cc (add_conv_candidate): Check constraints.
1717
1718 2023-07-17 Jason Merrill <jason@redhat.com>
1719
1720 * constexpr.cc (cxx_eval_call_expression): Only cache
1721 reduced_constant_expression_p results.
1722 (reduced_constant_expression_p): Handle CONSTRUCTOR of scalar type.
1723 (cxx_eval_constant_expression): Fold vectors here.
1724 (cxx_eval_bare_aggregate): Not here.
1725
1726 2023-07-15 Patrick Palka <ppalka@redhat.com>
1727
1728 PR c++/110441
1729 * call.cc (keep_unused_object_arg): Use cp_build_compound_expr
1730 instead of building a COMPOUND_EXPR directly.
1731
1732 2023-07-15 Patrick Palka <ppalka@redhat.com>
1733
1734 PR c++/110524
1735 * mangle.cc (write_expression): Handle TEMPLATE_ID_EXPR
1736 whose template is already an IDENTIFIER_NODE.
1737
1738 2023-07-14 Nathaniel Shead <nathanieloshead@gmail.com>
1739
1740 * constexpr.cc (cxx_eval_constant_expression): Pass t to get_value.
1741
1742 2023-07-14 Jason Merrill <jason@redhat.com>
1743
1744 PR c++/110344
1745 * constexpr.cc (cxx_eval_constant_expression): Move P2738 handling
1746 after heap handling.
1747 * name-lookup.cc (get_cxx_dialect_name): Add C++26.
1748
1749 2023-07-14 Marek Polacek <polacek@redhat.com>
1750 Jason Merrill <jason@redhat.com>
1751
1752 PR c++/109876
1753 * decl.cc (cp_finish_decl): Set TREE_CONSTANT when initializing
1754 an object of empty class type.
1755 * pt.cc (value_dependent_expression_p) <case VAR_DECL>: Treat a
1756 constexpr-declared non-constant variable as value-dependent.
1757
1758 2023-07-11 Patrick Palka <ppalka@redhat.com>
1759
1760 PR c++/110580
1761 * pt.cc (lookup_template_variable): Pass all levels of arguments
1762 to coerce_template_parms, and use the parameters from the most
1763 general template.
1764
1765 2023-07-10 Patrick Palka <ppalka@redhat.com>
1766
1767 PR c++/110523
1768 * pt.cc (redeclare_class_template): Relax the ttp DECL_CONTEXT
1769 assert, and downgrade it to a checking assert.
1770
1771 2023-06-30 Patrick Palka <ppalka@redhat.com>
1772
1773 * cp-tree.h (TEMPLATE_PARM_DESCENDANTS): Harden.
1774 (TEMPLATE_TYPE_DESCENDANTS): Define.
1775 (TEMPLATE_TEMPLATE_PARM_SIMPLE_P): Define.
1776 * pt.cc (reduce_template_parm_level): Revert
1777 r14-418-g0bc2a1dc327af9 change.
1778 (process_template_parm): Set TEMPLATE_TEMPLATE_PARM_SIMPLE_P
1779 appropriately.
1780 (uses_outer_template_parms): Determine the outer depth of
1781 a template template parm without relying on DECL_CONTEXT.
1782 (tsubst) <case TEMPLATE_TEMPLATE_PARM>: Cache lowering a
1783 simple template template parm. Consistently use 'code'.
1784
1785 2023-06-29 Patrick Palka <ppalka@redhat.com>
1786
1787 PR c++/110468
1788 * init.cc (maybe_instantiate_nsdmi_init): Mask out all
1789 tsubst flags except for tf_warning_or_error.
1790
1791 2023-06-29 Patrick Palka <ppalka@redhat.com>
1792
1793 PR c++/110463
1794 * cp-gimplify.cc (cp_fold) <case CONSTRUCTOR>: Propagate
1795 CONSTRUCTOR_MUTABLE_POISON.
1796
1797 2023-06-29 Patrick Palka <ppalka@redhat.com>
1798
1799 * cp-tree.h (tree_template_info::partial): New data member.
1800 (TI_PARTIAL_INFO): New tree accessor.
1801 (most_specialized_partial_spec): Add defaulted bool parameter.
1802 * module.cc (trees_out::core_vals) <case TEMPLATE_INFO>: Stream
1803 TI_PARTIAL_INFO.
1804 (trees_in::core_vals) <case TEMPLATE_INFO>: Likewise.
1805 * parser.cc (specialization_of): Adjust after making
1806 most_specialized_partial_spec return TEMPLATE_INFO instead
1807 of TREE_LIST.
1808 * pt.cc (process_partial_specialization): Set TI_PARTIAL_INFO
1809 of 'decl' to point back to the partial TEMPLATE_DECL. Likewise
1810 (and pass rechecking=true to most_specialization_partial_spec).
1811 (instantiate_class_template): Likewise.
1812 (instantiate_template): Set TI_PARTIAL_INFO to the result of
1813 most_specialization_partial_spec after forming a variable
1814 template specialization.
1815 (most_specialized_partial_spec): Add 'rechecking' parameter.
1816 Exit early if the template is not primary. Use the TI_PARTIAL_INFO
1817 of the corresponding TEMPLATE_INFO as a cache unless 'rechecking'
1818 is true. Don't bother setting TREE_TYPE of each TREE_LIST.
1819 (instantiate_decl): Adjust after making
1820 most_specialized_partial_spec return TEMPLATE_INFO instead of
1821 TREE_LIST.
1822 * ptree.cc (cxx_print_xnode) <case TEMPLATE_INFO>: Dump
1823 TI_PARTIAL_INFO.
1824
1825 2023-06-29 Eugene Rozenfeld <erozen@microsoft.com>
1826
1827 * Make-lang.in: Pass correct stage cc1plus when processing
1828 profile data collected while building target libraries
1829
1830 2023-06-28 Patrick Palka <ppalka@redhat.com>
1831
1832 PR c++/89442
1833 PR c++/107437
1834 * cp-tree.h (lookup_template_variable): Add complain parameter.
1835 * parser.cc (cp_parser_template_id): Pass tf_warning_or_error
1836 to lookup_template_variable.
1837 * pt.cc (lookup_template_variable): Add complain parameter.
1838 Coerce template arguments here ...
1839 (finish_template_variable): ... instead of here.
1840 (lookup_and_finish_template_variable): Check for error_mark_node
1841 result from lookup_template_variable.
1842 (tsubst_copy) <case TEMPLATE_ID_EXPR>: Pass complain to
1843 lookup_template_variable.
1844 (instantiate_template): Use build2 instead of
1845 lookup_template_variable to build a TEMPLATE_ID_EXPR
1846 for most_specialized_partial_spec.
1847
1848 2023-06-28 Marek Polacek <polacek@redhat.com>
1849
1850 PR c++/110175
1851 * typeck.cc (cp_build_unary_op): Check tf_warning before warning.
1852
1853 2023-06-28 Jason Merrill <jason@redhat.com>
1854
1855 PR c++/110334
1856 * cp-tree.h (clone_attrs): Declare.
1857 * method.cc (implicitly_declare_fn): Use it for inherited
1858 constructor.
1859 * optimize.cc (clone_attrs): New.
1860 (maybe_clone_body): Use it.
1861
1862 2023-06-28 Jason Merrill <jason@redhat.com>
1863
1864 PR c++/110344
1865 * constexpr.cc (cxx_eval_constant_expression): In C++26, allow cast
1866 from void* to the type of a pointed-to object.
1867
1868 2023-06-23 David Malcolm <dmalcolm@redhat.com>
1869
1870 PR c++/110164
1871 * cp-name-hint.h (maybe_suggest_missing_header): New decl.
1872 * decl.cc: Define INCLUDE_MEMORY. Add include of
1873 "cp/cp-name-hint.h".
1874 (start_decl_1): Call maybe_suggest_missing_header.
1875 * name-lookup.cc (maybe_suggest_missing_header): Remove "static".
1876
1877 2023-06-16 Alex Coplan <alex.coplan@arm.com>
1878
1879 * parser.cc (cp_parser_enum_specifier): Don't reject
1880 elaborated-type-specifier with enum-base, instead emit new
1881 Welaborated-enum-base warning.
1882
1883 2023-06-14 Jason Merrill <jason@redhat.com>
1884
1885 DR 2327
1886 PR c++/86521
1887 * call.cc (joust_maybe_elide_copy): Don't change cand.
1888 (joust): Move the elided tiebreaker later.
1889
1890 2023-06-13 David Malcolm <dmalcolm@redhat.com>
1891
1892 PR c/84890
1893 * name-lookup.cc (missing_std_header::~missing_std_header): Reword
1894 note to avoid negative tone of "forgetting".
1895
1896 2023-06-13 Jason Merrill <jason@redhat.com>
1897
1898 * tree.cc (build_target_expr): Check TYPE_HAS_MUTABLE_P.
1899
1900 2023-06-12 Tobias Burnus <tobias@codesourcery.com>
1901
1902 * parser.cc (cp_parser_omp_clause_map): Reword error message for
1903 clearness especially with 'omp target (enter/exit) data.'
1904 * semantics.cc (handle_omp_array_sections): Handle
1905 GOMP_MAP_{ALWAYS_,}PRESENT_{TO,TOFROM,FROM,ALLOC} enum values.
1906
1907 2023-06-12 Jason Merrill <jason@redhat.com>
1908
1909 PR c++/105838
1910 * call.cc (convert_like_internal) [ck_list]: Use
1911 maybe_init_list_as_array.
1912 * constexpr.cc (cxx_eval_vec_init_1): Init might have
1913 a different type.
1914 * tree.cc (build_vec_init_elt): Likewise.
1915 * init.cc (build_vec_init): Handle from_array from a
1916 TARGET_EXPR. Retain TARGET_EXPR of a different type.
1917
1918 2023-06-11 Patrick Palka <ppalka@redhat.com>
1919
1920 PR c++/110122
1921 * constexpr.cc (cxx_eval_call_expression): Synthesize defaulted
1922 functions needed for constant evaluation.
1923 (instantiate_cx_fn_r): Likewise.
1924
1925 2023-06-11 Patrick Palka <ppalka@redhat.com>
1926
1927 PR c++/110122
1928 * pt.cc (lookup_template_class): Extend shortcut for looking up the
1929 current class scope to consider outer class scopes too, and use
1930 current_nonlambda_class_type instead of current_class_type. Only
1931 call coerce_template_parms when specializing a primary template.
1932
1933 2023-06-10 Nathan Sidwell <nathan@acm.org>
1934
1935 PR c++/61663
1936 * pt.cc (maybe_adjust_types_for_deduction): Implement DR976.
1937
1938 2023-06-09 Jason Merrill <jason@redhat.com>
1939
1940 PR c++/110185
1941 PR c++/58487
1942 * method.cc (build_comparison_op): Give retval a name.
1943 * typeck.cc (check_return_expr): Fix for nameless variables.
1944
1945 2023-06-09 Jason Merrill <jason@redhat.com>
1946
1947 * parser.cc (cp_parser_simple_type_specifier): Check for auto
1948 in template argument.
1949 (cp_parser_template_type_arg): Remove auto checking.
1950
1951 2023-06-09 Jason Merrill <jason@redhat.com>
1952
1953 PR c++/110102
1954 * call.cc (maybe_init_list_as_array): Check that the element type is
1955 copyable.
1956
1957 2023-06-07 Jason Merrill <jason@redhat.com>
1958
1959 PR c++/58487
1960 PR c++/53637
1961 * cp-tree.h (INIT_EXPR_NRV_P): New.
1962 * semantics.cc (finalize_nrv_r): Check it.
1963 * name-lookup.h (decl_in_scope_p): Declare.
1964 * name-lookup.cc (decl_in_scope_p): New.
1965 * typeck.cc (check_return_expr): Allow non-NRV
1966 returns if the NRV is no longer in scope.
1967
1968 2023-06-07 Jason Merrill <jason@redhat.com>
1969
1970 PR c++/58487
1971 * typeck.cc (want_nrvo_p): New.
1972 (check_return_expr): Handle -Wnrvo.
1973
1974 2023-06-07 Jason Merrill <jason@redhat.com>
1975
1976 PR c++/51571
1977 PR c++/92407
1978 * decl.cc (finish_function): Simplify NRV handling.
1979 * except.cc (maybe_set_retval_sentinel): Also set if NRV.
1980 (maybe_splice_retval_cleanup): Don't add the cleanup region
1981 if we don't need it.
1982 * semantics.cc (nrv_data): Add simple field.
1983 (finalize_nrv): Set it.
1984 (finalize_nrv_r): Check it and retval sentinel.
1985 * cp-tree.h (finalize_nrv): Adjust declaration.
1986 * typeck.cc (check_return_expr): Remove named_labels check.
1987
1988 2023-06-07 Jason Merrill <jason@redhat.com>
1989
1990 PR c++/92407
1991 * typeck.cc (check_return_expr): Prevent NRV in the presence of
1992 named labels.
1993
1994 2023-06-07 Jason Merrill <jason@redhat.com>
1995
1996 PR c++/33799
1997 * except.cc (maybe_splice_retval_cleanup): Change
1998 recognition of function body and try scopes.
1999 * semantics.cc (do_poplevel): Call it after poplevel.
2000 (at_try_scope): New.
2001 * cp-tree.h (maybe_splice_retval_cleanup): Adjust.
2002
2003 2023-06-07 Jason Merrill <jason@redhat.com>
2004
2005 * semantics.cc (finalize_nrv_r): [RETURN_EXPR]: Only replace the
2006 INIT_EXPR.
2007
2008 2023-06-06 Kwok Cheung Yeung <kcy@codesourcery.com>
2009 Tobias Burnus <tobias@codesourcery.com>
2010
2011 * parser.cc (cp_parser_omp_clause_defaultmap,
2012 cp_parser_omp_clause_map): Parse 'present'.
2013 (cp_parser_omp_clause_from_to): New; parse to/from
2014 clauses with optional 'present' modifier.
2015 (cp_parser_omp_all_clauses): Update call.
2016 (cp_parser_omp_target_data, cp_parser_omp_target_enter_data,
2017 cp_parser_omp_target_exit_data): Handle new enum value for
2018 'present' mapping.
2019 * semantics.cc (finish_omp_target): Likewise.
2020
2021 2023-06-04 Jason Merrill <jason@redhat.com>
2022
2023 PR c++/97720
2024 * cp-tree.h (enum cp_tree_index): Add CPTI_CALL_TERMINATE_FN.
2025 (call_terminate_fn): New macro.
2026 * cp-gimplify.cc (gimplify_must_not_throw_expr): Use it.
2027 * except.cc (init_exception_processing): Set it.
2028 (cp_protect_cleanup_actions): Return it.
2029
2030 2023-06-03 Patrick Palka <ppalka@redhat.com>
2031
2032 PR c++/109923
2033 * pt.cc (is_specialization_of_friend): Fix overbroad check for
2034 a non-template member function of a class template.
2035
2036 2023-06-03 Patrick Palka <ppalka@redhat.com>
2037
2038 * pt.cc (iterative_hash_template_arg): Don't hash
2039 TEMPLATE_TEMPLATE_PARM specially.
2040
2041 2023-06-03 Patrick Palka <ppalka@redhat.com>
2042
2043 * class.cc (build_base_path): Check in_template_context instead
2044 of in_template_function.
2045 (resolves_to_fixed_type_p): Likewise.
2046 * cp-tree.h (in_template_context): Define.
2047 (in_template_function): Remove.
2048 * decl.cc (cp_make_fname_decl): Check current_function_decl
2049 and in_template_context instead of in_template_function.
2050 * decl2.cc (mark_used): Check in_template_context instead of
2051 in_template_function.
2052 * pt.cc (in_template_function): Remove.
2053 * semantics.cc (enforce_access): Check in_template_context
2054 instead of current_template_parms directly.
2055
2056 2023-06-03 Patrick Palka <ppalka@redhat.com>
2057
2058 PR c++/70790
2059 * mangle.cc (write_expression): Handle NOEXCEPT_EXPR.
2060
2061 2023-06-02 Jason Merrill <jason@redhat.com>
2062
2063 DR 2735
2064 PR c++/109247
2065 * call.cc (sfk_copy_or_move): New.
2066 (joust): Add tiebreaker for explicit conv and copy ctor.
2067
2068 2023-06-02 Jason Merrill <jason@redhat.com>
2069
2070 PR c++/110070
2071 PR c++/105838
2072 * call.cc (maybe_init_list_as_array): Set DECL_MERGEABLE.
2073 (convert_like_internal) [ck_list]: Set it.
2074 (set_up_extended_ref_temp): Copy it.
2075 * tree.cc (handle_no_unique_addr_attribute): Set it.
2076
2077 2023-06-01 Jason Merrill <jason@redhat.com>
2078
2079 * typeck2.cc (check_narrowing): Check flag_permissive.
2080
2081 2023-05-30 Tobias Burnus <tobias@codesourcery.com>
2082
2083 PR c/109999
2084 * parser.cc (cp_parser_oacc_all_clauses,
2085 cp_parser_omp_all_clauses): Improve error wording.
2086
2087 2023-05-19 Andrew Pinski <apinski@marvell.com>
2088
2089 PR driver/33980
2090 * lang-specs.h ("@c++-header"): Add %w after
2091 the --output-pch.
2092 ("@c++-system-header"): Likewise.
2093 ("@c++-user-header"): Likewise.
2094
2095 2023-05-19 Patrick Palka <ppalka@redhat.com>
2096
2097 * constraint.cc (normalize_concept_check): Avoid having to do
2098 two norm_cache lookups. Remove unnecessary early exit for an
2099 ill-formed concept definition.
2100
2101 2023-05-19 Patrick Palka <ppalka@redhat.com>
2102
2103 PR c++/97340
2104 * pt.cc (lookup_and_finish_template_variable): Don't call
2105 convert_from_reference.
2106 (tsubst_copy_and_build) <case TEMPLATE_ID_EXPR>: Call
2107 convert_from_reference on the result of
2108 lookup_and_finish_template_variable.
2109
2110 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
2111
2112 * call.cc (promoted_arithmetic_type_p): Use _P defines from tree.h.
2113 (build_conditional_expr): Ditto.
2114 (convert_like_internal): Ditto.
2115 (convert_arg_to_ellipsis): Ditto.
2116 (build_over_call): Ditto.
2117 (compare_ics): Ditto.
2118 * class.cc (is_empty_base_ref): Ditto.
2119 * coroutines.cc (rewrite_param_uses): Ditto.
2120 * cp-tree.h (DECL_DISCRIMINATOR_P): Ditto.
2121 (ARITHMETIC_TYPE_P): Ditto.
2122 * cvt.cc (ocp_convert): Ditto.
2123 * cxx-pretty-print.cc (pp_cxx_template_argument_list): Ditto.
2124 * decl.cc (layout_var_decl): Ditto.
2125 (get_tuple_size): Ditto.
2126 * error.cc (dump_simple_decl): Ditto.
2127 * lambda.cc (start_lambda_scope): Ditto.
2128 * mangle.cc (write_template_arg): Ditto.
2129 * method.cc (spaceship_comp_cat): Ditto.
2130 * module.cc (node_template_info): Ditto.
2131 (trees_out::start): Ditto.
2132 (trees_out::decl_node): Ditto.
2133 (trees_in::read_var_def): Ditto.
2134 (set_instantiating_module): Ditto.
2135 * name-lookup.cc (maybe_record_mergeable_decl): Ditto.
2136 (consider_decl): Ditto.
2137 (maybe_add_fuzzy_decl): Ditto.
2138 * pt.cc (convert_nontype_argument): Ditto.
2139 * semantics.cc (handle_omp_array_sections_1): Ditto.
2140 (finish_omp_clauses): Ditto.
2141 (finish_omp_target_clauses_r): Ditto.
2142 (is_this_parameter): Ditto.
2143 * tree.cc (build_cplus_array_type): Ditto.
2144 (is_this_expression): Ditto.
2145 * typeck.cc (do_warn_enum_conversions): Ditto.
2146 * typeck2.cc (store_init_value): Ditto.
2147 (check_narrowing): Ditto.
2148
2149 2023-05-17 Jakub Jelinek <jakub@redhat.com>
2150
2151 PR c++/109868
2152 * init.cc (build_zero_init_1): Don't initialize zero-width bitfields.
2153 For unions only initialize the first FIELD_DECL.
2154
2155 2023-05-16 Marek Polacek <polacek@redhat.com>
2156
2157 PR c++/109774
2158 * typeck.cc (check_return_expr): In a template, return only after
2159 suppressing -Wdangling-reference.
2160
2161 2023-05-16 Patrick Palka <ppalka@redhat.com>
2162
2163 PR c++/109871
2164 * call.cc (add_list_candidates): Check for invalid designated
2165 initialization sooner and even for types that have a list
2166 constructor.
2167
2168 2023-05-11 Patrick Palka <ppalka@redhat.com>
2169
2170 PR c++/109745
2171 * typeck2.cc (poison_mutable_constructors): Define.
2172 (store_init_value): Use it instead of setting
2173 CONSTRUCTOR_MUTABLE_POISON directly.
2174
2175 2023-05-11 Patrick Palka <ppalka@redhat.com>
2176 Jonathan Wakely <jwakely@redhat.com>
2177
2178 PR c++/83258
2179 PR c++/80488
2180 PR c++/97700
2181 * pt.cc (convert_nontype_argument_function): Remove linkage
2182 requirement for C++17 and later.
2183 (invalid_tparm_referent_p) <case ADDR_EXPR>: Restrict
2184 DECL_ARTIFICIAL rejection test to VAR_DECL.
2185
2186 2023-05-10 Marek Polacek <polacek@redhat.com>
2187
2188 PR c++/109680
2189 * method.cc (build_trait_object): New.
2190 (assignable_expr): Use it.
2191 (ref_xes_from_temporary): Likewise.
2192 (is_convertible_helper): Likewise. Check FUNC_OR_METHOD_TYPE_P.
2193
2194 2023-05-10 Jason Merrill <jason@redhat.com>
2195
2196 * call.cc (convert_like_internal): Share ck_ref_bind handling
2197 between all bad conversions.
2198
2199 2023-05-10 Jason Merrill <jason@redhat.com>
2200
2201 DR 2543
2202 * constexpr.cc (cxx_eval_outermost_constant_expr): Preserve
2203 TARGET_EXPR flags.
2204 (potential_constant_expression_1): Check TARGET_EXPR_ELIDING_P.
2205 * typeck2.cc (store_init_value): Diagnose constinit sooner.
2206
2207 2023-05-10 Jason Merrill <jason@redhat.com>
2208
2209 * constexpr.cc (cxx_eval_outermost_constant_expr): Always check
2210 for address of immediate fn.
2211 (maybe_constant_init_1): Evaluate PTRMEM_CST.
2212
2213 2023-05-10 Jakub Jelinek <jakub@redhat.com>
2214
2215 PR c++/109756
2216 * parser.cc (cp_parser_std_attribute): For unknown attributes with
2217 arguments set TREE_VALUE (attribute) to error_mark_node after skipping
2218 the balanced tokens.
2219 (cp_parser_std_attribute_list): If ... is used after attribute without
2220 arguments, diagnose it and return error_mark_node. If
2221 TREE_VALUE (attribute) is error_mark_node, don't call
2222 make_pack_expansion nor return early error_mark_node.
2223
2224 2023-05-09 Patrick Palka <ppalka@redhat.com>
2225
2226 PR c++/109752
2227 * constraint.cc (satisfaction_cache::satisfaction_cache): In the
2228 unexpected case of evaluating an atom for the first time noisily,
2229 remove the cache slot that we inserted.
2230
2231 2023-05-09 Patrick Palka <ppalka@redhat.com>
2232
2233 PR c++/109761
2234 * parser.cc (cp_parser_class_specifier): Don't pass a class
2235 context to noexcept_override_late_checks.
2236 (noexcept_override_late_checks): Remove 'type' parameter
2237 and use DECL_CONTEXT of 'fndecl' instead.
2238
2239 2023-05-09 Jakub Jelinek <jakub@redhat.com>
2240
2241 PR c++/109756
2242 * cp-gimplify.cc (process_stmt_assume_attribute): Diagnose pack
2243 expansion of assume attribute.
2244
2245 2023-05-08 Patrick Palka <ppalka@redhat.com>
2246
2247 PR c++/106214
2248 PR c++/93107
2249 * pt.cc (do_auto_deduction): Move up resolve_nondeduced_context
2250 calls to happen before do_class_deduction. Add some
2251 error_mark_node tests.
2252
2253 2023-05-07 Patrick Palka <ppalka@redhat.com>
2254
2255 PR c++/85979
2256 * cxx-pretty-print.cc (cxx_pretty_printer::unary_expression)
2257 <case ALIGNOF_EXPR>: Consider ALIGNOF_EXPR_STD_P.
2258 * error.cc (dump_expr) <case ALIGNOF_EXPR>: Likewise.
2259
2260 2023-05-07 Patrick Palka <ppalka@redhat.com>
2261
2262 DR 2256
2263 PR c++/103091
2264 * decl.cc (decl_jump_unsafe): Return bool instead of int.
2265 Don't consider TYPE_HAS_NONTRIVIAL_DESTRUCTOR.
2266 (check_previous_goto_1): Simplify now that decl_jump_unsafe
2267 returns bool instead of int.
2268 (check_goto): Likewise.
2269
2270 2023-05-07 Patrick Palka <ppalka@redhat.com>
2271
2272 * pt.cc (instantiate_alias_template): Exit early upon
2273 error from coerce_template_parms. Remove dependence test
2274 guarding constraints_satisfied_p.
2275
2276 2023-05-07 Patrick Palka <ppalka@redhat.com>
2277
2278 * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Harden via
2279 TEMPLATE_TYPE_PARM_CHECK.
2280 (TPARMS_PRIMARY_TEMPLATE): Harden via TREE_VEC_CHECK.
2281 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL): Harden via
2282 TEMPLATE_TEMPLATE_PARM_CHECK.
2283 * cxx-pretty-print.cc (cxx_pretty_printer::simple_type_specifier):
2284 Guard PLACEHOLDER_TYPE_CONSTRAINTS access.
2285 * error.cc (dump_type) <case TEMPLATE_TYPE_PARM>: Use separate
2286 variable to store CLASS_PLACEHOLDER_TEMPLATE result.
2287 * pt.cc (outer_template_args): Use strip_innermost_template_args.
2288 (any_type_dependent_arguments_p): Exit early if
2289 !processing_template_decl. Use range-based for.
2290 (any_dependent_template_arguments_p): Likewise.
2291
2292 2023-05-07 Patrick Palka <ppalka@redhat.com>
2293
2294 PR c++/98283
2295 * pt.cc (tsubst_copy_and_build) <case COMPONENT_REF>: Propagate
2296 REF_PARENTHESIZED_P more generally via force_paren_expr.
2297 * semantics.cc (force_paren_expr): Document default argument.
2298
2299 2023-05-07 Patrick Palka <ppalka@redhat.com>
2300
2301 PR c++/109651
2302 * pt.cc (coerce_template_args_for_ttp): Mention we can hit the
2303 current_template_parms fallback when level-lowering a bound ttp.
2304 (tsubst_template_decl): Add lambda_tparms parameter. Prefer to
2305 use lambda_tparms instead of substituting DECL_TEMPLATE_PARMS.
2306 (tsubst_decl) <case TEMPLATE_DECL>: Pass NULL_TREE as lambda_tparms
2307 to tsubst_template_decl.
2308 (tsubst_lambda_expr): For a generic lambda, substitute
2309 DECL_TEMPLATE_PARMS and set current_template_parms to it
2310 before substituting the function type. Pass the substituted
2311 DECL_TEMPLATE_PARMS as lambda_tparms to tsubst_template_decl.
2312
2313 2023-05-07 Patrick Palka <ppalka@redhat.com>
2314
2315 PR c++/109480
2316 * semantics.cc (enforce_access): Check current_template_parms
2317 instead of processing_template_decl when deciding whether to
2318 defer the access check.
2319
2320 2023-05-07 Patrick Palka <ppalka@redhat.com>
2321
2322 PR c++/109480
2323 * constexpr.cc (potential_constant_expression_1) <case CALL_EXPR>:
2324 Reorganize to call get_fns sooner. Remove special handling of
2325 the object argument of a non-static member function call. Remove
2326 dead store to 'fun'.
2327
2328 2023-05-05 Jason Merrill <jason@redhat.com>
2329
2330 Revert:
2331 2023-04-27 Jason Merrill <jason@redhat.com>
2332
2333 PR c++/61445
2334 * pt.cc (instantiate_decl): Assert !defer_ok for local
2335 class members.
2336
2337 2023-05-03 Jason Merrill <jason@redhat.com>
2338
2339 PR c++/91618
2340 PR c++/109649
2341 * friend.cc (do_friend): Don't call check_explicit_specialization if
2342 DECL_TEMPLATE_INFO is already set.
2343 * decl2.cc (check_classfn): Set DECL_TEMPLATE_INFO.
2344 * name-lookup.cc (set_decl_namespace): Likewise.
2345
2346 2023-05-03 Jakub Jelinek <jakub@redhat.com>
2347
2348 * cp-gimplify.cc (cp_fold_data): Move definition earlier.
2349 (cp_gimplify_expr): Pass address of ff_genericize | ff_mce_false
2350 constructed data rather than &pset to cp_walk_tree with cp_fold_r.
2351
2352 2023-05-03 Jason Merrill <jason@redhat.com>
2353
2354 * pt.cc (reduce_template_parm_level): Fix comparison of
2355 template template parm to cached version.
2356
2357 2023-05-02 Jason Merrill <jason@redhat.com>
2358
2359 * pt.cc (instantiate_class_template): Skip the RECORD_TYPE
2360 of a class template.
2361 (tsubst_template_decl): Clear CLASSTYPE_USE_TEMPLATE.
2362
2363 2023-05-02 Jason Merrill <jason@redhat.com>
2364
2365 * name-lookup.cc (pop_from_top_level): Don't
2366 invalidate_class_lookup_cache.
2367
2368 2023-05-02 Jason Merrill <jason@redhat.com>
2369
2370 PR c++/109678
2371 * cp-tree.h (lookup_base): Add offset parm.
2372 * constexpr.cc (cxx_fold_indirect_ref_1): Pass it.
2373 * search.cc (struct lookup_base_data_s): Add offset.
2374 (dfs_lookup_base): Handle it.
2375 (lookup_base): Pass it.
2376
2377 2023-05-02 Jason Merrill <jason@redhat.com>
2378
2379 PR c++/109678
2380 * constexpr.cc (cxx_fold_indirect_ref_1): Handle empty base first.
2381
2382 2023-05-01 Jason Merrill <jason@redhat.com>
2383
2384 PR c++/109666
2385 * name-lookup.cc (maybe_push_to_top_level)
2386 (maybe_pop_from_top_level): Split out...
2387 * pt.cc (instantiate_body): ...from here.
2388 * init.cc (maybe_instantiate_nsdmi_init): Use them.
2389 * name-lookup.h: Declare them..
2390
2391 2023-04-28 Eugene Rozenfeld <erozen@microsoft.com>
2392
2393 * Make-lang.in: Merge perf data collected when compiling cc1plus and runtime libraries
2394
2395 2023-04-27 Jason Merrill <jason@redhat.com>
2396
2397 * call.cc (print_conversion_rejection): Use iloc_sentinel.
2398
2399 2023-04-27 Jason Merrill <jason@redhat.com>
2400
2401 PR c++/61445
2402 * pt.cc (instantiate_decl): Assert !defer_ok for local
2403 class members.
2404
2405 2023-04-26 Jason Merrill <jason@redhat.com>
2406
2407 * init.cc (nsdmi_inst): Remove.
2408 (maybe_instantiate_nsdmi_init): Use DECL_INITIAL instead.
2409
2410 2023-04-26 Jason Merrill <jason@redhat.com>
2411
2412 PR c++/109241
2413 * pt.cc (instantiate_class_template): Do partially instantiate.
2414 (tsubst_expr): Do call complete_type for partial instantiations.
2415
2416 2023-04-26 Jason Merrill <jason@redhat.com>
2417
2418 PR c++/69836
2419 * pt.cc (regenerate_decl_from_template): Skip unique friends.
2420
2421 2023-04-26 Patrick Palka <ppalka@redhat.com>
2422
2423 * pt.cc (most_specialized_partial_spec): Exit early when
2424 DECL_TEMPLATE_SPECIALIZATIONS is empty. Move local variable
2425 declarations closer to their first use. Remove redundant
2426 flag_concepts test. Remove redundant forward declaration.
2427
2428 2023-04-25 Patrick Palka <ppalka@redhat.com>
2429
2430 PR c++/108975
2431 * pt.cc (value_dependent_expression_p) <case VAR_DECL>:
2432 Suppress conservative early exit for reference variables
2433 when DECL_HAS_VALUE_EXPR_P.
2434
2435 2023-04-25 Tobias Burnus <tobias@codesourcery.com>
2436
2437 * parser.cc (cp_parser_omp_scan_loop_body): Handle
2438 zero exec statements before/after 'omp scan'.
2439
2440 2023-04-24 Patrick Palka <ppalka@redhat.com>
2441
2442 * cp-tree.h (cp_expr_location): Define here.
2443 * tree.cc (cp_expr_location): Don't define here.
2444
2445 2023-04-21 Jason Merrill <jason@redhat.com>
2446
2447 PR c++/108099
2448 * decl.cc (grokdeclarator): Don't clear typedef_decl after 'unsigned
2449 typedef' pedwarn. Use c_common_signed_or_unsigned_type. Also
2450 handle 'signed typedef'.
2451
2452 2023-04-21 Patrick Palka <ppalka@redhat.com>
2453
2454 * tree.cc (cp_walk_subtrees): Avoid repeatedly dereferencing tp.
2455 <case DECLTYPE_TYPE>: Use cp_unevaluated and WALK_SUBTREE.
2456 <case ALIGNOF_EXPR etc>: Likewise.
2457
2458 2023-04-20 Patrick Palka <ppalka@redhat.com>
2459
2460 * pt.cc (tsubst) <case TEMPLATE_TYPE_PARM>: Don't recurse when
2461 level lowering a cv-qualified type template parameter. Remove
2462 recursive loop breaker in the level lowering case for constrained
2463 autos. Use the TEMPLATE_PARM_DESCENDANTS cache in this case as
2464 well.
2465
2466 2023-04-20 Patrick Palka <ppalka@redhat.com>
2467
2468 * constraint.cc (diagnose_trait_expr): Convert a TREE_VEC
2469 of arguments into a TREE_LIST for sake of pretty printing.
2470 * cxx-pretty-print.cc (pp_cxx_trait): Handle TREE_VEC
2471 instead of TREE_LIST of trailing variadic trait arguments.
2472 * method.cc (constructible_expr): Likewise.
2473 (is_xible_helper): Likewise.
2474 * parser.cc (cp_parser_trait): Represent trailing variadic trait
2475 arguments as a TREE_VEC instead of TREE_LIST.
2476 * pt.cc (value_dependent_expression_p): Handle TREE_VEC
2477 instead of TREE_LIST of trailing variadic trait arguments.
2478 * semantics.cc (finish_type_pack_element): Likewise.
2479 (check_trait_type): Likewise.
2480
2481 2023-04-20 Patrick Palka <ppalka@redhat.com>
2482
2483 * tree.cc (strip_typedefs): Move TREE_LIST handling to
2484 strip_typedefs_expr. Dispatch to strip_typedefs_expr for
2485 non-type 't'.
2486 <case TYPENAME_TYPE>: Remove manual dispatching to
2487 strip_typedefs_expr.
2488 <case TRAIT_TYPE>: Likewise.
2489 (strip_typedefs_expr): Replaces calls to strip_typedefs_expr
2490 with strip_typedefs throughout. Don't dispatch to strip_typedefs
2491 for type 't'.
2492 <case TREE_LIST>: Replace this with the better version from
2493 strip_typedefs.
2494
2495 2023-04-19 Patrick Palka <ppalka@redhat.com>
2496 Jonathan Wakely <jwakely@redhat.com>
2497
2498 PR c++/100157
2499 * cp-trait.def (TYPE_PACK_ELEMENT): Define.
2500 * cp-tree.h (finish_trait_type): Add complain parameter.
2501 * cxx-pretty-print.cc (pp_cxx_trait): Handle
2502 CPTK_TYPE_PACK_ELEMENT.
2503 * parser.cc (cp_parser_constant_expression): Document default
2504 arguments.
2505 (cp_parser_trait): Handle CPTK_TYPE_PACK_ELEMENT. Pass
2506 tf_warning_or_error to finish_trait_type.
2507 * pt.cc (tsubst) <case TRAIT_TYPE>: Handle non-type first
2508 argument. Pass complain to finish_trait_type.
2509 * semantics.cc (finish_type_pack_element): Define.
2510 (finish_trait_type): Add complain parameter. Handle
2511 CPTK_TYPE_PACK_ELEMENT.
2512 * tree.cc (strip_typedefs): Handle non-type first argument.
2513 Pass tf_warning_or_error to finish_trait_type.
2514 * typeck.cc (structural_comptypes) <case TRAIT_TYPE>: Use
2515 cp_tree_equal instead of same_type_p for the first argument.
2516
2517 2023-04-19 Patrick Palka <ppalka@redhat.com>
2518
2519 PR c++/109556
2520 * pt.cc (try_class_unification): Don't ggc_free the copy of
2521 'targs'.
2522
2523 2023-04-19 Jason Merrill <jason@redhat.com>
2524
2525 PR c++/108099
2526 * decl.cc (grokdeclarator): Keep typedef_decl for __int128_t.
2527
2528 2023-04-17 Patrick Palka <ppalka@redhat.com>
2529
2530 PR c++/109531
2531 * pt.cc (tsubst) <case BOUND_TEMPLATE_TEMPLATE_PARM>:
2532 In the level-lowering case just use lookup_template_class
2533 to rebuild the bound ttp.
2534
2535 2023-04-15 Jason Merrill <jason@redhat.com>
2536
2537 PR c++/109357
2538 * constexpr.cc (cxx_eval_constant_expression) [TARGET_EXPR]:
2539 Check for complex initializer.
2540
2541 2023-04-13 Patrick Palka <ppalka@redhat.com>
2542
2543 PR c++/109420
2544 * decl.cc (make_typename_type): Also ignore non-types during the
2545 lookup if tag_type corresponds to an elaborated-type-specifier.
2546 * pt.cc (tsubst) <case TYPENAME_TYPE>: Pass class_type or
2547 enum_type as tag_type to make_typename_type accordingly instead
2548 of always passing typename_type.
2549
2550 2023-04-13 Jason Merrill <jason@redhat.com>
2551
2552 PR c++/109277
2553 * semantics.cc (check_trait_type): Handle incomplete type directly.
2554 * typeck2.cc (cxx_incomplete_type_diagnostic): Remove assert.
2555
2556 2023-04-13 Jason Merrill <jason@redhat.com>
2557
2558 * typeck2.cc (cxx_incomplete_type_diagnostic): Return bool.
2559 * cp-tree.h (cxx_incomplete_type_diagnostic): Adjust.
2560
2561 2023-04-12 Jakub Jelinek <jakub@redhat.com>
2562
2563 * Make-lang.in (s-cp-module-version): New target.
2564 (cp/module.o): Depend on it.
2565 (MODULE_VERSION): Remove variable.
2566 (CFLAGS-cp/module.o): For -DMODULE_VERSION= argument just
2567 cat s-cp-module-version.
2568
2569 2023-04-09 Iain Sandoe <iain@sandoe.co.uk>
2570
2571 * coroutines.cc (coro_rewrite_function_body): Ensure that added
2572 bind expressions have scope blocks.
2573
2574 2023-04-04 Jason Merrill <jason@redhat.com>
2575
2576 PR c++/107484
2577 * decl2.cc (find_last_decl): Return early if DECL_USE_TEMPLATE.
2578
2579 2023-04-03 Patrick Palka <ppalka@redhat.com>
2580
2581 PR c++/109300
2582 * decl.cc (cp_finish_decl): Diagnose ordinary auto deduction
2583 with no initializer, instead of asserting.
2584
2585 2023-04-01 Patrick Palka <ppalka@redhat.com>
2586
2587 PR c++/109160
2588 * cp-tree.h (do_auto_deduction): Add defaulted tmpl parameter.
2589 * pt.cc (convert_template_argument): Pass 'in_decl' as 'tmpl' to
2590 do_auto_deduction.
2591 (tsubst_decl) <case VAR_/TYPE_DECL>: Pass 'tmpl' instead of 't' as
2592 'in_decl' to coerce_template_parms.
2593 (unify) <case TEMPLATE_PARM_INDEX>: Pass TPARMS_PRIMARY_TEMPLATE
2594 as 'tmpl' to do_auto_deduction.
2595 (do_auto_deduction): Document default arguments. Rename local
2596 variable 'tmpl' to 'ctmpl'. Use 'tmpl' to obtain a full set of
2597 template arguments for satisfaction in the adc_unify case.
2598
2599 2023-04-01 Patrick Palka <ppalka@redhat.com>
2600
2601 PR c++/53164
2602 PR c++/105848
2603 * pt.cc (invalid_tparm_referent_p): Accept ADDR_EXPR of
2604 FUNCTION_DECL.
2605 (instantiate_class_template): Call mark_template_arguments_used.
2606 (tsubst_copy_and_build) <case CALL_EXPR>: Revert r13-995 change.
2607 (mark_template_arguments_used): Define.
2608 (instantiate_body): Call mark_template_arguments_used.
2609
2610 2023-04-01 Iain Sandoe <iain@sandoe.co.uk>
2611
2612 PR c++/101118
2613 * coroutines.cc (flatten_await_stmt): Use the current count of
2614 promoted temporaries to build a unique name for the frame entries.
2615
2616 2023-03-30 Jason Merrill <jason@redhat.com>
2617
2618 PR c++/105452
2619 * search.cc (type_context_for_name_lookup): New.
2620 (accessible_p): Handle anonymous union.
2621 * init.cc (maybe_instantiate_nsdmi_init): Use
2622 type_context_for_name_lookup.
2623 * parser.cc (cp_parser_class_specifier): Likewise.
2624 * cp-tree.h (type_context_for_name_lookup): Declare.
2625
2626 2023-03-30 Jason Merrill <jason@redhat.com>
2627
2628 PR c++/105221
2629 * pt.cc (unify) [FUNCTION_TYPE]: Handle function pointer
2630 conversions.
2631
2632 2023-03-30 Jakub Jelinek <jakub@redhat.com>
2633
2634 PR c++/109319
2635 * decl2.cc (grok_array_decl): After emitting a pedwarn for
2636 -Wcomma-subscript, if processing_template_decl set orig_index_exp
2637 to compound expr from orig_index_exp_list.
2638
2639 2023-03-30 Jason Merrill <jason@redhat.com>
2640
2641 PR c++/107897
2642 PR c++/108887
2643 * decl2.cc (record_mangling): Use symtab_node::reset.
2644
2645 2023-03-30 Jakub Jelinek <jakub@redhat.com>
2646
2647 PR c++/109278
2648 * call.cc (convert_like_internal): If pedwarn for extended float
2649 type conversions doesn't report anything, avoid calling
2650 maybe_inform_about_fndecl_for_bogus_argument_init.
2651
2652 2023-03-29 Jason Merrill <jason@redhat.com>
2653
2654 PR c++/109321
2655 PR c++/109320
2656 * pt.cc (alias_ctad_tweaks): Rewrite deduced args.
2657 (type_targs_deducible_from): Handle null pack deduction.
2658
2659 2023-03-28 David Malcolm <dmalcolm@redhat.com>
2660
2661 PR c/107002
2662 * parser.cc (cp_parser_binary_expression): Update for new param of
2663 check_for_xor_used_as_pow.
2664
2665 2023-03-28 Jakub Jelinek <jakub@redhat.com>
2666
2667 PR c++/109309
2668 * contracts.cc: Include intl.h.
2669 (check_postcondition_result): Don't form diagnostics from two halves
2670 of an English message to allow translations.
2671
2672 2023-03-24 Patrick Palka <ppalka@redhat.com>
2673
2674 PR c++/106969
2675 * parser.cc (cp_parser_class_specifier): Clear current_class_ptr
2676 and current_class_ref sooner, before parsing a class definition.
2677
2678 2023-03-24 Jason Merrill <jason@redhat.com>
2679
2680 PR c++/105481
2681 * pt.cc (type_unification_real): Adjust for partial ordering.
2682
2683 2023-03-23 Jason Merrill <jason@redhat.com>
2684
2685 PR c++/105996
2686 * typeck.cc (build_ptrmemfunc): Drop 0-offset optimization
2687 and location wrappers.
2688
2689 2023-03-23 Marek Polacek <polacek@redhat.com>
2690
2691 PR c++/107532
2692 * call.cc (class_has_reference_member_p): New.
2693 (class_has_reference_member_p_r): New.
2694 (reference_like_class_p): Don't look for a specific constructor.
2695 Use a DFS walk with class_has_reference_member_p_r.
2696
2697 2023-03-23 Jason Merrill <jason@redhat.com>
2698
2699 PR c++/109241
2700 * pt.cc (find_parameter_packs_r): Handle null TREE_BINFO.
2701
2702 2023-03-22 Jason Merrill <jason@redhat.com>
2703
2704 PR c++/108390
2705 * pt.cc (unify): Use fold of build_nop instead of fold_convert.
2706
2707 2023-03-22 Jason Merrill <jason@redhat.com>
2708
2709 PR c++/108795
2710 * semantics.cc (finish_id_expression_1): Check scope before
2711 returning id_expression.
2712
2713 2023-03-22 Alex Coplan <alex.coplan@arm.com>
2714
2715 PR c++/109177
2716 * call.cc (build_over_call): Use make_temp_override to suppress
2717 both unavailable and deprecated warnings when calling
2718 build_addr_func.
2719
2720 2023-03-21 Jason Merrill <jason@redhat.com>
2721
2722 PR c++/106890
2723 * init.cc (maybe_instantiate_nsdmi_init): Don't leave
2724 current_function_decl set to a constructor.
2725
2726 2023-03-20 Marek Polacek <polacek@redhat.com>
2727
2728 PR c++/109159
2729 * call.cc (add_template_candidate_real): Add explicit decls to the
2730 set of candidates when the initializer is a braced-init-list.
2731
2732 2023-03-20 Jakub Jelinek <jakub@redhat.com>
2733
2734 PR c++/109164
2735 * cp-tree.h (var_needs_tls_wrapper): Declare.
2736 * decl2.cc (var_needs_tls_wrapper): No longer static.
2737 * decl.cc (cp_finish_decl): Clear TREE_READONLY on TLS variables
2738 for which a TLS wrapper will be needed.
2739
2740 2023-03-17 Jason Merrill <jason@redhat.com>
2741
2742 PR c++/108975
2743 * lambda.cc (prune_lambda_captures): Don't bother in a template.
2744
2745 2023-03-17 Jason Merrill <jason@redhat.com>
2746
2747 PR c++/109172
2748 * except.cc (build_throw): Check dtor access.
2749
2750 2023-03-17 Jason Merrill <jason@redhat.com>
2751
2752 PR c++/69410
2753 * friend.cc (do_friend): Handle namespace as scope argument.
2754 * decl.cc (grokdeclarator): Pass down in_namespace.
2755
2756 2023-03-16 Jason Merrill <jason@redhat.com>
2757
2758 PR c++/105809
2759 * init.cc (get_nsdmi): Split out...
2760 (maybe_instantiate_nsdmi_init): ...this function.
2761 * cp-tree.h: Declare it.
2762 * pt.cc (tsubst_expr): Use it.
2763
2764 2023-03-16 Jason Merrill <jason@redhat.com>
2765
2766 PR c++/108242
2767 * pt.cc (tsubst_expr) [TAG_DEFN]: Handle partial instantiation.
2768
2769 2023-03-16 Jason Merrill <jason@redhat.com>
2770
2771 PR c++/101869
2772 * semantics.cc (finish_qualified_id_expr): Don't try to build a
2773 pointer-to-member if the scope is an enumeration.
2774
2775 2023-03-16 Patrick Palka <ppalka@redhat.com>
2776
2777 PR c++/109030
2778 * constexpr.cc (maybe_constant_init_1): For an unevaluated
2779 non-manifestly-constant operand, don't constant evaluate
2780 and instead call fold_to_constant as in maybe_constant_value.
2781
2782 2023-03-16 Patrick Palka <ppalka@redhat.com>
2783
2784 PR c++/100288
2785 * constraint.cc (satisfaction_cache::get): Relax overly strict
2786 checking assert in the constraint recursion case.
2787
2788 2023-03-16 Jason Merrill <jason@redhat.com>
2789
2790 PR c++/105406
2791 * coroutines.cc (build_co_await): Handle lvalue 'o'.
2792
2793 2023-03-15 Jason Merrill <jason@redhat.com>
2794
2795 PR c++/103871
2796 PR c++/98056
2797 * typeck.cc (cp_build_modify_expr): Allow array initialization of
2798 DECL_ARTIFICIAL variable.
2799
2800 2023-03-15 Marek Polacek <polacek@redhat.com>
2801
2802 PR c++/107280
2803 * constexpr.cc (cxx_eval_store_expression): Strip location wrappers.
2804
2805 2023-03-15 Jason Merrill <jason@redhat.com>
2806
2807 PR c++/58538
2808 * semantics.cc (check_template_template_default_arg): Check
2809 maybe_get_template_decl_from_type_decl.
2810
2811 2023-03-15 Jason Merrill <jason@redhat.com>
2812
2813 PR c++/108179
2814 PR c++/104107
2815 PR c++/95036
2816 * pt.cc (coerce_template_template_parms): Use args from
2817 DECL_CONTEXT (arg_tmpl) instead of outer_args.
2818
2819 2023-03-15 Jason Merrill <jason@redhat.com>
2820
2821 PR c++/108179
2822 * pt.cc (coerce_template_template_parms): Take the arg and parm
2823 templates directly.
2824 (coerce_template_template_parm): Adjust.
2825 (template_template_parm_bindings_ok_p): Adjust.
2826 (convert_template_argument): Adjust.
2827
2828 2023-03-14 Patrick Palka <ppalka@redhat.com>
2829
2830 PR c++/96830
2831 * pt.cc (push_inline_template_parms_recursive): Set
2832 TEMPLATE_PARMS_CONSTRAINTS.
2833 (push_template_decl): For an out-of-line declaration, verify
2834 constraints for each enclosing template scope match those of the
2835 original template declaratation.
2836
2837 2023-03-14 Patrick Palka <ppalka@redhat.com>
2838
2839 PR c++/96830
2840 * pt.cc (redeclare_class_template): Add missing "of" in
2841 constraint mismatch diagnostic.
2842 (tsubst_friend_class): For an already declared class template,
2843 substitute and pass the friend declaration's constraints to
2844 redeclare_class_template instead of passing the existing
2845 template's constraints.
2846
2847 2023-03-14 Jason Merrill <jason@redhat.com>
2848
2849 PR c++/108468
2850 * pt.cc (unify_pack_expansion): Check that TPARMS_PRIMARY_TEMPLATE
2851 is non-null.
2852
2853 2023-03-14 Jason Merrill <jason@redhat.com>
2854
2855 PR c++/107310
2856 * cp-gimplify.cc (genericize_if_stmt): Restore folding
2857 of constant conditions.
2858
2859 2023-03-14 Jakub Jelinek <jakub@redhat.com>
2860
2861 PR c++/109096
2862 * tree.cc (record_has_unique_obj_representations): Ignore unnamed
2863 bitfields.
2864
2865 2023-03-13 Jason Merrill <jason@redhat.com>
2866
2867 PR c++/107128
2868 * parser.cc (cp_parser_set_decl_spec_type): Use
2869 redefined_builtin_type for extended_float_type_p.
2870
2871 2023-03-13 Marek Polacek <polacek@redhat.com>
2872
2873 PR c++/107532
2874 * call.cc (reference_like_class_p): Check for std::span.
2875
2876 2023-03-10 Jakub Jelinek <jakub@redhat.com>
2877
2878 PR c++/107558
2879 * decl.cc (cp_finish_decl): Don't clear TREE_READONLY on
2880 automatic non-aggregate variables just because of
2881 -fmerge-all-constants.
2882
2883 2023-03-10 Jakub Jelinek <jakub@redhat.com>
2884
2885 PR c++/109039
2886 * class.cc (end_of_class): For bit-fields, instead of computing
2887 offset as sum of byte_position (field) and DECL_SIZE_UNIT (field),
2888 compute it as sum of bit_position (field) and DECL_SIZE (field)
2889 divided by BITS_PER_UNIT rounded up.
2890
2891 2023-03-10 Jason Merrill <jason@redhat.com>
2892
2893 PR c++/108972
2894 * lambda.cc (compare_lambda_template_head): Check more
2895 for error_mark_node.
2896
2897 2023-03-10 Jason Merrill <jason@redhat.com>
2898
2899 PR c++/108566
2900 * mangle.cc (anon_aggr_naming_decl): New.
2901 (write_unqualified_name): Use it.
2902
2903 2023-03-10 Jakub Jelinek <jakub@redhat.com>
2904
2905 PR c/108079
2906 * decl.cc (poplevel): Suppress OPT_Wunused_variable warning
2907 after diagnosing it.
2908
2909 2023-03-10 Jason Merrill <jason@redhat.com>
2910
2911 PR c++/108099
2912 * decl.cc (grokdeclarator): Handle non-typedef typedef_decl.
2913
2914 2023-03-10 Jason Merrill <jason@redhat.com>
2915
2916 PR c++/108542
2917 * class.cc (instantiate_type): Strip location wrapper.
2918
2919 2023-03-09 Jason Merrill <jason@redhat.com>
2920
2921 PR c++/108773
2922 * init.cc (find_allocator_temps_r): New.
2923 (combine_allocator_temps): Replace find_allocator_temp.
2924 (build_vec_init): Adjust.
2925
2926 2023-03-09 Jason Merrill <jason@redhat.com>
2927
2928 DR 2664
2929 PR c++/102529
2930 * pt.cc (alias_ctad_tweaks): Continue after deduction failure.
2931
2932 2023-03-09 Jason Merrill <jason@redhat.com>
2933 Michael Spertus <mike@spertus.com>
2934
2935 PR c++/105841
2936 * pt.cc (corresponding_template_parameter_list): Split out...
2937 (corresponding_template_parameter): ...from here.
2938 (find_template_parameters): Factor out...
2939 (find_template_parameter_info::find_in): ...this function.
2940 (find_template_parameter_info::find_in_recursive): New.
2941 (find_template_parameter_info::found): New.
2942 (alias_ctad_tweaks): Only add parms used in the deduced args.
2943
2944 2023-03-09 Jason Merrill <jason@redhat.com>
2945
2946 * cp-trait.def (IS_DEDUCIBLE): Add space to name.
2947
2948 2023-03-09 Jason Merrill <jason@redhat.com>
2949
2950 PR c++/105841
2951 * cp-trait.def (IS_DEDUCIBLE): New.
2952 * cxx-pretty-print.cc (pp_cxx_trait): Handle non-type.
2953 * parser.cc (cp_parser_trait): Likewise.
2954 * tree.cc (cp_tree_equal): Likewise.
2955 * pt.cc (tsubst_copy_and_build): Likewise.
2956 (type_targs_deducible_from): New.
2957 (alias_ctad_tweaks): Use it.
2958 * semantics.cc (trait_expr_value): Handle CPTK_IS_DEDUCIBLE.
2959 (finish_trait_expr): Likewise.
2960 * constraint.cc (diagnose_trait_expr): Likewise.
2961 * cp-tree.h (type_targs_deducible_from): Declare.
2962
2963 2023-03-07 Jason Merrill <jason@redhat.com>
2964
2965 PR c++/108526
2966 PR c++/106651
2967 * pt.cc (tsubst_function_decl): Don't replace the closure
2968 parameter if DECL_STATIC_FUNCTION_P.
2969
2970 2023-03-07 Marek Polacek <polacek@redhat.com>
2971
2972 PR c++/107532
2973 * call.cc (reference_like_class_p): New.
2974 (do_warn_dangling_reference): Add new bool parameter. See through
2975 reference_like_class_p.
2976
2977 2023-03-07 Jakub Jelinek <jakub@redhat.com>
2978
2979 PR c++/109042
2980 * rtti.cc (emit_support_tinfo_1): Don't assert that last
2981 unemitted_tinfo_decls element is tinfo, instead pop from it only in
2982 that case.
2983 * decl2.cc (c_parse_final_cleanups): Don't call emit_tinfo_decl
2984 for unemitted_tinfO_decls which have already non-NULL DECL_INITIAL.
2985
2986 2023-03-07 Marek Polacek <polacek@redhat.com>
2987
2988 PR c++/109030
2989 * constexpr.cc (cxx_eval_call_expression): Relax assert.
2990
2991 2023-03-07 Marek Polacek <polacek@redhat.com>
2992
2993 PR c++/107939
2994 * constexpr.cc (potential_constant_expression_1) <case CALL_EXPR>: Pass
2995 'any' when recursing on a VAR_DECL and not a pointer to function.
2996
2997 2023-03-04 Jakub Jelinek <jakub@redhat.com>
2998
2999 PR c++/108702
3000 * constexpr.cc: Include toplev.h.
3001 (cxx_eval_constant_expression) <case DECL_EXPR>: When seeing a local
3002 static initialized by constant expression outside of a constexpr
3003 function which has been deferred by make_rtl_for_nonlocal_decl,
3004 call rest_of_decl_compilation on it.
3005
3006 2023-03-03 Patrick Palka <ppalka@redhat.com>
3007
3008 PR c++/108998
3009 * pt.cc (el_data::skipped_trees): New data member.
3010 (extract_locals_r): Push to skipped_trees any unevaluated
3011 contexts that we skipped over.
3012 (extract_local_specs): For the second walk, start from each
3013 tree in skipped_trees.
3014
3015 2023-03-03 Alexandre Oliva <oliva@adacore.com>
3016
3017 * typeck.cc (cp_build_binary_op): Suppress redundant warning
3018 for pfn null test in pmfn test with vbit-in-delta.
3019
3020 2023-03-02 Jakub Jelinek <jakub@redhat.com>
3021
3022 PR target/108883
3023 * cp-tree.h (enum cp_tree_index): Remove CPTI_FALLBACK_DFLOAT*_TYPE
3024 enumerators.
3025 (fallback_dfloat32_type, fallback_dfloat64_type,
3026 fallback_dfloat128_type): Remove.
3027 * rtti.cc (emit_support_tinfo_1): If not emitted already, call
3028 emit_tinfo_decl and remove from unemitted_tinfo_decls right away.
3029 (emit_support_tinfos): Move &dfloat*_type_node from fundamentals array
3030 into new fundamentals_with_fallback array. Call emit_support_tinfo_1
3031 on elements of that array too, with the difference that if
3032 the type is NULL, use a fallback REAL_TYPE for it temporarily.
3033 Drop the !targetm.decimal_float_supported_p () handling. Call
3034 targetm.emit_support_tinfos at the end.
3035 * mangle.cc (write_builtin_type): Remove references to
3036 fallback_dfloat*_type. Handle bfloat16_type_node mangling.
3037
3038 2023-03-02 Patrick Palka <ppalka@redhat.com>
3039
3040 PR c++/108243
3041 PR c++/97553
3042 * cp-gimplify.cc (cp_fully_fold): Add an internal overload that
3043 additionally takes and propagate an mce_value parameter, and
3044 define the existing public overload in terms of it.
3045 (cp_fully_fold_init): Pass mce_false to cp_fully_fold.
3046
3047 2023-03-02 Patrick Palka <ppalka@redhat.com>
3048
3049 PR c++/108243
3050 * constexpr.cc (maybe_constant_init_1): Override
3051 manifestly_const_eval to true if is_static.
3052
3053 2023-03-02 Jakub Jelinek <jakub@redhat.com>
3054
3055 PR debug/108716
3056 * cp-gimplify.cc (cp_genericize_r) <case USING_STMT>: Set
3057 DECL_SOURCE_LOCATION on IMPORTED_DECL to expression location
3058 of USING_STMT or input_location.
3059
3060 2023-03-02 Marek Polacek <polacek@redhat.com>
3061
3062 PR c++/106259
3063 * parser.cc (class_decl_loc_t::diag_mismatched_tags): If the first
3064 lookup of SPEC didn't find anything, try to look for
3065 most_general_template.
3066
3067 2023-03-02 Jakub Jelinek <jakub@redhat.com>
3068
3069 PR c++/105839
3070 * parser.cc (cp_convert_omp_range_for): Allow in assert
3071 decomp_first_name without DECL_HAS_VALUE_EXPR_P if it has
3072 error_mark_node type.
3073 (cp_finish_omp_range_for): Don't set DECL_HAS_VALUE_EXPR_P back
3074 on decls which have error_mark_node type.
3075
3076 2023-03-01 Marek Polacek <polacek@redhat.com>
3077
3078 PR c++/107574
3079 * constexpr.cc (cxx_eval_constant_expression): Emit an error when
3080 a PTRMEM_CST cannot be evaluated.
3081
3082 2023-03-01 Patrick Palka <ppalka@redhat.com>
3083
3084 * pt.cc (tsubst_scope): Define.
3085 (tsubst_decl) <case USING_DECL>: Call tsubst_scope instead of
3086 calling tsubst_scope with tf_qualifying_scope set.
3087 (tsubst_qualified_id): Call tsubst_scope instead of
3088 calling tsubst with tf_qualifying_scope set.
3089 (tsubst_copy): Immediately delegate to tsubst for all TYPE_P
3090 trees. Remove tf_qualifying_scope manipulation.
3091 <case SCOPE_REF>: Call tsubst_scope instead of calling
3092 tsubst with tf_qualifying_scope set.
3093
3094 2023-03-01 Patrick Palka <ppalka@redhat.com>
3095 Jason Merrill <jason@redhat.com>
3096
3097 PR c++/108219
3098 PR c++/108218
3099 * constexpr.cc (fold_to_constant): Define.
3100 (maybe_constant_value): Move up early exit test for unevaluated
3101 operands. Try reducing an unevaluated operand to a constant via
3102 fold_to_constant.
3103 (fold_non_dependent_expr_template): Add early exit test for
3104 CONSTANT_CLASS_P nodes. Try reducing an unevaluated operand
3105 to a constant via fold_to_constant.
3106 * cp-tree.h (fold_to_constant): Declare.
3107
3108 2023-03-01 Jakub Jelinek <jakub@redhat.com>
3109
3110 PR c++/108606
3111 * constexpr.cc (potential_constant_expression_1) <case DECL_EXPR>:
3112 Only recurse on DECL_INITIAL (tmp) if tmp is a VAR_DECL, otherwise
3113 just return true.
3114
3115 2023-02-28 Patrick Palka <ppalka@redhat.com>
3116
3117 PR c++/108848
3118 * pt.cc (finish_template_variable): Move dependence check
3119 to here from ...
3120 (lookup_and_finish_template_variable): ... here.
3121 * semantics.cc (finish_id_expression_1): Call
3122 finish_template_variable sooner, before (and regardless of) the
3123 type_dependent_expression_p test.
3124
3125 2023-02-28 Marek Polacek <polacek@redhat.com>
3126
3127 PR c++/108550
3128 * pt.cc (lookup_and_finish_template_variable): Clear tf_partial.
3129
3130 2023-02-20 Marek Polacek <polacek@redhat.com>
3131
3132 PR c++/101073
3133 * constexpr.cc (cxx_eval_call_expression): Replace shortcutting trivial
3134 constructor/op= with a checking assert.
3135
3136 2023-02-20 Marek Polacek <polacek@redhat.com>
3137
3138 PR c++/108829
3139 * pt.cc (prepend_one_capture): Set LAMBDA_CAPTURE_EXPLICIT_P.
3140 (tsubst_lambda_expr): Pass LAMBDA_CAPTURE_EXPLICIT_P to
3141 prepend_one_capture.
3142
3143 2023-02-18 Jason Merrill <jason@redhat.com>
3144
3145 DR 2518
3146 PR c++/52809
3147 PR c++/53638
3148 PR c++/87389
3149 PR c++/89741
3150 PR c++/92099
3151 PR c++/104041
3152 PR c++/104691
3153 * semantics.cc (finish_static_assert): Don't diagnose in
3154 template context.
3155
3156 2023-02-17 Patrick Palka <ppalka@redhat.com>
3157
3158 PR c++/108243
3159 PR c++/97553
3160 * cp-gimplify.cc (enum fold_flags): Define.
3161 (fold_flags_t): Declare.
3162 (cp_fold_data::genericize): Replace this data member with ...
3163 (cp_fold_data::fold_flags): ... this.
3164 (cp_fold_r): Adjust use of cp_fold_data and calls to cp_fold.
3165 (cp_fold_function): Likewise.
3166 (cp_fold_maybe_rvalue): Add an internal overload that
3167 additionally takes and propagates a fold_flags_t parameter, and
3168 define the existing public overload in terms of it.
3169 (cp_fold_rvalue): Likewise.
3170 (cp_fully_fold_init): Adjust use of cp_fold_data.
3171 (fold_cache): Replace with ...
3172 (fold_caches): ... this 2-element array of caches.
3173 (get_fold_cache): Define.
3174 (clear_fold_cache): Adjust.
3175 (cp_fold): Add fold_flags_t parameter. Use get_fold_cache.
3176 Pass flags to calls to cp_fold, cp_fold_rvalue and
3177 cp_fold_maybe_rvalue.
3178 <case CALL_EXPR>: If ff_mce_false is set, fold
3179 __builtin_is_constant_evaluated to false and pass mce_false to
3180 maybe_constant_value.
3181
3182 2023-02-17 Patrick Palka <ppalka@redhat.com>
3183
3184 * constexpr.cc (constexpr_call::manifestly_const_eval): Give
3185 it type int instead of bool.
3186 (constexpr_ctx::manifestly_const_eval): Give it type mce_value
3187 instead of bool.
3188 (cxx_eval_builtin_function_call): Adjust after making
3189 manifestly_const_eval tri-state.
3190 (cxx_eval_call_expression): Likewise.
3191 (cxx_eval_binary_expression): Likewise.
3192 (cxx_eval_conditional_expression): Likewise.
3193 (cxx_eval_constant_expression): Likewise.
3194 (cxx_eval_outermost_constant_expr): Likewise.
3195 (cxx_constant_value): Likewise.
3196 (cxx_constant_dtor): Likewise.
3197 (maybe_constant_value): Give manifestly_const_eval parameter
3198 type mce_value instead of bool and adjust accordingly.
3199 (fold_non_dependent_expr_template): Adjust call
3200 to cxx_eval_outermost_constant_expr.
3201 (fold_non_dependent_expr): Likewise.
3202 (maybe_constant_init_1): Likewise.
3203 * constraint.cc (satisfy_atom): Adjust call to
3204 maybe_constant_value.
3205 * cp-tree.h (enum class mce_value): Define.
3206 (maybe_constant_value): Adjust manifestly_const_eval parameter
3207 type and default argument.
3208 * decl.cc (compute_array_index_type_loc): Adjust call to
3209 maybe_constant_value.
3210 * pt.cc (convert_nontype_argument): Likewise.
3211
3212 2023-02-16 Patrick Palka <ppalka@redhat.com>
3213
3214 PR c++/107773
3215 * cp-tree.h (enum tsubst_flags): New flag tf_qualifying_scope.
3216 * decl.cc (make_typename_type): Use lookup_member instead of
3217 lookup_field. If tf_qualifying_scope is set, pass want_type=true
3218 instead of =false to lookup_member. Generalize format specifier
3219 in diagnostic to handle both type and non-type bindings.
3220 * pt.cc (tsubst_aggr_type_1): Clear tf_qualifying_scope. Tidy
3221 the function.
3222 (tsubst_decl) <case USING_DECL>: Set tf_qualifying_scope when
3223 substituting USING_DECL_SCOPE.
3224 (tsubst): Clear tf_qualifying_scope right away and remember if
3225 it was set. Do the same for tf_tst_ok sooner.
3226 <case TYPENAME_TYPE>: Set tf_qualifying_scope when substituting
3227 TYPE_CONTEXT. Pass tf_qualifying_scope to make_typename_type
3228 if it was set.
3229 (tsubst_qualified_id): Set tf_qualifying_scope when substituting
3230 the scope.
3231 (tsubst_copy): Clear tf_qualifying_scope and remember if it was
3232 set.
3233 <case SCOPE_REF>: Set tf_qualifying_scope when substituting the
3234 scope.
3235 <case *_TYPE>: Pass tf_qualifying_scope to tsubst if it was set.
3236 * search.cc (lookup_member): Document default argument.
3237
3238 2023-02-16 Patrick Palka <ppalka@redhat.com>
3239
3240 * cp-tree.h: Mechanically drop static from static inline
3241 functions via s/^static inline/inline/g.
3242
3243 2023-02-15 Marek Polacek <polacek@redhat.com>
3244
3245 PR c++/106675
3246 * call.cc (joust_maybe_elide_copy): Return false for ck_ambig.
3247
3248 2023-02-10 Marek Polacek <polacek@redhat.com>
3249
3250 PR c++/107079
3251 * call.cc (set_up_extended_ref_temp): Pass var to maybe_constant_init.
3252
3253 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
3254
3255 * parser.cc (cp_parser_omp_allocate): Parse align
3256 clause and check for restrictions.
3257
3258 2023-02-09 Jakub Jelinek <jakub@redhat.com>
3259
3260 PR c++/108698
3261 * mangle.cc (write_expression, write_template_arg): Handle
3262 EXCESS_PRECISION_EXPR with REAL_CST operand as
3263 write_template_arg_literal on fold_convert of the REAL_CST
3264 to EXCESS_PRECISION_EXPR type.
3265
3266 2023-02-06 Patrick Palka <ppalka@redhat.com>
3267
3268 PR c++/107461
3269 * cp-tree.h (call_expr_dependent_name): Declare.
3270 * pt.cc (iterative_hash_template_arg) <case CALL_EXPR>: Use
3271 call_expr_dependent_name instead of dependent_name.
3272 * tree.cc (call_expr_dependent_name): Define.
3273 (called_fns_equal): Adjust to take two CALL_EXPRs instead of
3274 CALL_EXPR_FNs thereof. Use call_expr_dependent_name instead
3275 of dependent_name.
3276 (cp_tree_equal) <case CALL_EXPR>: Adjust call to called_fns_equal.
3277
3278 2023-02-03 Marek Polacek <polacek@redhat.com>
3279
3280 PR c++/108158
3281 * constexpr.cc (cxx_eval_array_reference): Don't replace
3282 new_ctx.object.
3283
3284 2023-02-03 Patrick Palka <ppalka@redhat.com>
3285
3286 PR c++/107461
3287 * semantics.cc (finish_call_expr): Strip ADDR_EXPR from
3288 the selected callee during overload set pruning.
3289
3290 2023-02-03 Patrick Palka <ppalka@redhat.com>
3291
3292 PR c++/96745
3293 * class.cc (check_methods): Diagnose an unviable OVERLOAD
3294 set for CLASSTYPE_DESTRUCTOR differently from an ambiguous one.
3295 Then prune the OVERLOAD to a single function.
3296 (check_bases_and_members): Handle CLASSTYPE_DESTRUCTOR being
3297 an OVERLOAD when calling deduce_noexcept_on_destructor.
3298 Document why it has to be called before check_methods.
3299
3300 2023-02-03 Patrick Palka <ppalka@redhat.com>
3301
3302 PR c++/108579
3303 * class.cc (check_methods): Swap order of constraints_satisfied_p
3304 and copy/move_fn_p tests.
3305
3306 2023-02-01 Marek Polacek <polacek@redhat.com>
3307
3308 PR c++/107755
3309 * call.cc (build_new_op): Don't call warn_logical_operator when
3310 processing a template.
3311
3312 2023-02-01 Jakub Jelinek <jakub@redhat.com>
3313
3314 PR c++/108607
3315 * constexpr.cc (cxx_eval_constant_expression): Handle OMP_*
3316 and OACC_* constructs as non-constant.
3317 (potential_constant_expression_1): Handle OMP_SCAN and OMP_SCOPE.
3318
3319 2023-02-01 Jason Merrill <jason@redhat.com>
3320
3321 * class.cc (note_name_declared_in_class): Change from permerror to
3322 -Wchanges-meaning pedwarn, forcing -pedantic-errors for most cases.
3323
3324 2023-01-31 Jason Merrill <jason@redhat.com>
3325
3326 PR c++/108559
3327 * cp-gimplify.cc (any_non_eliding_target_exprs): New.
3328 (cp_genericize_init): Check it.
3329
3330 2023-01-31 Marek Polacek <polacek@redhat.com>
3331
3332 PR c++/107593
3333 PR c++/108597
3334 * cp-tree.h (instantiation_dependent_expression_p): Don't
3335 declare here.
3336
3337 2023-01-26 Marek Polacek <polacek@redhat.com>
3338
3339 PR c++/105300
3340 * parser.cc: Remove unnecessary forward declarations.
3341 (cp_parser_string_literal): New wrapper.
3342 (cp_parser_string_literal_common): Renamed from
3343 cp_parser_string_literal. Add a bool parameter. Give an error when
3344 UDLs are not permitted.
3345 (cp_parser_userdef_string_literal): New wrapper.
3346 (finish_userdef_string_literal): Renamed from
3347 cp_parser_userdef_string_literal.
3348 (cp_parser_primary_expression): Call cp_parser_userdef_string_literal
3349 instead of cp_parser_string_literal.
3350 (cp_parser_linkage_specification): Move a variable declaration closer
3351 to its first use.
3352 (cp_parser_static_assert): Likewise.
3353 (cp_parser_operator): Call cp_parser_userdef_string_literal instead of
3354 cp_parser_string_literal.
3355 (cp_parser_asm_definition): Move a variable declaration closer to its
3356 first use.
3357 (cp_parser_asm_specification_opt): Move variable declarations closer to
3358 their first use.
3359 (cp_parser_asm_operand_list): Likewise.
3360 (cp_parser_asm_clobber_list): Likewise.
3361
3362 2023-01-26 Jakub Jelinek <jakub@redhat.com>
3363
3364 PR c++/108503
3365 * parser.cc (cp_convert_omp_range_for): If cp_finish_decomp has been
3366 called in !processing_template_decl with processing_template_decl
3367 temporarily set, clear DECL_HAS_VALUE_EXPR_P on the vars temporarily.
3368 (cp_finish_omp_range_for): And set it back again here.
3369
3370 2023-01-25 Jakub Jelinek <jakub@redhat.com>
3371
3372 PR c++/108525
3373 * mangle.cc (write_closure_type_name): Don't assume all
3374 lambda operator() fns are methods.
3375
3376 2023-01-24 Jason Merrill <jason@redhat.com>
3377
3378 PR c++/108504
3379 * parser.cc (cp_lexer_new_main): Pass C_LEX_STRING_NO_JOIN for first
3380 token, too.
3381
3382 2023-01-24 Jason Merrill <jason@redhat.com>
3383
3384 PR c++/108526
3385 * pt.cc (tsubst_function_decl): Handle static lambda.
3386
3387 2023-01-24 Jakub Jelinek <jakub@redhat.com>
3388
3389 PR c++/108474
3390 * cp-gimplify.cc (cp_fold_r): Revert 2023-01-19 changes.
3391
3392 2023-01-24 Jason Merrill <jason@redhat.com>
3393
3394 PR c++/107303
3395 PR c++/107329
3396 * cp-gimplify.cc (cp_fold_r) [TARGET_EXPR]: In case of double
3397 TARGET_EXPR, keep the outer one instead of the inner one.
3398 (maybe_replace_decl): New.
3399
3400 2023-01-23 Jason Merrill <jason@redhat.com>
3401
3402 PR c++/107267
3403 * cp-gimplify.cc (cp_gimplify_init_expr): Allow unexpected elision
3404 of trivial types.
3405
3406 2023-01-23 Marek Polacek <polacek@redhat.com>
3407
3408 PR c++/107797
3409 * cvt.cc (ocp_convert): copy_warning when creating a new
3410 COMPOUND_EXPR.
3411 * init.cc (build_new_1): Suppress -Wunused-value on
3412 compiler-generated COMPOUND_EXPRs.
3413
3414 2023-01-23 Jason Merrill <jason@redhat.com>
3415
3416 PR c++/108195
3417 * call.cc (build_user_type_conversion_1): Check whether the
3418 iterators also find a list ctor.
3419
3420 2023-01-23 Jason Merrill <jason@redhat.com>
3421
3422 PR c++/108496
3423 * decl.cc (grokdeclarator): Check whether DECL_RESULT is already
3424 set.
3425
3426 2023-01-23 Jason Merrill <jason@redhat.com>
3427
3428 PR c++/53288
3429 DR 1299
3430 * call.cc (extend_ref_init_temps_1): Handle ptrmem expression.
3431
3432 2023-01-19 Jakub Jelinek <jakub@redhat.com>
3433
3434 PR c++/108437
3435 * cp-tree.h (keep_unused_object_arg): Declare.
3436 * call.cc (keep_unused_object_arg): No longer static.
3437 * tree.cc (build_min_non_dep_op_overload): Handle ARRAY_REF
3438 with overload being static member function.
3439
3440 2023-01-19 Jakub Jelinek <jakub@redhat.com>
3441
3442 PR c++/53932
3443 * cp-gimplify.cc (cp_fold_r): During cp_fully_fold_init replace
3444 DECL_ANON_UNION_VAR_P VAR_DECLs with their corresponding
3445 DECL_VALUE_EXPR.
3446
3447 2023-01-16 Jakub Jelinek <jakub@redhat.com>
3448
3449 PR c++/105593
3450 * decl.cc (cp_finish_decl): Check warning_enabled_at
3451 at the DECL_SOURCE_LOCATION (decl) for OPT_Winit_self instead
3452 of warn_init_self.
3453
3454 2023-01-14 Jakub Jelinek <jakub@redhat.com>
3455
3456 PR c++/108365
3457 * typeck.cc (cp_build_binary_op): Use may_shorten_divmod for integral
3458 division or modulo.
3459
3460 2023-01-13 Jakub Jelinek <jakub@redhat.com>
3461
3462 PR c++/108285
3463 * cvt.cc (cp_convert_and_check): For EXCESS_PRECISION_EXPR
3464 use its operand except that for warning purposes use the original
3465 EXCESS_PRECISION_EXPR.
3466 * call.cc (convert_like_internal): Only look through
3467 EXCESS_PRECISION_EXPR when calling cp_convert, not when calling
3468 cp_convert_and_check.
3469
3470 2023-01-09 Jakub Jelinek <jakub@redhat.com>
3471
3472 PR c++/105838
3473 PR c++/108047
3474 PR c++/108266
3475 * call.cc (maybe_init_list_as_range): Always return NULL_TREE if
3476 processing_template_decl.
3477
3478 2023-01-05 Patrick Palka <ppalka@redhat.com>
3479
3480 PR c++/108275
3481 * parser.cc (cp_parser_class_head): Use dk_deferred instead of
3482 dk_no_check when parsing the class name.
3483
3484 2023-01-05 Jakub Jelinek <jakub@redhat.com>
3485
3486 PR c++/108286
3487 * semantics.cc (finish_omp_target_clauses): Ignore clauses other than
3488 OMP_CLAUSE_MAP.
3489
3490 2023-01-04 Patrick Palka <ppalka@redhat.com>
3491
3492 PR c++/108282
3493 * decl2.cc (mark_single_function): Ignore mark_used failure
3494 only in a non-SFINAE context rather than in a SFINAE one.
3495
3496 2023-01-04 Jakub Jelinek <jakub@redhat.com>
3497
3498 PR c++/108206
3499 * decl.cc (merge_default_template_args): Return false if either
3500 new_parm or old_parm are erroneous.
3501
3502 \f
3503 Copyright (C) 2023 Free Software Foundation, Inc.
3504
3505 Copying and distribution of this file, with or without modification,
3506 are permitted in any medium without royalty provided the copyright
3507 notice and this notice are preserved.