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