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