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