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