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