]> gcc.gnu.org Git - gcc.git/blame - gcc/cp/ChangeLog
Fortran: Delete unused decl in intrinsic.h
[gcc.git] / gcc / cp / ChangeLog
CommitLineData
3ff5b4ed
GA
12021-10-26 Marek Polacek <polacek@redhat.com>
2
3 PR c++/102617
4 * parser.c (cp_parser_for): Maybe call cp_parser_init_statement
5 twice. Warn about range-based for loops with initializer here.
6 (cp_parser_init_statement): Don't duplicate code. Allow
7 alias-declaration in init-statement.
8
c2bd5d8a
GA
92021-10-22 Eric Gallager <egallager@gcc.gnu.org>
10
11 PR other/102663
12 * Make-lang.in: Add dummy c++.install-dvi target.
13
674dda6b
GA
142021-10-20 Jason Merrill <jason@redhat.com>
15
16 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
17 Pass true for declarator_p.
18 (cp_parser_nested_name_specifier_opt): Only look through
19 TYPENAME_TYPE if check_dependency_p is false.
20
212021-10-20 Jakub Jelinek <jakub@redhat.com>
22
23 PR c++/102642
24 * name-lookup.c (push_local_extern_decl_alias): Don't call
25 set_decl_tls_model on error_mark_node.
26 * decl.c (make_rtl_for_nonlocal_decl): Don't call
27 set_user_assembler_name on error_mark_node.
28 * parser.c (cp_parser_oacc_declare): Ignore DECL_LOCAL_DECL_ALIAS
29 if it is error_mark_node.
30 (cp_parser_omp_declare_target): Likewise.
31
19472fc3
GA
322021-10-19 Jakub Jelinek <jakub@redhat.com>
33
34 PR c++/102786
35 * constexpr.c (cxx_eval_constant_expression): Don't reject
36 INTEGER_CSTs with type POINTER_TYPE to METHOD_TYPE.
37
93d183a5
GA
382021-10-15 Jason Merrill <jason@redhat.com>
39
40 PR c++/51851
41 PR c++/101402
42 PR c++/102033
43 PR c++/102034
44 PR c++/102039
45 PR c++/102044
46 * pt.c (determine_specialization): Remove redundant code.
47 (fn_type_unification): Check for mismatched length.
48 (type_unification_real): Ignore terminal void.
49 (get_bindings): Don't stop at void_list_node.
50 * class.c (resolve_address_of_overloaded_function): Likewise.
51
522021-10-15 Jason Merrill <jason@redhat.com>
53
54 * constexpr.c (cxx_bind_parameters_in_call): Replace
55 new_call parameter with fun.
56 (cxx_eval_call_expression): Call it before instantiation.
57 (cxx_eval_outermost_constant_expr): Only instantiate fns
58 when manifestly_const_eval.
59 * typeck2.c (check_narrowing): This context is manifestly
60 constant-evaluated.
61
5d5885c9
GA
622021-10-14 Kwok Cheung Yeung <kcy@codesourcery.com>
63
64 * decl.c (omp_declare_variant_finalize_one): Change call from
65 c_omp_mark_declare_variant to omp_mark_declare_variant.
66 * parser.c (cp_finish_omp_declare_variant): Change call from
67 c_omp_check_context_selector to omp_check_context_selector.
68
c9db17b8
GA
692021-10-09 Jakub Jelinek <jakub@redhat.com>
70
71 * parser.c (cp_parser_omp_structured_block): Remove disallow_omp_attrs
72 argument.
73 (cp_parser_omp_structured_block_sequence): New function.
74 (cp_parser_omp_scan_loop_body): Use it.
75 (cp_parser_omp_sections_scope): Likewise.
76
ce6eec39
GA
772021-10-08 Martin Liska <mliska@suse.cz>
78
79 * constexpr.c (maybe_warn_about_constant_value): Use new macro
80 OPTION_SET_P.
81 * decl.c (redeclaration_error_message): Likewise.
82 (cxx_init_decl_processing): Likewise.
83
842021-10-08 Jakub Jelinek <jakub@redhat.com>
85
86 PR c++/102640
87 * parser.c (handle_omp_declare_target_clause): New function.
88 (cp_parser_omp_declare_target): Use it.
89
50e20ee6
GA
902021-10-07 Patrick Palka <ppalka@redhat.com>
91
92 PR c++/61355
93 * pt.c (convert_template_argument): Perform array/function to
94 pointer conversion on the substituted type of an NTTP.
95
962021-10-07 Patrick Palka <ppalka@redhat.com>
97
98 PR c++/99904
99 * pt.c (is_compatible_template_arg): Set processing_template_decl
100 around tsubst_constraint_info.
101
1022021-10-07 Jonathan Wakely <jwakely@redhat.com>
103
104 PR c++/102482
105 * init.c (maybe_warn_list_ctor): Do not warn for a reference to
106 a non-const std::initializer_list.
107
57c7ec62
GA
1082021-10-06 Jakub Jelinek <jakub@redhat.com>
109
110 PR c++/102612
111 * parser.c (cp_parser_jump_statement): Implement C++23 P2242R3.
112 Allow goto expressions in constexpr function bodies for C++23.
113 Adjust error message for older standards to mention it.
114 * decl.c (start_decl): Allow static and thread_local declarations
115 in constexpr function bodies for C++23. Adjust error message for
116 older standards to mention it.
117 * constexpr.c (ensure_literal_type_for_constexpr_object): Allow
118 declarations of variables with non-literal type in constexpr function
119 bodies for C++23. Adjust error message for older standards to mention
120 it.
121 (cxx_eval_constant_expression) <case DECL_EXPR>: Diagnose declarations
122 of initialization of static or thread_local vars.
123 (cxx_eval_constant_expression) <case GOTO_EXPR>: Diagnose goto
124 statements for C++23.
125 (potential_constant_expression_1) <case DECL_EXPR>: Swap the
126 CP_DECL_THREAD_LOCAL_P and TREE_STATIC checks.
127 (potential_constant_expression_1) <case LABEL_EXPR>: Allow labels for
128 C++23. Adjust error message for older standards to mention it.
129
1302021-10-06 Jakub Jelinek <jakub@redhat.com>
131 Jason Merrill <jason@redhat.com>
132
133 PR c++/98712
134 PR c++/102490
135 * cp-tree.h (maybe_synthesize_method): Declare.
136 * method.c (genericize_spaceship): Use
137 LOOKUP_NORMAL | LOOKUP_NONVIRTUAL | LOOKUP_DEFAULTED instead of
138 LOOKUP_NORMAL for flags.
139 (comp_info): Remove defining member. Add complain, code, retcat.
140 (comp_info::comp_info): Adjust.
141 (do_one_comp): Split out from build_comparison_op. Use
142 LOOKUP_NORMAL | LOOKUP_NONVIRTUAL | LOOKUP_DEFAULTED instead of
143 LOOKUP_NORMAL for flags.
144 (build_comparison_op): Add defining argument. Adjust comp_info
145 construction. Use defining instead of info.defining. Assert that
146 if defining, ctype is a complete type. Walk base binfos.
147 (synthesize_method, maybe_explain_implicit_delete,
148 explain_implicit_non_constexpr): Adjust build_comparison_op callers.
149 (maybe_synthesize_method): New function.
150 * class.c (check_bases_and_members): Don't call defaulted_late_check
151 for sfk_comparison.
152 (finish_struct_1): Call it here instead after class has been
153 completed.
154 * pt.c (maybe_instantiate_noexcept): Call maybe_synthesize_method
155 instead of synthesize_method.
156
bb6194e0
GA
1572021-10-05 Jakub Jelinek <jakub@redhat.com>
158
159 PR c++/102548
160 * tree.c (apply_identity_attributes): Fix handling of the
161 case where an attribute in the list doesn't affect type
162 identity but some attribute before it does.
163
1642021-10-05 Patrick Palka <ppalka@redhat.com>
165
166 PR c++/102547
167 * constexpr.c (potential_constant_expression_1): Handle
168 NONTYPE_ARGUMENT_PACK.
169
1702021-10-05 Patrick Palka <ppalka@redhat.com>
171
172 PR c++/98930
173 * pt.c (has_value_dependent_address): Return true for a static
174 local variable from a function template.
175
da9c5f78
GA
1762021-10-04 Marek Polacek <polacek@redhat.com>
177
178 PR c++/97573
179 * typeck.c (cp_build_binary_op): Call do_warn_array_compare.
180
154fd089
GA
1812021-10-03 Iain Sandoe <iain@sandoe.co.uk>
182
183 PR c++/101765
184 * coroutines.cc (register_local_var_uses): Emit a sorry if
185 we encounter a VLA in the coroutine local variables.
186
1872021-10-03 Iain Sandoe <iain@sandoe.co.uk>
188
189 PR c++/99710
190 * coroutines.cc (await_statement_walker): Report an error if
191 an await expression is found in a handler body.
192
1932021-10-03 John Eivind Helset <jehelset@gmail.com>
194
195 PR c++/100673
196 * coroutines.cc (build_co_await): Guard against NULL
197 await_suspend types.
198
1992021-10-03 Iain Sandoe <iain@sandoe.co.uk>
200
201 PR c++/101133
202 * coroutines.cc (build_co_await): Mark co_await_expr trees
203 with TREE_SIDE_EFFECTS, also mark any containing expression.
204 (finish_co_await_expr): Mark type-dependent co_await_expr
205 trees with TREE_SIDE_EFFECTS.
206
2072021-10-03 Iain Sandoe <iain@sandoe.co.uk>
208
209 PR c++/99575
210 * coroutines.cc (build_co_await): Strip NOPs from
211 candidate awaiter expressions before testing to see
212 if they need a temporary.
213
9d116bcc
GA
2142021-10-01 Martin Sebor <msebor@redhat.com>
215
216 PR c/102103
217 * typeck.c (warn_for_null_address): Enhance.
218 (cp_build_binary_op): Call it also for member pointers.
219
2202021-10-01 qingzhe huang <nickhuang99@hotmail.com>
221
222 PR c++/101783
223 * tree.c (cp_build_qualified_type_real): Exclude typedef from
224 error.
225
2262021-10-01 Jakub Jelinek <jakub@redhat.com>
227 Richard Biener <rguenther@suse.de>
228
229 PR sanitizer/102515
230 * typeck.c (cp_build_binary_op): Call ubsan_instrument_division
231 for division even for SANITIZE_SI_OVERFLOW.
232
2332021-10-01 Jakub Jelinek <jakub@redhat.com>
234
235 * parser.c (cp_parser_omp_clause_order): Set
236 OMP_CLAUSE_ORDER_REPRODUCIBLE for explicit reproducible: modifier.
237
2382021-10-01 Jakub Jelinek <jakub@redhat.com>
239
240 PR c++/102496
241 * name-lookup.c (push_local_extern_decl_alias): Return early even for
242 tls vars with non-dependent type when processing_template_decl. For
243 CP_DECL_THREAD_LOCAL_P vars call set_decl_tls_model on alias.
244
24679983
GA
2452021-09-30 Patrick Palka <ppalka@redhat.com>
246
247 PR c++/102535
248 * method.c (is_xible_helper): Don't exit early for multi-arg
249 ctors in C++20.
250
2512021-09-30 Patrick Palka <ppalka@redhat.com>
252
253 * parser.c (cp_parser_trait_expr): Call nreverse on the reversed
254 list of trailing arguments.
255
2562021-09-30 Patrick Palka <ppalka@redhat.com>
257
258 PR c++/95567
259 * method.c (build_comparison_op): Skip DECL_VIRTUAL_P fields.
260
fd133479
GA
2612021-09-28 Patrick Palka <ppalka@redhat.com>
262
263 PR c++/99909
264 * pt.c (coerce_template_template_parms): Keep
265 processing_template_decl set around the call to unify as well.
266
2672021-09-28 Iain Sandoe <iain@sandoe.co.uk>
268
269 PR c++/102454
270 * coroutines.cc (analyze_fn_parms): Clean up synthetic names for
271 unnamed function params.
272 (morph_fn_to_coro): Do not try to set a guard variable for param
273 DTORs in the ramp, unless we have exceptions active.
274
cf966403
GA
2752021-09-27 Patrick Palka <ppalka@redhat.com>
276
277 PR c++/102479
278 * pt.c (rewrite_template_parm): Handle single-level tsubst_args.
279 Avoid a tree cycle when assigning the DECL_TEMPLATE_PARMS for a
280 rewritten ttp.
281 (alias_ctad_tweaks): Set current_template_parms accordingly.
282
391b23e0
GA
2832021-09-23 Michel Morin <mimomorin@gmail.com>
284
285 * parser.c (cp_keyword_starts_decl_specifier_p): Do not
286 handle RID_ATTRIBUTE.
287 (cp_parser_constructor_declarator_p): Remove now-redundant
288 checks.
289 (cp_parser_lambda_declarator_opt): Likewise.
290
2912021-09-23 Michel Morin <mimomorin@gmail.com>
292
293 PR c++/77565
294 * parser.c (cp_keyword_starts_decl_specifier_p): Handle more
295 decl-specifiers (typedef/inline/cv/explicit/virtual/friend).
296
2972021-09-23 Patrick Palka <ppalka@redhat.com>
298
299 * ptree.c (cxx_print_decl): Dump the DECL_TEMPLATE_RESULT of
300 a TEMPLATE_DECL. Dump the DECL_TEMPLATE_INFO rather than just
301 printing its pointer value.
302
3032021-09-23 Jakub Jelinek <jakub@redhat.com>
304
305 PR c++/102413
306 * parser.c (cp_parser_omp_directive_args): Diagnose if omp::directive
307 is not followed by a balanced token sequence starting with open paren.
308
e4777439
GA
3092021-09-22 Patrick Palka <ppalka@redhat.com>
310
311 DR 2446
312 PR c++/102412
313 * constexpr.c (cxx_eval_constant_expression)
314 <case TEMPLATE_ID_EXPR>: Check value_dependent_expression_p
315 instead of processing_template_decl.
316 * pt.c (value_dependent_expression_p) <case TEMPLATE_ID_EXPR>:
317 Return true only if any_dependent_template_arguments_p.
318 (instantiation_dependent_r) <case CALL_EXPR>: Remove this case.
319 <case TEMPLATE_ID_EXPR>: Likewise.
320
3212021-09-22 Jakub Jelinek <jakub@redhat.com>
322
323 * parser.c (cp_parser_omp_clause_allocate): Parse allocate clause
324 modifiers.
325 * semantics.c (finish_omp_clauses) <OMP_CLAUSE_ALLOCATE>: Perform
326 semantic analysis of OMP_CLAUSE_ALLOCATE_ALIGN.
327 * pt.c (tsubst_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
328 also OMP_CLAUSE_ALLOCATE_ALIGN.
329
3302021-09-22 Barrett Adair <barrettellisadair@gmail.com>
331
332 * pt.c (find_parm_usage_r): New walk_tree callback to find func
333 parms.
334 (any_template_arguments_need_structural_equality_p): New special
335 case.
336
2c41dd82
GA
3372021-09-21 wangpc <pc.wang@linux.alibaba.com>
338
339 * decl.c (start_decl_1): Move verify_type_context to ...
340 (cp_finish_decl): ... to here.
341
cf74e7b5
GA
3422021-09-18 Jakub Jelinek <jakub@redhat.com>
343
344 * parser.c (cp_parser_omp_clause_order): Parse unconstrained
345 and reproducible modifiers.
346 (OMP_DISTRIBUTE_CLAUSE_MASK): Add order clause.
347
3482021-09-18 Jakub Jelinek <jakub@redhat.com>
349
350 * parser.c (cp_parser_omp_clause_default): Handle private and
351 firstprivate arguments, adjust diagnostics on unknown argument.
352 * cp-gimplify.c (cxx_omp_finish_clause): Handle OMP_CLAUSE_PRIVATE.
353
3542021-09-18 Jason Merrill <jason@redhat.com>
355
356 * cp-tree.h (dependentish_scope_p): Declare.
357 * pt.c (dependentish_scope_p): New.
358 * parser.c (cp_parser_lookup_name): Return a TYPENAME_TYPE
359 for lookup of a type in a dependent object.
360 (cp_parser_template_id): Handle TYPENAME_TYPE.
361 (cp_parser_template_name): If we're looking for a type,
362 a name followed by < names a template.
363
3642021-09-18 Jason Merrill <jason@redhat.com>
365
366 * cp-tree.h: Fix typo in LANG_FLAG list.
367
0a4cb439
GA
3682021-09-17 Jakub Jelinek <jakub@redhat.com>
369
370 * cp-tree.h (finish_omp_atomic): Add r and weak arguments.
371 * parser.c (cp_parser_omp_atomic): Update function comment for
372 OpenMP 5.1 atomics, parse OpenMP 5.1 atomics and fail, compare and
373 weak clauses.
374 * semantics.c (finish_omp_atomic): Add r and weak arguments, handle
375 them, handle COND_EXPRs.
376 * pt.c (tsubst_expr): Adjust for COND_EXPR forms that
377 finish_omp_atomic can now produce.
378
e19570d3
GA
3792021-09-16 Patrick Palka <ppalka@redhat.com>
380
381 PR c++/98486
382 * constraint.cc (get_normalized_constraints_from_decl): Always
383 look up constraints using the most general template.
384 * decl.c (grokdeclarator): Set constraints on a static data
385 member template.
386 * pt.c (determine_specialization): Check constraints on a
387 variable template.
388
3892021-09-16 Iain Sandoe <iain@sandoe.co.uk>
390
391 * coroutines.cc (await_statement_walker): Code cleanups.
392
3932021-09-16 Jason Merrill <jason@redhat.com>
394
395 * constexpr.c (cxx_eval_outermost_constant_expr): Use
396 protected_set_expr_location.
397
9e85da8d
GA
3982021-09-15 Patrick Palka <ppalka@redhat.com>
399
400 PR c++/101904
401 * call.c (build_user_type_conversion_1): Add tf_conv to complain.
402 (add_candidates): When in a SFINAE context, instead of adding a
403 candidate to bad_fns just mark it unviable.
404
4052021-09-15 Jason Merrill <jason@redhat.com>
406
407 * cp-tree.h (parsing_function_declarator): Declare.
408 * name-lookup.c (set_decl_context_in_fn): Use it.
409 * parser.c (cp_parser_direct_declarator): Use it.
410 (parsing_function_declarator): New.
411
4122021-09-15 Jakub Jelinek <jakub@redhat.com>
413
414 PR c++/88578
415 PR c++/102295
416 * typeck2.c (split_nonconstant_init_1): Don't throw away empty
417 initializers of flexible array members if they have non-zero type
418 size.
419
4202021-09-15 Patrick Palka <ppalka@redhat.com>
421
422 PR c++/102050
423 * decl.c (grok_special_member_properties): Set
424 TYPE_HAS_COPY_CTOR, TYPE_HAS_DEFAULT_CONSTRUCTOR
425 and TYPE_HAS_LIST_CTOR independently from each other.
426
4272021-09-15 Jason Merrill <jason@redhat.com>
428
429 * decl.c (cxx_init_decl_processing): Only warn about odd
430 interference sizes if they were specified with --param.
431
4322021-09-15 Jason Merrill <jason@redhat.com>
433
434 PR c++/48396
435 * cp-tree.h (enum cp_tree_index): Remove CPTI_TYPE_INFO_PTR_TYPE.
436 (type_info_ptr_type): Remove.
437 * rtti.c (init_rtti_processing): Don't predeclare std::type_info.
438 (typeid_ok_p): Check for null const_type_info_type_node.
439 (type_info_ptr_type, get_void_tinfo_ptr): New fns.
440 (get_tinfo_decl_dynamic, get_tinfo_ptr): Use them.
441 (ptr_initializer, ptm_initializer, get_pseudo_ti_init): Use them.
442 (get_tinfo_desc): Use const_ptr_type_node.
443
4442021-09-15 Jason Merrill <jason@redhat.com>
445
446 * parser.c (cp_parser_template_name): Move object type.
447 (cp_parser_pre_parsed_nested_name_specifier): Likewise.
448
4492021-09-15 Jason Merrill <jason@redhat.com>
450
451 * parser.c (cp_parser_unqualified_id): Only complain about ~A<T> in
452 a declarator.
453
52ac72a4
GA
4542021-09-14 Iain Sandoe <iain@sandoe.co.uk>
455
456 * coroutines.cc (struct param_info): Add copy_var.
457 (build_actor_fn): Use simplified param references.
458 (register_param_uses): Likewise.
459 (rewrite_param_uses): Likewise.
460 (analyze_fn_parms): New function.
461 (coro_rewrite_function_body): Add proxies for the fn
462 parameters to the outer bind scope of the rewritten code.
463 (morph_fn_to_coro): Use simplified version of param ref.
464
4652021-09-14 Iain Sandoe <iain@sandoe.co.uk>
466
467 * coroutines.cc (coro_resume_fn_id, coro_destroy_fn_id,
468 coro_promise_id, coro_frame_needs_free_id, coro_resume_index_id,
469 coro_self_handle_id, coro_actor_continue_id,
470 coro_frame_i_a_r_c_id): New.
471 (coro_init_identifiers): Initialize new name identifiers.
472 (coro_promise_type_found_p): Use pre-built identifiers.
473 (struct await_xform_data): Remove unused fields.
474 (transform_await_expr): Delete code that is now unused.
475 (build_actor_fn): Simplify interface, use pre-built identifiers and
476 remove transforms that are no longer needed.
477 (build_destroy_fn): Use revised field names.
478 (register_local_var_uses): Use pre-built identifiers.
479 (coro_rewrite_function_body): Simplify interface, use pre-built
480 identifiers. Generate proxy vars in the outer bind expr scope for the
481 implementation state that we wish to expose.
482 (morph_fn_to_coro): Adjust comments for new variable names, use pre-
483 built identifiers. Remove unused code to generate frame entries for
484 the implementation state. Adjust call for build_actor_fn.
485
4862021-09-14 Patrick Palka <ppalka@redhat.com>
487
488 PR c++/102163
489 * constexpr.c (cxx_eval_call_expression): After evaluating a
490 subobject constructor call for an empty union member, produce a
491 side effect that makes sure the member gets activated.
492
4932021-09-14 Jakub Jelinek <jakub@redhat.com>
494
495 PR c++/102295
496 * decl.c (layout_var_decl): For aggregates ending with a flexible
497 array member, add the size of the initializer for that member to
498 DECL_SIZE and DECL_SIZE_UNIT.
499
5002021-09-14 Jakub Jelinek <jakub@redhat.com>
501
502 PR c++/102305
503 * method.c (is_xible_helper): Call complete_type on to.
504
5052021-09-14 Jason Merrill <jason@redhat.com>
506
507 * decl.c (cxx_init_decl_processing): Don't warn if L1 cache line
508 size is smaller than maxalign.
509
07985c47
GA
5102021-09-13 Jason Merrill <jason@redhat.com>
511
512 * constexpr.c (maybe_warn_about_constant_value):
513 Complain about std::hardware_destructive_interference_size.
514 (cxx_eval_constant_expression): Call it.
515 * decl.c (cxx_init_decl_processing): Check
516 --param *-interference-size values.
517
5182021-09-13 Patrick Palka <ppalka@redhat.com>
519
520 PR c++/101764
521 * cp-tree.h (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): New accessor
522 macro.
523 * pt.c (has_extra_args_mechanism_p): New function.
524 (find_parameter_pack_data::found_extra_args_tree_p): New data
525 member.
526 (find_parameter_packs_r): Set ppd->found_extra_args_tree_p
527 appropriately.
528 (make_pack_expansion): Set PACK_EXPANSION_FORCE_EXTRA_ARGS_P if
529 ppd.found_extra_args_tree_p.
530 (use_pack_expansion_extra_args_p): Return true if there were
531 unsubstituted packs and PACK_EXPANSION_FORCE_EXTRA_ARGS_P.
532 (tsubst_pack_expansion): Pass the pack expansion to
533 use_pack_expansion_extra_args_p.
534
a26206ec
GA
5352021-09-10 Jakub Jelinek <jakub@redhat.com>
536
537 * parser.c (cp_parser_omp_atomic): Allow acq_rel on atomic read/write
538 and acq_rel/acquire clauses on update.
539 * semantics.c (finish_omp_atomic): Adjust c_finish_omp_atomic caller.
540
b6db7cd4
GA
5412021-09-08 Richard Biener <rguenther@suse.de>
542
543 PR c++/102228
544 * cp-tree.h (ANON_AGGR_TYPE_FIELD): New define.
545 * decl.c (fixup_anonymous_aggr): Wipe RTTI info put in
546 place on invalid code.
547 * decl2.c (reset_type_linkage): Guard CLASSTYPE_TYPEINFO_VAR
548 access.
549 * module.cc (trees_in::read_class_def): Likewise. Reconstruct
550 ANON_AGGR_TYPE_FIELD.
551 * semantics.c (finish_member_declaration): Populate
552 ANON_AGGR_TYPE_FIELD for anon aggregate typed members.
553 * typeck.c (lookup_anon_field): Remove DFS search and return
554 ANON_AGGR_TYPE_FIELD directly.
555
b2748138
GA
5562021-09-07 Jakub Jelinek <jakub@redhat.com>
557
558 PR c++/100495
559 * constexpr.c (maybe_save_constexpr_fundef): Save body even for
560 constexpr deleting dtors.
561 (cxx_eval_call_expression): Don't use DECL_CLONED_FUNCTION for
562 deleting dtors.
563
5642021-09-07 Marcel Vollweiler <marcel@codesourcery.com>
565
566 * parser.c (cp_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
567 directive.
568 * semantics.c (finish_omp_flush): Handle MEMMODEL_SEQ_CST.
569
7b739540
GA
5702021-09-03 Iain Sandoe <iain@sandoe.co.uk>
571
572 * coroutines.cc (register_local_var_uses): Do not mangle
573 frame entries for the outermost scope. Record the outer
574 scope as nesting depth 0.
575
5762021-09-03 Iain Sandoe <iain@sandoe.co.uk>
577
578 * coroutines.cc (coro_build_artificial_var): New.
579 (build_actor_fn): Use var builder, rename vars to use
580 implementation namespace.
581 (coro_rewrite_function_body): Likewise.
582 (morph_fn_to_coro): Likewise.
583
5842021-09-03 Iain Sandoe <iain@sandoe.co.uk>
585
586 * coroutines.cc (transform_local_var_uses): Record
587 frame offset expressions as DECL_VALUE_EXPRs instead of
588 rewriting them.
589
5902021-09-03 Patrick Palka <ppalka@redhat.com>
591
592 PR c++/101904
593 * call.c (build_this_conversion): New function, split out from
594 add_function_candidate.
595 (add_function_candidate): New parameter shortcut_bad_convs.
596 Document it. Use build_this_conversion. Stop at the first bad
597 argument conversion when shortcut_bad_convs is true.
598 (add_template_candidate_real): New parameter shortcut_bad_convs.
599 Use build_this_conversion to check the 'this' conversion before
600 attempting deduction. When the rejection reason code is
601 rr_bad_arg_conversion, pass -1 instead of 0 as the viable
602 parameter to add_candidate. Pass 'convs' to add_candidate.
603 (add_template_candidate): New parameter shortcut_bad_convs.
604 (add_template_conv_candidate): Pass false as shortcut_bad_convs
605 to add_template_candidate_real.
606 (add_candidates): Prefer to shortcut bad conversions during
607 overload resolution under the assumption that we'll eventually
608 see a strictly viable candidate. If this assumption turns out
609 to be false, re-process the non-strictly viable candidates
610 without shortcutting those bad conversions.
611
6122021-09-03 Jason Merrill <jason@redhat.com>
613
614 * pt.c (limit_bad_template_recursion): Suppress -Wunused for decls
615 we decide not to instantiate.
616
6172021-09-03 Jakub Jelinek <jakub@redhat.com>
618
619 PR target/102024
620 * class.c (build_base_field): Use SET_DECL_FIELD_ABI_IGNORED
621 instead of writing to DECL_FIELD_ABI_IGNORED.
622 (layout_class_type): Likewise. In the place where zero-width
623 bitfields used to be removed, use
624 SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD on those fields instead.
625
e11c6046
GA
6262021-09-01 Iain Sandoe <iain@sandoe.co.uk>
627
628 * call.c (build_over_call): Handle unavailable state in addition to
629 deprecation.
630 * class.c (type_build_ctor_call): Likewise.
631 (type_build_dtor_call): Likewise.
632 * cp-tree.h: Rename cp_warn_deprecated_use to
633 cp_handle_deprecated_or_unavailable.
634 * decl.c (duplicate_decls): Merge unavailability.
635 (grokdeclarator): Handle unavailability in addition to deprecation.
636 (type_is_unavailable): New.
637 (grokparms): Handle unavailability in addition to deprecation.
638 * decl.h (enum deprecated_states): Add
639 UNAVAILABLE_DEPRECATED_SUPPRESS.
640 * decl2.c (cplus_decl_attributes): Propagate unavailability to
641 templates.
642 (cp_warn_deprecated_use): Rename to ...
643 (cp_handle_deprecated_or_unavailable): ... this and amend to handle
644 the unavailable case. It remains a warning in the case of deprecation
645 but becomes an error in the case of unavailability.
646 (cp_warn_deprecated_use_scopes): Handle unavailability.
647 (mark_used): Likewise.
648 * parser.c (cp_parser_template_name): Likewise.
649 (cp_parser_template_argument): Likewise.
650 (cp_parser_parameter_declaration_list): Likewise.
651 * typeck.c (build_class_member_access_expr): Likewise.
652 (finish_class_member_access_expr): Likewise.
653 * typeck2.c (build_functional_cast_1): Likewise.
654
6552021-09-01 Iain Sandoe <iain@sandoe.co.uk>
656
657 * coroutines.cc (build_actor_fn): Add begin/finish clauses
658 to the initial test in the actor function.
659
6602021-09-01 Iain Sandoe <iain@sandoe.co.uk>
661
662 * coroutines.cc (await_statement_walker): Use build_stmt and
663 add_stmt instead of build1 and finish_expr_stmt.
664
6d51ee43
GA
6652021-08-31 Jason Merrill <jason@redhat.com>
666
667 * coroutines.cc (flatten_await_stmt): Fix copyo.
668 * decl.c (reshape_init_class): Simplify.
669 * module.cc (module_state::read_language): Add null check.
670 * parser.c (build_range_temp): Avoid type_uses_auto.
671 (cp_parser_class_specifier_1): Add null check.
672
6732021-08-31 Patrick Palka <ppalka@redhat.com>
674
675 PR c++/12672
676 * call.c (rejection_reason::call_varargs_p): Rename this
677 previously unused member to ...
678 (rejection_reason::least_p): ... this.
679 (arity_rejection): Add least_p parameter.
680 (add_template_candidate_real): When there are explicit
681 template arguments, check that the arity of the call agrees with
682 the arity of the function before attempting deduction.
683 (print_arity_information): Add least_p parameter.
684 (print_z_candidate): Adjust call to print_arity_information.
685
6862021-08-31 Martin Sebor <msebor@redhat.com>
687
688 * parser.c (cp_parser_selection_statement): Use direct initialization
689 instead of copy.
690
6912021-08-31 Jason Merrill <jason@redhat.com>
692
693 * constexpr.c (explain_invalid_constexpr_fn): Use iloc_sentinel.
694
6952021-08-31 Jason Merrill <jason@redhat.com>
696
697 PR c++/92193
698 * cp-tree.h (FNDECL_MANIFESTLY_CONST_EVALUATED): New.
699 * constexpr.c (cxx_eval_call_expression): Set it.
700 * pt.c (neglectable_inst_p): Check it.
701
7022021-08-31 Marcel Vollweiler <marcel@codesourcery.com>
703
704 * parser.c (cp_parser_omp_clause_device): Parse device-modifiers 'device_num'
705 and 'ancestor' in 'target device' clauses.
706 * semantics.c (finish_omp_clauses): Error handling. Constant device ids must
707 evaluate to '1' if 'ancestor' is used.
708
1e2f030b
GA
7092021-08-30 Jason Merrill <jason@redhat.com>
710
711 PR c++/96286
712 * cp-tree.h (struct lang_type): Add erroneous bit-field.
713 (CLASSTYPE_ERRONEOUS): New.
714 * pt.c (limit_bad_template_recursion): Check it.
715 (instantiate_class_template_1): Set it.
716
7172021-08-30 Jason Merrill <jason@redhat.com>
718
719 * constexpr.c (cxx_eval_outermost_constant_expr): Copy
720 expr location to result.
721
7222021-08-30 Jason Merrill <jason@redhat.com>
723
724 PR c++/101460
725 * cp-tree.h (cxx_constant_value_sfinae): Declare.
726 * constexpr.c (cxx_constant_value_sfinae): New.
727 * pt.c (fold_targs_r, maybe_fold_fn_template_args): New.
728 (tsubst_copy_and_build) [CALL_EXPR]: Call
729 maybe_fold_fn_template_args.
730
7312021-08-30 Jason Merrill <jason@redhat.com>
732
733 * parser.c (cp_parser_simple_requirement): Warn about missing
734 requires.
735
1e52538d
GA
7362021-08-27 Jason Merrill <jason@redhat.com>
737
738 * typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
739 a dependent pointer.
740
85d77ac4
GA
7412021-08-25 Andrew Pinski <apinski@marvell.com>
742
743 PR c++/66590
744 * cp-objcp-common.c (cxx_block_may_fallthru): Handle
745 CLEANUP_STMT for the case which will be try/finally.
746
7472021-08-25 Jakub Jelinek <jakub@redhat.com>
748
749 PR c++/102019
750 * init.c (build_value_init_noctor): Ignore unnamed zero-width
751 bitfields.
752
38b19c5b
GA
7532021-08-23 Jakub Jelinek <jakub@redhat.com>
754
755 * parser.c (cp_parser_omp_clause_num_tasks,
756 cp_parser_omp_clause_grainsize): Parse the optional strict: modifier.
757
7c9e1645
GA
7582021-08-20 Jakub Jelinek <jakub@redhat.com>
759
760 * parser.c (cp_parser_handle_statement_omp_attributes): Determine if
761 PRAGMA_OMP_ERROR directive is C_OMP_DIR_STANDALONE.
762 (cp_parser_omp_error): New function.
763 (cp_parser_pragma): Handle PRAGMA_OMP_ERROR.
764
7652021-08-20 Jakub Jelinek <jakub@redhat.com>
766
767 * parser.c (cp_parser_omp_clause_depend_sink): Reject spurious
768 comma at the end of list. Don't parse closing paren here...
769 (cp_parser_omp_clause_depend): ... but here instead.
770
b57fba5e
GA
7712021-08-19 Patrick Palka <ppalka@redhat.com>
772
773 PR c++/101803
774 * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT): Clarify comment.
775
7762021-08-19 Jakub Jelinek <jakub@redhat.com>
777
778 * parser.c (cp_parser_omp_requires): Don't call cp_lexer_nth_token_is
779 and optionally consume token if current token is CPP_EOF,
780 CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
781
7822021-08-19 Jakub Jelinek <jakub@redhat.com>
783
784 * parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
785 instead of cp_parser_skip_to_pragma_eol.
786
6e529985
GA
7872021-08-18 Patrick Palka <ppalka@redhat.com>
788
789 PR c++/101344
0c0907f9 790 PR c++/101803
6e529985
GA
791 * cp-tree.h (CONSTRUCTOR_BRACES_ELIDED_P): Define.
792 * decl.c (reshape_init_r): Set it.
793 * pt.c (collect_ctor_idx_types): Recurse into a sub-CONSTRUCTOR
794 iff CONSTRUCTOR_BRACES_ELIDED_P.
795
7962021-08-18 Patrick Palka <ppalka@redhat.com>
797
798 PR c++/101883
799 * pt.c (convert_template_argument): Pass LOOKUP_IMPLICIT to
800 do_auto_deduction.
801
8022021-08-18 Jakub Jelinek <jakub@redhat.com>
803
804 * parser.c (cp_parser_omp_nothing): New function.
805 (cp_parser_pragma): Handle PRAGMA_OMP_NOTHING.
806
8072021-08-18 Jakub Jelinek <jakub@redhat.com>
808
809 * parser.c (cp_parser_omp_ordered): Return true instead of
810 false after emitting errors that the directive is not allowed in
811 pragma_stmt context.
812 (cp_parser_omp_target_update): Likewise.
813 (cp_parser_omp_cancellation_point): Change return type from void to
814 bool, return false if the directive should be ignored in pragma_stmt
815 contexts.
816 (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data):
817 Change return type from tree to bool, return false if the
818 directive should be ignored in pragma_stmt contexts.
819 (cp_parser_omp_target): Adjust callers of cp_parser_omp_target_*_data,
820 return their result directly.
821 (cp_parser_pragma): For PRAGMA_OMP_CANCELLATION_POINT return what
822 cp_parser_omp_cancellation_point returned. Return true instead of
823 false after emitting errors that the directive is not allowed in
824 pragma_stmt context.
825
2d14d64b
GA
8262021-08-17 Jakub Jelinek <jakub@redhat.com>
827
828 PR c++/101539
829 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_LAYOUT_COMPATIBLE.
830 (enum cp_built_in_function): Add CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
831 (fold_builtin_is_corresponding_member, next_common_initial_seqence,
832 layout_compatible_type_p): Declare.
833 * parser.c (cp_parser_primary_expression): Handle
834 RID_IS_LAYOUT_COMPATIBLE.
835 (cp_parser_trait_expr): Likewise.
836 * cp-objcp-common.c (names_builtin_p): Likewise.
837 * constraint.cc (diagnose_trait_expr): Handle
838 CPTK_IS_LAYOUT_COMPATIBLE.
839 * decl.c (cxx_init_decl_processing): Register
840 __builtin_is_corresponding_member builtin.
841 * constexpr.c (cxx_eval_builtin_function_call): Handle
842 CP_BUILT_IN_IS_CORRESPONDING_MEMBER builtin.
843 * semantics.c (is_corresponding_member_union,
844 is_corresponding_member_aggr, fold_builtin_is_corresponding_member):
845 New functions.
846 (trait_expr_value): Handle CPTK_IS_LAYOUT_COMPATIBLE.
847 (finish_trait_expr): Likewise.
848 * typeck.c (next_common_initial_seqence, layout_compatible_type_p):
849 New functions.
850 * cp-gimplify.c (cp_gimplify_expr): Fold
851 CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
852 (cp_fold): Likewise.
853 * tree.c (builtin_valid_in_constant_expr_p): Handle
854 CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
855 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
856 CPTK_IS_LAYOUT_COMPATIBLE.
857 * class.c (remove_zero_width_bit_fields): Remove.
858 (layout_class_type): Don't call it.
859
8602021-08-17 Jakub Jelinek <jakub@redhat.com>
861
862 * parser.c (OMP_SCOPE_CLAUSE_MASK): Define.
863 (cp_parser_omp_scope): New function.
864 (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_SCOPE.
865 * pt.c (tsubst_expr): Handle OMP_SCOPE.
866
72be20e2
GA
8672021-08-12 Jakub Jelinek <jakub@redhat.com>
868
869 * parser.c (cp_parser_omp_clause_name): Parse filter clause name.
870 (cp_parser_omp_clause_filter): New function.
871 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FILTER.
872 (OMP_MASKED_CLAUSE_MASK): Define.
873 (cp_parser_omp_masked): New function.
874 (cp_parser_omp_parallel): Handle parallel masked.
875 (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_MASKED.
876 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_FILTER.
877 * pt.c (tsubst_omp_clauses): Likewise.
878 (tsubst_expr): Handle OMP_MASKED.
879
8802021-08-12 Sergei Trofimovich <siarheit@google.com>
881
882 PR c++/101219
883 * pt.c (tsubst_copy_and_build): Use build_ptrmemfunc_access_expr
884 to construct ptrmemfunc expression instantiation.
885
8862021-08-12 Tobias Burnus <tobias@codesourcery.com>
887
888 * parser.c (cp_parser_omp_clause_proc_bind): Accept
889 'primary' as alias for 'master'.
890
8912021-08-12 Jakub Jelinek <jakub@redhat.com>
892
893 * cp-tree.h (omp_declare_target_attr): New type.
894 (struct saved_scope): Change type of omp_declare_target_attribute
895 from int to vec<omp_declare_target_attr, va_gc> * and move it.
896 * parser.c (cp_parser_omp_declare_target): Instead of
897 incrementing scope_chain->omp_declare_target_attribute, push
898 a struct containing parser->lexer->in_omp_attribute_pragma to
899 the vector.
900 (cp_parser_omp_end_declare_target): Instead of decrementing
901 scope_chain->omp_declare_target_attribute, pop a structure
902 from it. Diagnose mismatching declare target vs.
903 end declare target syntax.
904 * semantics.c (finish_translation_unit): Use vec_safe_length
905 and vec_safe_truncate on scope_chain->omp_declare_target_attributes.
906 * decl2.c (cplus_decl_attributes): Use vec_safe_length
907 on scope_chain->omp_declare_target_attributes.
908
9092021-08-12 Jakub Jelinek <jakub@redhat.com>
910
911 * parser.c (cp_parser_lambda_body): Add temp overrides
912 for parser->{omp_declare_simd,oacc_routine,omp_attrs_forbidden_p}.
913 (cp_parser_statement): Restore parser->omp_attrs_forbidden_p for
914 cp_parser_declaration_statement.
915 (cp_parser_default_argument): Add temp override for
916 parser->omp_attrs_forbidden_p.
917 (cp_parser_late_parsing_omp_declare_simd): Diagnose declare simd
918 or declare variant in attribute syntax on a declaration immediately
919 following an OpenMP construct in pragma syntax.
920
9212021-08-12 Jakub Jelinek <jakub@redhat.com>
922
923 PR c++/94162
924 * method.c (cat_tag_for): Return cc_last for !CLASS_TYPE_P
925 or for classes not in std namespace.
926
9272021-08-12 Jakub Jelinek <jakub@redhat.com>
928
929 * name-lookup.c (finish_using_directive): Diagnose omp::directive
930 or omp::sequence attributes on using-directive.
931
9322021-08-12 Jakub Jelinek <jakub@redhat.com>
933
934 * parser.c (cp_parser_block_declaration): Call
935 cp_parser_using_directive for C++11 attributes followed by
936 using namespace tokens.
937 (cp_parser_using_directive): Parse C++11 attributes at the start
938 of the directive rather than at the end, only parse GNU attributes
939 at the end.
940
9412021-08-12 Patrick Palka <ppalka@redhat.com>
942
943 PR c++/101663
944 * constexpr.c (cxx_eval_store_expression): Handle the lval=true
945 case in the early exit code path for empty stores with mismatched
946 types.
947
58f87503
GA
9482021-08-11 Patrick Palka <ppalka@redhat.com>
949
950 PR c++/101725
951 DR 2082
952 * cp-tree.h (unevaluated_p): Return true for REQUIRES_EXPR.
953 * decl.c (local_variable_p_walkfn): Don't walk into unevaluated
954 operands.
955 * parser.c (cp_parser_primary_expression) <case CPP_NAME>: Never
956 reject uses of local variables in unevaluated contexts.
957 * tree.c (cp_walk_subtrees) <case REQUIRES_EXPR>: Increment
958 cp_unevaluated_operand. Use cp_walk_tree directly instead of
959 WALK_SUBTREE to avoid the goto. Use REQUIRES_EXPR_REQS instead
960 of TREE_OPERAND directly.
961
9622021-08-11 Jakub Jelinek <jakub@redhat.com>
963
964 PR c++/101786
965 * decl2.c (var_defined_without_dynamic_init): Return true for
966 DECL_DECLARED_CONSTINIT_P with complete type and trivial destructor.
967
9682021-08-11 Patrick Palka <ppalka@redhat.com>
969
970 PR c++/79501
971 * parser.c (maybe_adjust_declarator_for_dguide): New, split
972 out from ...
973 (cp_parser_init_declarator): ... here.
974 (cp_parser_member_declaration): Use it.
975
9762021-08-11 Patrick Palka <ppalka@redhat.com>
977
978 PR c++/89062
979 * parser.c (cp_parser_parameter_declaration_list): Don't call
980 grokdeclarator if cp_parser_error_occurred.
981 (cp_parser_parameter_declaration): Simulate an error if we see
982 the beginning of a CTAD form, i.e. if we see an opening brace
983 after the decl-specifier-seq and the type is a CTAD placeholder.
984
3ae564ea
GA
9852021-08-10 Jakub Jelinek <jakub@redhat.com>
986
987 * parser.c (cp_parser_member_declaration): Move odsd declaration
988 before cp_parser_using_declaration call to avoid errors with
989 GCC 4.8 to 6.
990
9912021-08-10 Jakub Jelinek <jakub@redhat.com>
992
993 * parser.h (struct cp_omp_declare_simd_data): Remove
994 in_omp_attribute_pragma and clauses members, add loc and attribs.
995 (struct cp_oacc_routine_data): Remove loc member, add clauses
996 member.
997 * parser.c (cp_finalize_omp_declare_simd): New function.
998 (cp_parser_handle_statement_omp_attributes): Mention in
999 function comment the function is used also for
1000 attribute-declaration.
1001 (cp_parser_handle_directive_omp_attributes): New function.
1002 (cp_parser_statement): Don't call
1003 cp_parser_handle_statement_omp_attributes if statement doesn't
1004 have attribute-specifier-seq at the beginning at all or if
1005 if those attributes don't appertain to the statement.
1006 (cp_parser_simple_declaration): Call
1007 cp_parser_handle_directive_omp_attributes and
1008 cp_finalize_omp_declare_simd.
1009 (cp_parser_explicit_instantiation): Likewise.
1010 (cp_parser_init_declarator): Initialize prefix_attributes
1011 only after parsing declarators.
1012 (cp_parser_direct_declarator): Call
1013 cp_parser_handle_directive_omp_attributes and
1014 cp_finalize_omp_declare_simd.
1015 (cp_parser_member_declaration): Likewise.
1016 (cp_parser_single_declaration): Likewise.
1017 (cp_parser_omp_declare_simd): Don't initialize
1018 data.in_omp_attribute_pragma, instead initialize
1019 data.attribs[0] and data.attribs[1].
1020 (cp_finish_omp_declare_variant): Remove
1021 in_omp_attribute_pragma argument, instead use
1022 parser->lexer->in_omp_attribute_pragma.
1023 (cp_parser_late_parsing_omp_declare_simd): Adjust
1024 cp_finish_omp_declare_variant caller. Handle attribute-syntax
1025 declare simd/variant.
1026
f92f4778
GA
10272021-08-06 Tamar Christina <tamar.christina@arm.com>
1028
1029 * cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
1030 * decl.c (cxx_simulate_enum_decl): Likewise.
1031
2697f832
GA
10322021-08-04 Jakub Jelinek <jakub@redhat.com>
1033
1034 PR c++/101759
1035 * parser.c (cp_parser_default_argument): Temporarily override
1036 parser->omp_declare_simd and parser->oacc_routine to NULL.
1037
4d17ca1b
GA
10382021-08-02 Patrick Palka <ppalka@redhat.com>
1039
1040 PR c++/100828
1041 * logic.cc (formula::formula): Use emplace_back instead of
1042 push_back.
1043 (formula::branch): Insert a copy of m_current directly after
1044 m_current instead of at the end of the list.
1045 (formula::erase): Define.
1046 (decompose_formula): Remove.
1047 (decompose_antecedents): Remove.
1048 (decompose_consequents): Remove.
1049 (derive_proofs): Remove.
1050 (max_problem_size): Remove.
1051 (diagnose_constraint_size): Remove.
1052 (subsumes_constraints_nonnull): Rewrite directly in terms of
1053 decompose_clause and derive_proof, interleaving decomposition
1054 with implication checking. Remove limit on constraint complexity.
1055 Use formula::erase to free the current clause before moving on to
1056 the next one.
1057
10582021-07-31 Jason Merrill <jason@redhat.com>
1059
1060 PR c++/96636
1061 * decl.c (fixup_anonymous_aggr): Clear TYPE_NEEDS_CONSTRUCTING
1062 after error.
1063
10642021-07-31 Jason Merrill <jason@redhat.com>
1065
1066 * ptree.c (cxx_print_type) [TYPE_PACK_EXPANSION]: Also print
1067 PACK_EXPANSION_PATTERN.
1068
10692021-07-31 Jakub Jelinek <jakub@redhat.com>
1070
1071 * parser.c (cp_parser_declaration): Handle OpenMP directives
1072 in attribute-declaration.
1073
10742021-07-30 Jakub Jelinek <jakub@redhat.com>
1075
1076 PR c++/101539
1077 * cp-tree.h (enum cp_trait_kind): Add
1078 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1079 (enum cp_built_in_function): Add
1080 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.
1081 (fold_builtin_is_pointer_inverconvertible_with_class): Declare.
1082 * parser.c (cp_parser_primary_expression): Handle
1083 RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1084 (cp_parser_trait_expr): Likewise.
1085 * cp-objcp-common.c (names_builtin_p): Likewise.
1086 * constraint.cc (diagnose_trait_expr): Handle
1087 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1088 * decl.c (cxx_init_decl_processing): Register
1089 __builtin_is_pointer_interconvertible_with_class builtin.
1090 * constexpr.c (cxx_eval_builtin_function_call): Handle
1091 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS builtin.
1092 * semantics.c (pointer_interconvertible_base_of_p,
1093 first_nonstatic_data_member_p,
1094 fold_builtin_is_pointer_inverconvertible_with_class): New functions.
1095 (trait_expr_value): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1096 (finish_trait_expr): Likewise. Formatting fix.
1097 * cp-gimplify.c (cp_gimplify_expr): Fold
1098 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. Call
1099 fndecl_built_in_p just once.
1100 (cp_fold): Likewise.
1101 * tree.c (builtin_valid_in_constant_expr_p): Handle
1102 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. Call
1103 fndecl_built_in_p just once.
1104 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1105 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1106
11072021-07-30 Jason Merrill <jason@redhat.com>
1108
1109 * class.c (finish_struct_anon): Improve comment.
1110 * decl.c (fixup_anonymous_aggr): Reject anonymous struct
1111 with bases.
1112
11132021-07-30 Jakub Jelinek <jakub@redhat.com>
1114
1115 * parser.c (cp_parser_statement): Rollback attributes not just
1116 when std_attrs is non-NULL, but whenever
1117 cp_parser_std_attribute_spec_seq parsed any tokens.
1118
11192021-07-30 Jakub Jelinek <jakub@redhat.com>
1120
1121 PR c++/101582
1122 * parser.c (cp_parser_skip_std_attribute_spec_seq): Add a forward
1123 declaration.
1124 (cp_parser_declaration): Parse empty-declaration and
1125 attribute-declaration.
1126 (cp_parser_toplevel_declaration): Don't parse empty-declaration here.
1127
39169029
GA
11282021-07-28 Martin Sebor <msebor@redhat.com>
1129
1130 * init.c: Include new header.
1131
af3f12e6
GA
11322021-07-27 Marek Polacek <polacek@redhat.com>
1133
1134 DR 1512
1135 PR c++/99701
1136 * cp-gimplify.c (cp_fold): Remove {LE,LT,GE,GT_EXPR} from
1137 a switch.
1138 * typeck.c (cp_build_binary_op): Reject ordered comparison
1139 of two null pointers.
1140
1a7febe9
GA
11412021-07-26 Jakub Jelinek <jakub@redhat.com>
1142
1143 * parser.h (struct cp_lexer): Add orphan_p member.
1144 * parser.c (cp_parser_statement): Don't change in_omp_attribute_pragma
1145 upon restart from CPP_PRAGMA handling. Fix up condition when a lexer
1146 should be destroyed and adjust saved_tokens if it records tokens from
1147 the to be destroyed lexer.
1148 (cp_parser_omp_section_scan): New function.
1149 (cp_parser_omp_scan_loop_body): Use it. If
1150 parser->lexer->in_omp_attribute_pragma, allow optional comma
1151 after scan.
1152 (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
1153
ead235f6
GA
11542021-07-23 Jakub Jelinek <jakub@redhat.com>
1155
1156 * parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
1157 * parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
1158 mixing of attribute and pragma syntax directives when seeing
1159 omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
1160 directives are followed by OpenMP pragma.
1161 (cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
1162 the cp_parser_handle_statement_omp_attributes call.
1163 (cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
1164 if true, set parser->omp_attrs_forbidden_p.
1165 (cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
1166 false as disallow_omp_attrs to cp_parser_omp_structured_block.
1167 (cp_parser_omp_parallel, cp_parser_omp_task): Set
1168 parser->omp_attrs_forbidden_p.
1169
419c6c68
GA
11702021-07-21 Thomas Schwinge <thomas@codesourcery.com>
1171 Joseph Myers <joseph@codesourcery.com>
1172 Cesar Philippidis <cesar@codesourcery.com>
1173
1174 * parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
1175 (cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
1176 (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
1177 * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
1178 * semantics.c (finish_omp_clauses): Likewise.
1179
11802021-07-21 Jakub Jelinek <jakub@redhat.com>
1181
1182 PR c++/101516
1183 * semantics.c (finish_omp_reduction_clause): Also call
1184 complete_type_or_else and return true if it fails.
1185
21ea2f93
GA
11862021-07-19 Iain Sandoe <iain@sandoe.co.uk>
1187
1188 PR c++/95520
1189 * coroutines.cc (struct coroutine_info): Add fields for
1190 actor and destroy function decls.
1191 (to_ramp): New.
1192 (coro_get_ramp_function): New.
1193 (coro_get_actor_function): New.
1194 (coro_get_destroy_function): New.
1195 (act_des_fn): Set up mapping between ramp, actor and
1196 destroy functions.
1197 (morph_fn_to_coro): Adjust interface to the builder for
1198 helper function decls.
1199 * cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
1200 JOIN_STR): New.
1201 * mangle.c (write_encoding): Handle coroutine helpers.
1202 (write_unqualified_name): Handle lambda coroutine helpers.
1203
87277b6a
GA
12042021-07-16 Patrick Palka <ppalka@redhat.com>
1205
1206 PR c++/101233
1207 * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
1208 substituting DECL_ARGUMENTS.
1209
12102021-07-16 Patrick Palka <ppalka@redhat.com>
1211
1212 DR 960
1213 PR c++/99664
1214 * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
1215 when the return types are references.
1216
12172021-07-16 Marek Polacek <polacek@redhat.com>
1218
1219 * typeck2.c (check_narrowing): Don't suppress the pedantic error
1220 in system headers.
1221
d97d71a1
GA
12222021-07-15 Jakub Jelinek <jakub@redhat.com>
1223
1224 PR c++/101443
1225 * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
1226 operands, fold them right away to true or false.
1227
12282021-07-15 Jason Merrill <jason@redhat.com>
1229
1230 PR c++/101095
1231 * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
1232 (cp_tree_size): Remove redundant entries.
1233
c4fee1c6
GA
12342021-07-14 Patrick Palka <ppalka@redhat.com>
1235
1236 PR c++/88252
1237 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
1238 * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
1239 handling.
1240 (redeclare_class_template): Likewise.
1241 (forwarding_reference_p): Define.
1242 (maybe_adjust_types_for_deduction): Use it instead. Add 'tparms'
1243 parameter.
1244 (unify_one_argument): Pass tparms to
1245 maybe_adjust_types_for_deduction.
1246 (try_one_overload): Likewise.
1247 (unify): Likewise.
1248 (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
1249 handling.
1250
12512021-07-14 Jason Merrill <jason@redhat.com>
1252
1253 * class.c (struct find_final_overrider_data): Use auto_vec.
1254 (find_final_overrider): Remove explicit release.
1255 * coroutines.cc (process_conditional): Use auto_vec.
1256 * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
1257 (cp_genericize_tree): Remove explicit release.
1258 * parser.c (cp_parser_objc_at_property_declaration): Use
1259 auto_delete_vec.
1260 * semantics.c (omp_reduction_lookup): Use auto_vec.
1261
12622021-07-14 Marek Polacek <polacek@redhat.com>
1263
1264 PR c++/101371
1265 * constexpr.c (cxx_eval_array_reference): Create a new .object
1266 and .ctor for the non-aggregate non-scalar case too when
1267 value-initializing.
1268
07bcbf9c
GA
12692021-07-12 Patrick Palka <ppalka@redhat.com>
1270
1271 PR c++/79501
1272 PR c++/100983
1273 * decl.c (grokfndecl): Don't require that deduction guides are
1274 declared at namespace scope. Check that class-scope deduction
1275 guides have the same access as the member class template.
1276 (grokdeclarator): Pretend class-scope deduction guides are static.
1277 * search.c (lookup_member): Don't use a BASELINK for (class-scope)
1278 deduction guides.
1279
269256f3
GA
12802021-07-10 Patrick Palka <ppalka@redhat.com>
1281
1282 PR c++/82110
1283 * init.c (build_aggr_init): Return error_mark_node if
1284 expand_aggr_init_1 returns false.
1285 (expand_default_init): Change return type to bool. Return false
1286 on error, true on success.
1287 (expand_aggr_init_1): Likewise.
1288
ef2ace64
GA
12892021-07-09 Jason Merrill <jason@redhat.com>
1290
1291 PR c++/101098
1292 * decl.c (function_requirements_equivalent_p): Only compare
1293 trailing requirements on a specialization.
1294
12952021-07-09 Iain Sandoe <iain@sandoe.co.uk>
1296
1297 * coroutines.cc (build_actor_fn): Move common code to
1298 act_des_fn.
1299 (build_destroy_fn): Likewise.
1300 (act_des_fn): Build the void return here. Ensure that the
1301 source location matches the original function.
1302
13032021-07-09 Iain Sandoe <iain@sandoe.co.uk>
1304
1305 * coroutines.cc
1306 (coro_rewrite_function_body): Connect the replacement
1307 function block to the block nest correctly.
1308
13092021-07-09 Patrick Palka <ppalka@redhat.com>
1310
1311 PR c++/101181
1312 * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
1313 add_extra_args.
1314 * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
1315 * pt.c (build_extra_args): Make a copy of args.
1316 (add_extra_args): Add complain/in_decl parameters. Enable the
1317 code for handling the case where the extra arguments are
1318 dependent.
1319 (tsubst_pack_expansion): Pass complain/in_decl to
1320 add_extra_args.
1321 (tsubst_template_args): Handle missing template arguments.
1322 (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
1323 add_extra_args.
1324
13252021-07-09 Patrick Palka <ppalka@redhat.com>
1326
1327 PR c++/101247
1328 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
1329 DECL_CONTEXT.
1330
fdc4d2a5
GA
13312021-07-08 Martin Sebor <msebor@redhat.com>
1332
1333 PR bootstrap/101372
1334 * module.cc (identifier): Suppress warning.
1335 (module_state::read_macro_maps): Remove warning suppression.
1336 (module_state::install_macros): Ditto.
1337
13382021-07-08 Marek Polacek <polacek@redhat.com>
1339
1340 PR c++/101087
1341 * cp-tree.h (unevaluated_p): New.
1342 * except.c (check_noexcept_r): Use it. Don't walk into
1343 unevaluated operands.
1344
13452021-07-08 Martin Sebor <msebor@redhat.com>
1346
1347 PR bootstrap/101374
1348 * module.cc (module_state::read_macro_maps): Temporarily disable
1349 -Warray-bounds.
1350 (module_state::install_macros): Same.
1351
6fba0eea
GA
13522021-07-06 Martin Sebor <msebor@redhat.com>
1353
1354 * error.c (cp_printer): Remove support for %G and %K.
1355
7a60a6e8
GA
13562021-07-02 Jakub Jelinek <jakub@redhat.com>
1357
1358 * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
1359 (struct cp_omp_declare_simd_data): Likewise.
1360 * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
1361 (omp_identifier): Define.
1362 * parser.c (cp_parser_skip_to_pragma_eol): Handle
1363 in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
1364 (cp_parser_require_pragma_eol): Likewise.
1365 (struct cp_omp_attribute_data): New type.
1366 (cp_parser_handle_statement_omp_attributes): New function.
1367 (cp_parser_statement): Handle OpenMP directives in statement's
1368 attribute-specifier-seq.
1369 (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
1370 functions.
1371 (cp_parser_std_attribute): Handle omp::directive and omp::sequence
1372 attributes.
1373 (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
1374 a comma also before the first clause.
1375 (cp_parser_omp_allocate): Likewise.
1376 (cp_parser_omp_atomic): Likewise.
1377 (cp_parser_omp_depobj): Likewise.
1378 (cp_parser_omp_flush): Likewise.
1379 (cp_parser_omp_ordered): Likewise.
1380 (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
1381 into struct cp_omp_declare_simd_data.
1382 (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
1383 argument. If set, allow a comma also before match clause.
1384 (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
1385 allow a comma also before the first clause. Adjust
1386 cp_finish_omp_declare_variant caller.
1387 (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
1388 a comma also before the first clause.
1389 (cp_parser_omp_declare_reduction_exprs): Likewise.
1390 (cp_parser_omp_requires): Likewise.
1391 * decl.c (initialize_predefined_identifiers): Initialize
1392 omp_identifier.
1393 * decl2.c (cplus_decl_attributes): Reject omp::directive and
1394 omp::sequence attributes.
1395
13962021-07-02 Jakub Jelinek <jakub@redhat.com>
1397
1398 PR c/101297
1399 * parser.c (cp_parser_omp_atomic): Consume comma only if it
1400 appears before a CPP_NAME.
1401
14022021-07-02 Patrick Palka <ppalka@redhat.com>
1403
1404 PR c++/101247
1405 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
1406 use common_enclosing_class and to not depend on the TREE_TYPE
1407 of outer levels pointing to the corresponding primary template.
1408
bea7c16a
GA
14092021-07-01 Patrick Palka <ppalka@redhat.com>
1410
1411 PR c++/101194
1412 * constexpr.c (cxx_eval_array_reference): When the element type
1413 is an empty type and the corresponding element is omitted, just
1414 return an empty CONSTRUCTOR instead of attempting value
1415 initialization.
1416
14172021-07-01 Patrick Palka <ppalka@redhat.com>
1418
1419 PR c++/96204
1420 * pt.c (finish_template_variable): Pass the partially
1421 instantiated template and its args to instantiate_template.
1422 (instantiate_class_template_1): No need to call
1423 push_nested_class and pop_nested_class around the call to
1424 most_specialized_partial_spec.
1425 (instantiate_template_1): Pass the partially instantiated
1426 template to lookup_template_variable.
1427 (most_specialized_partial_spec): Use push_access_scope_guard
1428 to set the access scope appropriately. Use
1429 deferring_access_check_sentinel to force access to get checked
1430 immediately.
1431 (instantiate_decl): Just pass the VAR_DECL to
1432 most_specialized_partial_spec.
1433
25b6bfea
GA
14342021-06-30 Patrick Palka <ppalka@redhat.com>
1435
1436 * constraint.cc (get_normalized_constraints_from_decl): Use
1437 push_access_scope_guard instead of push_nested_class_guard.
1438 * cp-tree.h (struct push_nested_class_guard): Replace with ...
1439 (struct push_access_scope_guard): ... this.
1440 * pt.c (push_access_scope): When the argument corresponds to
1441 a class type, push the class instead of its context.
1442 (pop_access_scope): Adjust accordingly.
1443
14442021-06-30 Marek Polacek <polacek@redhat.com>
1445
1446 PR c++/100975
1447 DR 2397
1448 * decl.c (create_array_type_for_decl): Allow array of auto.
1449
6bc18203
GA
14502021-06-29 Jason Merrill <jason@redhat.com>
1451
1452 * pt.c (instantiate_decl): Only consider partial specializations of
1453 actual variable templates.
1454
461f937b
GA
14552021-06-26 Patrick Palka <ppalka@redhat.com>
1456
1457 PR c++/96204
1458 * pt.c (instantiate_class_template_1): Enter the scope of the
1459 type when calling most_specialized_partial_spec.
1460
14612021-06-26 Jason Merrill <jason@redhat.com>
1462
1463 PR c++/101040
1464 PR c++/97566
1465 * class.c (is_empty_field): Handle null argument.
1466 * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
1467 for empty field.
1468
90708f87
GA
14692021-06-26 Marek Polacek <polacek@redhat.com>
1470
1471 PR c++/100752
1472 * parser.c (cp_parser_declarator): Pass flags down to
1473 cp_parser_declarator. Also pass static_p/member_p.
1474
14752021-06-25 Martin Sebor <msebor@redhat.com>
1476
1477 * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
1478 with warning_suppressed_p, suppress_warning, and copy_no_warning, or
1479 nothing if not necessary.
1480 (set_up_extended_ref_temp): Same.
1481 * class.c (layout_class_type): Same.
1482 * constraint.cc (constraint_satisfaction_value): Same.
1483 * coroutines.cc (finish_co_await_expr): Same.
1484 (finish_co_yield_expr): Same.
1485 (finish_co_return_stmt): Same.
1486 (build_actor_fn): Same.
1487 (coro_rewrite_function_body): Same.
1488 (morph_fn_to_coro): Same.
1489 * cp-gimplify.c (genericize_eh_spec_block): Same.
1490 (gimplify_expr_stmt): Same.
1491 (cp_genericize_r): Same.
1492 (cp_fold): Same.
1493 * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
1494 * cvt.c (cp_fold_convert): Same.
1495 (convert_to_void): Same.
1496 * decl.c (wrapup_namespace_globals): Same.
1497 (grokdeclarator): Same.
1498 (finish_function): Same.
1499 (require_deduced_type): Same.
1500 * decl2.c (no_linkage_error): Same.
1501 (c_parse_final_cleanups): Same.
1502 * except.c (expand_end_catch_block): Same.
1503 * init.c (build_new_1): Same.
1504 (build_new): Same.
1505 (build_vec_delete_1): Same.
1506 (build_vec_init): Same.
1507 (build_delete): Same.
1508 * method.c (defaultable_fn_check): Same.
1509 * parser.c (cp_parser_fold_expression): Same.
1510 (cp_parser_primary_expression): Same.
1511 * pt.c (push_tinst_level_loc): Same.
1512 (tsubst_copy): Same.
1513 (tsubst_omp_udr): Same.
1514 (tsubst_copy_and_build): Same.
1515 * rtti.c (build_if_nonnull): Same.
1516 * semantics.c (maybe_convert_cond): Same.
1517 (finish_return_stmt): Same.
1518 (finish_parenthesized_expr): Same.
1519 (cp_check_omp_declare_reduction): Same.
1520 * tree.c (build_cplus_array_type): Same.
1521 * typeck.c (build_ptrmemfunc_access_expr): Same.
1522 (cp_build_indirect_ref_1): Same.
1523 (cp_build_function_call_vec): Same.
1524 (warn_for_null_address): Same.
1525 (cp_build_binary_op): Same.
1526 (unary_complex_lvalue): Same.
1527 (cp_build_modify_expr): Same.
1528 (build_x_modify_expr): Same.
1529 (convert_for_assignment): Same.
1530
9aa8327e
GA
15312021-06-24 Patrick Palka <ppalka@redhat.com>
1532
1533 PR c++/98832
1534 * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
1535
15362021-06-24 Patrick Palka <ppalka@redhat.com>
1537
1538 PR c++/101182
1539 * constraint.cc (evaluate_requires_expr): Adjust function comment.
1540 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
1541 (cp_fold) <case REQUIRES_EXPR>: ... here.
1542
15432021-06-24 Jakub Jelinek <jakub@redhat.com>
1544
1545 * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
1546 C_ORT_OMP for clauses on target construct.
1547 (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
1548 (cp_parser_omp_target): For non-combined target add
1549 map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION. Pass
1550 C_ORT_OMP_TARGET to finish_omp_clauses.
1551 * semantics.c (handle_omp_array_sections_1): Adjust ort handling
1552 for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
1553 never present on C_ORT_*DECLARE_SIMD.
1554 (handle_omp_array_sections): Likewise.
1555 (finish_omp_clauses): Likewise. Handle OMP_CLAUSE_IN_REDUCTION
1556 on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
1557 corresponding map clauses.
1558 * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
1559 clauses on target construct.
1560
fcf617f0
GA
15612021-06-23 Patrick Palka <ppalka@redhat.com>
1562
1563 PR c++/101174
1564 * pt.c (push_access_scope): For artificial deduction guides,
1565 set the access scope to that of the constructor.
1566 (pop_access_scope): Likewise.
1567 (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
1568
15692021-06-23 Patrick Palka <ppalka@redhat.com>
1570
1571 PR c++/86439
1572 * call.c (print_error_for_call_failure): Constify 'args' parameter.
1573 (perform_dguide_overload_resolution): Define.
1574 * cp-tree.h: (perform_dguide_overload_resolution): Declare.
1575 * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
1576 instead of build_new_function_call. Don't use tf_decltype or
1577 set cp_unevaluated_operand. Remove unnecessary NULL_TREE tests.
1578
2f080224
GA
15792021-06-21 Patrick Palka <ppalka@redhat.com>
1580
1581 PR c++/67302
1582 * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
1583 sooner, before the NRVO handling.
1584
15852021-06-21 Patrick Palka <ppalka@redhat.com>
1586
1587 PR c++/80431
1588 * tree.c (bot_replace): Use convert_to_base to build the
1589 conversion to the (morally) virtual base.
1590
15912021-06-21 Jakub Jelinek <jakub@redhat.com>
1592
1593 PR inline-asm/100785
1594 * typeck.c (cxx_mark_addressable): Diagnose trying to make
1595 bit-fields addressable.
1596
688359a2
GA
15972021-06-17 Jason Merrill <jason@redhat.com>
1598
1599 PR c++/101106
1600 * decl.c (duplicate_decls): Make 'deleted after first declaration'
1601 pedwarn on by default.
1602
16032021-06-17 Jason Merrill <jason@redhat.com>
1604
1605 PR c++/101029
1606 * init.c (build_vec_init): Preserve the type of base.
1607
9a61dfdb
GA
16082021-06-16 Jason Merrill <jason@redhat.com>
1609
1610 PR c++/101078
1611 PR c++/91706
1612 * pt.c (tsubst_baselink): Update binfos in non-dependent case.
1613
ede6c356
GA
16142021-06-15 Robin Dapp <rdapp@linux.ibm.com>
1615
1616 * decl.c (duplicate_decls): Likewise.
1617
8dc48181
GA
16182021-06-14 Tobias Burnus <tobias@codesourcery.com>
1619
1620 PR c/100913
1621 * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
1622 var in the error case.
1623
4e70c34e
GA
16242021-06-13 Trevor Saunders <tbsaunde@tbsaunde.org>
1625
1626 * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
1627 with range based for.
1628 (cxx_eval_store_expression): Likewise.
1629 (cxx_eval_loop_expr): Likewise.
1630 * decl.c (wrapup_namespace_globals): Likewise.
1631 (cp_finish_decl): Likewise.
1632 (cxx_simulate_enum_decl): Likewise.
1633 * parser.c (cp_parser_postfix_expression): Likewise.
1634
8b8c3912
GA
16352021-06-12 Jason Merrill <jason@redhat.com>
1636
1637 PR c++/101029
1638 * init.c (build_vec_init): Shortcut [0] case.
1639
16402021-06-12 Jason Merrill <jason@redhat.com>
1641
1642 * pt.c (lookup_template_class_1): Shortcut current_class_type.
1643
f16f65f8
GA
16442021-06-11 Patrick Palka <ppalka@redhat.com>
1645
1646 DR 1227
1647 PR c++/96560
1648 * pt.c (tsubst_arg_types): Rearrange so that we substitute into
1649 TYPE_ARG_TYPES in forward order while short circuiting
1650 appropriately. Adjust formatting.
1651
16522021-06-11 Jakub Jelinek <jakub@redhat.com>
1653
1654 PR c++/100974
1655 * cp-tree.h (struct saved_scope): Add consteval_if_p
1656 member. Formatting fix for the discarded_stmt comment.
1657 (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
1658 * parser.c (cp_parser_lambda_expression): Temporarily disable
1659 in_consteval_if_p when parsing lambda body.
1660 (cp_parser_selection_statement): Parse consteval if.
1661 * decl.c (struct named_label_entry): Add in_consteval_if member.
1662 (level_for_consteval_if): New function.
1663 (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
1664 consteval if.
1665 * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
1666 why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
1667 for !ctx->manifestly_const_eval.
1668 (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
1669 condition as if it was __builtin_is_constant_evaluated call.
1670 (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
1671 recurse on both branches.
1672 * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
1673 as the else branch.
1674 * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
1675 Temporarily set in_consteval_if_p when recursing on
1676 IF_STMT_CONSTEVAL_P then branch.
1677 (tsubst_lambda_expr): Temporarily disable
1678 in_consteval_if_p when instantiating lambda body.
1679 * call.c (immediate_invocation_p): Return false when
1680 in_consteval_if_p.
1681
43c35d0d
GA
16822021-06-11 Marek Polacek <polacek@redhat.com>
1683
1684 PR c++/100995
1685 * constexpr.c (maybe_constexpr_fn): New.
1686 * cp-tree.h (maybe_constexpr_fn): Declare.
1687 * semantics.c (find_std_constant_evaluated_r): New.
1688 (maybe_warn_for_constant_evaluated): New.
1689 (finish_if_stmt_cond): Call it.
1690
16912021-06-10 Patrick Palka <ppalka@redhat.com>
1692
1693 PR c++/67829
1694 * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
1695 the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
1696 a template template parameter, adjust to the
1697 TEMPLATE_TEMPLATE_PARAMETER before falling through.
1698
16992021-06-10 Patrick Palka <ppalka@redhat.com>
1700
1701 PR c++/100946
1702 * constraint.cc (normalize_placeholder_type_constraints): When
1703 normalizing a non-templated return-type-requirement, add a dummy
1704 level to initial_parms.
1705
c6038721
GA
17062021-06-08 Marek Polacek <polacek@redhat.com>
1707
1708 PR c++/100065
1709 * decl.c (grokdeclarator): Store a value-dependent
1710 explicit-specifier even for deduction guides.
1711
17122021-06-08 Jason Merrill <jason@redhat.com>
1713
1714 * parser.c (cp_parser_string_literal): Adjust diagnostic.
1715
17162021-06-08 Jason Merrill <jason@redhat.com>
1717
1718 PR c++/100963
1719 * call.c (perfect_conversion_p): Check check_narrowing.
1720
17212021-06-08 Jason Merrill <jason@redhat.com>
1722
1723 PR c++/91706
1724 * name-lookup.c (get_class_binding): Keep a BASELINK.
1725 (set_inherited_value_binding_p): Adjust.
1726 * lambda.c (is_lambda_ignored_entity): Adjust.
1727 * pt.c (lookup_template_function): Copy a BASELINK before
1728 modifying it.
1729
17302021-06-08 Jason Merrill <jason@redhat.com>
1731
1732 PR c++/91706
1733 * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
1734
17352021-06-08 Jason Merrill <jason@redhat.com>
1736
1737 * module.cc (duplicate_hash::hash): Comment out.
1738 (trees_in::tree_value): Adjust loop counter.
1739
17402021-06-08 Jason Merrill <jason@redhat.com>
1741
1742 PR c++/100102
1743 * init.c (build_offset_ref): Return the BASELINK for a static
1744 member function.
1745
438aac59
GA
17462021-06-07 Patrick Palka <ppalka@redhat.com>
1747
1748 PR c++/100918
1749 * parser.c (cp_parser_lookup_name): Check access of the lookup
1750 result before we potentially adjust an injected-class-name to
1751 its TEMPLATE_DECL.
1752
7d6987e9
GA
17532021-06-06 Jakub Jelinek <jakub@redhat.com>
1754
1755 PR c/100902
1756 * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
1757 even when target is combined with other constructs.
1758
600f90cb
GA
17592021-06-04 Patrick Palka <ppalka@redhat.com>
1760
1761 PR c++/100893
1762 * pt.c (convert_template_argument): Strip top-level cv-quals
1763 on the substituted type of a non-type template parameter.
1764
17652021-06-04 Patrick Palka <ppalka@redhat.com>
1766
1767 PR c++/100102
1768 * pt.c (tsubst_function_decl): Remove old code for reducing
1769 args when it has excess levels.
1770
17712021-06-04 Jakub Jelinek <jakub@redhat.com>
1772
1773 PR c++/100872
1774 * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
1775 ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
1776 to the start.
1777
440c8a0a
GA
17782021-06-03 Patrick Palka <ppalka@redhat.com>
1779
1780 PR c++/100592
1781 * decl.c (make_typename_type): After calling
1782 lookup_template_class, adjust the result to its TYPE_NAME and
1783 then consider the tf_keep_type_decl flag.
1784
17852021-06-03 Patrick Palka <ppalka@redhat.com>
1786
1787 PR c++/100862
1788 * pt.c (set_current_access_from_decl): Move to ...
1789 * class.c (set_current_access_from_decl): ... here.
1790 (handle_using_decl): Use it to propagate the access of the
1791 using-enum decl to the copy of the imported enumerator.
1792 * cp-tree.h (set_current_access_from_decl): Declare.
1793 * decl.c (build_enumerator): Simplify using make_temp_override
1794 and set_current_access_from_decl.
1795
17962021-06-03 Jakub Jelinek <jakub@redhat.com>
1797
1798 PR c++/100859
1799 * semantics.c (handle_omp_array_sections_1): For
1800 OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
1801 finish_non_static_data_member and allow this as base.
1802 (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
1803 after depend only cases. Let this be diagnosed by !lvalue_p
1804 case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
1805 assert.
1806 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
1807
9663c744
GA
18082021-06-02 Jason Merrill <jason@redhat.com>
1809
1810 PR c++/100838
1811 * call.c (convert_like_internal): Clear tf_no_cleanup when
1812 recursing.
1813 (build_user_type_conversion_1): Only add ck_rvalue if
1814 LOOKUP_ONLYCONVERTING.
1815
b75978d1
GA
18162021-06-01 Patrick Palka <ppalka@redhat.com>
1817
1818 PR c++/65816
1819 * init.c (expand_aggr_init_1): Check
1820 type_has_non_user_provided_default_constructor instead of
1821 type_has_user_provided_constructor.
1822
18232021-06-01 Jason Merrill <jason@redhat.com>
1824
1825 PR c++/91859
1826 * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
1827 for destroying delete.
1828 * init.c (build_delete): Don't clobber before destroying delete.
1829
18302021-06-01 Jason Merrill <jason@redhat.com>
1831
1832 PR c++/94492
1833 * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
1834
ee682192
GA
18352021-05-31 Richard Biener <rguenther@suse.de>
1836
1837 PR c++/88601
1838 * cp-objcp-common.c (names_builtin_p): Handle
1839 RID_BUILTIN_SHUFFLEVECTOR.
1840 * cp-tree.h (build_x_shufflevector): Declare.
1841 * parser.c (cp_parser_postfix_expression): Handle
1842 RID_BUILTIN_SHUFFLEVECTOR.
1843 * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
1844 * typeck.c (build_x_shufflevector): Build either a lowered
1845 VEC_PERM_EXPR or an unlowered shufflevector via a temporary
1846 internal function IFN_SHUFFLEVECTOR.
1847
48166757
GA
18482021-05-28 Jason Merrill <jason@redhat.com>
1849
1850 * constexpr.c (build_data_member_initialization): Use tsi_range.
1851 (build_constexpr_constructor_member_initializers): Likewise.
1852 (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
1853 (potential_constant_expression_1): Likewise.
1854 * coroutines.cc (await_statement_expander): Likewise.
1855 (await_statement_walker): Likewise.
1856 * module.cc (trees_out::core_vals): Likewise.
1857 * pt.c (tsubst_expr): Likewise.
1858 * semantics.c (set_cleanup_locs): Likewise.
1859
18602021-05-28 Jason Merrill <jason@redhat.com>
1861
1862 PR c++/100797
1863 PR c++/95719
1864 * call.c (build_over_call): Adjust base_binfo in
1865 resolves_to_fixed_type_p case.
1866
18672021-05-28 Jakub Jelinek <jakub@redhat.com>
1868
1869 PR middle-end/99928
1870 * semantics.c (handle_omp_array_sections): Copy
1871 OMP_CLAUSE_MAP_IMPLICIT.
1872 (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
1873 marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT. Add
1874 map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
1875 maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
1876 present too. For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
1877 if present in map_head, map_field_head or map_firstprivate_head
1878 bitmaps.
1879
18802021-05-28 Tobias Burnus <tobias@codesourcery.com>
1881
1882 * parser.c (cp_parser_omp_clause_affinity): New.
1883 (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
1884 cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
1885 clause.
1886 * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
1887 finish_omp_clauses): Likewise.
1888
cd62d089
GA
18892021-05-27 Matthias Kretz <kretz@kde.org>
1890
1891 PR c++/100716
1892 * error.c (dump_template_bindings): Include code to print
1893 "[with" and ']', conditional on whether anything is printed at
1894 all. This is tied to whether a semicolon is needed to separate
1895 multiple template parameters. If the template argument repeats
1896 the template parameter (T = T), then skip the parameter.
1897 (dump_substitution): Moved code to print "[with" and ']' to
1898 dump_template_bindings.
1899 (dump_function_decl): Partial revert of PR50828, which masked
1900 TFF_TEMPLATE_NAME for all of dump_function_decl. Now
1901 TFF_TEMPLATE_NAME is masked for the scope of the function and
1902 only carries through to dump_function_name.
1903 (dump_function_name): Avoid calling dump_template_parms if
1904 TFF_TEMPLATE_NAME is set.
1905
19062021-05-27 Matthias Kretz <kretz@kde.org>
1907
1908 PR c++/100763
1909 * error.c: Call dump_scope when printing a typedef.
1910
19112021-05-27 Patrick Palka <ppalka@redhat.com>
1912
1913 PR c++/99893
1914 * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
1915
19162021-05-27 Jason Merrill <jason@redhat.com>
1917
1918 PR c++/86355
1919 * pt.c (use_pack_expansion_extra_args_p): Don't compare
1920 args from the same argument pack.
1921
19222021-05-27 Patrick Palka <ppalka@redhat.com>
1923
1924 DR 1315
1925 PR c++/67593
1926 PR c++/96555
1927 * pt.c (process_partial_specialization): Don't error on a
1928 non-simple non-type template argument that involves template
1929 parameters.
1930 (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
1931 MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
1932
01c59ef2
GA
19332021-05-26 Patrick Palka <ppalka@redhat.com>
1934
1935 PR c++/100502
1936 * typeck.c (finish_class_member_access_expr): Disable ahead
1937 of time access checking during the member lookup.
1938
19392021-05-26 Patrick Palka <ppalka@redhat.com>
1940
1941 PR c++/100368
1942 * tree.c (build_target_expr_with_type): Don't call force_rvalue
1943 on CALL_EXPR initializer. Simplify now that bot_manip is no
1944 longer a caller.
1945 (bot_manip): Use force_target_expr instead of
1946 build_target_expr_with_type.
1947
19482021-05-26 Patrick Palka <ppalka@redhat.com>
1949
1950 PR c++/97420
1951 * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
1952 (fnptr_conv_p): Don't call non_reference. Use INDIRECT_TYPE_P
1953 instead of TYPE_PTR_P.
1954 * pt.c (convert_nontype_argument_function): Look through
1955 implicit INDIRECT_REFs before calling strip_fnptr_conv.
1956
2bc6dace
GA
19572021-05-25 Jakub Jelinek <jakub@redhat.com>
1958
1959 PR c++/100666
1960 * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
1961 and side-effects, temporarily disable -Wunused-result warning when
1962 building COMPOUND_EXPR.
1963
2832d51b
GA
19642021-05-21 Jakub Jelinek <jakub@redhat.com>
1965
1966 PR middle-end/99928
1967 * semantics.c (finish_omp_clauses): Move firstprivate clauses with
1968 OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain. Don't error
1969 if a decl is mentioned both in map clause and in such firstprivate
1970 clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
1971
ea34e2ed
GA
19722021-05-20 Jason Merrill <jason@redhat.com>
1973
1974 * call.c (reference_binding): Check for designator.
1975 (implicit_conversion_1, build_special_member_call): Likewise.
1976 * decl.c (reshape_init_r): Likewise.
1977 * pt.c (do_class_deduction): Likewise.
1978 * typeck2.c (digest_init_r): Likewise.
1979
19802021-05-20 Jason Merrill <jason@redhat.com>
1981
1982 PR c++/100489
1983 * decl.c (reshape_init_class): Handle designator for
1984 member of anonymous aggregate here.
1985 * typeck2.c (process_init_constructor_record): Not here.
1986
19872021-05-20 Jonathan Wakely <jwakely@redhat.com>
1988
1989 * call.c (maybe_warn_array_conv): Use new warning option.
1990 * decl.c (mark_inline_variable, grokdeclarator): Likewise.
1991 * error.c (maybe_warn_cpp0x): Likewise.
1992 * parser.c (cp_parser_primary_expression)
1993 (cp_parser_unqualified_id)
1994 (cp_parser_pseudo_destructor_name)
1995 (cp_parser_lambda_introducer)
1996 (cp_parser_lambda_declarator_opt)
1997 (cp_parser_selection_statement)
1998 (cp_parser_init_statement)
1999 (cp_parser_decomposition_declaration)
2000 (cp_parser_function_specifier_opt)
2001 (cp_parser_static_assert)
2002 (cp_parser_namespace_definition)
2003 (cp_parser_using_declaration)
2004 (cp_parser_asm_definition)
2005 (cp_parser_ctor_initializer_opt_and_function_body)
2006 (cp_parser_initializer_list)
2007 (cp_parser_type_parameter_key)
2008 (cp_parser_member_declaration)
2009 (cp_parser_try_block)
2010 (cp_parser_std_attribute_spec): Likewise.
2011 * pt.c (check_template_variable): Likewise.
2012
20132021-05-20 Jason Merrill <jason@redhat.com>
2014
2015 PR c++/100634
2016 * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
2017
20182021-05-20 Jason Merrill <jason@redhat.com>
2019
2020 PR c++/100659
2021 * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
2022
65f32e5d
GA
20232021-05-19 Jason Merrill <jason@redhat.com>
2024
2025 PR c++/100367
2026 PR c++/96299
2027 * method.c (genericize_spaceship): Use fold_build2 for scalar
2028 operands.
2029
20302021-05-19 Jason Merrill <jason@redhat.com>
2031
2032 * pt.c (build_deduction_guide): Treat the implicit deduction guide
2033 as a member of the class.
2034
20352021-05-19 Marek Polacek <polacek@redhat.com>
2036
2037 PR c++/100596
2038 * cp-tree.h (any_non_type_attribute_p): Remove.
2039 * decl.c (grokdeclarator): Turn an error into a warning and only
2040 warn for standard attributes.
2041 * decl2.c (any_non_type_attribute_p): Remove.
2042 * parser.c (cp_parser_elaborated_type_specifier): Turn an error
2043 into a warning and only warn for standard attributes.
2044 (cp_parser_member_declaration): Likewise.
2045
20462021-05-19 Martin Liska <mliska@suse.cz>
2047
2048 PR testsuite/100658
2049 * mangle.c (write_encoding): Fix typos.
2050
20512021-05-19 Jakub Jelinek <jakub@redhat.com>
2052
2053 PR middle-end/99928
2054 * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
2055 master when combined with taskloop.
2056 (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
2057 parallel master when not combined with taskloop.
2058
20592021-05-19 Jason Merrill <jason@redhat.com>
2060
2061 PR c++/100261
2062 * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
2063
20642021-05-19 Jason Merrill <jason@redhat.com>
2065
2066 PR c++/100372
2067 * tree.c (strip_typedefs): Only look at the pattern of a
2068 TYPE_PACK_EXPANSION if it's a type.
2069
a8daf9a1
GA
20702021-05-18 Marek Polacek <polacek@redhat.com>
2071
2072 * class.c (classtype_has_non_deleted_copy_ctor): Remove.
2073 * constraint.cc (contains_wildcard_p): Likewise.
2074 (get_template_head_requirements): Likewise.
2075 (check_constrained_friend): Likewise.
2076 (subsumes_constraints): Likewise.
2077 * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
2078 (push_void_library_fn): Likewise.
2079 (get_pattern_parm): Likewise.
2080 (get_template_parms_at_level): Likewise.
2081 (lambda_return_type): Likewise.
2082 (get_template_head_requirements): Likewise.
2083 (check_constrained_friend): Likewise.
2084 (subsumes_constraints): Likewise.
2085 * decl.c (push_void_library_fn): Likewise.
2086 * lambda.c (lambda_return_type): Likewise.
2087 * pt.c (get_template_parms_at_level): Likewise.
2088 (get_pattern_parm): Likewise.
2089
20902021-05-18 Jason Merrill <jason@redhat.com>
2091
2092 PR c++/100644
2093 * call.c (perfect_candidate_p): An implicitly deleted move
2094 is not perfect.
2095
20962021-05-18 Andreas Krebbel <krebbel@linux.ibm.com>
2097
2098 PR c++/100281
2099 * cvt.c (cp_convert_to_pointer): Use the size of the target
2100 pointer type.
2101 * tree.c (cp_build_reference_type): Call
2102 cp_build_reference_type_for_mode with VOIDmode.
2103 (cp_build_reference_type_for_mode): Rename from
2104 cp_build_reference_type. Add MODE argument and invoke
2105 build_reference_type_for_mode.
2106 (strip_typedefs): Use build_pointer_type_for_mode and
2107 cp_build_reference_type_for_mode for pointers and references.
2108
a7ffc1ef
GA
21092021-05-17 Jonathan Wakely <jwakely@redhat.com>
2110
2111 PR c++/100635
2112 * call.c (convert_like_internal): Print different diagnostic if
2113 the lvalue reference is const.
2114
87a7d10c
GA
21152021-05-14 Jason Merrill <jason@redhat.com>
2116
2117 PR c++/95870
2118 * pt.c (enclosing_instantiation_of): Just compare
2119 DECL_SOURCE_LOCATION.
2120 (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
2121
21222021-05-14 Marek Polacek <polacek@redhat.com>
2123 Jason Merrill <jason@redhat.com>
2124
2125 PR c++/99032
2126 * cp-tree.h (any_non_type_attribute_p): Declare.
2127 * decl.c (grokdeclarator): Diagnose when an attribute appertains to
2128 a friend declaration that is not a definition.
2129 * decl2.c (any_non_type_attribute_p): New.
2130 * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
2131 in the middle of decl-specifiers.
2132 (cp_parser_elaborated_type_specifier): Diagnose when an attribute
2133 appertains to a friend declaration that is not a definition.
2134 (cp_parser_member_declaration): Likewise.
2135
0ff3a0f2
GA
21362021-05-12 Marek Polacek <polacek@redhat.com>
2137
2138 * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
2139 sentinel.
2140
21412021-05-12 Marcel Vollweiler <marcel@codesourcery.com>
2142
2143 * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
2144 'close'.
2145
037e3661
GA
21462021-05-11 Jason Merrill <jason@redhat.com>
2147
2148 PR c++/100517
2149 * typeck.c (build_reinterpret_cast_1): Check intype on
2150 cast to vector.
2151
21522021-05-11 Patrick Palka <ppalka@redhat.com>
2153
2154 PR c++/51577
2155 * name-lookup.c (maybe_save_operator_binding): Unconditionally
2156 enable for all function templates, not just generic lambdas.
2157 Handle compound-assignment operator expressions.
2158 * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
2159 in the type-dependent case.
2160 (build_x_modify_expr): Likewise. Move declaration of 'op' closer
2161 to its first use.
2162
21632021-05-11 Patrick Palka <ppalka@redhat.com>
2164
2165 PR c++/100138
2166 * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
2167 (satisfy_atom): Set up iloc_sentinel before calling
2168 cxx_constant_value.
2169 * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
2170 expansion, carry over PACK_EXPANSION_LOCAL_P and
2171 PACK_EXPANSION_SIZEOF_P from the original pack expansion.
2172
aa891c56
GA
21732021-05-10 Richard Biener <rguenther@suse.de>
2174
2175 PR middle-end/100464
2176 PR c++/100468
2177 * call.c (set_up_extended_ref_temp): Mark the temporary
2178 addressable if the TARGET_EXPR was.
2179
21802021-05-10 Martin Liska <mliska@suse.cz>
2181
2182 * decl.c (duplicate_decls): Use startswith
2183 function instead of strncmp.
2184 (cxx_builtin_function): Likewise.
2185 (omp_declare_variant_finalize_one): Likewise.
2186 (grokfndecl): Likewise.
2187 * error.c (dump_decl_name): Likewise.
2188 * mangle.c (find_decomp_unqualified_name): Likewise.
2189 (write_guarded_var_name): Likewise.
2190 (decl_tls_wrapper_p): Likewise.
2191 * parser.c (cp_parser_simple_type_specifier): Likewise.
2192 (cp_parser_tx_qualifier_opt): Likewise.
2193 * pt.c (template_parm_object_p): Likewise.
2194 (dguide_name_p): Likewise.
2195
21962021-05-10 Martin Liska <mliska@suse.cz>
2197
2198 PR c++/99616
2199 * decl.c (grokdeclarator): Remove redundant NULL check.
2200
62d87a32
GA
22012021-05-07 Jason Merrill <jason@redhat.com>
2202
2203 * tree.c (rvalue): Assert expr is not a class lvalue.
2204
22052021-05-07 Jason Merrill <jason@redhat.com>
2206
2207 * cp-tree.h (build_stub_object): Declare.
2208 * method.c (build_stub_object): No longer static.
2209 * call.c (can_convert): Use it.
2210 * tree.c (build_dummy_object): Adjust comment.
2211 * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
2212 TARGET_EXPR.
2213
22142021-05-07 Jason Merrill <jason@redhat.com>
2215
2216 * coroutines.cc (build_co_await): Don't call 'rvalue'.
2217 (flatten_await_stmt): Simplify initialization.
2218 (morph_fn_to_coro): Change 'rvalue' to 'move'. Simplify.
2219
99e8df7a
GA
22202021-05-04 Tobias Burnus <tobias@codesourcery.com>
2221
2222 * semantics.c (finish_omp_reduction_clause): Accept float + complex
2223 for || and && reductions.
2224
e690396d
GA
22252021-05-03 Patrick Palka <ppalka@redhat.com>
2226
2227 PR c++/100362
2228 * parser.c (cp_parser_class_head): Reinstate calls to pushclass
2229 and popclass when parsing the base-clause that were removed in
2230 r11-6815.
2231
22322021-05-03 Patrick Palka <ppalka@redhat.com>
2233
2234 PR c++/68942
2235 PR c++/100344
2236 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
2237 only when the callee is a FUNCTION_DECL.
2238
22392021-05-03 Marek Polacek <polacek@redhat.com>
2240
2241 PR c++/100055
2242 * decl.c (grokfndecl): Check current_template_parms.
2243
22442021-05-03 Marek Polacek <polacek@redhat.com>
2245
2246 DR 1312
2247 * constexpr.c (cxx_eval_constant_expression): Don't check
2248 integer_zerop.
2249
620a0635
GA
22502021-05-01 Jason Merrill <jason@redhat.com>
2251
2252 * cp-tree.h (class ovl_iterator): Allow copying. Add op==.
2253 (class ovl_range, class lkp_range): New.
2254 * call.c (build_op_call_1, add_candidates): Use them.
2255 (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
2256 (has_trivial_copy_p): Likewise.
2257 * class.c (handle_using_decl, get_basefndecls): Likewise.
2258 (maybe_warn_about_overly_private_class): Likewise.
2259 (warn_hidden, add_implicitly_declared_members): Likewise.
2260 (check_methods, clone_constructors_and_destructors): Likewise.
2261 (type_has_user_nondefault_constructor): Likewise.
2262
3c8e539d
GA
22632021-04-29 Jason Merrill <jason@redhat.com>
2264
2265 * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
2266 don't find a field.
2267
22682021-04-29 Jason Merrill <jason@redhat.com>
2269
2270 PR c++/51344
2271 * decl2.c (grokfield): Call cplus_decl_attributes for friend.
2272 (save_template_attributes): Use chainon.
2273 * friend.c (do_friend): Remove attrlist parm.
2274 * cp-tree.h (do_friend): Adjust.
2275 * class.c (add_implicitly_declared_members): Adjust.
2276 * decl.c (grokdeclarator): Adjust.
2277 * pt.c (apply_late_template_attributes): Optimize.
2278
22792021-04-29 Jason Merrill <jason@redhat.com>
2280
2281 PR c++/97974
2282 * class.c (finish_struct_anon_r): Drop complain parm.
2283 Remove non-field diagnostic.
2284 (finish_struct_anon): Adjust.
2285 * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
2286
22872021-04-29 Jason Merrill <jason@redhat.com>
2288
2289 * cp-tree.h (cp_evaluated): Add reset parm to constructor.
2290 * parser.c (cp_parser_constant_expression): Change
2291 allow_non_constant_p to int. Use cp_evaluated.
2292 (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
2293 * semantics.c (finish_id_expression_1): Don't mess with
2294 cp_unevaluated_operand here.
2295
22962021-04-29 Jason Merrill <jason@redhat.com>
2297
2298 * cp-tree.h: Clarify comments.
2299 * pt.c (get_template_parm_object): Add assert.
2300 * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
2301 * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
2302 * typeck2.c (store_init_value): Likewise.
2303
23042021-04-29 Patrick Palka <ppalka@redhat.com>
2305
2306 PR c++/68942
2307 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
2308 set tf_conv during the initial substitution into the function.
2309
23102021-04-29 Jakub Jelinek <jakub@redhat.com>
2311
2312 PR c++/100319
2313 * semantics.c (finish_omp_clauses): Fix up check that variable
2314 mentioned in detach clause doesn't appear in data-sharing clauses.
2315
e4ff4ffb
GA
23162021-04-28 Jakub Jelinek <jakub@redhat.com>
2317
2318 * module.cc: Remove #error that triggers if DEV-PHASE is empty.
2319
8f54dd61
GA
23202021-04-27 Jason Merrill <jason@redhat.com>
2321
2322 PR c++/92145
2323 * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
2324 of operator=.
2325
23262021-04-27 Patrick Palka <ppalka@redhat.com>
2327
2328 PR c++/88580
2329 * pt.c (tsubst_initializer_list): Correctly handle the case
2330 where an argument inside a base initializer pack expansion is
2331 itself a pack expansion.
2332
c0fa3f2f
GA
23332021-04-26 Patrick Palka <ppalka@redhat.com>
2334
2335 PR c++/100209
2336 * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
2337 object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
2338 with a negative offset into one whose offset is nonnegative
2339 before calling cxx_fold_indirect_ref_1.
2340
502ef97c
GA
23412021-04-24 Patrick Palka <ppalka@redhat.com>
2342
2343 PR c++/89565
2344 PR c++/93383
2345 PR c++/95291
2346 PR c++/99200
2347 PR c++/99683
2348 * pt.c (do_class_deduction): Punt if the initializer is
2349 type-dependent.
2350
23512021-04-24 Patrick Palka <ppalka@redhat.com>
2352
2353 PR c++/87709
2354 * parser.c (cp_parser_type_id_1): If we see a template
2355 placeholder, first try simulating an error before issuing
2356 a real error.
2357
05ec629f
GA
23582021-04-23 Patrick Palka <ppalka@redhat.com>
2359
2360 PR c++/98767
2361 * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
2362 Adjust parameter list loop to iterate over 'types' instead of
2363 'args'. Output the trailing '...' for a variadic function.
2364 Remove PARM_DECL support.
2365 (pp_cxx_requires_expr): Pretty print the parameter list directly
2366 instead of going through pp_cxx_parameter_declaration_clause.
2367
23682021-04-23 Patrick Palka <ppalka@redhat.com>
2369
2370 DR 2374
2371 * decl.c (is_direct_enum_init): Check the implicit
2372 convertibility requirement added by CWG 2374.
2373
23742021-04-23 Martin Liska <mliska@suse.cz>
2375
2376 * cp-tree.h (STATIC_ASSERT): Prefer static assert.
2377 * lex.c (init_operators): Remove run-time check.
2378
e3948473
GA
23792021-04-22 Marek Polacek <polacek@redhat.com>
2380
2381 PR c++/100161
2382 * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
2383 op1 separately for value- or type-dependence.
2384
c1ef0c92
GA
23852021-04-21 Marek Polacek <polacek@redhat.com>
2386
2387 PR c++/96380
2388 * parser.c (cp_parser_enum_specifier): Don't allow defining
2389 types in enum-base.
2390
23912021-04-21 Martin Liska <mliska@suse.cz>
2392
2393 Revert:
2394 2021-04-21 Martin Liska <mliska@suse.cz>
2395
2396 * error.c (dump_decl): Use flags in dump_generic_node call.
2397
23982021-04-21 Martin Liska <mliska@suse.cz>
2399
2400 * error.c (dump_decl): Use flags in dump_generic_node call.
2401
24022021-04-21 Martin Liska <mliska@suse.cz>
2403
2404 * error.c (dump_decl): Support anonymous labels.
2405
be8aad8d
GA
24062021-04-20 Jason Merrill <jason@redhat.com>
2407
2408 PR c++/100109
2409 * pt.c (find_parameter_packs_r): Look into enum initializers.
2410
6e81e015
GA
24112021-04-19 Marek Polacek <polacek@redhat.com>
2412
2413 PR c++/97536
2414 * decl.c (grokvardecl): Given an error when a concept is not defined
2415 at namespace scope.
2416
8ae884c0
GA
24172021-04-16 Jakub Jelinek <jakub@redhat.com>
2418
2419 PR c++/100111
2420 * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
2421 for empty classes into *valp when types don't match even when *valp
2422 is NULL.
2423
24242021-04-16 Marek Polacek <polacek@redhat.com>
2425
2426 PR c++/99803
2427 * decl.c (make_typename_type): Give an error and return when
2428 name is is_overloaded_fn.
2429 * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
2430 before calling make_typename_type.
2431
24322021-04-16 Patrick Palka <ppalka@redhat.com>
2433
2434 PR c++/99700
2435 * constexpr.c (reduced_constant_expression_p): For array
2436 CONSTRUCTORs, use a dedicated loop that additionally verifies
2437 the CONSTRUCTOR spans the entire array.
2438
24392021-04-16 Jakub Jelinek <jakub@redhat.com>
2440
2441 PR c++/99850
2442 * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
2443 If lambda_p, return pce_ok instead of pce_maybe_postfix.
2444
24452021-04-16 Jakub Jelinek <jakub@redhat.com>
2446
2447 PR c++/99833
2448 * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
2449 binding, add to data.internal also all corresponding structured
2450 binding decls.
2451
24522021-04-16 Jason Merrill <jason@redhat.com>
2453
2454 PR c++/100079
2455 * cp-tree.h (first_field): Declare.
2456 * mangle.c (range_expr_nelts): New.
2457 (write_expression): Improve class NTTP mangling.
2458 * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
2459 * tree.c (zero_init_expr_p): Improve class NTTP handling.
2460 * decl.c: Adjust comment.
2461
ee351f7f
GA
24622021-04-15 Jason Merrill <jason@redhat.com>
2463
2464 PR c++/80456
2465 * call.c (build_new_method_call_1): Check again for side-effects
2466 with a volatile object.
2467
24682021-04-15 Jason Merrill <jason@redhat.com>
2469
2470 PR c++/100101
2471 PR c++/99583
2472 * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
2473 TYPE_RAISES_EXCEPTIONS here.
2474 * tree.c (cp_walk_subtrees): Not here.
2475
24762021-04-15 Jason Merrill <jason@redhat.com>
2477
2478 PR c++/100091
2479 PR c++/99478
2480 * parser.c (cp_parser_default_type_template_argument): Set
2481 parser->local_variables_forbidden_p.
2482
24832021-04-15 Richard Sandiford <richard.sandiford@arm.com>
2484
2485 PR c++/98852
2486 * typeck.c (merge_type_attributes_from): New function.
2487 (cp_common_type): Use it for vector types.
2488
df3b1289
GA
24892021-04-14 Jason Merrill <jason@redhat.com>
2490
2491 PR c++/100078
2492 PR c++/93085
2493 * pt.c (uses_outer_template_parms): Also look at default
2494 template argument.
2495
24962021-04-14 Jason Merrill <jason@redhat.com>
2497
2498 PR c++/93314
2499 * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
2500 for a non-static data member in a constant-expression.
2501
25022021-04-14 Patrick Palka <ppalka@redhat.com>
2503
2504 PR c++/83476
2505 PR c++/99885
2506 * pt.c (deducible_expression): Look through implicit
2507 INDIRECT_REFs as well.
2508
25092021-04-14 Jason Merrill <jason@redhat.com>
2510
2511 PR c++/99478
2512 * parser.c (cp_parser_lambda_expression): Reject lambda
2513 in template parameter type.
2514
25152021-04-14 Jason Merrill <jason@redhat.com>
2516
2517 PR c++/90674
2518 * decl.c (duplicate_decls): Don't propagate
2519 DECL_INITIALIZED_IN_CLASS_P to a specialization.
2520
25212021-04-14 Jason Merrill <jason@redhat.com>
2522
2523 PR c++/88742
2524 PR c++/49951
2525 PR c++/58123
2526 * semantics.c (set_cleanup_locs): New.
2527 (do_poplevel): Call it.
2528 * parser.c (cp_parser_compound_statement): Consume the }
2529 before finish_compound_stmt.
2530
6d0d35d5
GA
25312021-04-13 Jason Merrill <jason@redhat.com>
2532
2533 PR c++/100032
2534 * pt.c (get_underlying_template): Compare TYPE_QUALS.
2535
25362021-04-13 Jason Merrill <jason@redhat.com>
2537
2538 PR c++/100054
2539 PR c++/90479
2540 * init.c (get_nsdmi): Do more context adjustment for local classes.
2541
25422021-04-13 Patrick Palka <ppalka@redhat.com>
2543
2544 PR c++/99008
2545 * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
2546 rather than issuing a pedwarn.
2547 * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
2548 for consistent diagnostics.
2549
25502021-04-13 Jason Merrill <jason@redhat.com>
2551
2552 PR c++/91933
2553 * class.c (build_base_path): Shortcut simple non-pointer case.
2554
25552021-04-13 Eric Botcazou <ebotcazou@adacore.com>
2556
2557 * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
2558 of the linemap.
2559 (module_state::write_location): Likewise.
2560
25612021-04-13 Patrick Palka <ppalka@redhat.com>
2562
2563 PR c++/97134
2564 * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
2565 when checking if the initializer is an equivalent class
2566 placeholder template parameter.
2567
25682021-04-13 Patrick Palka <ppalka@redhat.com>
2569
2570 PR c++/99961
2571 PR c++/99994
2572 * constraint.cc (satisfy_normalized_constraints): Set
2573 cp_unevaluated.
2574 * parser.c (cp_parser_concept_definition): Likewise.
2575 (cp_parser_requires_clause_opt): Likewise.
2576
287ad814
GA
25772021-04-12 Jason Merrill <jason@redhat.com>
2578
2579 PR c++/93085
2580 * pt.c (uses_outer_template_parms): Handle non-type and template
2581 template parameters specifically.
2582
a0ecde22
GA
25832021-04-11 Jason Merrill <jason@redhat.com>
2584
2585 PR c++/97974
2586 * decl.c (fixup_anonymous_aggr): Prune all functions from
2587 CLASSTYPE_MEMBER_VEC.
2588
1d54b138
GA
25892021-04-10 Jason Merrill <jason@redhat.com>
2590
2591 PR c++/98800
2592 PR c++/97399
2593 * parser.c (cp_parser_direct_declarator): Don't
2594 inject_this_parameter if static_p.
2595 (cp_parser_omp_var_list_no_open): Parse 'this' even if
2596 current_class_ptr isn't set for a better diagnostic.
2597
25982021-04-10 Jason Merrill <jason@redhat.com>
2599
2600 PR c++/99180
2601 PR c++/93295
2602 PR c++/93867
2603 PR c++/99118
2604 PR c++/96873
2605 * pt.c (alias_ctad_tweaks): Handle failure better.
2606
26072021-04-10 Jason Merrill <jason@redhat.com>
2608
2609 PR c++/100006
2610 * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
2611
3115aba8
GA
26122021-04-09 Patrick Palka <ppalka@redhat.com>
2613
2614 * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
2615 (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
2616 (LAMBDA_EXPR_REGEN_INFO): ... this.
2617 (tree_lambda_expr::regenerated_from)
2618 (tree_lambda_expr::regenerating_targs): Replace these with ...
2619 (tree_lambda_expr::regen_info): ... this.
2620 * constraint.cc (satisfy_declaration_constraints): Adjust
2621 accordingly.
2622 * lambda.c (build_lambda_expr): Likewise.
2623 * pt.c (regenerated_lambda_fn_p): Likewise.
2624 (most_general_lambda): Likewise.
2625 (tsubst_lambda_expr): Likewise.
2626
26272021-04-09 Marek Polacek <polacek@redhat.com>
2628
2629 PR c++/99806
2630 * parser.c (cp_parser_member_declaration): Call
2631 cp_parser_save_default_args even for function templates. Use
2632 STRIP_TEMPLATE on the declaration we're passing.
2633
019a9220
GA
26342021-04-08 Patrick Palka <ppalka@redhat.com>
2635
2636 PR c++/99874
2637 * constraint.cc (get_normalized_constraints_from_decl): Handle
2638 regenerated lambdas.
2639 (satisfy_declaration_constraints): Likewise. Check for
2640 dependent args later.
2641 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
2642 (LAMBDA_EXPR_REGENERATED_FROM): ... this.
2643 (LAMBDA_EXPR_REGENERATING_TARGS): New.
2644 (tree_lambda_expr::regenerated_from): New data member.
2645 (tree_lambda_expr::regenerating_targs): New data member.
2646 (add_to_template_args): Declare.
2647 (regenerated_lambda_fn_p): Likewise.
2648 (most_general_lambda): Likewise.
2649 * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
2650 and LAMBDA_EXPR_REGENERATING_TARGS.
2651 * pt.c (add_to_template_args): No longer static.
2652 (tsubst_function_decl): Unconditionally propagate constraints on
2653 the substituted function decl.
2654 (instantiated_lambda_fn_p): Rename to ...
2655 (regenerated_lambda_fn_p): ... this. Check
2656 LAMBDA_EXPR_REGENERATED_FROM instead of
2657 LAMBDA_EXPR_INSTANTIATED.
2658 (most_general_lambda): Define.
2659 (enclosing_instantiation_of): Adjust after renaming
2660 instantiated_lambda_fn_p.
2661 (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED. Set
2662 LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
2663 Don't substitute or set constraints on the regenerated lambda.
2664
26652021-04-08 Patrick Palka <ppalka@redhat.com>
2666
2667 PR c++/97679
2668 * pt.c (build_deduction_guide): Document OUTER_ARGS. Substitute
2669 them into the propagated constraints.
2670
26712021-04-08 Jason Merrill <jason@redhat.com>
2672
2673 PR c++/91849
2674 * call.c (convert_like_internal): Improve reference diagnostic.
2675
26762021-04-08 Jakub Jelinek <jakub@redhat.com>
2677
2678 PR c++/99859
2679 * constexpr.c (addr_of_non_const_var): New function.
2680 (cxx_bind_parameters_in_call): Set *non_constant_args to true
2681 even if cp_walk_tree on arg with addr_of_non_const_var callback
2682 returns true.
2683
26842021-04-08 Jason Merrill <jason@redhat.com>
2685
2686 PR c++/94529
2687 * pt.c (determine_specialization): Improve diagnostic.
2688
26892021-04-08 Marek Polacek <polacek@redhat.com>
2690
2691 PR c++/99844
2692 * decl.c (build_explicit_specifier): Call
2693 check_for_bare_parameter_packs.
2694 * except.c (build_noexcept_spec): Likewise.
2695
299859c2
GA
26962021-04-07 Jason Merrill <jason@redhat.com>
2697
2698 PR c++/41723
2699 * parser.c (cp_parser_class_name): Check dependent_scope_p.
2700
27012021-04-07 Jason Merrill <jason@redhat.com>
2702
2703 PR c++/52625
2704 * pt.c (maybe_process_partial_specialization): Check
2705 DECL_SELF_REFERENCE_P.
2706
27072021-04-07 Jason Merrill <jason@redhat.com>
2708
2709 PR c++/92918
2710 * name-lookup.c (push_class_level_binding_1): Do overload a new
2711 function with a previous using-declaration.
2712
8cac6af6
GA
27132021-04-06 Jason Merrill <jason@redhat.com>
2714
2715 PR c++/96673
2716 * init.c (get_nsdmi): Don't defer access checking.
2717
27182021-04-06 Jason Merrill <jason@redhat.com>
2719
2720 PR c++/99901
2721 * decl.c (cp_finish_decl): mark_needed an implicitly inline
2722 static data member with an out-of-class redeclaration.
2723
27242021-04-06 Jason Merrill <jason@redhat.com>
2725
2726 PR c++/91241
2727 * mangle.c (write_compact_number): Add sanity check.
2728 (write_local_name): Use list_length for parm number.
2729
27302021-04-06 Patrick Palka <ppalka@redhat.com>
2731
2732 PR c++/99899
2733 * pt.c (do_auto_deduction): Don't exit early when deducing the
2734 array type of a structured binding. Also handle adc_decomp_type
2735 during constraint checking.
2736
b1da9916
GA
27372021-04-05 Jason Merrill <jason@redhat.com>
2738
2739 PR c++/96311
2740 * typeck.c (check_return_expr): Call mark_exp_read in dependent
2741 case.
2742
27432021-04-05 Jason Merrill <jason@redhat.com>
2744
2745 PR c++/98440
2746 * typeck.c (build_reinterpret_cast_1): Don't perform
2747 temporary materialization.
2748
27492021-04-05 Jason Merrill <jason@redhat.com>
2750
2751 PR c++/95317
2752 * pt.c (lookup_template_class_1): Do tsubst_enum when
2753 tsubsting a generic lambda.
2754
27552021-04-05 Jason Merrill <jason@redhat.com>
2756
2757 PR c++/95870
2758 * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
2759 there is no enclosing non-lambda function.
2760
27612021-04-05 Nathan Sidwell <nathan@acm.org>
2762
2763 PR c++/99380
2764 * module.cc (name_pending_imports): Drop 'atend' parm. Don't
2765 query export when not needed.
2766 (preprocess_module, preprocessed_module): Adjust.
2767
27682021-04-05 Jason Merrill <jason@redhat.com>
2769
2770 PR c++/99066
2771 * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
2772
27732021-04-05 Jason Merrill <jason@redhat.com>
2774
2775 PR c++/99201
2776 * pt.c (class el_data): Add visited field.
2777 (extract_local_specs): Pass it to cp_walk_tree.
2778 (extract_locals_r): Walk into the body of a lambda.
2779
27802021-04-05 Jason Merrill <jason@redhat.com>
2781
2782 * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
2783 template result.
2784
91472884
GA
27852021-04-04 Jason Merrill <jason@redhat.com>
2786
2787 PR c++/99643
2788 * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
2789
c0756c4e
GA
27902021-04-03 Marek Polacek <polacek@redhat.com>
2791
2792 PR c++/91416
2793 * parser.c: Create a GC root for attributes in a decl specifier.
2794 (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
2795
27962021-04-03 Jason Merrill <jason@redhat.com>
2797
2798 PR c++/91217
2799 * pt.c (tsubst_lambda_expr): Skip the body block from
2800 DECL_SAVED_TREE.
2801
28022021-04-03 Jason Merrill <jason@redhat.com>
2803
2804 PR c++/90664
2805 * cvt.c (can_convert_qual): Check fnptr_conv_p.
2806
28072021-04-03 Jason Merrill <jason@redhat.com>
2808
2809 PR c++/97900
2810 * pt.c (regenerate_decl_from_template): tsubst_decl
2811 the parms.
2812
b7c1f3d6
GA
28132021-04-02 Patrick Palka <ppalka@redhat.com>
2814
2815 PR c++/99869
2816 * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
2817 to do_auto_deduction.
2818
28192021-04-02 Patrick Palka <ppalka@redhat.com>
2820
2821 PR c++/99586
2822 * semantics.c (finish_compound_literal): Check
2823 template_placeholder_p instead of type_uses_auto.
2824
28252021-04-02 Jason Merrill <jason@redhat.com>
2826
2827 PR c++/97938
2828 * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
2829 * lambda.c (add_capture): Set it.
2830 * pt.c (tsubst_pack_expansion): Handle it.
2831
28322021-04-02 Nathan Sidwell <nathan@acm.org>
2833
2834 * cp-tree.h (lang_decl_base): Correct module flag comment.
2835 * module.cc (trees_in::assert_definition): Break out
2836 not_tmpl var.
2837 (trees_out::lang_decl_bools): Do not write purview for header units.
2838
f1607029
GA
28392021-04-01 Marek Polacek <polacek@redhat.com>
2840
2841 PR c++/99831
2842 * method.c (defaulted_late_check): ++ and -- function_depth around
2843 the call to synthesize_method.
2844 * pt.c: Remove the saved_trees global.
2845
28462021-04-01 Jason Merrill <jason@redhat.com>
2847
2848 PR c++/99583
2849 PR c++/99584
2850 * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
2851 TYPE_RAISES_EXCEPTIONS.
2852
28532021-04-01 Iain Sandoe <iain@sandoe.co.uk>
2854
2855 * mapper-client.cc (INCLUDE_MAP): New; require map to be
2856 included from system.h.
2857 * mapper-resolver.cc (INCLUDE_MAP): Likewise.
2858
28592021-04-01 Jason Merrill <jason@redhat.com>
2860
2861 PR c++/98481
2862 * mangle.c (write_expression): Adjust.
2863 * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
2864 (mark_abi_tags_r): Likewise.
2865
28662021-04-01 Nathan Sidwell <nathan@acm.org>
2867
2868 PR c++/99283
2869 * module.cc (trees_out::decl_node): Adjust importedness reference
2870 assert.
2871 (module_state::intercluster_seed): New. Seed both imports and
2872 inter-cluster references. Broken out of ...
2873 (module_state::write_cluster): ... here. Call it.
2874
95d217ab
GA
28752021-03-31 Jason Merrill <jason@redhat.com>
2876
2877 PR c++/99445
2878 * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
2879
28802021-03-31 Patrick Palka <ppalka@redhat.com>
2881
2882 PR c++/88115
2883 * mangle.c (write_expression): Adjust the mangling of
2884 __alignof__.
2885
28862021-03-31 Patrick Palka <ppalka@redhat.com>
2887
2888 PR c++/99815
2889 * pt.c (placeholder_type_constraint_dependent_p): Expand
2890 argument packs to separate the first non-pack argument
2891 from the rest.
2892
08d2edae
GA
28932021-03-30 Nathan Sidwell <nathan@acm.org>
2894
2895 PR c++/99283
2896 * module.cc (dumper::operator): Make less brittle.
2897 (trees_out::core_bools): VAR_DECLs always have a context.
2898 (trees_out::key_mergeable): Use same_type_p for asserting.
2899 (trees_in::read_var_def): Propagate
2900 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2901
29022021-03-30 Jakub Jelinek <jakub@redhat.com>
2903
2904 PR c++/99790
2905 * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
2906
651684b4
GA
29072021-03-26 Marek Polacek <polacek@redhat.com>
2908
2909 PR c++/98352
2910 * method.c (implicitly_declare_fn): Pass &raises to
2911 synthesized_method_walk.
2912
29132021-03-26 Nathan Sidwell <nathan@acm.org>
2914
2915 PR c++/99283
2916 * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
2917 (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
2918 * decl.c (duplicate_decls): Remove template_decl module flag
2919 propagation.
2920 * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
2921 (dumper::impl::nested_name): Adjust for template-decl module flag
2922 change.
2923 (trees_in::assert_definition): Likewise.
2924 (trees_in::install_entity): Likewise.
2925 (trees_out::decl_value): Likewise. Remove alias template
2926 separation of template and type_decl.
2927 (trees_in::decl_value): Likewise.
2928 (trees_out::key_mergeable): Likewise,
2929 (trees_in::key_mergeable): Likewise.
2930 (trees_out::decl_node): Adjust for template-decl module flag
2931 change.
2932 (depset::hash::make_dependency): Likewise.
2933 (get_originating_module, module_may_redeclare): Likewise.
2934 (set_instantiating_module, set_defining_module): Likewise.
2935 * name-lookup.c (name_lookup::search_adl): Likewise.
2936 (do_pushdecl): Likewise.
2937 * pt.c (build_template_decl): Likewise.
2938 (lookup_template_class_1): Remove special alias_template handling
2939 of DECL_TI_TEMPLATE.
2940 (tsubst_template_decl): Likewise.
2941
29422021-03-26 Jakub Jelinek <jakub@redhat.com>
2943
2944 PR c++/99705
2945 * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
2946 in DECL_EXPR or in BIND_EXPR_VARS.
2947
4493b1c1
GA
29482021-03-25 Jakub Jelinek <jakub@redhat.com>
2949
2950 PR c++/99672
2951 * parser.c (cp_parser_postfix_expression): For calls, create
2952 combined_loc and temporarily set input_location to it before
2953 calling finish_call_expr.
2954
29552021-03-25 Marek Polacek <polacek@redhat.com>
2956
2957 PR c++/94751
2958 * call.c (build_over_call): Maybe call mark_used in case
2959 deduce_inheriting_ctor fails and return error_mark_node.
2960 * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
2961 * method.c (deduce_inheriting_ctor): Return bool if the deduction
2962 fails.
2963 (implicitly_declare_fn): If raises is error_mark_node, call
2964 synthesized_method_walk with diag being true.
2965
29662021-03-25 Jakub Jelinek <jakub@redhat.com>
2967
2968 PR c++/99745
2969 * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
2970 packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
2971
29722021-03-25 Marek Polacek <polacek@redhat.com>
2973
2974 PR c++/99331
2975 * call.c (build_converted_constant_expr_internal): Don't emit
2976 -Wconversion warnings.
2977
29782021-03-25 Jakub Jelinek <jakub@redhat.com>
2979
2980 PR c++/99565
2981 * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
2982 to operand_equal_p.
2983 * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
2984 or COMPOUND_EXPR.
2985
bf1f3168
GA
29862021-03-23 Nathan Sidwell <nathan@acm.org>
2987
2988 PR c++/99283
2989 * name-lookup.c (check_module_override): Set global or partition
2990 DUP on the binding vector.
2991
29922021-03-23 Marek Polacek <polacek@redhat.com>
2993
2994 PR c++/99318
2995 * decl2.c (cp_warn_deprecated_use_scopes): Only call
2996 cp_warn_deprecated_use when decl is a namespace, class, or enum.
2997
29982021-03-23 Nathan Sidwell <nathan@acm.org>
2999
3000 PR c++/99239
3001 * decl.c (duplicate_decls): Remove assert about maybe-imported
3002 artificial decls.
3003
30042021-03-23 Jakub Jelinek <jakub@redhat.com>
3005
3006 PR c++/99650
3007 * decl.c (cp_finish_decomp): Diagnose void initializers when
3008 using tuple_element and get.
3009
8b744f46
GA
30102021-03-22 Nathan Sidwell <nathan@acm.org>
3011
3012 PR c++/99480
3013 * module.cc (depset::hash::make_dependency): Propagate flags for
3014 partial specialization.
3015 (module_may_redeclare): Handle partial specialization.
3016
30172021-03-22 Nathan Sidwell <nathan@acm.org>
3018
3019 PR c++/99425
3020 * cp-tree.h (map_context_from, map_context_to): Delete.
3021 (add_mergeable_specialization): Add is_alias parm.
3022 * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
3023 * module.cc (map_context_from, map_context_to): Delete.
3024 (trees_in::decl_value): Add specializations later, adjust call.
3025 Drop useless alias lookup. Set duplicate fn parm context.
3026 (check_mergeable_decl): Drop context mapping.
3027 (trees_in::is_matching_decl): Likewise.
3028 (trees_in::read_function_def): Drop parameter context adjustment
3029 here.
3030
30312021-03-22 Martin Liska <mliska@suse.cz>
3032
3033 PR c++/99687
3034 * module.cc (fini_modules): Call vec_free instead of delete.
3035
6af7b307
GA
30362021-03-20 Jakub Jelinek <jakub@redhat.com>
3037
3038 PR debug/99230
3039 * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
3040 special code, instead call c_genericize_control_stmt.
3041
5f256a70
GA
30422021-03-19 Jakub Jelinek <jakub@redhat.com>
3043
3044 PR c++/99456
3045 * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
3046 INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
3047 don't diagnose it, set *non_constant_p nor return t.
3048
287e3e84
GA
30492021-03-19 Marek Polacek <polacek@redhat.com>
3050
3051 PR c++/99500
3052 * parser.c (cp_parser_requirement_parameter_list): Handle
3053 error_mark_node.
3054
30552021-03-18 Marek Polacek <polacek@redhat.com>
3056
3057 * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
3058
30592021-03-18 Marek Polacek <polacek@redhat.com>
3060
3061 * pt.c (tsubst_copy_and_build): Add assert.
3062
30632021-03-18 Iain Sandoe <iain@sandoe.co.uk>
3064
3065 PR objc++/49070
3066 * parser.c (cp_debug_parser): Add Objective-C++ message
3067 state flag.
3068 (cp_parser_nested_name_specifier_opt): Allow colon to
3069 terminate an assignment-expression when parsing Objective-
3070 C++ messages.
3071 (cp_parser_objc_message_expression): Set and clear message
3072 parsing state on entry and exit.
3073 * parser.h (struct cp_parser): Add a context flag for
3074 Objective-C++ message state.
3075
30762021-03-18 Martin Liska <mliska@suse.cz>
3077
3078 PR c++/99617
3079 * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
3080 to NULL.
3081
19ac7c94
GA
30822021-03-17 Marek Polacek <polacek@redhat.com>
3083
3084 PR c++/97973
3085 * call.c (conv_unsafe_in_template_p): New.
3086 (convert_like): Use it.
3087
30882021-03-17 Anthony Sharp <anthonysharp15@gmail.com>
3089 Jason Merrill <jason@redhat.com>
3090
3091 * semantics.c (get_class_access_diagnostic_decl): New
3092 function that examines special cases when a parent
3093 class causes a private access failure.
3094 (enforce_access): Slightly modified to call function
3095 above.
3096
bc212776
GA
30972021-03-16 Jason Merrill <jason@redhat.com>
3098
3099 * tree.c (cp_tree_equal): Use real_identical.
3100
31012021-03-16 Jakub Jelinek <jakub@redhat.com>
3102
3103 PR c++/99613
3104 * decl.c (expand_static_init): For thread guards, call __cxa_atexit
3105 before calling __cxa_guard_release rather than after it. Formatting
3106 fixes.
3107
31082021-03-16 Martin Liska <mliska@suse.cz>
3109 Jason Merrill <jason@redhat.com>
3110
3111 PR c++/99108
3112 * call.c (get_function_version_dispatcher): Handle
3113 DECL_LOCAL_DECL_P.
3114 * decl.c (maybe_version_functions): Likewise.
3115 (maybe_mark_function_versioned): New.
3116 * name-lookup.c (push_local_extern_decl_alias): No longer static.
3117 * name-lookup.h (push_local_extern_decl_alias): Adjust.
3118
31192021-03-16 Nathan Sidwell <nathan@acm.org>
3120
3121 PR c++/99496
3122 * module.cc (trees_out::decl_value): Adjust typedef streaming,
3123 indicate whether it is a dependent alias.
3124 (trees_in::decl_value): Likewise. Set as dependent alias, if it
3125 is one.
3126
3c5b6d24
GA
31272021-03-15 Iain Sandoe <iain@sandoe.co.uk>
3128
3129 PR c++/99047
3130 * coroutines.cc (expand_one_await_expression): If the
3131 await_ready() expression is not a boolean then convert it
3132 as required.
3133
31342021-03-15 Iain Sandoe <iain@sandoe.co.uk>
3135
3136 PR c++/98704
3137 * coroutines.cc (build_actor_fn): Make destroy index 1
3138 correspond to the abnormal unhandled_exception() exit.
3139 Substitute the proxy for the resume index.
3140 (coro_rewrite_function_body): Arrange to reset the resume
3141 index and make done = true for a rethrown exception from
3142 unhandled_exception ().
3143 (morph_fn_to_coro): Adjust calls to build_actor_fn and
3144 coro_rewrite_function_body.
3145
31462021-03-15 Iain Sandoe <iain@sandoe.co.uk>
3147
3148 PR c++/98480
3149 * coroutines.cc (replace_continue): Rewrite continue into
3150 'goto label'.
3151 (await_statement_walker): Handle await expressions in the
3152 initializer, condition and iteration expressions of for
3153 loops.
3154
31552021-03-15 Iain Sandoe <iain@sandoe.co.uk>
3156
3157 PR c++/96749
3158 * coroutines.cc (flatten_await_stmt): Allow for the case
3159 where a target expression variable only has uses in the
3160 second part of a compound expression.
3161 (maybe_promote_temps): Avoid emiting empty statements.
3162
31632021-03-15 Tobias Burnus <tobias@codesourcery.com>
3164
3165 PR c++/99509
3166 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
3167 ensure that the varpool node is marked as offloadable.
3168
6da2762a
GA
31692021-03-12 Nathan Sidwell <nathan@acm.org>
3170
3171 PR c++/99238
3172 * module.cc (depset::hash::add_binding_entity): Assert not
3173 visited.
3174 (depset::add::add_specializations): Likewise.
3175 * name-lookup.c (name_lookup::dedup): New.
3176 (name_lookup::~name_lookup): Assert not deduping.
3177 (name_lookup::restore_state): Likewise.
3178 (name_lookup::add_overload): Replace outlined code with dedup
3179 call.
3180 (name_lookup::add_value): Likewise.
3181 (name_lookup::search_namespace_only): Likewise.
3182 (name_lookup::adl_namespace_fns): Likewise.
3183 (name_lookup::adl_class_fns): Likewise.
3184 (name_lookup::search_adl): Likewise. Add clearing dedup call.
3185 (name_lookup::search_qualified): Likewise.
3186 (name_lookup::search_unqualified): Likewise.
3187
31882021-03-12 Jakub Jelinek <jakub@redhat.com>
3189
3190 PR c++/99507
3191 * call.c (build_over_call): For immediate evaluation of functions
3192 that return references, undo convert_from_reference effects before
3193 calling cxx_constant_value and call convert_from_reference
3194 afterwards.
3195
48ff383f
GA
31962021-03-11 Nathan Sidwell <nathan@acm.org>
3197
3198 PR c++/99248
3199 * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
3200 when there's a binding vector.
3201 * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
3202
32032021-03-11 Nathan Sidwell <nathan@acm.org>
3204
3205 PR c++/99528
3206 * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
3207 MK_decl_tmpl_spec.
3208 (trees_in::decl_value): Adjust add_mergeable_specialization call.
3209 (trees_out::get_merge_kind): Adjust detecting a partial template
3210 instantiation.
3211 (trees_out::key_mergeable): Adjust handling same.
3212 (trees_in::key_mergeabvle): Likewise.
3213
e9800852
GA
32142021-03-10 Nathan Sidwell <nathan@acm.org>
3215
3216 PR c++/99423
3217 * module.cc (post_load_processing): Assert not gcable.
3218 (laxy_load_pendings): Extend no-gc region around
3219 post_load_processing.
3220
32212021-03-10 Nathan Sidwell <nathan@acm.org>
3222
3223 PR c++/99508
3224 * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
3225 assembler name to the ns alias.
3226
8dc225d3
GA
32272021-03-09 Jakub Jelinek <jakub@redhat.com>
3228
3229 PR c++/99459
3230 * coroutines.cc (build_co_await): Look through NOP_EXPRs in
3231 build_special_member_call return value to find the CALL_EXPR.
3232 Simplify.
3233
32342021-03-09 Nathan Sidwell <nathan@acm.org>
3235
3236 PR c++/99472
3237 * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
3238 that C++20 does not yet imply modules.
3239
6405b40f
GA
32402021-03-08 Nathan Sidwell <nathan@acm.org>
3241
3242 PR c++/99436
3243 * name-lookup.c (get_cxx_dialect_name): Add cxx23.
3244
32452021-03-08 Nathan Sidwell <nathan@acm.org>
3246
3247 * lex.c (module_token_filter::resume): Ignore module-decls inside
3248 header-unit.
3249 * parser.c (cp_parser_module_declaration): Reject in header-unit.
3250
32512021-03-08 Nathan Sidwell <nathan@acm.org>
3252
3253 PR c++/99285
3254 * cp-tree.h (match_mergeable_specialization)
3255 (add_mergeable_specialization): Adjust parms.
3256 * module.cc (trees_in::decl_value): Adjust
3257 add_mergeable_specialization calls.
3258 (trees_out::key_mergeable): Adjust match_mergeable_specialization
3259 calls.
3260 (specialization_add): Likewise.
3261 * pt.c (match_mergeable_specialization): Do not insert.
3262 (add_mergeable_specialization): Add to hash table here.
3263
0ad6a2e2
GA
32642021-03-06 Patrick Palka <ppalka@redhat.com>
3265 Jakub Jelinek <jakub@redhat.com>
3266
3267 PR c++/99287
3268 * constexpr.c (cxx_eval_increment_expression): Pass lval when
3269 evaluating the MODIFY_EXPR, and update 'mod' with the result of
3270 this evaluation. Check *non_constant_p afterwards. For prefix
3271 ops, just return 'mod'.
3272
32732021-03-06 Patrick Palka <ppalka@redhat.com>
3274 Jakub Jelinek <jakub@redhat.com>
3275
3276 PR c++/96330
3277 * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
3278 variable 'fn' to 'tmpl'. Handle a variable template-id by
3279 calling lookup_template_variable.
3280
32812021-03-06 Patrick Palka <ppalka@redhat.com>
3282
3283 PR c++/99365
3284 * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
3285 outer_targs to do_auto_deduction.
3286 (placeholder_type_constraint_dependent_p): Define.
3287 (do_auto_deduction): When processing_template_decl != 0
3288 and context is adc_unify and we have constraints, pretend the
3289 constraints are satisfied instead of punting. Otherwise don't
3290 punt unless placeholder_type_constraint_dependent_p holds.
3291 Add some clarifying sanity checks. Add a hack to add missing
3292 outermost template levels to outer_args before checking
3293 satisfaction. Don't substitute outer_targs into type if it's
3294 already been done.
3295
ceae9533
GA
32962021-03-05 Marek Polacek <polacek@redhat.com>
3297
3298 PR c++/99374
3299 * call.c (standard_conversion): When converting pointers to
3300 member, don't return NULL when the bases are equivalent but
3301 incomplete.
3302
33032021-03-05 Marek Polacek <polacek@redhat.com>
3304
3305 PR c++/99120
3306 * name-lookup.c (check_local_shadow): Check if the type of decl
3307 is non-null before checking TYPE_PTR*.
3308
33092021-03-05 Nathan Sidwell <nathan@acm.org>
3310
3311 PR c++/99245
3312 * module.cc (module_state::write_cluster): Relax binding assert.
3313
33142021-03-05 Nathan Sidwell <nathan@acm.org>
3315
3316 PR c++/99377
3317 * pt.c (instantiate_decl): Call set_instantiating_module.
3318
33192021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3320
3321 PR c++/98118
3322 * coroutines.cc (build_co_await): Use type_build_ctor_call()
3323 to determine cases when a CTOR needs to be built.
3324 (flatten_await_stmt): Likewise.
3325 (morph_fn_to_coro): Likewise.
3326
33272021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3328
3329 PR c++/95616
3330 * coroutines.cc (coro_diagnose_throwing_fn): New helper.
3331 (coro_diagnose_throwing_final_aw_expr): New helper.
3332 (build_co_await): Diagnose throwing final await expression
3333 components.
3334 (build_init_or_final_await): Diagnose a throwing promise
3335 final_suspend() call.
3336
33372021-03-05 Iain Sandoe <iain@sandoe.co.uk>
3338
3339 PR c++/95615
3340 * coroutines.cc (struct param_info): Track parameter copies that need
3341 a DTOR.
3342 (coro_get_frame_dtor): New helper function factored from build_actor().
3343 (build_actor_fn): Use coro_get_frame_dtor().
3344 (morph_fn_to_coro): Track parameters that need DTORs on exception,
3345 likewise the frame promise and the return object. On exception, run the
3346 DTORs for these, destroy the frame and then rethrow the exception.
3347
33482021-03-05 Nathan Sidwell <nathan@acm.org>
3349
3350 PR c++/99389
3351 * pt.c (instantiate_class_template_1): Set instantiating module
3352 here.
3353
33542021-03-05 Tobias Burnus <tobias@codesourcery.com>
3355
3356 PR c/99137
3357 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
3358
67f10d28
GA
33592021-03-04 Jakub Jelinek <jakub@redhat.com>
3360
3361 PR c++/88146
3362 PR c++/99362
3363 * cvt.c (convert_to_void): Revert 2019-10-17 changes. Clarify
3364 comment.
3365
33662021-03-04 Nathan Sidwell <nathan@acm.org>
3367
3368 PR c++/99170
3369 * module.cc (class uintset): Delete.
3370 (typedef attached_map_t): A hash map.
3371 (attached_table): Use attached_map_t. Adjust uses ...
3372 (trees_out::decl_value, trees_in::decl_value): ... here ...
3373 (trees_out::key_mergeable): ... here ...
3374 (trees_in::key_mergeable): ... here ...
3375 (maybe_attach_decl): ... here ...
3376 (direct_import): ... and here.
3377
33782021-03-04 Nathan Sidwell <nathan@acm.org>
3379
3380 PR c++/99170
3381 * cp-tree.h
3382 * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
3383 rename.
3384 * module.cc (class pending_key): New.
3385 (default_hash_traits<pending_key>): New specialization.
3386 (pending_map_t): New typedef.
3387 (pending_table): Replace old table.
3388 (trees_out::lang_decl_bools): Adjust.
3389 (trees_in::lang_decl_bools): Adjust.
3390 (trees_in::install_entity): Drop pending member and specialization
3391 handling.
3392 (find_pending_key): New.
3393 (depset::hash::fiund_dependencies): Use it.
3394 (pendset_lazy_load): Delete.
3395 (module_state::write_cluster): Don't count pendings here. Bye
3396 Duff's device-like thing.
3397 (module_state::write_pendings): Reimplement.
3398 (module_state::read_pendings): Reimplement.
3399 (lazy_specializations_p): Delete.
3400 (module_state::write): Adjust write_pendings call.
3401 (lazy_load_pendings): New.
3402 (lazy_load_specializations): Delete.
3403 (lazy_load_members): Delete.
3404 (init_modules): Adjust.
3405 * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
3406 not lazy_load_members.
3407 (note_pending_specializations): Delete.
3408 (load_pending_specializations): Delete.
3409 * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
3410 (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
3411 (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
3412 (note_pending_specializations): Delete.
3413 (load_pending_specializations): Delete.
3414 * pt.c (lookup_template_class_1): Call lazy_load_pendings not
3415 lazy_load_specializations.
3416 (instantiate_template_class_1): Likewise.
3417 (instantiate_decl): Call lazy_load_pendings.
3418 * typeck.c (complete_type): Likewise.
3419
f3641ac7
GA
34202021-03-03 Nathan Sidwell <nathan@acm.org>
3421
3422 PR c++/99170
3423 * module.cc (post_load_decls): New.
3424 (lazy_snum, recursive_lazy): Move earlier.
3425 (module_state::read_cluster): Push cloning onto post_load_decls.
3426 (post_load_processing): New. Do the cloning here.
3427 (module_state::read_inits): Call post_load_processing.
3428 (module_state::read_language): Likewise.
3429 (lazy_load_binding, lazy_load_specializations): Likewise
3430 (lazy_load_members): Likewise
3431
34322021-03-03 Nathan Sidwell <nathan@acm.org>
3433
3434 PR c++/99170
3435 * module.cc (trees_out::decl_value): Stream specialization keys
3436 after decl.
3437 (trees_in::decl_value): Stream them back and insert after
3438 completing the decl.
3439 (trees_out::key_mergeable): Drop some streaming here ...
3440 (trees_in::key_mergeable): ... and here. Don't insert into
3441 specialization tables.
3442
34432021-03-03 Patrick Palka <ppalka@redhat.com>
3444
3445 * constraint.cc (struct sat_info): Document the different
3446 meanings of noisy() and diagnose_unsatisfaction_p() during
3447 satisfaction and requires-expression evaluation.
3448 (tsubst_valid_expression_requirement): Take a sat_info instead
3449 of a subst_info. Perform the substitution quietly first. Fold
3450 in error-replaying code from diagnose_valid_expression.
3451 (tsubst_simple_requirement): Take a sat_info instead of a
3452 subst_info.
3453 (tsubst_type_requirement_1): New. Fold in error-replaying code
3454 from diagnose_valid_type.
3455 (tsubst_type_requirement): Use the above. Take a sat_info
3456 instead of a subst_info.
3457 (tsubst_compound_requirement): Likewise. Fold in
3458 error-replaying code from diagnose_compound_requirement.
3459 (tsubst_nested_requirement): Take a sat_info instead of a
3460 subst_info. Fold in error-replaying code from
3461 diagnose_nested_requirement.
3462 (tsubst_requirement): Take a sat_info instead of a subst_info.
3463 (tsubst_requires_expr): Split into two versions, one that takes
3464 a sat_info argument and another that takes a complain and
3465 in_decl argument. Remove outdated documentation. Document the
3466 effects of the sat_info argument. Don't short-circuit
3467 processing of requirements when diagnosing unsatisfaction,
3468 mirroring diagnose_requires_expr.
3469 (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
3470 assert, and se the three-parameter version of tsubst_requires_expr.
3471 (diagnose_trait_expr): Make static. Take a template argument
3472 vector instead of a parameter mapping.
3473 (diagnose_valid_expression): Remove.
3474 (diagnose_valid_type): Remove.
3475 (diagnose_simple_requirement): Remove.
3476 (diagnose_compound_requirement): Remove.
3477 (diagnose_type_requirement): Remove.
3478 (diagnose_nested_requirement): Remove.
3479 (diagnose_requirement): Remove.
3480 (diagnose_requires_expr): Remove.
3481 (diagnose_atomic_constraint): Take a sat_info instead of a
3482 subst_info. Adjust call to diagnose_trait_expr. Call
3483 tsubst_requires_expr instead of diagnose_requires_expr.
3484 (diagnose_constraints): Remove special casing of REQUIRES_EXPR
3485 and just always call constraint_satisfaction_value.
3486
34872021-03-03 Patrick Palka <ppalka@redhat.com>
3488
3489 * constexpr.c (cxx_eval_call_expression): Adjust call to
3490 evaluate_concept_check.
3491 (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
3492 evaluate_requires_expression instead of
3493 satisfy_constraint_expression.
3494 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3495 * constraint.cc (struct sat_info): Adjust comment about which
3496 satisfaction entrypoints use noisy-unsat.
3497 (normalize_template_requirements): Remove (and adjust callers
3498 appropriately).
3499 (normalize_nontemplate_requirements): Likewise.
3500 (tsubst_nested_requirement): Use constraint_satisfaction_value
3501 instead of satisfy_constraint_expression, which'll do the
3502 noisy replaying of ill-formed quiet satisfaction for us.
3503 (decl_satisfied_cache): Adjust comment.
3504 (satisfy_constraint): Rename to ...
3505 (satisfy_normalized_constraints): ... this.
3506 (satisfy_associated_constraints): Remove (and make its
3507 callers check for dependent arguments).
3508 (satisfy_constraint_expression): Rename to ...
3509 (satisfy_nondeclaration_constraints): ... this. Assert that
3510 'args' is empty when 't' is a concept-id. Removing handling
3511 bare constraint-expressions, and handle REQUIRES_EXPRs
3512 specially. Adjust comment accordingly.
3513 (satisfy_declaration_constraints): Assert in the two-parameter
3514 version that 't' is not a TEMPLATE_DECL. Adjust following
3515 removal of normalize_(non)?template_requirements and
3516 satisfy_asociated_constraints.
3517 (constraint_satisfaction_value): Combine the two- and
3518 three-parameter versions in the natural way.
3519 (constraints_satisfied_p): Combine the one- and two-parameter
3520 versions in the natural way. Improve documentation.
3521 (evaluate_requires_expr): Define.
3522 (evaluate_concept_check): Remove 'complain' parameter. Use
3523 constraint_satisfaction_value instead of
3524 satisfy_constraint_expression.
3525 (diagnose_nested_requirement): Adjust following renaming of
3526 satisfy_constraint_expression.
3527 (diagnose_constraints): Handle REQUIRES_EXPR by going through
3528 diagnose_requires_expr directly instead of treating it as a
3529 constraint-expression. Improve documentation.
3530 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
3531 to evaluate_concept_check.
3532 <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
3533 constraints_satisfied_p.
3534 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3535 * cp-tree.h (evaluate_requires_expr): Declare.
3536 (evaluate_concept_check): Remove tsubst_flag_t parameter.
3537 (satisfy_constraint_expression): Remove declaration.
3538 (constraints_satisfied_p): Remove one-parameter declaration.
3539 Add a default argument to the two-parameter declaration.
3540 * cvt.c (convert_to_void): Adjust call to
3541 evaluate_concept_check.
3542
35432021-03-03 Jakub Jelinek <jakub@redhat.com>
3544
3545 PR c++/82959
3546 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
3547 and COMPOUND_EXPR.
3548
35492021-03-03 Marek Polacek <polacek@redhat.com>
3550
3551 PR c++/97034
3552 PR c++/99009
3553 * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
3554 (maybe_aggr_guide): Use the original template type where needed. In
3555 a class member template, partially instantiate the result of
3556 collect_ctor_idx_types.
3557 (do_class_deduction): Defer the deduction until the enclosing
3558 scope is non-dependent.
3559
35602021-03-03 Jason Merrill <jason@redhat.com>
3561
3562 PR c++/95675
3563 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
3564 if it didn't get one before.
3565
35662021-03-03 Nathan Sidwell <nathan@acm.org>
3567
3568 PR c++/99344
3569 * module.cc (trees_out::decl_node): Small refactor.
3570 (depset::hash::add_binding_entity): Return true on meeting an
3571 import. Set namespace's import here.
3572 (module_state:write_namespaces): Inform of purview too.
3573 (module_state:read_namespaces): Adjust.
3574 * name-lookup.c (implicitly_export_namespace): Delete.
3575 (do_pushdecl): Don't call it.
3576 (push_namespace): Likewise, set purview.
3577 (add_imported_namespace): Reorder parms.
3578 * name-lookup.h (add_imported_namespace): Alter param ordering.
3579
d97a92dc
GA
35802021-03-02 Martin Sebor <msebor@redhat.com>
3581
3582 PR c++/99251
3583 * class.c (build_base_path): Call build_if_nonnull.
3584 * cp-tree.h (build_if_nonnull): Declare.
3585 * rtti.c (ifnonnull): Rename...
3586 (build_if_nonnull): ...to this. Set no-warning bit on COND_EXPR.
3587 (build_dynamic_cast_1): Adjust to name change.
3588
35892021-03-02 Patrick Palka <ppalka@redhat.com>
3590
3591 PR c++/96443
3592 PR c++/96960
3593 * constraint.cc (type_deducible_p): Don't substitute into the
3594 constraints, and instead just pass 'args' to do_auto_deduction
3595 as the outer template arguments.
3596 (tsubst_parameter_mapping): Remove confused code for handling
3597 placeholder type arguments.
3598 (normalize_placeholder_type_constraint): Define.
3599 (satisfy_constraint_expression): Use it to handle placeholder
3600 'auto' types.
3601 * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
3602 (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
3603 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
3604 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3605 (make_constrained_placeholder_type): Set
3606 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3607 (do_auto_deduction): Clarify comments about the outer_targs
3608 parameter. Rework satisfaction of a placeholder type constraint
3609 to pass in the complete set of template arguments directly to
3610 constraints_satisfied_p.
3611 (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
3612 instead. Also rebuild the the constraint info on the new auto.
3613
36142021-03-02 Patrick Palka <ppalka@redhat.com>
3615
3616 * constraint.cc (build_parameter_mapping): Rely on the caller to
3617 determine the in-scope template parameters.
3618 (norm_info::norm_info): Delegate the tsubst_flags_t constructor
3619 to the two-parameter constructor. In the two-parameter
3620 constructor, fold in the definition of make_context, set
3621 initial_parms appropriately, and don't set the now-removed
3622 orig_decl member.
3623 (norm_info::make_context): Remove, now that its only use is
3624 inlined into the caller.
3625 (norm_info::update_context): Adjust call to
3626 build_parameter_mapping to pass in the relevant set of in-scope
3627 template parameters.
3628 (norm_info::ctx_parms): Define this member function.
3629 (norm_info::context): Initialize to NULL_TREE.
3630 (norm_info::orig_decl): Remove this data member.
3631 (norm_info::initial_parms): Define this data member.
3632 (normalize_atom): Adjust call to build_parameter_mapping to pass
3633 in the relevant set of in-scope template parameters. Use
3634 info.initial_parms instead of info.orig_decl.
3635 (normalize_constraint_expression): Take a norm_info object
3636 instead of a bool. Cache the result of normalization.
3637 (tsubst_nested_requirement): Call satisfy_constraint_expression
3638 instead of satisfy_constraint, so that we normalize on demand.
3639 (satisfy_constraint_expression): Handle a NESTED_REQ argument.
3640 Adjust call to normalize_constraint_expression.
3641 (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
3642 to current_template_parms.
3643 (diagnose_nested_requirements): Go through
3644 satisfy_constraint_expression, as with tsubst_nested_requirement.
3645
36462021-03-02 Patrick Palka <ppalka@redhat.com>
3647
3648 * constraint.cc (tsubst_parameter_mapping): Canonicalize the
3649 arguments of a substituted TYPE_ARGUMENT_PACK even if we've
3650 started with a TYPE_ARGUMENT_PACK.
3651 (finish_requires_expr): Don't set DECL_CONTEXT and
3652 CONSTRAINT_VAR_P on each of the introduced parameters here.
3653 * parser.c (cp_parser_requirement_parameter_list): Instead set
3654 these fields earlier, here.
3655 * pt.c (do_auto_deduction): Canonicalize the result of
3656 do_auto_deduction. Pass 'complain' to finish_decltype_type.
3657
36582021-03-02 Patrick Palka <ppalka@redhat.com>
3659
3660 * constraint.cc (tsubst_simple_requirement): Just return
3661 boolean_true_node on success.
3662 (tsubst_type_requirement): Likewise.
3663 (tsubst_compound_requirement): Likewise.
3664 (tsubst_nested_requirement): Likewise.
3665 (tsubst_requirement_body): Remove.
3666 (check_constaint_variables): Rename to ...
3667 (check_constraint_variables): ... this.
3668 (tsubst_constraint_variables): Adjust.
3669 (tsubst_requires_expr): Fold tsubst_requirement_body into here.
3670
88938886
GA
36712021-03-01 Nathan Sidwell <nathan@acm.org>
3672
3673 PR c++/99294
3674 * class.c (fixup_type_variants): Propagate mode, precision,
3675 alignment & emptiness.
3676 * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
3677 (trees_in::tree_node): Rematerialize alignment here.
3678
ec9dc4fa
GA
36792021-02-27 Jason Merrill <jason@redhat.com>
3680
3681 PR c++/90333
3682 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
3683 between () and ->.
3684
06a9f20f
GA
36852021-02-26 Jakub Jelinek <jakub@redhat.com>
3686
3687 * parser.c (cp_parser_lambda_declarator_opt): Implement
3688 P1102R2 - Down with ()! Make ()s optional before lambda specifiers
3689 for -std={c,gnu}++2b or with pedwarn in earlier versions.
3690
36912021-02-26 Jakub Jelinek <jakub@redhat.com>
3692
3693 PR c++/95451
3694 * lambda.c (is_lambda_ignored_entity): Before checking for
3695 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check.
3696
36972021-02-26 Jason Merrill <jason@redhat.com>
3698
3699 PR c++/98810
3700 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
3701 to a class non-type template argument that needs it.
3702
37032021-02-26 Patrick Palka <ppalka@redhat.com>
3704
3705 PR c++/98990
3706 * pt.c (splice_late_return_type): Rebuild the entire return type
3707 if we have to adjust the level of an auto within.
3708 (type_uses_auto): Adjust call to find_type_usage.
3709 * type-utils.h (find_type_usage): Revert r10-6571 change that
3710 made this function return a pointer to the auto node.
3711
daa68844
GA
37122021-02-25 Patrick Palka <ppalka@redhat.com>
3713
3714 PR c++/99213
3715 PR c++/94521
3716 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
3717 TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
3718
37192021-02-25 Patrick Palka <ppalka@redhat.com>
3720
3721 PR c++/99103
3722 * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
3723 (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
3724
37252021-02-25 Marek Polacek <polacek@redhat.com>
3726
3727 DR 1312
3728 PR c++/99176
3729 * constexpr.c (is_std_construct_at): New overload.
3730 (is_std_allocator_allocate): New overload.
3731 (cxx_eval_call_expression): Use the new overloads.
3732 (cxx_eval_constant_expression): Reject casting
3733 from void * as per DR 1312. Don't check can_convert.
3734
37352021-02-25 Iain Sandoe <iain@sandoe.co.uk>
3736
3737 PR c++/97587
3738 * coroutines.cc (struct param_info): Track rvalue refs.
3739 (morph_fn_to_coro): Track rvalue refs, and call the promise
3740 CTOR with the frame copy of passed parms.
3741
37422021-02-25 Iain Sandoe <iain@sandoe.co.uk>
3743
3744 PR c++/95822
3745 * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
3746 set throwing_cleanup marker.
3747
37482021-02-25 Nathan Sidwell <nathan@acm.org>
3749
3750 PR c++/99166
3751 * module.cc (module_state::inform_cmi_p): Renamed field.
3752 (module_state::do_import): Adjust.
3753 (init_modules, finish_module_processing): Likewise.
3754 (handle_module_option): Likewise.
3755
37562021-02-25 Nathan Sidwell <nathan@acm.org>
3757
3758 PR c++/98318
3759 * mapper-client.cc (module_client::open_module_client): Fix typo
3760 of fd init.
3761
4028d01a
GA
37622021-02-24 Nathan Sidwell <nathan@acm.org>
3763
3764 PR c++/98718
3765 * module.cc (ool): New indirection vector.
3766 (loc_spans::maybe_propagate): Location is not optional.
3767 (loc_spans::open): Likewise. Assert monotonically advancing.
3768 (module_for_ordinary_loc): Use ool indirection vector.
3769 (module_state::write_prepare_maps): Do not count empty macro
3770 expansions. Elide empty spans.
3771 (module_state::write_macro_maps): Skip empty expansions.
3772 (ool_cmp): New qsort comparator.
3773 (module_state::write): Create and destroy ool vector.
3774 (name_pending_imports): Fix dump push/pop.
3775 (preprocess_module): Likewise. Add more dumping.
3776 (preprocessed_module): Likewise.
3777
37782021-02-24 Iain Sandoe <iain@sandoe.co.uk>
3779
3780 PR c++/96251
3781 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
3782 error reporting when instantiating for a constexpr.
3783
71e24b06
GA
37842021-02-23 Nathan Sidwell <nathan@acm.org>
3785
3786 PR c++/99208
3787 * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
3788 identity.
3789
37902021-02-23 Patrick Palka <ppalka@redhat.com>
3791
3792 PR c++/95468
3793 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
3794 over from tsubst_copy.
3795
37962021-02-23 Patrick Palka <ppalka@redhat.com>
3797
3798 * pt.c (instantiation_dependent_expression_p): Check
3799 processing_template_decl before calling
3800 potential_constant_expression.
3801
2f5765cf
GA
38022021-02-22 Nathan Sidwell <nathan@acm.org>
3803
3804 PR c++/99174
3805 * module.cc (struct module_state): Add visited_p flag.
3806 (name_pending_imports): Use it to avoid duplicate requests.
3807 (preprocess_module): Don't read preprocessor state if we failed to
3808 load a module's config.
3809
38102021-02-22 Nathan Sidwell <nathan@acm.org>
3811
3812 PR c++/99153
3813 * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
3814 to common-path.
3815 * module.cc (set_defining_module): Add assert.
3816
50352c6c
GA
38172021-02-19 Nathan Sidwell <nathan@acm.org>
3818
3819 PR c++/98741
3820 * module.cc (pending_imports): New.
3821 (declare_module): Adjust test condition.
3822 (name_pending_imports): New.
3823 (preprocess_module): Reimplement using pending_imports.
3824 (preprocessed_module): Move name-getting to name_pending_imports.
3825 * name-lookup.c (append_imported_binding_slot): Assert module
3826 ordering is increasing.
3827
38282021-02-19 Nathan Sidwell <nathan@acm.org>
3829
3830 * module.cc (note_cmis): New.
3831 (struct module_state): Add inform_read_p bit.
3832 (module_state::do_import): Inform of CMI location, if enabled.
3833 (init_modules): Canonicalize note_cmis entries.
3834 (handle_module_option): Handle -flang-info-module-read=FOO.
3835
38362021-02-19 Jason Merrill <jason@redhat.com>
3837
3838 PR c++/96926
3839 * call.c (perfect_conversion_p): Limit rvalueness
3840 test to reference bindings.
3841
38422021-02-19 Jason Merrill <jason@redhat.com>
3843
3844 PR c++/96926
3845 * call.c (perfect_conversion_p): New.
3846 (perfect_candidate_p): New.
3847 (add_candidates): Ignore templates after a perfect non-template.
3848
bf81237e
GA
38492021-02-18 Nathan Sidwell <nathan@acm.org>
3850
3851 PR c++/99023
3852 * module.cc (canonicalize_header_name): Use
3853 cpp_probe_header_unit.
3854 (maybe_translate_include): Fix note_includes comparison.
3855 (init_modules): Fix note_includes string termination.
3856
38572021-02-18 Jakub Jelinek <jakub@redhat.com>
3858
3859 PR c++/99132
3860 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
3861 cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
3862 for immediate function calls.
3863
acc0ee5c
GA
38642021-02-17 Nathan Sidwell <nathan@acm.org>
3865
3866 PR c++/99023
3867 * module.cc (struct macro_export): Add GTY markers.
3868 (macro_exports): Likewise, us a va_gc Vector.
3869
38702021-02-17 Jakub Jelinek <jakub@redhat.com>
3871
3872 PR sanitizer/99106
3873 * init.c (build_zero_init_1): For flexible array members just return
3874 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
3875 ARRAY_TYPE.
3876
38772021-02-17 Nathan Sidwell <nathan@acm.org>
3878
3879 PR c++/99116
3880 * name-lookup.c (do_pushdecl): Don't peek under template_parm
3881 bindings here ...
3882 (set_identifier_type_value_with_scope): ... or here.
3883 (do_pushtag): Only set_identifier_type_value_with_scope at
3884 non-class template parm scope, and use parent scope.
3885
38862021-02-17 Nathan Sidwell <nathan@acm.org>
3887
3888 PR c++/99071
3889 * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
3890 pointer.
3891
38922021-02-17 Patrick Palka <ppalka@redhat.com>
3893
3894 PR debug/96997
3895 PR c++/94034
3896 * tree.c (build_aggr_init_expr): Revert r10-7718 change.
3897
fab095da
GA
38982021-02-12 Nathan Sidwell <nathan@acm.org>
3899
3900 * module.cc (module_state::write_cluster): Check bindings for
3901 imported using-decls.
3902
39032021-02-12 Nathan Sidwell <nathan@acm.org>
3904
3905 PR c++/99040
3906 * module.cc (trees_in::decl_value): Call add_module_namespace_decl
3907 for new namespace-scope entities.
3908 (module_state::read_cluster): Don't call add_module_decl here.
3909 * name-lookup.h (add_module_decl): Rename to ...
3910 (add_module_namespace_decl): ... this.
3911 * name-lookup.c (newbinding_bookkeeping): Move into ...
3912 (do_pushdecl): ... here. Its only remaining caller.
3913 (add_module_decl): Rename to ...
3914 (add_module_namespace_decl): ... here. Add checking-assert for
3915 circularity. Don't call newbinding_bookkeeping, just extern_c
3916 checking and incomplete var checking.
3917
39182021-02-12 Nathan Sidwell <nathan@acm.org>
3919
3920 PR c++/99039
3921 PR c++/99040
3922 * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
3923 (global_type_node): Delete.
3924 (IDENTIFIER_TYPE_VALUE): Delete.
3925 (IDENTIFIER_HAS_TYPE_VALUE): Delete.
3926 (get_type_value): Delete.
3927 * name-lookup.h (identifier_type_value): Delete.
3928 * name-lookup.c (check_module_override): Don't
3929 SET_IDENTIFIER_TYPE_VALUE here.
3930 (do_pushdecl): Nor here.
3931 (identifier_type_value_1, identifier_type_value): Delete.
3932 (set_identifier_type_value_with_scope): Only
3933 SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
3934 (pushdecl_nanmespace_level): Remove shadow stack nadgering.
3935 (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
3936 * call.c (check_dtor_name): Use lookup_name.
3937 * decl.c (cxx_init_decl_processing): Drop global_type_node.
3938 * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
3939 here.
3940 * init.c (get_type_value): Delete.
3941 * pt.c (instantiate_class_template_1): Don't call pushtag or
3942 SET_IDENTIFIER_TYPE_VALUE here.
3943 (tsubst): Assert never an identifier.
3944 (dependent_type_p): Drop global_type_node assert.
3945 * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
3946 to determine ctorness.
3947
39482021-02-12 Jakub Jelinek <jakub@redhat.com>
3949
3950 PR c++/97742
3951 * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
3952 CPP_EOF.
3953
39542021-02-12 Jason Merrill <jason@redhat.com>
3955
3956 PR c++/97246
3957 PR c++/94546
3958 * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
3959 (register_parameter_specializations): Not here.
3960
0c5cdb31
GA
39612021-02-11 Marek Polacek <polacek@redhat.com>
3962
3963 PR c++/95888
3964 * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
3965 for the partial instantiation.
3966
39672021-02-11 Jakub Jelinek <jakub@redhat.com>
3968
3969 PR c++/99033
3970 * init.c (build_zero_init_1): Handle zero initialiation of
3971 flexible array members like initialization of [0] arrays.
3972 Use integer_minus_onep instead of comparison to integer_minus_one_node
3973 and integer_zerop instead of comparison against size_zero_node.
3974 Formatting fixes.
3975
39762021-02-11 Marek Polacek <polacek@redhat.com>
3977
3978 PR c++/99063
3979 * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
3980
39812021-02-11 Patrick Palka <ppalka@redhat.com>
3982
3983 PR c++/97582
3984 * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
3985 lookup result by discarding it if the first element is a
3986 class-scope declaration, otherwise return it.
3987 (push_operator_bindings): Handle an ambiguous lookup result by
3988 doing push_local_binding on each element in the list.
3989
39902021-02-11 Marek Polacek <polacek@redhat.com>
3991
3992 * parser.c (cp_parser_selection_statement): Use vec_free.
3993
4b37c3ea
GA
39942021-02-10 Jakub Jelinek <jakub@redhat.com>
3995
3996 PR c++/98988
3997 PR c++/99031
3998 * constexpr.c: Include cgraph.h.
3999 (cxx_eval_call_expression): Call varpool_node::finalize_decl on
4000 heap artificial vars.
4001 (cxx_eval_outermost_constant_expr): Remove varpool nodes for
4002 heap artificial vars.
4003
40042021-02-10 Nathan Sidwell <nathan@acm.org>
4005
4006 PR c++/99030
4007 * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
4008 answer if there's no local specialization.
4009
0a91b73e
GA
40102021-02-09 Nathan Sidwell <nathan@acm.org>
4011
4012 PR c++/98944
4013 * module.cc (module_state::is_rooted): Rename to ...
4014 (module_state::has_location): ... here. Adjust callers.
4015 (module_state::read_partitions): Adjust validity check.
4016 Don't overwrite a known location.
4017
40182021-02-09 Jason Merrill <jason@redhat.com>
4019
4020 PR c++/96905
4021 * pt.c (mark_decl_instantiated): Exit early if consteval.
4022
40232021-02-09 Jason Merrill <jason@redhat.com>
4024
4025 PR c++/98326
4026 PR c++/20408
4027 * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
4028 parm.
4029
40302021-02-09 Jason Merrill <jason@redhat.com>
4031
4032 PR c++/98994
4033 PR c++/97566
4034 * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
4035 RECORD_TYPE.
4036
2da7ce23
GA
40372021-02-08 Nathan Sidwell <nathan@acm.org>
4038
4039 * decl.c (start_cleanup_fn): Push function into
4040 namespace.
4041
40422021-02-08 Nathan Sidwell <nathan@acm.org>
4043
4044 PR c++/98531
4045 * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
4046 * decl.c (push_abi_namespace, pop_abi_namespace): Moved
4047 from rtti.c, add default namespace arg.
4048 (check_redeclaration_exception_specification): Allow a lazy
4049 builtin's eh spec to differ from an lready-declared user
4050 declaration.
4051 (declare_global_var): Use push/pop_abi_namespace.
4052 (get_atexit_node): Push the fndecl into a namespace.
4053 * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
4054 decl.c.
4055
40562021-02-08 Marek Polacek <polacek@redhat.com>
4057
4058 * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
4059
1ed59127
GA
40602021-02-05 Marek Polacek <polacek@redhat.com>
4061
4062 PR c++/98947
4063 * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
4064 on arg2/arg3.
4065 * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
4066 issuing the -Wvolatile warning. Only set TREE_THIS_VOLATILE if
4067 a warning was emitted.
4068
40692021-02-05 Marek Polacek <polacek@redhat.com>
4070
4071 PR c++/96462
4072 * name-lookup.c (lookup_using_decl): Hoist the destructor check.
4073
40742021-02-05 Jakub Jelinek <jakub@redhat.com>
4075
4076 PR c++/97878
4077 * decl.c (check_array_initializer): For structured bindings, require
4078 the array type to be complete.
4079
a19dd5e6
GA
40802021-02-04 Jason Merrill <jason@redhat.com>
4081
4082 PR c++/98717
4083 * constraint.cc (build_concept_check_arguments): Remove assert.
4084 (build_concept_check): Allow empty args.
4085
40862021-02-04 Tom Greenslade (thomgree) <thomgree@cisco.com>
4087
4088 PR c++/90926
4089 * call.c (can_convert_array): Extend to handle all valid aggregate
4090 initializers of an array; including by string literals, not just by
4091 brace-init-list.
4092 (build_aggr_conv): Call can_convert_array more often, not just in
4093 brace-init-list case.
4094 * typeck2.c (array_string_literal_compatible_p): New function.
4095 (digest_init_r): call array_string_literal_compatible_p
4096 * cp-tree.h: (array_string_literal_compatible_p): Declare.
4097
40982021-02-04 Jason Merrill <jason@redhat.com>
4099
4100 PR c++/98802
4101 * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
4102
41032021-02-04 Jason Merrill <jason@redhat.com>
4104
4105 PR c++/95192
4106 * pt.c (tsubst_attribute): Handle error.
4107 (apply_late_template_attributes): Return false on error.
4108 (tsubst_function_decl): Check its return value.
4109 (tsubst_decl): Likewise.
4110 (push_template_decl): Assert current_template_parms.
4111 (tsubst_template_decl): Set current_template_parms.
4112
9faaa807
GA
41132021-02-03 Marek Polacek <polacek@redhat.com>
4114
4115 PR c++/98951
4116 * call.c (struct z_candidate): Mark rewritten and reversed as const.
4117 (struct NonPublicField): Mark operator() as const.
4118 (struct NonTrivialField): Likewise.
4119
41202021-02-03 Jason Merrill <jason@redhat.com>
4121
4122 PR c++/98926
4123 PR c++/98570
4124 * pt.c (spec_hasher::equal): Set processing_template_decl.
4125 * Make-lang.in (check-g++-strict-gc): Add --param
4126 hash-table-verification-limit=10000.
4127
41282021-02-03 Marek Polacek <polacek@redhat.com>
4129
4130 PR c++/98899
4131 * parser.c (cp_parser_class_specifier_1): Use any possible
4132 DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
4133 (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
4134 * pt.c (tsubst_exception_specification): Stash new_specs into
4135 DEFPARSE_INSTANTIATIONS.
4136 * tree.c (fixup_deferred_exception_variants): Use
4137 UNPARSED_NOEXCEPT_SPEC_P.
4138
548b75d8
GA
41392021-02-02 Jason Merrill <jason@redhat.com>
4140
4141 PR c++/98929
4142 PR c++/96199
4143 * error.c (dump_expr): Ignore dummy object.
4144 * pt.c (tsubst_baselink): Handle dependent scope.
4145
f7884fb1
GA
41462021-02-01 Patrick Palka <ppalka@redhat.com>
4147
4148 PR c++/98295
4149 * constexpr.c (cxx_eval_array_reference): Also set
4150 new_ctx.object when setting new_ctx.ctor.
4151
41522021-02-01 Marek Polacek <polacek@redhat.com>
4153
4154 PR c++/98355
4155 * parser.c (cp_parser_has_attribute_expression): Use
4156 uses_template_parms instead of type_dependent_expression_p.
4157
41582021-02-01 Jason Merrill <jason@redhat.com>
4159
4160 PR c++/98570
4161 * cp-tree.h: Declare it.
4162 * pt.c (comparing_dependent_aliases): New flag.
4163 (template_args_equal, spec_hasher::equal): Set it.
4164 (dependent_alias_template_spec_p): Assert that we don't
4165 get non-types other than error_mark_node.
4166 (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
4167 on complex alias specializations. Set TYPE_DEPENDENT_P here.
4168 (tsubst_decl): Not here.
4169 * module.cc (module_state::read_cluster): Set
4170 comparing_dependent_aliases instead of
4171 comparing_specializations.
4172 * tree.c (cp_tree_equal): Remove comparing_specializations
4173 module handling.
4174 * typeck.c (structural_comptypes): Adjust.
4175 (comptypes): Remove comparing_specializations handling.
4176
2900f2f2
GA
41772021-01-29 Nathan Sidwell <nathan@acm.org>
4178
4179 PR c++/98843
4180 * module.cc (module_state_config): Add num_entities field.
4181 (module_state::read_entities): The entity_ary span is
4182 already allocated.
4183 (module_state::write_config): Write num_entities.
4184 (module_state::read_config): Read num_entities.
4185 (module_state::write): Set config's num_entities.
4186 (module_state::read_initial): Allocate the entity ary
4187 span here.
4188 (module_state::read_language): Do not set entity_lwm
4189 here.
4190
41912021-01-29 Marek Polacek <polacek@redhat.com>
4192
4193 PR c++/96137
4194 * parser.c (cp_parser_class_name): If parser->scope is
4195 error_mark_node, return it, otherwise continue.
4196
85d04a2e
GA
41972021-01-28 Jakub Jelinek <jakub@redhat.com>
4198
4199 PR c++/98841
4200 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
4201
42022021-01-28 Jakub Jelinek <jakub@redhat.com>
4203
4204 PR c++/33661
4205 PR c++/98847
4206 * decl.c (cp_finish_decl): For register vars with asmspec in templates
4207 call set_user_assembler_name and set DECL_HARD_REGISTER.
4208 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
4209 pass asmspec_tree to cp_finish_decl.
4210
42112021-01-28 Nathan Sidwell <nathan@acm.org>
4212
4213 PR c++/98770
4214 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
4215 check order.
4216 (trees_in::decl_value): Do typedef frobbing only when installing
4217 a new typedef, adjust is_matching_decl call. Swap is_typedef
4218 & TYPE_NAME check.
4219 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
4220 names and deal with typedef checking.
4221
aa69f0a8
GA
42222021-01-27 Jason Merrill <jason@redhat.com>
4223
4224 PR c++/97874
4225 * name-lookup.c (lookup_using_decl): Clean up handling
4226 of dependency and inherited constructors.
4227 (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
4228 * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
4229
e62bb7f0
GA
42302021-01-26 Jason Merrill <jason@redhat.com>
4231
4232 PR c++/97474
4233 * call.c (type_passed_as): Don't mark invisiref restrict.
4234
42352021-01-26 Jason Merrill <jason@redhat.com>
4236
4237 PR c++/97566
4238 PR c++/98463
4239 * class.c (layout_class_type): An empty field gets size 0.
4240 (is_empty_field): New.
4241 (check_bases): Check it.
4242 * cp-tree.h (is_empty_field): Declare it.
4243 * constexpr.c (cxx_eval_store_expression): Check it.
4244 (cx_check_missing_mem_inits): Likewise.
4245 * init.c (perform_member_init): Likewise.
4246 * typeck2.c (process_init_constructor_record): Likewise.
4247
161e4c08
GA
42482021-01-25 Martin Sebor <msebor@redhat.com>
4249
4250 PR c++/98646
4251 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
4252
42532021-01-25 Jason Merrill <jason@redhat.com>
4254
4255 PR c++/98463
4256 * constexpr.c (get_or_insert_ctor_field): Add check.
4257 (cxx_eval_store_expression): Handle discontinuity of refs.
4258
6b163337
GA
42592021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
4260
4261 * call.c (complain_about_access): Altered function.
4262 * cp-tree.h (complain_about_access): Changed parameters of function.
4263 (get_parent_with_private_access): Declared new function.
4264 * search.c (get_parent_with_private_access): Defined new function.
4265 * semantics.c (enforce_access): Modified function.
4266 * typeck.c (complain_about_unrecognized_member): Updated function
4267 arguments in complain_about_access.
4268
42692021-01-23 Patrick Palka <ppalka@redhat.com>
4270
4271 PR c++/97399
4272 * cp-tree.h (shared_member_p): Adjust declaration.
4273 * parser.c (cp_parser_init_declarator): If the storage class
4274 specifier is sc_static, pass true for static_p to
4275 cp_parser_declarator.
4276 (cp_parser_direct_declarator): Don't do inject_this_parm when
4277 the declarator is a friend.
4278 * search.c (shared_member_p): Change return type to bool and
4279 adjust function body accordingly. Return false for a dependent
4280 USING_DECL instead of aborting.
4281 * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
4282 even when type-dependent.
4283
8502e23d
GA
42842021-01-22 Marek Polacek <polacek@redhat.com>
4285
4286 PR c++/96623
4287 * parser.c (inject_parm_decls): Remove a redundant assignment.
4288 (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
4289 before calling inject_parm_decls.
4290
42912021-01-22 Jason Merrill <jason@redhat.com>
4292
4293 PR c++/98744
4294 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
4295
42962021-01-22 Jakub Jelinek <jakub@redhat.com>
4297
4298 PR sanitizer/95693
4299 * init.c (build_zero_init_1): Revert the 2018-03-06 change to
4300 return build_zero_cst for reference types.
4301 * typeck2.c (process_init_constructor_record): Instead call
4302 build_zero_cst here during error recovery instead of build_zero_init.
4303
43042021-01-22 Marek Polacek <polacek@redhat.com>
4305
4306 PR c++/98545
4307 * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
4308 warnings regardless of abi_version_at_least.
4309 (write_expression): When the expression is a dependent name
4310 and an operator name, write "on" before writing its name.
4311
43122021-01-22 Marek Polacek <polacek@redhat.com>
4313
4314 PR c++/97966
4315 * pt.c (instantiate_class_template_1): Instantiate members
4316 marked with attribute used only after we're done instantiating
4317 the class.
4318
7559d465
GA
43192021-01-21 Patrick Palka <ppalka@redhat.com>
4320
4321 PR c++/71879
4322 * semantics.c (finish_decltype_type): Set up a cp_unevaluated
4323 sentinel at the start of the function. Remove a now-redundant
4324 manual adjustment of cp_unevaluated_operand.
4325
43262021-01-21 Nathan Sidwell <nathan@acm.org>
4327
4328 PR c++/98624
4329 * module.cc (depset::hash::find_dependencies): Add
4330 module arg.
4331 (trees_out::core_vals): Check state before calling
4332 write_location.
4333 (sort_cluster, module_state::write): Adjust
4334 find_dependencies call.
4335
43362021-01-21 Jakub Jelinek <jakub@redhat.com>
4337
4338 PR c++/98672
4339 * constexpr.c (check_for_return_continue_data): Add break_stmt member.
4340 (check_for_return_continue): Also look for BREAK_STMT. Handle
4341 SWITCH_STMT by ignoring break_stmt from its body.
4342 (potential_constant_expression_1) <case FOR_STMT>,
4343 <case WHILE_STMT>: If the condition isn't constant true, check if
4344 the loop body can contain a return stmt.
4345 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
4346 <case IF_STMT>: If recursion with tf_none is successful,
4347 merge *jump_target from the branches - returns with highest priority,
4348 breaks or continues lower. If then branch is potentially constant and
4349 doesn't return, check the else branch if it could return, break or
4350 continue.
4351
43522021-01-21 Nathan Sidwell <nathan@acm.org>
4353
4354 PR c++/98530
4355 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
4356
b93d0e36
GA
43572021-01-20 Nathan Sidwell <nathan@acm.org>
4358
4359 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
4360 signed type.
4361
43622021-01-20 Patrick Palka <ppalka@redhat.com>
4363
4364 PR c++/95434
4365 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
4366 CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
4367 adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
4368
43692021-01-20 Patrick Palka <ppalka@redhat.com>
4370
4371 PR c++/82613
4372 * parser.c (cp_parser_class_head): Defer access checking when
4373 parsing the base-clause until all bases are seen and attached
4374 to the class type.
4375 * pt.c (instantiate_class_template): Likewise when substituting
4376 into dependent bases.
4377
43782021-01-20 Jakub Jelinek <jakub@redhat.com>
4379
4380 PR c++/98742
4381 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
4382 error_operand_p, remove clause without further checking. Check
4383 for non-NULL TYPE_NAME.
4384
f35a4f96
GA
43852021-01-19 Marek Polacek <polacek@redhat.com>
4386
4387 PR c++/98659
4388 * pt.c (maybe_instantiate_noexcept): Return false if FN is
4389 error_mark_node.
4390
43912021-01-19 Marek Polacek <polacek@redhat.com>
4392
4393 PR c++/98687
4394 * name-lookup.c (push_using_decl_bindings): New, broken out of...
4395 (finish_nonmember_using_decl): ...here.
4396 * name-lookup.h (push_using_decl_bindings): Update declaration.
4397 * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
4398
43992021-01-19 Patrick Palka <ppalka@redhat.com>
4400
4401 PR c++/41437
4402 PR c++/58993
4403 * search.c (friend_accessible_p): If scope is a hidden friend
4404 defined inside a dependent class, consider access from the
4405 class.
4406 * parser.c (cp_parser_late_parsing_for_member): Don't push a
4407 dk_no_check access state.
4408
44092021-01-19 Marek Polacek <polacek@redhat.com>
4410
4411 PR c++/98333
4412 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
4413 of NSDMIs before late-parsing of noexcept-specifiers.
4414
44152021-01-19 Nathan Sidwell <nathan@acm.org>
4416
4417 * module.cc (identifier): Merge overloads.
4418
44192021-01-19 Nathan Sidwell <nathan@acm.org>
4420
4421 PR c++/98624
4422 * module.cc (trees_out::write_location): Make static.
4423
59cf67d1
GA
44242021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
4425
4426 * parser.c (cp_parser_omp_clause_detach): New.
4427 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
4428 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
4429 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4430 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4431 Prevent use of detach with mergeable and overriding the data sharing
4432 mode of the event handle.
4433
2f7f0d32
GA
44342021-01-15 Nathan Sidwell <nathan@acm.org>
4435
4436 PR c++/98538
4437 * tree.c (cp_build_qualified_type_real): Propagate an array's
4438 dependentness to the copy, if known.
4439
44402021-01-15 Jason Merrill <jason@redhat.com>
4441
4442 PR c++/98642
4443 * call.c (unsafe_return_slot_p): Return int.
4444 (init_by_return_slot_p): Split out from...
4445 (unsafe_copy_elision_p): ...here.
4446 (unsafe_copy_elision_p_opt): New name for old meaning.
4447 (build_over_call): Adjust.
4448 (make_safe_copy_elision): New.
4449 * typeck2.c (split_nonconstant_init_1): Elide copy from safe
4450 list-initialization.
4451 * cp-tree.h: Adjust.
4452
44532021-01-15 Jason Merrill <jason@redhat.com>
4454
4455 * call.c (base_ctor_for, make_base_init_ok): New.
4456 (build_over_call): Use make_base_init_ok.
4457
44582021-01-15 Jason Merrill <jason@redhat.com>
4459
4460 PR c++/63707
4461 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
4462 if we got a CONSTRUCTOR.
4463
44642021-01-15 Nathan Sidwell <nathan@acm.org>
4465
4466 PR c++/98591
4467 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
4468
5fff80fd
GA
44692021-01-14 Jason Merrill <jason@redhat.com>
4470
4471 * typeck2.c (process_init_constructor_record): Use fldtype
4472 variable consistently.
4473
44742021-01-14 Nathan Sidwell <nathan@acm.org>
4475
4476 PR c++/98372
4477 * tree.c (cp_tree_equal): Correct map_context logic.
4478
be0851b8
GA
44792021-01-13 Marek Polacek <polacek@redhat.com>
4480
4481 PR c++/98231
4482 * name-lookup.c (push_using_decl_bindings): New.
4483 * name-lookup.h (push_using_decl_bindings): Declare.
4484 * pt.c (tsubst_expr): Call push_using_decl_bindings.
4485
44862021-01-13 Nathan Sidwell <nathan@acm.org>
4487
4488 PR c++/98626
4489 * module.cc (module_add_import_initializers): Pass a
4490 zero-element argument vector.
4491
6851dda2
GA
44922021-01-12 Patrick Palka <ppalka@redhat.com>
4493
4494 PR c++/98611
4495 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
4496 the template of a CTAD placeholder.
4497
44982021-01-12 Marek Polacek <polacek@redhat.com>
4499
4500 PR c++/98620
4501 * typeck2.c (process_init_constructor_record): Don't emit
4502 -Wmissing-field-initializers warnings in unevaluated contexts.
4503
67fbb7f0
GA
45042021-01-11 Jakub Jelinek <jakub@redhat.com>
4505
4506 PR c++/98481
4507 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
4508 for types.
4509 (mark_abi_tags_r): Likewise.
4510 * decl2.c (min_vis_r): Likewise.
4511 * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
4512 typedefs.
4513
bf5cbb9e
GA
45142021-01-08 Patrick Palka <ppalka@redhat.com>
4515
4516 PR c++/98551
4517 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
4518 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
4519
45202021-01-08 Patrick Palka <ppalka@redhat.com>
4521
4522 PR c++/98515
4523 * semantics.c (check_accessibility_of_qualified_id): Punt if
4524 we're checking access of a scoped non-static member inside a
4525 class template.
4526
7d187e4f
GA
45272021-01-07 Jakub Jelinek <jakub@redhat.com>
4528
4529 PR c++/98329
4530 * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
4531 cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
4532 its location.
4533 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
4534
45352021-01-07 Marek Polacek <polacek@redhat.com>
4536
4537 PR c++/98441
4538 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
4539 !late_return_type block.
4540
45412021-01-07 Jason Merrill <jason@redhat.com>
4542
4543 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
4544 (cxx_eval_store_expression): Add comment.
4545
45462021-01-07 Jason Merrill <jason@redhat.com>
4547
4548 * call.c (has_next): Factor out from...
4549 (next_conversion): ...here.
4550 (strip_standard_conversion): And here.
4551 (is_subseq): And here.
4552 (build_conv): Check it.
4553 (standard_conversion): Don't call build_conv
4554 for ck_identity.
4555
942ae5be
GA
45562021-01-06 Martin Sebor <msebor@redhat.com>
4557
4558 PR c++/95768
4559 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
4560
651b8a50
GA
45612021-01-05 Patrick Palka <ppalka@redhat.com>
4562
4563 * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
4564 the type of the NTTP, substitute into the type again. If the
4565 type is still dependent, don't unify the NTTP.
4566
45672021-01-05 Jakub Jelinek <jakub@redhat.com>
4568
4569 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
4570 $(CODYLIB) after $(BACKEND).
4571
45722021-01-05 Jakub Jelinek <jakub@redhat.com>
4573
4574 PR c++/98469
4575 * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
4576 Punt if lval is true.
4577 * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
4578 the result if it has a class type.
4579
45802021-01-05 Marek Polacek <polacek@redhat.com>
4581
4582 PR c++/82099
4583 * pt.c (resolve_overloaded_unification): Call
4584 maybe_instantiate_noexcept after instantiating the function
4585 decl.
4586
45872021-01-05 Nathan Sidwell <nathan@acm.org>
4588
4589 * parser.c (cp_parser_module_declaration): Alter diagnostic
4590 text to say where is permissable.
4591
45922021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4593
4594 PR c++/98316
4595 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
4596
2eacfdbd
GA
45972021-01-02 Jan Hubicka <jh@suse.cz>
4598
4599 * cp-tree.h (cp_tree_c_finish_parsing): Declare.
4600 * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
4601 * tree.c (cp_tree_c_finish_parsing): New function.
4602
b6dd195a
GA
46032021-01-01 Jakub Jelinek <jakub@redhat.com>
4604
4605 * ChangeLog-2020: Rotate ChangeLog. New file.
4606
ad41bd84 4607\f
618e665a 4608Copyright (C) 2021 Free Software Foundation, Inc.
ad41bd84
JM
4609
4610Copying and distribution of this file, with or without modification,
4611are permitted in any medium without royalty provided the copyright
4612notice and this notice are preserved.
This page took 4.060156 seconds and 5 git commands to generate.