]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/ChangeLog
Daily bump.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
CommitLineData
4dabb037
GA
12020-11-17 Nathan Sidwell <nathan@acm.org>
2
3 PR c++/97877
4 * decl.c (duplicate_decls): Deal with duplicated DECL_LOCAL_DECL_P
5 decls. Extend decl_lang_specific checking assert.
6
72020-11-17 Nathan Sidwell <nathan@acm.org>
8
9 * cp-tree.h (enum cp_tree_index): Reorder to place lazy fields
10 after newly-added CPTI_MODULE_HWM.
11
122020-11-17 Iain Sandoe <iain@sandoe.co.uk>
13
14 PR c++/97871
15 * parser.c (cp_parser_declaration): Remove checking assert.
16
cba30651
GA
172020-11-15 Jason Merrill <jason@redhat.com>
18
19 * decl.c (cp_finish_decl): Only check abstractness on definition.
20 (require_complete_types_for_parms): Check abstractness here.
21 (create_array_type_for_decl): Not here.
22 (grokdeclarator, grokparms, complete_vars): Not here.
23 * pt.c (tsubst, tsubst_arg_types, tsubst_function_type): Not here.
24 * typeck2.c (struct pending_abstract_type): Remove.
25 (struct abstract_type_hasher): Remove.
26 (abstract_pending_vars, complete_type_check_abstract): Remove.
27 (abstract_virtuals_error_sfinae): Handle arrays.
28 * call.c (conv_is_prvalue): Split out from...
29 (conv_binds_ref_to_prvalue): ...here.
30 (implicit_conversion_1): Rename from implicit_conversion.
31 (implicit_conversion): An abstract prvalue is bad.
32 (convert_like_internal): Don't complain if expr is already
33 error_mark_node.
34
77f67db2
GA
352020-11-13 Jason Merrill <jason@redhat.com>
36
37 * cp-tree.h (USING_DECL_UNRELATED_P): New.
38 (CONST_DECL_USING_P): New.
39 * class.c (handle_using_decl): If USING_DECL_UNRELATED_P,
40 clone the CONST_DECL.
41 * name-lookup.c (supplement_binding_1): A clone hides its
42 using-declaration.
43 (lookup_using_decl): Rewrite to separate lookup and validation.
44 (do_class_using_decl): Adjust.
45 (finish_nonmember_using_decl): Adjust.
46 * parser.c (make_location): Add cp_token overload.
47 (finish_using_decl): Split out from...
48 (cp_parser_using_declaration): ...here. Don't look through enums.
49 (cp_parser_using_enum): New.
50 (cp_parser_block_declaration): Call it.
51 (cp_parser_member_declaration): Call it.
52 * semantics.c (finish_id_expression_1): Handle enumerator
53 used from class scope.
54
552020-11-13 Vladimir N. Makarov <vmakarov@redhat.com>
56
57 * parser.c (cp_parser_asm_definition): Parse outputs for asm
58 goto too.
59
602020-11-13 Iain Sandoe <iain@sandoe.co.uk>
61
62 PR objc/77404
63 * parser.c (cp_parser_objc_class_interface): Pass the
64 location of the class name to the interface declaration.
65
a5a11525
GA
662020-11-13 Patrick Palka <ppalka@redhat.com>
67
68 * semantics.c (finish_compound_literal): Don't wrap the original
69 compound literal in a TARGET_EXPR when inside a template.
70
712020-11-12 Jakub Jelinek <jakub@redhat.com>
72
73 PR c++/97790
74 * constexpr.c (cxx_eval_constant_expression) <case CLEANUP_POINT_EXPR,
75 case TRY_FINALLY_EXPR, case CLEANUP_STMT>: Don't pass jump_target to
76 cxx_eval_constant_expression when evaluating the cleanups.
77
0f5f9ed5
GA
782020-11-11 Iain Sandoe <iain@sandoe.co.uk>
79
80 * parser.c (cp_parser_declaration): Unless we are compiling for
81 Ojective-C++, warn about and discard any attributes that prefix
82 a linkage specification.
83
842020-11-11 Patrick Palka <ppalka@redhat.com>
85
86 PR c++/88115
87 * mangle.c (write_expression): Mangle __alignof_ differently
88 from alignof when the ABI version is at least 15.
89
902020-11-11 Patrick Palka <ppalka@redhat.com>
91
92 PR c++/88115
93 * cp-tree.h (cxx_sizeof_or_alignof_expr): Add bool parameter.
94 * decl.c (fold_sizeof_expr): Pass false to
95 cxx_sizeof_or_alignof_expr.
96 * parser.c (cp_parser_unary_expression): Pass std_alignof to
97 cxx_sizeof_or_alignof_expr.
98 * pt.c (tsubst_copy): Pass false to cxx_sizeof_or_alignof_expr.
99 (tsubst_copy_and_build): Pass std_alignof to
100 cxx_sizeof_or_alignof_expr.
101 * typeck.c (cxx_alignof_expr): Add std_alignof bool parameter
102 and pass it to cxx_sizeof_or_alignof_type. Set ALIGNOF_EXPR_STD_P
103 appropriately.
104 (cxx_sizeof_or_alignof_expr): Add std_alignof bool parameter
105 and pass it to cxx_alignof_expr. Assert op is either
106 SIZEOF_EXPR or ALIGNOF_EXPR.
107
1082020-11-11 Marek Polacek <polacek@redhat.com>
109
110 PR c++/97518
111 * pt.c (tsubst_qualified_id): Use EXPR_LOCATION of the qualified-id.
112 Use it to maybe_wrap_with_location the final expression.
113
bb622641
GA
1142020-11-10 Marek Polacek <polacek@redhat.com>
115
116 PR c++/97518
117 * cp-tree.h (finish_static_assert): Adjust declaration.
118 * parser.c (cp_parser_static_assert): Pass false to
119 finish_static_assert.
120 * pt.c (tsubst_expr): Pass true to finish_static_assert.
121 * semantics.c (find_failing_clause_r): New function.
122 (find_failing_clause): New function.
123 (finish_static_assert): Add a bool parameter. Use
124 iloc_sentinel. Call contextual_conv_bool instead of
125 perform_implicit_conversion_flags. Don't check for INTEGER_CST before
126 calling integer_zerop. Call find_failing_clause and maybe use its
127 location. Print the original condition or the failing clause if
128 SHOW_EXPR_P.
129
1302020-11-10 Strager Neds <strager.nds@gmail.com>
131
132 * decl.c (duplicate_decls): Use new overload of
133 set_decl_section_name.
134 * method.c (use_thunk): Same.
135 * optimize.c (maybe_clone_body): Same.
136 * coroutines.cc (act_des_fn): Same.
137
1382020-11-10 Jakub Jelinek <jakub@redhat.com>
139
140 PR c/97748
141 * cvt.c (convert_to_void): Check (complain & tf_warning) in the outer
142 if rather than twice times in the inner one. Use warn_if_unused_value.
143 Formatting fix.
144
1452020-11-10 Chung-Lin Tang <cltang@codesourcery.com>
146
147 * parser.c (cp_parser_omp_target_data): Add use of
148 new c_omp_adjust_map_clauses function. Add GOMP_MAP_ATTACH_DETACH as
149 handled map clause kind.
150 (cp_parser_omp_target_enter_data): Likewise.
151 (cp_parser_omp_target_exit_data): Likewise.
152 (cp_parser_omp_target): Likewise.
153 * semantics.c (handle_omp_array_sections): Adjust COMPONENT_REF case to
154 use GOMP_MAP_ATTACH_DETACH map kind for C_ORT_OMP region type. Fix
155 interaction between reference case and attach/detach.
156 (finish_omp_clauses): Adjust bitmap checks to allow struct decl and
157 same struct field access to co-exist on OpenMP construct.
158
2bee28dd
GA
1592020-11-09 Marek Polacek <polacek@redhat.com>
160
161 DR 1914
162 * parser.c (cp_parser_check_std_attribute): Return bool. Add a
163 location_t parameter. Return true if the attribute wasn't duplicated.
164 Give a warning instead of an error. Check more attributes.
165 (cp_parser_std_attribute_list): Don't add duplicated attributes to
166 the list. Pass location to cp_parser_check_std_attribute.
167
1682020-11-09 Patrick Palka <ppalka@redhat.com>
169
170 * constraint.cc (norm_info::norm_info): Initialize orig_decl.
171 (norm_info::orig_decl): New data member.
172 (normalize_atom): When caching an atom for the first time,
173 compute a list of template parameters used in the targets of the
174 parameter mapping and store it in the TREE_TYPE of the mapping.
175 (get_normalized_constraints_from_decl): Set current_function_decl
176 appropriately when normalizing. As an optimization, don't
177 set up a push_nested_class_guard when decl has no constraints.
178 (sat_hasher::hash): Use this list to hash only the template
179 arguments that are relevant to the atom.
180 (satisfy_atom): Use this list to compare only the template
181 arguments that are relevant to the atom.
182 * pt.c (keep_template_parm): Do a sanity check on the parameter's
183 index when flag_checking.
184
1852020-11-09 Patrick Palka <ppalka@redhat.com>
186
187 * cp-tree.h (ATOMIC_CONSTR_MAP_INSTANTIATED_P): Define this flag
188 for ATOMIC_CONSTRs.
189 * constraint.cc (sat_hasher::hash): Use hash_atomic_constraint
190 if the flag is set, otherwise keep using a pointer hash.
191 (sat_hasher::equal): Return false if the flag's setting differs
192 on two atoms. Call atomic_constraints_identical_p if the flag
193 is set, otherwise keep using a pointer equality test.
194 (satisfy_atom): After instantiating the parameter mapping, form
195 another ATOMIC_CONSTR using the instantiated mapping and query
196 the cache again. Cache the satisfaction value of both atoms.
197 (diagnose_atomic_constraint): Simplify now that the supplied
198 atom has an instantiated mapping.
199
2002020-11-09 Patrick Palka <ppalka@redhat.com>
201
202 * constraint.cc (atom_cache): Define this deletable hash_table.
203 (normalize_atom): Use it to cache ATOMIC_CONSTRs when not
204 generating diagnostics.
205 (sat_hasher::hash): Use htab_hash_pointer instead of
206 hash_atomic_constraint.
207 (sat_hasher::equal): Test for pointer equality instead of
208 atomic_constraints_identical_p.
209 * cp-tree.h (struct atom_hasher): Moved and renamed from ...
210 * logic.cc (struct constraint_hash): ... here.
211 (clause::m_set): Adjust accordingly.
212
2132020-11-09 Patrick Palka <ppalka@redhat.com>
214
215 PR c++/93907
216 * constraint.cc (tsubst_parameter_mapping): Also canonicalize
217 the type arguments of a TYPE_ARGUMENT_PACk.
218
2192020-11-09 Jason Merrill <jason@redhat.com>
220
221 * pt.c (tsubst): Replace *_ARGUMENT_PACK code with
222 a call to tsubst_argument_pack.
223
2242020-11-09 Jason Merrill <jason@redhat.com>
225
226 * class.c (handle_using_decl): Add an iloc_sentinel.
227
2282020-11-09 Marek Polacek <polacek@redhat.com>
229
230 PR c++/97762
231 * parser.c (warn_about_ambiguous_parse): Handle the case when
232 there is no type in the decl-specifiers.
233
2342020-11-09 Nathan Sidwell <nathan@acm.org>
235
236 * cp-tree.h (LOOKUP_FOUND_P): Add ENUMERAL_TYPE.
237 * name-lookup.c (class name_lookup): Add comments.
238 (name_lookup::adl_namespace_only): Replace with ...
239 (name_lookup::adl_class_fns): ... this and ...
240 (name_lookup::adl_namespace_fns): ... this.
241 (name_lookup::adl_namespace): Deal with inline nests here.
242 (name_lookup::adl_class): Complete the type here.
243 (name_lookup::adl_type): Call broken-out enum ..
244 (name_lookup::adl_enum): New. No need to call the namespace adl
245 if it is class-scope.
246 (name_lookup::search_adl): Iterate over collected scopes here.
247
2482020-11-09 Nathan Sidwell <nathan@acm.org>
249
250 * name-lookup.c (lookup_qualified_name): Expose an overload of a
251 singleton with known type.
252 (lookup_name_1): Just check the overload's type to expose it.
253 * parser.c (cp_parser_lookup_name): Do not do that check here.
254
fb95de7a
GA
2552020-11-08 Iain Sandoe <iain@sandoe.co.uk>
256
257 * parser.c (cp_parser_objc_at_property_declaration): Handle
258 class keywords in @property attribute context.
259
44cab2d8
GA
2602020-11-06 Marek Polacek <polacek@redhat.com>
261
262 PR c++/81660
263 * except.c (can_convert_eh): Change the return type to bool. If
264 the type TO and FROM are the same, return true.
265
2662020-11-06 Iain Sandoe <iain@sandoe.co.uk>
267
268 * parser.c (cp_parser_objc_at_property_declaration):
269 Improve parsing fidelity. Associate better location info
270 with @property attributes. Clean up the interface to
271 objc_add_property_declaration ().
272
2732020-11-06 Jakub Jelinek <jakub@redhat.com>
274
275 PR c++/67453
276 * decl.c (duplicate_decls): Propagate DECL_ATTRIBUTES and
277 DECL_PRESERVE_P from olddecl to its clones if any.
278
2792020-11-06 Nathan Sidwell <nathan@acm.org>
280
281 * cp-tree.h (DECL_UNDECLARED_BUILTIN_P): Delete.
282 * cp-objcp-common.c (names_bultin_p): Rename
283 DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
284 * decl.c (decls_match): Likewise. Replace
285 DECL_UNDECLARED_BUILTIN_P with DECL_IS_UNDECLARED_BUILTIN.
286 (duplicate_decls): Likewise.
287 * decl2.c (collect_source_refs): Likewise.
288 * name-lookup.c (anticipated_builtin_p, print_binding_level)
289 (do_nonmember_using_decl): Likewise.
290 * pt.c (builtin_pack_fn_p): Likewise.
291 * typeck.c (error_args_num): Likewise.
292
2932020-11-06 Nathan Sidwell <nathan@acm.org>
294
295 * parser.c (cp_parser_template_declaration): Adjust 'export' warning.
296 (cp_parser_explicit_specialization): Remove unneeded bool setting.
297
2982020-11-06 Jan Hubicka <jh@suse.cz>
299
300 * tree.c (cp_fix_function_decl_p): Do not access ipa_ref_list dirrectly.
301
3022020-11-06 Tobias Burnus <tobias@codesourcery.com>
303
304 * parser.c (cp_parser_omp_atomic): Add openacc parameter and update
305 OpenACC matching.
306 (cp_parser_omp_construct): Update call.
307
0cfd9109
GA
3082020-11-05 Marek Polacek <polacek@redhat.com>
309
310 * except.c (check_handlers_1): Add auto_diagnostic_group.
311
3122020-11-05 Marek Polacek <polacek@redhat.com>
313
314 PR c++/78209
315 * pt.c (do_auto_deduction): If init is REFERENCE_REF_P, use its
316 first operand.
317
3182020-11-05 Marek Polacek <polacek@redhat.com>
319
320 PR c++/97675
321 * except.c (check_handlers_1): Use OPT_Wexceptions for the
322 warning. Use inform for the second part of the warning.
323
3242020-11-05 Marek Polacek <polacek@redhat.com>
325
326 PR c++/25814
327 * cp-tree.h (enum cp_tree_index): Add CPTI_EXPLICIT_VOID_LIST.
328 (explicit_void_list_node): Define.
329 (PARENTHESIZED_LIST_P): New macro.
330 (struct cp_declarator): Add function::parens_loc.
331 * decl.c (cxx_init_decl_processing): Initialize explicit_void_list_node.
332 (grokparms): Also break when explicit_void_list_node.
333 * parser.c (make_call_declarator): New location_t parameter. Use it
334 to set declarator->u.function.parens_loc.
335 (cp_parser_lambda_declarator_opt): Pass UNKNOWN_LOCATION to
336 make_call_declarator.
337 (warn_about_ambiguous_parse): New function.
338 (cp_parser_init_declarator): Call warn_about_ambiguous_parse.
339 (cp_parser_declarator): Set *parenthesized_p to false rather than to
340 true.
341 (cp_parser_direct_declarator): Create a location for the function's
342 parentheses and pass it to make_call_declarator.
343 (cp_parser_parameter_declaration_clause): Return explicit_void_list_node
344 for (void).
345 (cp_parser_parameter_declaration_list): Set PARENTHESIZED_LIST_P
346 in the parameters tree.
347
35c125cb
GA
3482020-11-04 Jakub Jelinek <jakub@redhat.com>
349
350 PR c++/97670
351 * semantics.c (finish_omp_clauses): Look through array reductions to
352 find underlying decl to clear in the aligned_head bitmap. Use
353 DECL_UID (t) instead of DECL_UID (OMP_CLAUSE_DECL (c)) when clearing
354 in the bitmap. Only diagnose errors about allocate vars not being
355 privatized on the same construct on allocate clause if it has
356 a DECL_P OMP_CLAUSE_DECL.
357
3582020-11-04 Iain Sandoe <iain@sandoe.co.uk>
359
360 * constexpr.c (potential_constant_expression_1): Handle
361 expressions known to be non-constant for Objective-C.
362
fd2325ea
GA
3632020-11-03 Jason Merrill <jason@redhat.com>
364
365 * tree.c (is_byte_access_type): Don't use char_type_p.
366
3672020-11-03 Jakub Jelinek <jakub@redhat.com>
368
369 PR c++/97663
370 * parser.c (cp_parser_init_declarator): Don't try to parse
371 C++17 deduction guides if there are any type specifiers even when
372 type is NULL.
373
3742020-11-03 Kamlesh Kumar <kamleshbhalui@gmail.com>
375 Jason Merrill <jason@redhat.com>
376
377 PR c++/97453
378 DR2303
379 * pt.c (get_template_base): Consider closest base in template
380 deduction when base of base also matches.
381
3822020-11-03 Nathan Sidwell <nathan@acm.org>
383
384 * pt.c (tsubst_expr): Simplify using decl instantiation, add
385 asserts.
386
3872020-11-03 Nathan Sidwell <nathan@acm.org>
388
389 * class.c (copy_fndecl_with_name): Always not top level.
390 (build_cdtor_clones): Add update_methods parm, use it to
391 conditionally update the method vec. Return void
392 (clone_cdtor): Adjust.
393 (clone_constructors_and_destructors): Adjust comment.
394
3952020-11-03 Nathan Sidwell <nathan@acm.org>
396
397 * pt.c (primary_template_specialization_p): Use
398 VAR_OR_FUNCTION_DECL_P.
399 (tsubst_template_decl): Check for FUNCTION_DECL, not !TYPE && !VAR
400 for registering a specialization.
401
4022020-11-03 Nathan Sidwell <nathan@acm.org>
403
404 * cp-tree.h (fixup_deferred_exception_variants): Declare.
405 * parser.c (cp_parser_class_specifier_1): Call it when
406 completing deferred parses rather than creating a variant.
407 (cp_parser_member_declaration): Move comment from ...
408 (cp_parser_noexcept_specification_opt): ... here. Refactor the
409 deferred parse.
410 * tree.c (fixup_deferred_exception_variants): New.
411
4122020-11-03 Nathan Sidwell <nathan@acm.org>
413
414 * pt.c (tsubst_lambda_expr): Reorder extra-scope handling to match
415 the non-template case.
416 (instantiate_body): Move a couple of declarations to their
417 initializers.
418
4192020-11-03 Nathan Sidwell <nathan@acm.org>
420
421 * decl.c (duplicate_decls): Return error_mark_node fo extern-c
422 mismatch.
423
4242020-11-03 Marek Polacek <polacek@redhat.com>
425
426 * constexpr.c (potential_constant_expression_1): Treat
427 __PRETTY_FUNCTION__ inside a template function as
428 potentially-constant.
429 * pt.c (uses_template_parms): Call
430 instantiation_dependent_expression_p instead of
431 value_dependent_expression_p.
432 (instantiation_dependent_expression_p): Check
433 potential_constant_expression before calling
434 value_dependent_expression_p.
435
4362020-11-03 Marek Polacek <polacek@redhat.com>
437
438 PR c++/97632
439 * init.c (build_new_1): Disable -Winit-list-lifetime for an unevaluated
440 operand.
441
4422020-11-03 Nathan Sidwell <nathan@acm.org>
443
444 * tree.c (bind_template_template_parm): Mark the parm as a
445 template parm.
446 (cp_tree_equal): Refactor CALL_EXPR. Use comp_template_args for
447 TREE_VECs.
448
4492020-11-03 Nathan Sidwell <nathan@acm.org>
450
451 * rtti.c (init_rtti_processing): Move var decl to its init.
452 (get_tinfo_decl): Likewise. Break out creation to called helper
453 ...
454 (get_tinfo_decl_direct): ... here.
455 (build_dynamic_cast_1): Move var decls to their initializers.
456 (tinfo_base_init): Set decl's location to BUILTINS_LOCATION.
457 (get_tinfo_desc): Only push ABI namespace when needed. Set type's
458 context.
459
88ce3d5f
GA
4602020-11-02 Nathan Sidwell <nathan@acm.org>
461
462 * decl.c (start_decl_1): Refactor declarations. Fixup some
463 whitespace.
464 (lookup_and_check_tag): Fixup some whitespace.
465
4662020-11-02 Nathan Sidwell <nathan@acm.org>
467
468 * decl.c (duplicate_decls): Refactor some template & builtin
469 handling.
470
4712020-11-02 Nathan Sidwell <nathan@acm.org>
472
473 * cp-tree.h (struct cxx_int_tree_map): Delete.
474 (struct cxx_int_tree_map_hasher): Delete.
475 * cp-gimplify.c (cxx_int_tree_map_hasher::equal): Delete.
476 (cxx_int_tree_map_hasher::hash): Delete.
477
4782020-11-02 Patrick Palka <ppalka@redhat.com>
479
480 * class.c (finish_struct_1): Don't call clear_satisfaction_cache.
481 * constexpr.c (clear_cv_and_fold_caches): Likewise. Remove bool
482 parameter.
483 * constraint.cc (clear_satisfaction_cache): Remove definition.
484 * cp-tree.h (clear_satisfaction_cache): Remove declaration.
485 (clear_cv_and_fold_caches): Remove bool parameter.
486 * typeck2.c (store_init_value): Remove argument to
487 clear_cv_and_fold_caches.
488
4892020-11-01 Iain Sandoe <iain@sandoe.co.uk>
490
491 * parser.c (cp_parser_objc_at_property_declaration): Use any
492 exisiting syntax error to suppress complaints about a missing
493 closing parenthesis in parsing property attributes.
494
4952020-10-30 Jakub Jelinek <jakub@redhat.com>
496
497 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
498 non-static members in methods.
499 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_ALLOCATE.
500
4f0606fe
GA
5012020-10-29 Marek Polacek <polacek@redhat.com>
502
503 DR 625
504 PR c++/97479
505 * parser.c (cp_parser_type_id_1): Reject using auto as
506 a template-argument in C++20.
507
5082020-10-29 Marek Polacek <polacek@redhat.com>
509
510 PR c++/93107
511 * pt.c (do_auto_deduction): Call resolve_nondeduced_context for
512 the elements of a { } list.
513
5142020-10-29 Marek Polacek <polacek@redhat.com>
515
516 * typeck.c (do_warn_enum_conversions): Don't warn for SPACESHIP_EXPR.
517 (cp_build_binary_op): Reject float <=> enum or enum <=> float. Use
518 CP_INTEGRAL_TYPE_P instead of INTEGRAL_OR_ENUMERATION_TYPE_P.
519
5202020-10-29 Patrick Palka <ppalka@redhat.com>
521
522 * constraint.cc (get_normalized_constraints): Remove 'args'
523 parameter. Pass NULL_TREE as the initial template arguments to
524 normalize_expression.
525 (get_normalized_constraints_from_info): Remove 'args' parameter
526 and adjust the call to get_normalized_constraints.
527 (get_normalized_constraints_from_decl): Remove 'args' local
528 variable and adjust call to get_normalized_constraints_from_info.
529 (normalize_concept_definition): Remove 'args' local variable
530 and adjust call to get_normalized_constraints.
531 (normalize_constraint_expression): Remove the two-parameter
532 overload. Remove 'args' parameter from the three-parameter
533 overload and update function comment accordingly. Remove
534 default argument from 'diag' parameter. Adjust call to
535 get_normalized_constraints.
536 (finish_nested_requirement): Adjust call to
537 normalize_constraint_expression.
538 (strictly_subsumes): Remove 'args' parameter. Adjust call to
539 get_normalized_constraints_from_info.
540 (weakly_subsumes): Likewise.
541 * cp-tree.h (strictly_subsumes): Remove 'args' parameter.
542 (weakly_subsumes): Likewise.
543 * pt.c (process_partial_specialization): Adjust call to
544 strictly_subsumes.
545 (is_compatible_template_arg): Adjust call to weakly_subsumes.
546
5472020-10-29 Patrick Palka <ppalka@redhat.com>
548
549 PR c++/97412
550 * constraint.cc (normalize_concept_check): Don't call
551 tsubst_template_args when 'args' is NULL.
552
5532020-10-29 Jason Merrill <jason@redhat.com>
554
555 PR c++/97388
556 * constexpr.c (cxx_eval_outermost_constant_expr): Revert to
557 original expression if evaluation sets non_constant_p.
558
5592020-10-29 Jakub Jelinek <jakub@redhat.com>
560 Jason Merrill <jason@redhat.com>
561
562 PR c++/97388
563 * constexpr.c (cxx_bind_parameters_in_call): Set non_constant_args
564 if the parameter type has a non-trivial destructor.
565 (cxx_eval_call_expression): Only unshare arguments if we're
566 memoizing this evaluation.
567
5682020-10-29 Jakub Jelinek <jakub@redhat.com>
569
570 PR c++/95808
571 * cp-tree.h (enum cp_tree_index): Add CPTI_HEAP_VEC_UNINIT_IDENTIFIER
572 and CPTI_HEAP_VEC_IDENTIFIER.
573 (heap_vec_uninit_identifier, heap_vec_identifier): Define.
574 * decl.c (initialize_predefined_identifiers): Initialize those
575 identifiers.
576 * constexpr.c (cxx_eval_call_expression): Reject array allocations
577 deallocated with non-array deallocation or non-array allocations
578 deallocated with array deallocation.
579 (non_const_var_error): Handle heap_vec_uninit_identifier and
580 heap_vec_identifier too.
581 (cxx_eval_constant_expression): Handle also heap_vec_uninit_identifier
582 and in that case during initialization replace it with
583 heap_vec_identifier.
584 (find_heap_var_refs): Handle heap_vec_uninit_identifier and
585 heap_vec_identifier too.
586
5872020-10-29 Nathan Sidwell <nathan@acm.org>
588
589 * pt.c (push_template_decl): Do not give function-scope entities
590 other than implicit typedefs a template header. Do not readd
591 template info to a redeclared template.
592
e93aae4a
GA
5932020-10-28 Marek Polacek <polacek@redhat.com>
594
595 * decl.c (grokdeclarator): Offer a fix-it hint for the "unnecessary
596 parentheses in declaration" warning.
597 * parser.c (cp_parser_direct_declarator): When setting
598 declarator->parenthesized, use a location range.
599
6002020-10-28 Marek Polacek <polacek@redhat.com>
601
602 PR c++/97573
603 * call.c (build_conditional_expr_1): Warn about the deprecated
604 enum/real type conversion in C++20. Also warn about a non-enumerated
605 and enumerated type in ?: when -Wenum-conversion is on.
606 * typeck.c (do_warn_enum_conversions): New function.
607 (cp_build_binary_op): Call it.
608
6092020-10-28 Marek Polacek <polacek@redhat.com>
610
611 PR c++/96675
612 PR c++/96742
613 * pt.c (tsubst_copy_and_build): Call value_dependent_expression_p or
614 type_dependent_expression_p instead of type_dependent_expression_p_push.
615 But only call value_dependent_expression_p for expressions that are
616 potential_constant_expression.
617
6182020-10-28 Marek Polacek <polacek@redhat.com>
619
620 PR c++/94799
621 * parser.c (cp_parser_class_name): Use parser->scope when
622 setting typename_p.
623
6242020-10-28 Marek Polacek <polacek@redhat.com>
625
626 PR c++/86773
627 * parser.c (cp_parser_fold_expression): Return error_mark_node
628 if a left fold is preceded by an expression.
629
6302020-10-28 Nathan Sidwell <nathan@acm.org>
631
632 * parser.c (cp_parser_omp_declare_reduction): Set
633 DECL_LOCAL_DECL_P before push_template_decl.
634 * pt.c (instantiate_body): Nested fns do not have template_info.
635
6362020-10-28 Patrick Palka <ppalka@redhat.com>
637
638 PR c++/95132
639 * decl2.c (mark_used): Move up the constraints_satisfied_p check
640 so that we check constraints before calling maybe_instantiate_decl.
641
6422020-10-28 Nathan Sidwell <nathan@acm.org>
643
644 * pt.c (push_template_decl): Refactor for some RAII.
645
6462020-10-28 Jakub Jelinek <jakub@redhat.com>
647
648 * parser.c (cp_parser_omp_clause_name): Handle allocate.
649 (cp_parser_omp_clause_allocate): New function.
650 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ALLOCATE.
651 (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
652 OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK,
653 OMP_TASK_CLAUSE_MASK, OMP_TASKGROUP_CLAUSE_MASK,
654 OMP_DISTRIBUTE_CLAUSE_MASK, OMP_TEAMS_CLAUSE_MASK,
655 OMP_TARGET_CLAUSE_MASK, OMP_TASKLOOP_CLAUSE_MASK): Add
656 PRAGMA_OMP_CLAUSE_ALLOCATE.
657 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_ALLOCATE.
658 * pt.c (tsubst_omp_clauses): Likewise.
659
89bb01e7
GA
6602020-10-27 Nathan Sidwell <nathan@acm.org>
661
662 * cp-tree.h (struct lang_type): Delete nested_udts field.
663 (CLASSTYPE_NESTED_UTDS): Delete.
664 * name-lookup.h (binding_table, binding_entry): Delete typedefs.
665 (bt_foreach_proc): Likewise.
666 (struct binding_entry_s): Delete.
667 (SCOPE_DEFAULT_HT_SIZE, CLASS_SCOPE_HT_SIZE)
668 (NAMESPACE_ORDINARY_HT_SIZE, NAMESPACE_STD_HT_SIZE)
669 (GLOBAL_SCOPE_HT_SIZE): Delete.
670 (binding_table_foreach, binding_table_find): Delete declarations.
671 * name-lookup.c (ENTRY_INDEX): Delete.
672 (free_binding_entry): Delete.
673 (binding_entry_make, binding_entry_free): Delete.
674 (struct binding_table_s): Delete.
675 (binding_table_construct, binding_table_free): Delete.
676 (binding_table_new, binding_table_expand): Delete.
677 (binding_table_insert, binding_table_find): Delete.
678 (binding_table_foreach): Delete.
679 (maybe_process_template_type_declaration): Delete
680 CLASSTYPE_NESTED_UTDS insertion.
681 (do_pushtag): Likewise.
682 * decl2.c (bt_reset_linkage_1): Fold into reset_type_linkage_1.
683 (reset_type_linkage_2, bt_reset_linkage_2): Fold into
684 reset_type_linkage.
685 * pt.c (instantiate_class_template_1): Delete NESTED_UTDs comment.
686 (bt_instantiate_type_proc): Delete.
687 (do_type_instantiation): Instantiate implicit typedef fields.
688 Delete NESTED_UTD walk.
689 * search.c (lookup_field_r): Delete unreachable NESTED_UTD
690 search.
691
6922020-10-27 Nathan Sidwell <nathan@acm.org>
693
694 * parser.c (cp_parser_explicit_instantiation): Refactor some RAII.
695 * pt.c (bt_instantiate_type_proc): DATA is the tree, pass type to
696 do_type_instantiation.
697 (do_type_instantiation): Require T to be a type. Refactor for
698 some RAII.
699
f19e7c8d
GA
7002020-10-26 Ville Voutilainen <ville.voutilainen@gmail.com>
701
702 * cp-tree.h (CPTK_IS_NOTHROW_ASSIGNABLE): New.
703 (CPTK_IS_NOTHROW_CONSTRUCTIBLE): Likewise.
704 (is_nothrow_xible): Likewise.
705 * method.c (is_nothrow_xible): New.
706 (is_trivially_xible): Tweak.
707 * parser.c (cp_parser_primary_expression): Handle the new RID_*.
708 (cp_parser_trait_expr): Likewise.
709 * semantics.c (trait_expr_value): Handle the new RID_*.
710 (finish_trait_expr): Likewise.
711
d7ddd287
GA
7122020-10-24 Marek Polacek <polacek@redhat.com>
713
714 PR c++/96241
715 * constexpr.c (cxx_eval_array_reference): Set up ctx->ctor if we
716 are initializing an aggregate. Call free_constructor on the new
717 CONSTRUCTOR if it isn't returned from cxx_eval_constant_expression.
718
efe71fcc
GA
7192020-10-23 Marek Polacek <polacek@redhat.com>
720
721 PR c++/91741
722 * typeck.c (cp_build_binary_op): Implement -Wsizeof-array-div.
723
43868df3
GA
7242020-10-22 Patrick Palka <ppalka@redhat.com>
725
726 PR c++/97328
727 * constexpr.c (init_subob_ctx): Don't punt on RANGE_EXPR
728 indexes, instead build a sub-aggregate initialization context
729 with no subobject.
730
7312020-10-22 Patrick Palka <ppalka@redhat.com>
732
733 PR c++/96575
734 * constexpr.c (cxx_eval_constant_expression)
735 <case EMPTY_CLASS_EXPR>: Lower it to a CONSTRUCTOR.
736 (potential_constant_expression_1) <case COMPOUND_EXPR>: Remove
737 now-redundant handling of COMPOUND_EXPR with EMPTY_CLASS_EXPR
738 second operand.
739 <case EMPTY_CLASS_EXPR>: Return true instead of false.
740
7412020-10-22 Patrick Palka <ppalka@redhat.com>
742
743 PR c++/97511
744 * decl.c (duplicate_decls): Return NULL_TREE if
745 DECL_TEMPLATE_PARM_P differ.
746
e2e04288
GA
7472020-10-20 Nathan Sidwell <nathan@acm.org>
748
749 * name-lookup.c (push_local_extern_decl_alias): Reconstextualize
750 alias' parm decls. Drop any default args.
751
970d683f
GA
7522020-10-19 Iain Sandoe <iain@sandoe.co.uk>
753
754 PR c++/97438
755 * coroutines.cc (struct coroutine_info): Add a field to
756 record that we emitted a promise type error.
757 (coro_promise_type_found_p): Check for the case that the
758 promise type contains both return_void and return_value.
759 Emit an error if so, with information about the wrong
760 type methods.
761
56e4eee9
GA
7622020-10-16 Nathan Sidwell <nathan@acm.org>
763
764 PR c++/97460
765 * pt.c (push_template_decl): Check DECL_LANG_SPECIFIC in friend
766 case.
767
7682020-10-16 Nathan Sidwell <nathan@acm.org>
769
770 PR c++/96258
771 * parser.c (cp_parser_declaration): Make token2 point to EOF if
772 token1 was EOF.
773
b85d5dc5
GA
7742020-10-15 Jason Merrill <jason@redhat.com>
775
776 PR c++/95844
777 * decl.c (copy_fn_p): Return false for a function that is neither a
778 constructor nor an assignment operator.
779 (move_signature_fn_p): Likewise.
780
7812020-10-15 Marek Polacek <polacek@redhat.com>
782
783 PR c++/97406
784 PR c++/85901
785 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Handle OFFSET_TYPE.
786 (cxx_pretty_printer::abstract_declarator): Fix the printing of ')'.
787 (cxx_pretty_printer::direct_abstract_declarator): Handle OFFSET_TYPE.
788 (cxx_pretty_printer::type_id): Likewise. Print the abstract declarator
789 for pointers-to-members.
790
b2698c21
GA
7912020-10-14 Jason Merrill <jason@redhat.com>
792
793 PR c++/97358
794 * pt.c (check_for_bare_parameter_packs): Diagnose use of
795 capture pack.
796
7972020-10-14 Nathan Sidwell <nathan@acm.org>
798
799 * cp-tree.h (struct lang_decl_fn): Adjust context comment.
800 (DECL_FRIEND_P): Replace with ...
801 (DECL_UNIQUE_FRIEND_P): ... this. Only for FUNCTION_DECLs.
802 (DECL_FRIEND_CONTEXT): Adjust.
803 * class.c (add_implicitly_declared_members): Detect friendly
804 spaceship from context.
805 * constraint.cc (remove_constraints): Use a checking assert.
806 (maybe_substitute_reqs_for): Use DECL_UNIQUE_FRIEND_P.
807 * decl.c (check_no_redeclaration_friend_default_args):
808 DECL_UNIQUE_FRIEND_P is signficant, not hiddenness.
809 (duplicate_decls): Adjust DECL_UNIQUE_FRIEND_P clearing.
810 (redeclaration_error_message): Use DECL_UNIQUE_FRIEND_P.
811 (start_preparsed_function): Correct in-class friend processing.
812 Refactor some initializers.
813 (grokmethod): Directly check friend decl-spec.
814 * decl2.c (grokfield): Check DECL_UNIQUE_FRIEND_P.
815 * friend.c (do_friend): Set DECL_UNIQUE_FRIEND_P first, remove
816 extraneous conditions. Don't re set it afterwards.
817 * name-lookup.c (lookup_elaborated_type_1): Simplify revealing
818 code.
819 (do_pushtag): Likewise.
820 * pt.c (optimize_specialization_lookup_p): Check
821 DECL_UNIQUE_FRIEND_P.
822 (push_template_decl): Likewise. Drop unneeded friend setting.
823 (type_dependent_expression_p): Check DECL_UNIQUE_FRIEND_P.
824
8252020-10-14 Nathan Sidwell <nathan@acm.org>
826
827 * name-lookup.c (push_local_extern_decl_alias): Push into alias's
828 namespace and use pushdecl.
829 (do_pushdecl_with_scope): Clarify behaviour.
830
8be127ca
GA
8312020-10-12 Martin Sebor <msebor@redhat.com>
832
833 PR c++/97201
834 * error.c (dump_type_suffix): Handle both the C and C++ forms of
835 zero-length arrays.
836
8372020-10-12 Martin Sebor <msebor@redhat.com>
838
839 PR c++/96511
840 PR middle-end/96384
841 * init.c (warn_placement_new_too_small): Call builtin_objsize instead
842 of duplicating what it does.
843
da9df699
GA
8442020-10-08 Jason Merrill <jason@redhat.com>
845
846 PR c++/96805
847 PR c++/96199
848 * pt.c (tsubst_aggr_type): Don't build a TYPENAME_TYPE when
849 entering_scope.
850 (tsubst_template_decl): Use tsubst_aggr_type.
851
8522020-10-08 Patrick Palka <ppalka@redhat.com>
853
854 PR c++/97052
855 * constraint.cc (build_type_constraint): Temporarily increment
856 processing_template_decl before calling build_concept_check.
857 * pt.c (make_constrained_placeholder_type): Likewise.
858
8592020-10-08 Patrick Palka <ppalka@redhat.com>
860
861 PR c++/96229
862 * parser.c (cp_parser_class_specifier_1): Move call to
863 associate_classtype_constraints from here to ...
864 (cp_parser_class_head): ... here.
865 * pt.c (is_compatible_template_arg): Correct documentation to
866 say "argument is _no_ more constrained than the parameter".
867
6caec77e
GA
8682020-10-07 Marek Polacek <polacek@redhat.com>
869
870 PR c++/97010
871 * pt.c (tsubst_copy_and_build) <case TEMPLATE_ID_EXPR>: Call
872 tsubst_copy_and_build explicitly instead of using the RECUR macro.
873 Handle a TEMPLATE_ID_EXPR with an IDENTIFIER_NODE as its operand.
874 <case CALL_EXPR>: Perform ADL for a TEMPLATE_ID_EXPR with an
875 IDENTIFIER_NODE as its operand.
876
8772020-10-07 Patrick Palka <ppalka@redhat.com>
878
879 PR c++/88115
880 PR libstdc++/97273
881 * tree.c (cp_tree_equal) <case ALIGNOF_EXPR>: Return false if
882 ALIGNOF_EXPR_STD_P differ.
883
8842020-10-07 Nathan Sidwell <nathan@acm.org>
885
886 * cp-tree.h (struct language_function): Delete extern_decl_map.
887 (DECL_LOCAL_DECL_ALIAS): New.
888 * name-lookup.h (is_local_extern): Delete.
889 * name-lookup.c (set_local_extern_decl_linkage): Replace with ...
890 (push_local_extern_decl): ... this new function.
891 (do_pushdecl): Call new function after pushing new decl. Unhide
892 hidden non-functions.
893 (is_local_extern): Delete.
894 * decl.c (layout_var_decl): Do not allow VLA local externs.
895 * decl2.c (mark_used): Also mark DECL_LOCAL_DECL_ALIAS. Drop old
896 local-extern treatment.
897 * parser.c (cp_parser_oacc_declare): Deal with local extern aliases.
898 * pt.c (tsubst_expr): Adjust local extern instantiation.
899 * cp-gimplify.c (cp_genericize_r): Remap DECL_LOCAL_DECLs.
900
9012020-10-07 Nathan Sidwell <nathan@acm.org>
902
903 * cp-tree.h (DECL_BUILTIN_P): Rename to ...
904 (DECL_UNDECLARED_BUILTIN_P): ... here.
905 * decl.c (duplicate_decls): Adjust.
906 * name-lookup.c (anticipated_builtin_p): Adjust.
907 (do_nonmember_using_decl): Likewise.
908
9092020-10-07 Nathan Sidwell <nathan@acm.org>
910
911 * tree.c (build_cp_fntype_variant): Clear
912 TYPE_DEPENDENT_P_VALID if necessary.
913
8e97b905
GA
9142020-10-06 Marek Polacek <polacek@redhat.com>
915
916 PR c++/97297
917 * parser.c (cp_parser_direct_declarator): When checking if a
918 name is a function template declaration for the P0634R3 case,
919 look in uninstantiated templates too.
920
7e9282ae
GA
9212020-10-05 Marek Polacek <polacek@redhat.com>
922
923 * cp-tree.h (NON_UNION_CLASS_TYPE_P): Fix typo in a comment.
924
9252020-10-05 Richard Biener <rguenther@suse.de>
926 Jakub Jelinek <jakub@redhat.com>
927
928 PR c++/97197
929 * error.c (dump_expr): Handle TARGET_MEM_REF.
930
9312020-10-05 Nathan Sidwell <nathan@acm.org>
932
933 * name-lookup.c (maybe_add_fuzzy_decl): New.
934 (maybe_add_fuzzy_binding): New.
935 (consider_binding_level): Use intermediate sortable vector for
936 namespace bindings.
937
b0b9b8f0
GA
9382020-10-02 Marek Polacek <polacek@redhat.com>
939
940 PR c++/97014
941 * cxx-pretty-print.c (pp_cxx_template_argument_list): If the
942 argument is template_parm_object_p, print its DECL_INITIAL.
943
9442020-10-02 Nathan Sidwell <nathan@acm.org>
945
946 * cp-tree.h (lang_decl_base): anticipated_p is not used for
947 anticipatedness.
948 (DECL_ANTICIPATED): Delete.
949 * decl.c (duplicate_decls): Delete DECL_ANTICIPATED_management,
950 use was_hidden.
951 (cxx_builtin_function): Drop DECL_ANTICIPATED setting.
952 (xref_tag_1): Drop DECL_ANTICIPATED assert.
953 * name-lookup.c (name_lookup::adl_class_only): Drop
954 DECL_ANTICIPATED check.
955 (name_lookup::search_adl): Always dedup.
956 (anticipated_builtin_p): Reimplement.
957 (do_pushdecl): Drop DECL_ANTICIPATED asserts & update.
958 (lookup_elaborated_type_1): Drop DECL_ANTICIPATED update.
959 (do_pushtag): Drop DECL_ANTICIPATED setting.
960 * pt.c (push_template_decl): Likewise.
961 (tsubst_friend_class): Likewise.
962
9632020-10-02 Nathan Sidwell <nathan@acm.org>
964
965 * name-lookup.c (consider_decl): New, broken out of ...
966 (consider_binding_level): ... here. Iterate the hash table for
967 namespace bindings.
968
9692020-10-02 Nathan Sidwell <nathan@acm.org>
970
971 * cp-tree.h (base_ctor_omit_inherited_parms): Declare.
972 * class.c (add_method): Refactor main loop, only pass fns to
973 ctor_omit_inherited_parms.
974 (build_cdtor_clones): Rename bool parms.
975 (clone_cdtor): Call base_ctor_omit_inherited_parms.
976 * method.c (base_ctor_omit_inherited_parms): New, broken out of
977 ...
978 (ctor_omit_inherited_parms): ... here, call it with
979 DECL_CLONED_FUNCTION.
980
9812020-10-02 Nathan Sidwell <nathan@acm.org>
982
983 * cp-tree.h (cp_fname_init): Delete declaration.
984 * decl.c (cp_fname_init): Merge into only caller ...
985 (cp_make_fname): ... here & refactor.
986
9872020-10-02 Jason Merril <jason@redhat.com>
988
989 * call.c (build_operator_new_call): Set CALL_FROM_NEW_OR_DELETE_P.
990 (build_op_delete_call): Likewise.
991 * init.c (build_new_1, build_vec_delete_1, build_delete): Not here.
992 (build_delete):
993
9942020-10-02 Jason Merril <jason@redhat.com>
995
996 * lambda.c (call_from_lambda_thunk_p): New.
997 * cp-gimplify.c (cp_genericize_r): Use it.
998 * pt.c (tsubst_copy_and_build): Use it.
999 * typeck.c (check_return_expr): Use it.
1000 * cp-tree.h: Declare it.
1001 (CALL_FROM_NEW_OR_DELETE_P): Move to gcc/tree.h.
1002
6c2675fa
GA
10032020-10-01 Nathan Sidwell <nathan@acm.org>
1004
1005 * cp-tree.h (DECL_ANTICIPATED): Adjust comment.
1006 (DECL_HIDDEN_P, TYPE_HIDDEN_P): Delete.
1007 * tree.c (ovl_insert): Delete DECL_HIDDEN_P assert.
1008 (ovl_skip_hidden): Likewise.
1009
10102020-10-01 Nathan Sidwell <nathan@acm.org>
1011
1012 * name-lookup.c (pushdecl_top_level): Assert incoming context is
1013 null, add global_namespace context.
1014 (pushdecl_top_level_and_finish): Likewise.
1015 * pt.c (get_template_parm_object): Clear decl context before
1016 pushing.
1017 * semantics.c (finish_compound_literal): Likewise.
1018
10192020-10-01 Nathan Sidwell <nathan@acm.org>
1020
1021 * decl.c (lookup_and_check_tag): Refactor.
1022
10232020-10-01 Jakub Jelinek <jakub@redhat.com>
1024
1025 PR c++/96994
1026 * call.c (build_over_call): If obj_arg is non-NULL, return INIT_EXPR
1027 setting obj_arg to call.
1028
10292020-10-01 Jakub Jelinek <jakub@redhat.com>
1030
1031 PR c++/97195
1032 * constexpr.c (cxx_eval_call_expression): Don't VERIFY_CONSTANT the
1033 second argument.
1034
10352020-10-01 Marek Polacek <polacek@redhat.com>
1036
1037 PR c++/90210
1038 * pt.c (do_class_deduction): Don't prune explicit deduction guides
1039 in copy-list-initialization. In copy-list-initialization, if an
1040 explicit deduction guide was selected, give an error.
1041
660bfe61
GA
10422020-09-30 Nathan Sidwell <nathan@acm.org>
1043
1044 * cp-tree.h (struct lang_decl_fn): Remove hidden_friend_p.
1045 (DECL_HIDDEN_FRIEND_P): Delete.
1046 * call.c (add_function_candidate): Drop assert about anticipated
1047 decl.
1048 (build_new_op_1): Drop koenig lookup flagging for hidden friend.
1049 * decl.c (duplicate_decls): Drop HIDDEN_FRIEND_P updating.
1050 * name-lookup.c (do_pushdecl): Likewise.
1051 (set_decl_namespace): Discover hiddenness from OVL_HIDDEN_P.
1052 * pt.c (check_explicit_specialization): Record found_hidden
1053 explicitly.
1054
93bca37c
GA
10552020-09-29 Marek Polacek <polacek@redhat.com>
1056
1057 PR c++/94695
1058 * call.c (ref_conv_binds_directly_p): New function.
1059 * cp-tree.h (ref_conv_binds_directly_p): Declare.
1060 * parser.c (warn_for_range_copy): New function.
1061 (cp_convert_range_for): Call it.
1062
10632020-09-29 Nathan Sidwell <nathan@acm.org>
1064
1065 * cp-tree.h (ovl_insert): Change final parm to hidden-or-using
1066 indicator.
1067 * name-lookup.h (HIDDEN_TYPE_BINDING_P): New.
1068 (struct cxx_binding): Add type_is_hidden flag.
1069 * tree.c (ovl_insert): Change using_p parm to using_or_hidden,
1070 adjust.
1071 (ovl_skip_hidden): Assert we never see a naked hidden decl.
1072 * decl.c (xref_tag_1): Delete unhiding friend from here (moved to
1073 lookup_elaborated_type_1).
1074 * name-lookup.c (STAT_TYPE_HIDDEN_P, STAT_DECL_HIDDEN_P): New.
1075 (name_lookup::search_namespace_only): Check new hidden markers.
1076 (cxx_binding_make): Clear HIDDEN_TYPE_BINDING_P.
1077 (update_binding): Update new hidden markers.
1078 (lookup_name_1): Check HIDDEN_TYPE_BINDING_P and simplify friend
1079 ignoring.
1080 (lookup_elaborated_type_1): Use new hidden markers. Reveal the
1081 decl here.
1082
10832020-09-29 Nathan Sidwell <nathan@acm.org>
1084
1085 * name-lookup.c (create_local_binding): Do not clear
1086 INHERITED_VALUE_BINDING_P here.
1087 (name_lookup::process_binding): Move done hidden-decl triage to ...
1088 (name_lookup::search_namespace_only): ... here, its only caller.
1089 (cxx_binding_make): Clear flags here.
1090 (push_binding): Not here.
1091 (pop_local_binding): RAII.
1092 (update_binding): Refactor.
1093 (do_pushdecl): Assert we're never revealing a local binding.
1094 (do_pushdecl_with_scope): Directly call do_pushdecl.
1095 (get_class_binding): Do not clear LOCAL_BINDING_P here.
1096 * pt.c (push_template_decl): Set friend & anticipated before
1097 pushing.
1098
10992020-09-29 Nathan Sidwell <nathan@acm.org>
1100
1101 * name-lookup.c (update_binding): We never meet two implicit
1102 typedefs.
1103 (do_pushdecl): Adjust set_identifier_type_value_with_scope calls.
1104 (set_identifier_type_value_with_scope): Do not update binding in
1105 the namespace-case. Assert it is already there.
1106
cdd8f031
GA
11072020-09-25 Nathan Sidwell <nathan@acm.org>
1108
1109 * cp-tree.h (duplicate_decls): Replace 'is_friend' with 'hiding'
1110 and add 'was_hidden'.
1111 * name-lookup.h (pushdecl_namespace_level): Replace 'is_friend'
1112 with 'hiding'.
1113 (pushdecl): Likewise.
1114 (pushdecl_top_level): Drop is_friend parm.
1115 * decl.c (check_no_redeclaration_friend_default_args): Rename parm
1116 olddelc_hidden_p.
1117 (duplicate_decls): Replace 'is_friend' with 'hiding'
1118 and 'was_hidden'. Do minimal adjustments in body.
1119 (cxx_builtin_function): Pass 'hiding' to pushdecl.
1120 * friend.c (do_friend): Pass 'hiding' to pushdecl.
1121 * name-lookup.c (supplement_binding_1): Drop defaulted arg to
1122 duplicate_decls.
1123 (update_binding): Replace 'is_friend' with 'hiding'. Drop
1124 defaulted arg to duplicate_decls.
1125 (do_pushdecl): Replace 'is_friend' with 'hiding'. Assert no
1126 surprise hidhing. Adjust duplicate_decls calls to inform of old
1127 decl's hiddennes.
1128 (pushdecl): Replace 'is_friend' with 'hiding'.
1129 (set_identifier_type_value_with_scope): Adjust update_binding
1130 call.
1131 (do_pushdecl_with_scope): Replace 'is_friend' with 'hiding'.
1132 (pushdecl_outermost_localscope): Drop default arg to
1133 do_pushdecl_with_scope.
1134 (pushdecl_namespace_level): Replace 'is_friend' with 'hiding'.
1135 (pushdecl_top_level): Drop is_friend parm.
1136 * pt.c (register_specialization): Comment duplicate_decls call
1137 args.
1138 (push_template_decl): Commont pushdecl_namespace_level.
1139 (tsubst_friend_function, tsubst_friend_class): Likewise.
1140
11412020-09-25 Nathan Sidwell <nathan@acm.org>
1142
1143 * name-lookup.h (enum tag_scope): Replace with ...
1144 (enum class TAG_how): ... this. Add HIDDEN_FRIEND value.
1145 (lookup_type_scope): Replace with ...
1146 (lookup_elaborated_type): ... this.
1147 (pushtag): Use TAG_how, not tag_scope.
1148 * cp-tree.h (xref_tag): Parameter is TAG_how, not tag_scope.
1149 * decl.c (lookup_and_check_tag): Likewise. Adjust.
1150 (xref_tag_1, xref_tag): Likewise. adjust.
1151 (start_enum): Adjust lookup_and_check_tag call.
1152 * name-lookup.c (lookup_type_scope_1): Rename to ...
1153 (lookup_elaborated_type_1) ... here. Use TAG_how, not tag_scope.
1154 (lookup_type_scope): Rename to ...
1155 (lookup_elaborated_type): ... here. Use TAG_how, not tag_scope.
1156 (do_pushtag): Use TAG_how, not tag_scope. Adjust.
1157 (pushtag): Likewise.
1158 * parser.c (cp_parser_elaborated_type_specifier): Adjust.
1159 (cp_parser_class_head): Likewise.
1160
11612020-09-25 Nathan Sidwell <nathan@acm.org>
1162
1163 * cp-tree.h (DECL_BUILTIN_P): New.
1164 * decl.c (duplicate_decls): Use it. Do not treat omp-udr as a
1165 builtin.
1166 * name-lookup.c (anticipated_builtin): Use it.
1167 (set_decl_context_in_fn): Function-scope OMP UDRs have function context.
1168 (do_nonmember_using_decl): Use DECL_BUILTIN_P.
1169 * parser.c (cp_parser_omp_declare_reduction): Function-scope OMP
1170 UDRs have function context. Assert we never find a valid duplicate.
1171 * pt.c (tsubst_expr): Function-scope OMP UDRs have function context.
1172
a2b7397b
GA
11732020-09-24 Nathan Sidwell <nathan@acm.org>
1174
1175 * cp-tree.h (duplicate_decls): Default is_friend to false.
1176 (xref_tag): Default tag_scope & tpl_header_p to ts_current & false.
1177 (push_template_decl_real): Default is_friend to false. Rename to
1178 ...
1179 (push_template_decl): ... here. Delete original decl.
1180 * name-lookup.h (pushdecl_namespace_level): Default is_friend to
1181 false.
1182 (pushtag): Default tag_scope to ts_current.
1183 * coroutines.cc (morph_fn_to_coro): Drop default args to xref_tag.
1184 * decl.c (start_decl): Drop default args to duplicate_decls.
1185 (start_enum): Drop default arg to pushtag & xref_tag.
1186 (start_preparsed_function): Pass DECL_FRIEND_P to
1187 push_template_decl.
1188 (grokmethod): Likewise.
1189 * friend.c (do_friend): Rename push_template_decl_real calls.
1190 * lambda.c (begin_lamnbda_type): Drop default args to xref_tag.
1191 (vla_capture_type): Likewise.
1192 * name-lookup.c (maybe_process_template_type_declaration): Rename
1193 push_template_decl_real call.
1194 (pushdecl_top_level_and_finish): Drop default arg to
1195 pushdecl_namespace_level.
1196 * pt.c (push_template_decl_real): Assert no surprising friend
1197 functions. Rename to ...
1198 (push_template_decl): ... here. Delete original function.
1199 (lookup_template_class_1): Drop default args from pushtag.
1200 (instantiate_class_template_1): Likewise.
1201 * ptree.c (debug_overload): Print hidden and using markers.
1202 * rtti.c (init_rtti_processing): Drop refault args from xref_tag.
1203 (build_dynamic_cast_1, tinfo_base_init): Likewise.
1204 * semantics.c (begin_class_definition): Drop default args to
1205 pushtag.
1206
12072020-09-24 Nathan Sidwell <nathan@acm.org>
1208
1209 PR c++/97186
1210 * pt.c (maybe_instantiate_noexcept): Local externs are never
1211 member fns.
1212
82b77dee
GA
12132020-09-23 Nathan Sidwell <nathan@acm.org>
1214
1215 * name-lookup.h (typedef cxx_binding): Delete tdef.
1216 (typedef cp_binding_level): Likewise.
1217 (struct cxx_binding): Flags are bools.
1218
12192020-09-23 Nathan Sidwell <nathan@acm.org>
1220
1221 PR c++/97171
1222 * pt.c (tsubst_copy) [FUNCTION_DECL,VAR_DECL]: Retrieve local
1223 specialization for DECL_LOCAL_P decls.
1224
521d2711
GA
12252020-09-22 Patrick Palka <ppalka@redhat.com>
1226
1227 PR c++/95310
1228 * pt.c (corresponding_template_parameter): Define.
1229 (keep_template_parm): Use it to adjust the given template
1230 parameter to the corresponding in-scope one from ctx_parms.
1231
12322020-09-22 Nathan Sidwell <nathan@acm.org>
1233
1234 * cp-tree.h (xref_tag_from_type): Don't declare.
1235 * decl.c (xref_tag_from_type): Delete.
1236 * pt.c (lookup_template_class_1): Erroneously located class
1237 definitions just give error_mark, don't try and inject it into the
1238 namespace.
1239
12402020-09-22 Jakub Jelinek <jakub@redhat.com>
1241
1242 PR c++/97145
1243 * constexpr.c (cxx_eval_builtin_function_call): Return void_node for
1244 calls to __sanitize_ptr_{sub,cmp} builtins.
1245
12462020-09-22 Nathan Sidwell <nathan@acm.org>
1247
1248 * pt.c (instantiate_class_template_1): Do not repush and unhide
1249 injected friend.
1250
44135373
GA
12512020-09-21 Marek Polacek <polacek@redhat.com>
1252
1253 PR c++/90583
1254 DR 1722
1255 * lambda.c (maybe_add_lambda_conv_op): Mark the conversion function
1256 as noexcept.
1257
12582020-09-21 Marek Polacek <polacek@redhat.com>
1259
1260 * pt.c (deduction_guides_for): Add a bool parameter. Set it.
1261 (do_class_deduction): Warn when CTAD succeeds but the type doesn't
1262 have any explicit deduction guides.
1263
12642020-09-21 Nathan Sidwell <nathan@acm.org>
1265
1266 * decl.c (xref_tag_1): Use IDENTIFIER_LAMBDA_P to detect lambdas.
1267 * lambda.c (begin_lambda_type): Use ts_current to push the tag.
1268 * name-lookup.h (enum tag_scope): Drop ts_lambda.
1269
12702020-09-21 Marek Polacek <polacek@redhat.com>
1271
1272 PR c++/97099
1273 * decl.c (redeclaration_error_message): Detect a redeclaration of
1274 deduction guides.
1275
2fe5b7d1
GA
12762020-09-19 Sandra Loosemore <sandra@codesourcery.com>
1277
1278 * cp-gimplify.c (enum bc_t, bc_label): Move to c-family.
1279 (begin_bc_block, finish_bc_block, get_bc_label): Likewise.
1280 (genericize_cp_loop): Likewise.
1281 (genericize_for_stmt, genericize_while_stmt): Likewise.
1282 (genericize_do_stmt, genericize_switch_stmt): Likewise.
1283 (genericize_continue_stmt, genericize_break_stmt): Likewise.
1284 (genericize_omp_for_stmt): Likewise.
1285 (cp_genericize_r): Call c_genericize_control_stmt instead of
1286 above functions directly.
1287 (cp_genericize): Call save_bc_state and restore_bc_state instead
1288 of manipulating bc_label directly.
1289 * cp-objcp-common.c (cxx_block_may_fallthru): Defer to
1290 c_block_may_fallthru instead of handling SWITCH_STMT here.
1291 (cp_common_init_ts): Move handling of loop and switch-related
1292 statements to c-family.
1293 * cp-tree.def (FOR_STMT, WHILE_STMT, DO_STMT): Move to c-family.
1294 (BREAK_STMT, CONTINUE_STMT, SWITCH_STMT): Likewise.
1295 * cp-tree.h (LABEL_DECL_BREAK, LABEL_DECL_CONTINUE): Likewise.
1296 (WHILE_COND, WHILE_BODY): Likewise.
1297 (DO_COND, DO_BODY): Likewise.
1298 (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY, FOR_SCOPE): Likewise.
1299 (SWITCH_STMT_COND, SWITCH_STMT_BODY): Likewise.
1300 (SWITCH_STMT_TYPE, SWITCH_STMT_SCOPE): Likewise.
1301 (SWITCH_STMT_ALL_CASES_P, SWITCH_STMT_NO_BREAK_P): Likewise.
1302 * cxx-pretty-print.c (cxx_pretty_printer::statement): Move code
1303 to handle structured loop and switch tree nodes to c-family.
1304 * dump.c (cp_dump_tree): Likewise.
1305
13062020-09-19 Patrick Palka <ppalka@redhat.com>
1307
1308 PR c++/96531
1309 PR c++/97103
1310 * constraint.cc (map_arguments): Call template_parm_to_arg
1311 in the self-mapping case.
1312 (finish_shorthand_constraint): No need to build a TREE_LIST
1313 before calling template_parm_to_arg.
1314 * pt.c (template_parm_to_arg): Rewrite to handle TEMPLATE_PARM_P
1315 nodes as well as DECL_TEMPLATE_PARM_P nodes, and to make the
1316 overlying TREE_LIST node optional.
1317 (keep_template_parm): Don't record a BOUND_TEMPLATE_TEMPLATE_PARM,
1318 instead record its corresponding TEMPLATE_TEMPLATE_PARM.
1319 (convert_generic_types_to_packs): Don't call
1320 template_parm_to_arg.
1321
13222020-09-19 Patrick Palka <ppalka@redhat.com>
1323
1324 PR c++/97051
1325 * constraint.cc (satisfy_atom): Pass true as the
1326 manifestly_const_eval argument to maybe_constant_value.
1327
239601c5
GA
13282020-09-18 Jason Merrill <jason@redhat.com>
1329
1330 PR bootstrap/97118
1331 * decl.c (complete_vars): Only call layout_var_decl if completing
1332 the type succeeded.
1333
13342020-09-18 Jason Merrill <jason@redhat.com>
1335
1336 * decl.c (complete_vars): Call layout_var_decl.
1337
2aad20c0
GA
13382020-09-17 Patrick Palka <ppalka@redhat.com>
1339
1340 PR c++/96409
1341 PR c++/96410
1342 * constraint.cc (tsubst_requires_expr): Use REQUIRES_EXPR_PARMS
1343 and REQUIRES_EXPR_REQS. Use REQUIRES_EXPR_EXTRA_ARGS,
1344 add_extra_args and build_extra_args to defer substitution until
1345 we have all the template arguments.
1346 (finish_requires_expr): Adjust the call to build_min so that
1347 REQUIRES_EXPR_EXTRA_ARGS gets set to NULL_TREE.
1348 * cp-tree.def (REQUIRES_EXPR): Give it a third operand.
1349 * cp-tree.h (REQUIRES_EXPR_PARMS, REQUIRES_EXPR_REQS,
1350 REQUIRES_EXPR_EXTRA_ARGS): Define.
1351 (add_extra_args, build_extra_args): Declare.
1352
ecde1b0a
GA
13532020-09-16 Nathan Sidwell <nathan@acm.org>
1354
1355 * cp-tree.h (cp_check_omp_declare_reduction): Return bool.
1356 * semantics.c (cp_check_omp_declare_reduction): Return true on for
1357 success.
1358 * pt.c (push_template_decl_real): OMP reductions do not get a
1359 template header.
1360 (tsubst_function_decl): Remove special casing for local decl omp
1361 reductions.
1362 (tsubst_expr): Call instantiate_body for a local omp reduction.
1363 (instantiate_body): Add nested_p parm, and deal with such
1364 instantiations.
1365 (instantiate_decl): Reject FUNCTION_SCOPE entities, adjust
1366 instantiate_body call.
1367
13682020-09-16 Nathan Sidwell <nathan@acm.org>
1369
1370 * pt.c (instantiate_body): Remove 'nested' var, simplify
1371 push_to_top logic.
1372
13732020-09-16 Nathan Sidwell <nathan@acm.org>
1374
1375 * pt.c (instantiate_body): New, broken out of ..
1376 (instantiate_decl): ... here. Call it.
1377
9f7ab8c5
GA
13782020-09-15 Nathan Sidwell <nathan@acm.org>
1379
1380 * pt.c (push_template_decl_real): OMP reductions retain a template
1381 header.
1382 (tsubst_function_decl): Likewise.
1383
13842020-09-15 Tobias Burnus <tobias@codesourcery.com>
1385
1386 PR fortran/96668
1387 * cp-gimplify.c (cxx_omp_finish_clause): Add bool openacc arg.
1388 * cp-tree.h (cxx_omp_finish_clause): Likewise
1389 * semantics.c (handle_omp_for_class_iterator): Update call.
1390
50a71cd0
GA
13912020-09-14 Marek Polacek <polacek@redhat.com>
1392
1393 * pt.c (push_template_decl_real): Use VAR_OR_FUNCTION_DECL_P.
1394
13952020-09-14 Nathan Sidwell <nathan@acm.org>
1396
1397 * pt.c (push_template_decl_real): Don't attach a template head to
1398 local externs.
1399 (tsubst_function_decl): Add support for headless local extern
1400 decls.
1401 (tsubst_decl): Add support for headless local extern decls.
1402
ac35c090
GA
14032020-09-11 Nathan Sidwell <nathan@acm.org>
1404
1405 * decl.c (grokfndecl): Don't attach to local extern.
1406
14072020-09-11 Nathan Sidwell <nathan@acm.org>
1408
1409 * parser.c (cp_parser_objc_method_definition_list): Reimplement
1410 loop, make sure we pop scope.
1411
14122020-09-11 Marek Polacek <polacek@redhat.com>
1413
1414 * cp-tree.h (LOOKUP_CONSTINIT): Remove.
1415 (LOOKUP_REWRITTEN): Adjust.
1416 * decl.c (duplicate_decls): Set DECL_DECLARED_CONSTINIT_P.
1417 (check_initializer): Use DECL_DECLARED_CONSTINIT_P instead of
1418 LOOKUP_CONSTINIT.
1419 (cp_finish_decl): Don't set DECL_DECLARED_CONSTINIT_P. Use
1420 DECL_DECLARED_CONSTINIT_P instead of LOOKUP_CONSTINIT.
1421 (grokdeclarator): Set DECL_DECLARED_CONSTINIT_P.
1422 * decl2.c (grokfield): Don't handle LOOKUP_CONSTINIT.
1423 * parser.c (cp_parser_decomposition_declaration): Remove
1424 LOOKUP_CONSTINIT handling.
1425 (cp_parser_init_declarator): Likewise.
1426 * pt.c (tsubst_expr): Likewise.
1427 (instantiate_decl): Likewise.
1428 * typeck2.c (store_init_value): Use DECL_DECLARED_CONSTINIT_P instead
1429 of LOOKUP_CONSTINIT.
1430
fdcc0283
GA
14312020-09-10 Nathan Sidwell <nathan@acm.org>
1432
1433 * cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Replace with ...
1434 (DECL_DECLARED_CONSTINIT_P): ... this.
1435 * decl.c (start_decl): No need to retrofit_lang_decl for constinit
1436 flag.
1437 (cp_finish_decl): Use DECL_DECLARED_CONSTINIT_P.
1438 * pt.c (tsubst_decl): No need to handle constinit flag
1439 propagation.
1440 (tsubst_expr): Or here.
1441
14422020-09-10 Nathan Sidwell <nathan@acm.org>
1443
1444 * cp-tree.h (DECL_LOCAL_FUNCTION_P): Rename to ...
1445 (DECL_LOCAL_DECL_P): ... here. Accept both fns and vars.
1446 * decl.c (start_decl): Set DECL_LOCAL_DECL_P for local externs.
1447 (omp_declare_variant_finalize_one): Use DECL_LOCAL_DECL_P.
1448 (local_variable_p): Simplify.
1449 * name-lookup.c (set_decl_context_in_fn): Assert DECL_LOCAL_DECL_P
1450 is as expected. Simplify.
1451 (do_pushdecl): Don't set decl_context_in_fn for friends.
1452 (is_local_extern): Simplify.
1453 * call.c (equal_functions): Use DECL_LOCAL_DECL_P.
1454 * parser.c (cp_parser_postfix_expression): Likewise.
1455 (cp_parser_omp_declare_reduction): Likewise.
1456 * pt.c (check_default_tmpl_args): Likewise.
1457 (tsubst_expr): Assert nested reduction function is local.
1458 (type_dependent_expression_p): Use DECL_LOCAL_DECL_P.
1459 * semantics.c (finish_call_expr): Likewise.
1460
80f86e78
GA
14612020-09-09 Marek Polacek <polacek@redhat.com>
1462
1463 PR c++/77841
1464 * decl.c (reshape_init): If we're initializing a char array from
1465 a string-literal that is enclosed in braces, unwrap it.
1466 * init.c (build_new_1): Don't handle string-initializers here.
1467 (build_new): Handle new-expression with paren-init when the
1468 array bound is known. Always pass string constants to build_new_1
1469 enclosed in braces. Don't handle string-initializers in any
1470 special way.
1471
14722020-09-09 Marek Polacek <polacek@redhat.com>
1473
1474 PR c++/95164
1475 * decl.c (reshape_init_r): When initializing an aggregate member
1476 with an initializer from an initializer-list, also consider
1477 COMPOUND_LITERAL_P.
1478
14792020-09-09 Nathan Sidwell <nathan@acm.org>
1480
1481 * parser.c (cp_parser_omp_declare_reduction): Refactor to avoid
1482 code duplication. Update DECL_TI_TEMPLATE's context.
1483 * pt.c (tsubst_expr): For OMP reduction function, set context to
1484 global_namespace before pushing.
1485 (tsubst_omp_udr): Assert current_function_decl, add comment about
1486 decl context.
1487
14882020-09-09 Patrick Palka <ppalka@redhat.com>
1489
1490 PR c++/96647
1491 * class.c (resolve_address_of_overloaded_function): Check
1492 constraints_satisfied_p and perform return-type deduction via
1493 maybe_instantiate_decl when considering non-template functions
1494 in the overload set.
1495 * cp-tree.h (maybe_instantiate_decl): Declare.
1496 * decl2.c (maybe_instantiate_decl): Remove static.
1497
bec05c98
GA
14982020-09-04 Jason Merrill <jason@redhat.com>
1499
1500 * expr.c (mark_use): Use iloc_sentinel.
1501
6e82b6cf
GA
15022020-09-03 Jakub Jelinek <jakub@redhat.com>
1503
1504 PR c++/96901
1505 * constexpr.c (fundef_copies_table): Change type from
1506 hash_map<tree, tree> * to decl_tree_map *.
1507
15082020-09-03 Marek Polacek <polacek@redhat.com>
1509
1510 PR c++/92812
1511 * cp-tree.h (do_aggregate_paren_init): Declare.
1512 * decl.c (do_aggregate_paren_init): New.
1513 (grok_reference_init): Use it.
1514 (check_initializer): Likewise.
1515 * init.c (perform_member_init): Handle initializing an array from
1516 a ()-list. Use do_aggregate_paren_init.
1517
15182020-09-03 Jakub Jelinek <jakub@redhat.com>
1519
1520 PR c++/96862
1521 * constexpr.c (cxx_eval_outermost_constant_expr): Temporarily disable
1522 flag_rounding_math during manifestly constant evaluation.
1523
e1a4a8a0
GA
15242020-09-01 Marek Polacek <polacek@redhat.com>
1525
1526 PR c++/77841
1527 * init.c (build_new_1): Call reshape_init.
1528
15292020-09-01 Jakub Jelinek <jakub@redhat.com>
1530
1531 PR c++/96867
1532 * semantics.c (handle_omp_array_sections_1): Test
1533 DECL_ARRAY_PARAMETER_P only on PARM_DECLs.
1534
13e4ba28
GA
15352020-08-31 Marek Polacek <polacek@redhat.com>
1536 Jason Merrill <jason@redhat.com>
1537
1538 PR c++/93529
1539 * call.c (build_new_method_call_1): Use build_constructor_from_vec
1540 instead of build_tree_list_vec + build_constructor_from_list.
1541 * init.c (build_new_1): Handle new char[]{"foo"}. Use
1542 build_constructor_from_vec instead of build_tree_list_vec +
1543 build_constructor_from_list.
1544 (build_new): Deduce the array size in new-expression if not
1545 present. Handle ()-init. Handle initializing an array from
1546 a string literal.
1547 * parser.c (cp_parser_new_type_id): Leave [] alone.
1548 (cp_parser_direct_new_declarator): Allow [].
1549 * pt.c (type_dependent_expression_p): In a NEW_EXPR, consider
1550 array types whose dimension has to be deduced type-dependent.
1551
8b394f01
GA
15522020-08-27 Martin Liska <mliska@suse.cz>
1553
1554 * class.c (build_vtbl_initializer): Set exact argument of a vector
1555 growth function to true.
1556 * constraint.cc (get_mapped_args): Likewise.
1557 * decl.c (cp_maybe_mangle_decomp): Likewise.
1558 (cp_finish_decomp): Likewise.
1559 * parser.c (cp_parser_omp_for_loop): Likewise.
1560 * pt.c (canonical_type_parameter): Likewise.
1561 * rtti.c (get_pseudo_ti_init): Likewise.
1562
57ea0894
GA
15632020-08-26 Nathan Sidwell <nathan@acm.org>
1564
1565 * decl.c (poplevel): A local-binding tree list holds the name in
1566 TREE_PURPOSE.
1567 * name-lookup.c (update_local_overload): Add id to TREE_PURPOSE.
1568 (lookup_name_1): Deal with local-binding error_mark_node marker.
1569 (op_unqualified_lookup): Return error_mark_node for 'nothing
1570 found'. Retain global binding, check class binding here.
1571 (maybe_save_operator_binding): Reimplement to always cache a
1572 result.
1573 (push_operator_bindings): Deal with 'ignore' marker.
1574
db0f6efe
GA
15752020-08-25 Tobias Burnus <tobias@codesourcery.com>
1576
1577 PR c/96678
1578 * semantics.c (handle_omp_array_sections_1): Talk about
1579 array function parameter in the error message.
1580
15812020-08-25 Jakub Jelinek <jakub@redhat.com>
1582
1583 PR c++/96721
1584 * cp-tree.h (build_trivial_dtor_call): Add bool argument defaulted
1585 to false.
1586 * call.c (build_trivial_dtor_call): Add NO_PTR_DEREF argument. If
1587 instance is a pointer and NO_PTR_DEREF is true, clobber the pointer
1588 rather than what it points to.
1589 * semantics.c (finish_call_expr): Call build_trivial_dtor_call with
1590 true as NO_PTR_DEREF.
1591
15922020-08-25 Jason Merrill <jason@redhat.com>
1593
1594 PR c++/95428
1595 * optimize.c (populate_clone_array): Revert PR70462 change.
1596 (maybe_clone_body): Likewise.
1597
b2b24d30
GA
15982020-08-24 Nathan Sidwell <nathan@acm.org>
1599
1600 * ptree.c (debug_overload): New.
1601
04e23a40
GA
16022020-08-19 Jason Merrill <jason@redhat.com>
1603
1604 DR 2369
1605 * cp-tree.h (push_tinst_level, push_tinst_level_loc): Declare.
1606 * constraint.cc (satisfy_declaration_constraints):
1607 Use add_outermost_template_args and push_tinst_level.
1608 * pt.c (add_outermost_template_args): Handle getting
1609 a TEMPLATE_DECL as the first argument.
1610 (push_tinst_level, push_tinst_level_loc): No longer static.
1611 (fn_type_unification): Check satisfaction before non-dependent
1612 conversions.
1613
5c265693
GA
16142020-08-18 Nathan Sidwell <nathan@acm.org>
1615
1616 * cp-tree.h (SET_TYPE_TEMPLTE_INFO): Do not deal with ALIAS templates.
1617 * pt.c (lookup_template_class_1): Special-case alias template
1618 template_info setting.
1619
16202020-08-18 Jason Merrill <jason@redhat.com>
1621
1622 PR c++/96199
1623 * pt.c (tsubst_aggr_type): Rewrite in C++17, too.
1624 (maybe_dependent_member_ref): Likewise.
1625 (build_deduction_guide): Re-substitute template parms.
1626 * cp-tree.h (struct push_nested_class_guard): New.
1627 * constraint.cc (get_normalized_constraints_from_decl): Use it.
1628
16292020-08-18 Jason Merrill <jason@redhat.com>
1630
1631 PR c++/96199
1632 * pt.c (maybe_dependent_member_ref): New.
1633 (tsubst_copy) [CONST_DECL]: Use it.
1634 [VAR_DECL]: Likewise.
1635 (tsubst_aggr_type): Handle nested type.
1636
16372020-08-18 Nathan Sidwell <nathan@acm.org>
1638
1639 * name-lookup.c (qualify_lookup): Drop lambda checking here.
1640 Reorder namespace & type checking.
1641 (lookup_name_1): Do hidden lambda checking here.
1642
661ee09b
GA
16432020-08-14 Nathan Sidwell <nathan@acm.org>
1644
1645 * name-lookup.h (lookup_name_real, lookup_name_nonclass): Rename
1646 to ...
1647 (lookup_name): ... these new overloads.
1648 * name-lookup.c (identifier_type_value_1): Rename lookup_name_real
1649 call.
1650 (lookup_name_real_1): Rename to ...
1651 (lookup_name_1): ... here.
1652 (lookup_name_real): Rename to ...
1653 (lookup_name): ... here. Rename lookup_name_real_1 call.
1654 (lookup_name_nonclass): Delete.
1655 * call.c (build_operator_new_call): Rename lookup_name_real call.
1656 (add_operator_candidates): Likewise.
1657 (build_op_delete_call): Rename lookup_name_nonclass call.
1658 * parser.c (cp_parser_lookup_name): Likewise.
1659 * pt.c (tsubst_friend_class, lookup_init_capture_pack): Likewise.
1660 (tsubst_expr): Likewise.
1661 * semantics.c (capture_decltype): Likewise.
1662
16632020-08-14 Nathan Sidwell <nathan@acm.org>
1664
1665 * cp-tree.h (LOOKUP_HIDDEN): Delete.
1666 (LOOKUP_PREFER_RVALUE): Adjust initializer.
1667 * name-lookup.h (enum class LOOK_want): Add HIDDEN_FRIEND and
1668 HIDDEN_LAMBDA flags.
1669 (lookup_name_real): Drop flags parm.
1670 (lookup_qualified_name): Drop find_hidden parm.
1671 * name-lookup.c (class name_lookup): Drop hidden field, adjust
1672 ctors.
1673 (name_lookup::add_overload): Check want for hiddenness.
1674 (name_lookup::process_binding): Likewise.
1675 (name_lookup::search_unqualified): Likewise.
1676 (identifier_type_value_1): Adjust lookup_name_real call.
1677 (set_decl_namespace): Adjust name_lookup ctor.
1678 (qualify_lookup): Drop flags parm, use want for hiddenness.
1679 (lookup_qualified_name): Drop find_hidden parm.
1680 (lookup_name_real_1): Drop flags parm, adjust qualify_lookup
1681 calls.
1682 (lookup_name_real): Drop flags parm.
1683 (lookup_name_nonclass, lookup_name): Adjust lookup_name_real
1684 calls.
1685 (lookup_type_scope_1): Adjust qualify_lookup calls.
1686 * call.c (build_operator_new_call): Adjust lookup_name_real call.
1687 (add_operator_candidates): Likewise.
1688 * coroutines.cc (morph_fn_to_coro): Adjust lookup_qualified_name
1689 call.
1690 * parser.c (cp_parser_lookup_name): Adjust lookup_name_real calls.
1691 * pt.c (check_explicit_specialization): Adjust
1692 lookup_qualified_name call.
1693 (deduction_guides_for): Likewise.
1694 (tsubst_friend_class): Adjust lookup_name_real call.
1695 (lookup_init_capture_pack): Likewise.
1696 (tsubst_expr): Likewise, don't look in namespaces.
1697 * semantics.c (capture_decltype): Adjust lookup_name_real. Don't
1698 look in namespaces.
1699
17002020-08-14 Jason Merrill <jason@redhat.com>
1701
1702 PR c++/90254
1703 PR c++/93711
1704 * cp-tree.h (unsafe_return_slot_p): Declare.
1705 * call.c (is_base_field_ref): Rename to unsafe_return_slot_p.
1706 (build_over_call): Check unsafe_return_slot_p.
1707 (build_special_member_call): Likewise.
1708 * init.c (expand_default_init): Likewise.
1709 * typeck2.c (split_nonconstant_init_1): Likewise.
1710
17112020-08-14 Nathan Sidwell <nathan@acm.org>
1712
1713 * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES)
1714 (LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY)
1715 (LOOKUP_QUALIFIERS_ONL): Delete.
1716 (LOOKUP_HIDDEN): Adjust.
1717 * name-lookup.h (enum class LOOK_want): New.
1718 (operator|, operator&): Overloads for it.
1719 (lookup_name_real): Replace prefer_type & namespaces_only with
1720 LOOK_want parm.
1721 (lookup_qualified_name): Replace prefer_type with LOOK_want.
1722 (lookup_name_prefer_type): Replace with ...
1723 (lookup_name): ... this. New overload with LOOK_want parm.
1724 * name-lookup.c (struct name_lookup): Replace flags with want and
1725 hidden fields. Adjust constructors.
1726 (name_lookyp::add_overload): Correct hidden stripping test. Update
1727 for new LOOK_want type.
1728 (name_lookup::process_binding): Likewise.
1729 (name_lookup::search_unqualified): Use hidden flag.
1730 (identifier_type_value_1): Adjust lookup_name_real call.
1731 (set_decl_namespace): Adjust name_lookup ctor.
1732 (lookup_flags): Delete.
1733 (qualify_lookup): Add LOOK_want parm, adjust.
1734 (lookup_qualified_name): Replace prefer_type parm with LOOK_want.
1735 (lookup_name_real_1): Replace prefer_type and namespaces_only with
1736 LOOK_want parm.
1737 (lookup_name_real): Likewise.
1738 (lookup_name_nonclass, lookup_name): Adjust lookup_name_real call.
1739 (lookup_name_prefer_type): Rename to ...
1740 (lookup_name): ... here. New overload with LOOK_want parm.
1741 (lookup_type_scope_1): Adjust qualify_lookup calls.
1742 * call.c (build_operator_new_call)
1743 (add_operator_candidates): Adjust lookup_name_real calls.
1744 * coroutines.cc (find_coro_traits_template_decl)
1745 (find_coro_handle_template_decl, morph_fn_to_coro): Adjust
1746 lookup_qualified_name calls.
1747 * cp-objcp-common.c (identifier_global_tag): Likewise.
1748 * decl.c (get_tuple_size, get_tuple_decomp_init): Likewise.
1749 (lookup_and_check_tag): Use lookup_name overload.
1750 * parser.c (cp_parser_userdef_numeric_literal): Adjust
1751 lookup_qualified_name call.
1752 (prefer_arg_type): Drop template_mem_access parm, return LOOK_want
1753 value.
1754 (cp_parser_lookup_name): Adjust lookup_member, lookup_name_real
1755 calls.
1756 * pt.c (check_explicit_specialization): Adjust lookup_qualified_name
1757 call.
1758 (tsubst_copy_and_build, tsubst_qualified_name): Likewise
1759 (deduction_guides_for): Likewise.
1760 (tsubst_friend_class): Adjust lookup_name_real call.
1761 (lookup_init_capture, tsubst_expr): Likewise.
1762 * rtti.c (emit_support_tinfos): Adjust lookup_qualified_name call.
1763 * semantics.c (omp_reduction_lookup): Likewise.
1764 (capture_decltype): Adjust lookup_name_real call.
1765
b3cb5606
GA
17662020-08-13 Nathan Sidwell <nathan@acm.org>
1767
1768 * name-lookup.h (enum class LOOK_where): New.
1769 (operator|, operator&): Overloads for it.
1770 (lookup_name_real): Replace NONCLASS & BLOCK_P parms with WHERE.
1771 * name-lookup.c (identifier_type_value_w): Adjust
1772 lookup_name_real call.
1773 (lookup_name_real_1): Replace NONCLASS and BLOCK_P parameters
1774 with WHERE bitmask. Don't search namespaces if not asked to.
1775 (lookup_name_real): Adjust lookup_name_real_1 call.
1776 (lookup_name_nonclass, lookup_name)
1777 (lookup_name_prefer_type): Likewise.
1778 * call.c (build_operator_new_call)
1779 (add_operator_candidates): Adjust lookup_name_real calls.
1780 * parser.c (cp_parser_lookup_name): Likewise.
1781 * pt.c (tsubst_friend_class, lookup_init_capture_pack)
1782 (tsubst_expr): Likewise.
1783 * semantics.c (capture_decltype): Likewise.
1784
17852020-08-13 Marek Polacek <polacek@redhat.com>
1786
1787 PR c++/92812
1788 * typeck.c (build_static_cast_1): Implement P1975R0 by allowing
1789 static_cast to aggregate type.
1790
84005b8a
GA
17912020-08-10 Jakub Jelinek <jakub@redhat.com>
1792
1793 PR c++/96497
1794 * constexpr.c (cxx_eval_binary_expression): For SPACESHIP_EXPR, tail
1795 call cxx_eval_constant_expression after genericize_spaceship to avoid
1796 undesirable further VERIFY_CONSTANT.
1797
17982020-08-10 Patrick Palka <ppalka@redhat.com>
1799
1800 * pt.c (resolve_overloaded_unification): Drop functions with
1801 unsatisfied constraints.
1802 (resolve_nondeduced_context): Likewise.
1803
aa5ea20c
GA
18042020-08-05 Patrick Palka <ppalka@redhat.com>
1805 Jason Merrill <jason@redhat.com>
1806
1807 PR c++/96282
1808 * constexpr.c (cxx_eval_vec_init_1): Truncate ctx->ctor and
1809 then clear CONSTRUCTOR_NO_CLEARING on each appended element
1810 initializer if we're initializing a previously zero-initialized
1811 array object.
1812
abba2591
GA
18132020-08-04 Marek Polacek <polacek@redhat.com>
1814
1815 PR c++/96082
1816 * parser.c (cp_parser_elaborated_type_specifier): Allow
1817 'template' following ::.
1818
18192020-08-04 Nathan Sidwell <nathan@acm.org>
1820
1821 * parser.c (cp_parser_explicit_specialization): Refactor
1822 to avoid leak of num_template_parameter_lists value.
1823
18242020-08-04 Patrick Palka <ppalka@redhat.com>
1825
1826 PR c++/94024
1827 * init.c (sort_mem_initializers): Preserve TREE_TYPE of the
1828 member initializer list node.
1829 (emit_mem_initializers): Set input_location when performing each
1830 member initialization.
1831 * parser.c (cp_parser_mem_initializer): Attach the source
1832 location of this initializer to a dummy EMPTY_CLASS_EXPR
1833 within the TREE_TYPE of the list node.
1834 * pt.c (tsubst_initializer_list): Preserve TREE_TYPE of the
1835 member initializer list node.
1836
6a1ad710
GA
18372020-08-03 Marek Polacek <polacek@redhat.com>
1838
1839 * cp-tree.h (after_nsdmi_defaulted_late_checks): Remove.
1840
18412020-08-03 Marek Polacek <polacek@redhat.com>
1842
1843 DR 2032
1844 PR c++/96218
1845 * pt.c (check_default_tmpl_args): Also consider variable
1846 templates.
1847
48cc2e46
GA
18482020-07-31 Jakub Jelinek <jakub@redhat.com>
1849
1850 PR c++/96182
1851 * decl.c (finish_function): In constexpr functions use for C++14 and
1852 later error instead of warning if no return statement is present and
1853 diagnose it regardless of warn_return_type. Move the warn_return_type
1854 diagnostics earlier in the function.
1855
18562020-07-31 Martin Sebor <msebor@redhat.com>
1857
1858 PR c++/96003
1859 * class.c (build_base_path): Set no-warning bit on the synthesized
1860 conditional expression in static_cast.
1861
18622020-07-31 Richard Biener <rguenther@suse.de>
1863
1864 PR debug/96383
1865 * cp-objcp-common.h (LANG_HOOKS_FINALIZE_EARLY_DEBUG):
1866 Define to c_common_finalize_early_debug.
1867
18682020-07-31 Patrick Palka <ppalka@redhat.com>
1869
1870 PR c++/96197
1871 * constexpr.c (cxx_eval_constant_expression) <case CONST_DECL>:
1872 Pass false to decl_constant_value and decl_really_constant_value
1873 so that they don't unshare their result.
1874 * cp-tree.h (decl_constant_value): New declaration with an added
1875 bool parameter.
1876 (decl_really_constant_value): Add bool parameter defaulting to
1877 true to existing declaration.
1878 * init.c (constant_value_1): Add bool parameter which controls
1879 whether to unshare the initializer before returning. Call
1880 unshare_expr at most once.
1881 (scalar_constant_value): Pass true to constant_value_1's new
1882 bool parameter.
1883 (decl_really_constant_value): Add bool parameter and forward it
1884 to constant_value_1.
1885 (decl_constant_value): Likewise, but instead define a new
1886 overload with an added bool parameter.
1887
d48cca8f
GA
18882020-07-30 Patrick Palka <ppalka@redhat.com>
1889
1890 PR c++/64194
1891 * pt.c (resolve_overloaded_unification): If the function
1892 template specialization has a placeholder return type,
1893 then instantiate it before attempting unification.
1894
18952020-07-30 Patrick Palka <ppalka@redhat.com>
1896
1897 PR c++/95486
1898 * pt.c (alias_ctad_tweaks): Call remove_constraints before
1899 calling set_constraints.
1900
19012020-07-30 Patrick Palka <ppalka@redhat.com>
1902
1903 PR c++/96106
1904 * pt.c (reduce_template_parm_level): Propagate DECL_VIRTUAL_P
1905 from the original TEMPLATE_PARM_DECL to the new lowered one.
1906
19072020-07-30 Patrick Palka <ppalka@redhat.com>
1908
1909 PR c++/96164
1910 * constraint.cc (constraints_satisfied_p): Return true if
1911 !flags_concepts.
1912 * pt.c (do_type_instantiation): Update a paragraph taken from
1913 [temp.explicit] to reflect the latest specification. Don't
1914 instantiate a member with unsatisfied constraints.
1915
bea7a391
GA
19162020-07-29 Jason Merrill <jason@redhat.com>
1917
1918 PR c++/91427
1919 * cp-tree.h (IMPLICIT_RVALUE_P): New.
1920 (enum cp_lvalue_kind_flags): Add clk_implicit_rval.
1921 (implicit_rvalue_p, set_implicit_rvalue_p): New.
1922 * call.c (reference_binding): Check clk_implicit_rval.
1923 (build_over_call): Adjust C++20 implicit move.
1924 * coroutines.cc (finish_co_return_stmt): Simplify implicit move.
1925 * except.c (build_throw): Adjust C++20 implicit move.
1926 * pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Propagate
1927 IMPLICIT_RVALUE_P.
1928 * tree.c (lvalue_kind): Set clk_implicit_rval.
1929 * typeck.c (treat_lvalue_as_rvalue_p): Overhaul.
1930 (maybe_warn_pessimizing_move): Adjust.
1931 (check_return_expr): Adjust C++20 implicit move.
1932
19332020-07-29 Jason Merrill <jason@redhat.com>
1934
1935 PR c++/91212
1936 * call.c (build_over_call): Don't call a const ref
1937 overload for implicit move.
1938
7ebb7d0c
GA
19392020-07-28 Nathan Sidwell <nathan@acm.org>
1940
1941 * cp-gimplify.c (cp_genericize_r): Set IMPORTED_DECL's context.
1942 * cp-objcp-common.c (cp_pushdecl): Set decl's context.
1943 * decl.c (grokfndecl): Make DECL_CONTEXT setting clearer.
1944
19452020-07-28 Nathan Sidwell <nathan@acm.org>
1946
1947 * class.c (fixup_type_variants): Copy TYPE_SIZE and
1948 TYPE_SIZE_UINIT.
1949 (finish_struct): Call it.
1950
19512020-07-28 Nathan Sidwell <nathan@acm.org>
1952
1953 * ptree.c (cxx_print_decl): Better indentation.
1954
19552020-07-28 Jakub Jelinek <jakub@redhat.com>
1956 Mark Wielaard <mark@klomp.org>
1957
1958 PR c++/96328
1959 * parser.c (cp_lexer_safe_previous_token): Don't call
1960 cp_lexer_previous_token, instead inline it by hand and return NULL
1961 instead of failing assertion if all previous tokens until the first
1962 one are purged.
1963 (cp_parser_error_1): Optimize - only call cp_lexer_safe_previous_token
1964 if token->type is CPP_NAME. Use cp_lexer_safe_previous_token instead
1965 of cp_lexer_previous_token for the missing_token_desc != RT_NONE
1966 case too.
1967
e71dab87
GA
19682020-07-27 Nathan Sidwell <nathan@acm.org>
1969
1970 * cp-tree.h (enum cp_tree_index): Add CPTI_AS_BASE_IDENTIFIER.
1971 (as_base_identifier): Define.
1972 * decl.c (initialize_predifined_identifiers): Initialize as_base
1973 identifier.
1974 * class.c (layout_class_type): Name the as-base type. Zap
1975 NSDMI its fields may have.
1976
3ea9abca
GA
19772020-07-22 Nathan Sidwell <nathan@acm.org>
1978
1979 * class.c (maybe_add_class_template_decl_list): Don't add CONST_DECLs.
1980
19812020-07-22 Nathan Sidwell <nathan@acm.org>
1982
1983 * typeck.c (structural_comptypes): [DECLTYPE_TYPE] break
1984 apart complex if.
1985 [UNDERLYING_TYPE]: Use an if.
1986 [TYPEOF_TYPE]: New.
1987
19882020-07-22 Nathan Sidwell <nathan@acm.org>
1989
1990 * decl.c (decls_match): Move variables into scopes
1991 they're needed in.
1992 (duplicate_decls): Use STRIP_TEMPLATE.
1993 (build_typename_type): Move var decls to their assignments.
1994 (begin_function_body): Likewise.
1995 * decl2.c (get_guard): Likewise.
1996 (mark_used): Use true for truthiness.
1997 * error.c (dump_aggr_type): Hold the decl in a var called
1998 'decl', not 'name'.
1999
20002020-07-22 Nathan Sidwell <nathan@acm.org>
2001
2002 * cp-tree.h (struct tree_lambda_expr): Shrink
2003 default_capture_mode & discriminator.
2004
20052020-07-22 Nathan Sidwell <nathan@acm.org>
2006
2007 * mangle.c (decl_is_template_id): Rename to ...
2008 (maybe_template_info): ... here. Return the template info,
2009 rather than use a pointer. Adjust all callers.
2010 (find_substitution): Use template_args_equal, rather than
2011 local check.
2012
20132020-07-22 Tobias Burnus <tobias@codesourcery.com>
2014
2015 * parser.c (cp_parser_omp_clause_hint): Require nonnegative hint.
2016 (cp_parser_omp_critical): Permit hint(0) clause without named critical.
2017 * pt.c (tsubst_expr): Re-check the latter for templates.
2018
30430061
GA
20192020-07-21 Sunil K Pandey <skpgkp2@gmail.com>
2020
2021 PR target/95237
2022 * decl.c (cp_finish_decl): Call target hook
2023 lower_local_decl_alignment to lower local decl alignment.
2024
20252020-07-21 Nathan Sidwell <nathan@acm.org>
2026
2027 * parser.c (cp_lexer_consume_token): Drop PRAGMA_EOL assert.
2028 (cp_parser_skip_to_closing_parenthesis_1): Only pass start token
2029 to pragma skipper if recovering.
2030 (cp_parser_skip_to_pragma_eol): Only purge and change pragma
2031 state when recovering.
2032
0933f508
GA
20332020-07-20 Jason Merrill <jason@redhat.com>
2034
2035 * pt.c (type_dependent_expression_p): A pseudo-dtor can be
2036 dependent.
2037 * semantics.c (finish_call_expr): Use build_trivial_dtor_call for
2038 pseudo-destructor.
2039 (finish_pseudo_destructor_expr): Leave type NULL for dependent arg.
2040
20412020-07-20 Jason Merrill <jason@redhat.com>
2042
2043 * mangle.c (write_base_ref): New.
2044 (write_expression): Use it for base field COMPONENT_REFs.
2045 * pt.c (invalid_tparm_referent_p): Canonicalize the type
2046 of array offsets. Allow subobjects.
2047
20482020-07-20 Jason Merrill <jason@redhat.com>
2049
2050 * pt.c (collect_ctor_idx_types): Add 'const' when deducing from
2051 a string constant.
2052
ab660b01
GA
20532020-07-17 Marek Polacek <polacek@redhat.com>
2054
2055 PR c++/79815
2056 * decl.c (grokdeclarator): Detect cv-qual decltype(auto).
2057 * pt.c (do_auto_deduction): Likewise.
2058
96686b3f
GA
20592020-07-16 Iain Sandoe <iain@sandoe.co.uk>
2060
2061 PR c++/95591
2062 PR c++/95599
2063 PR c++/95823
2064 PR c++/95824
2065 PR c++/95895
2066 * coroutines.cc (struct coro_ret_data): Delete.
2067 (coro_maybe_expand_co_return): Delete.
2068 (co_return_expander): Delete.
2069 (expand_co_returns): Delete.
2070 (co_await_find_in_subtree): Remove unused name.
2071 (build_actor_fn): Remove unused parm, remove handling
2072 for co_return expansion.
2073 (register_await_info): Demote duplicate info message to a
2074 warning.
2075 (coro_make_frame_entry): Move closer to use site.
2076 (struct susp_frame_data): Add fields for final suspend label
2077 and a flag to indicate await expressions with initializers.
2078 (captures_temporary): Delete.
2079 (register_awaits): Remove unused code, update comments.
2080 (find_any_await): New.
2081 (tmp_target_expr_p): New.
2082 (struct interesting): New.
2083 (find_interesting_subtree): New.
2084 (struct var_nest_node): New.
2085 (flatten_await_stmt): New.
2086 (handle_nested_conditionals): New.
2087 (process_conditional): New.
2088 (replace_statement_captures): Rename to...
2089 (maybe_promote_temps): ... this.
2090 (maybe_promote_captured_temps): Delete.
2091 (analyze_expression_awaits): Check for await expressions with
2092 initializers. Simplify handling for truth-and/or-if.
2093 (expand_one_truth_if): Simplify (map cases that need expansion
2094 to COND_EXPR).
2095 (await_statement_walker): Handle CO_RETURN_EXPR. Simplify the
2096 handling for truth-and/or-if expressions.
2097 (register_local_var_uses): Ensure that we create names in the
2098 implementation namespace.
2099 (morph_fn_to_coro): Add final suspend label to suspend frame
2100 callback data and remove it from the build_actor_fn call.
2101
21022020-07-16 Marek Polacek <polacek@redhat.com>
2103
2104 * call.c (convert_like): Remove macro and introduce a new
2105 wrapper instead.
2106 (convert_like_with_context): Likewise.
2107 (convert_like_real): Rename to convert_like.
2108 (convert_like_real_1): Rename to convert_like_internal. Call
2109 convert_like instead of convert_like_real therein.
2110 (perform_direct_initialization_if_possible): Call convert_like
2111 instead of convert_like_real.
2112
21132020-07-16 Iain Sandoe <iain@sandoe.co.uk>
2114
2115 * coroutines.cc: Correct some spelling errors
2116 in comments.
2117
fe8185b5
GA
21182020-07-15 Nathan Sidwell <nathan@acm.org>
2119
2120 * parser.c (cp_parser_declaration): Avoid copying tokens.
2121 (cp_parser_block_declaration): RAII token pointer.
2122
21232020-07-15 Nathan Sidwell <nathan@acm.org>
2124
2125 * parser.c (cp_parser_skip_to_closing_parenthesis_1): Deal with
2126 meeting a deferred pragma.
2127 (cp_parser_skip_to_end_of_statement): Likewise.
2128 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
2129 (cp_parser_skip_to_pragma_eol): We should never meet EOF.
2130 (cp_parser_omp_declare_simd): Likewise.
2131 (cp_parser_omp_declare_reduction, cp_parser_oacc_routine)
2132 (pragma_lex): Likewise.
2133
8ca07a30
GA
21342020-07-14 Marek Polacek <polacek@redhat.com>
2135
2136 PR c++/95789
2137 PR c++/96104
2138 PR c++/96179
2139 * call.c (convert_like_real_1): Renamed from convert_like_real.
2140 (convert_like_real): New wrapper for convert_like_real_1.
2141
21422020-07-14 Nathan Sidwell <nathan@acm.org>
2143
2144 * parser.c (cp_lexer_alloc): Do not deal with PCH here.
2145 (cp_lexer_new_main): Deal with PCH here. Store the tokens directly
2146 into the buffer.
2147 (cp_lexer_new_from_tokens): Assert last token isn't purged either.
2148 (cp_lexer_get_preprocessor_token): Change first arg to flags, adjust.
2149 (cp_parser_new): Pass the lexer in, don't create it here.
2150 (cp_parser_translation_unit): Initialize access checks here.
2151 (cp_parser_initial_pragma): First token is provided by caller,
2152 don't deal with PCH stopping here. Adjust error message.
2153 (c_parse_file): Adjust, change error message to avoid C++20 module
2154 confusion.
2155
21562020-07-14 Nathan Sidwell <nathan@acm.org>
2157
2158 * ptree.c (cxx_print_type): Add TYPEOF_TYPE and BASES.
2159
21602020-07-14 Nathan Sidwell <nathan@acm.org>
2161
2162 * class.c (build_base_field_1): Cache CLASSTYPE_AS_BASE.
2163 (build_self_reference): Rename value -> decl.
2164 (dump_class_hierarchy_1): Cache CLASSTYPE_AS_BASE.
2165
21662020-07-14 Marek Polacek <polacek@redhat.com>
2167
2168 PR c++/95820
2169 * decl.c (grokdeclarator) <case cdk_function>: Check also
2170 pointers/references/... to functions.
2171
21722020-07-14 Nathan Sidwell <nathan@acm.org>
2173
2174 * cp-tree.h: Correct some tree lang flag comments,
2175 reformat some structure definitions. Note some structure
2176 sizes. Clarify some comments.
2177 (yyungetc): Delete. Not been a thing for some time.
2178 * class.c (copy_fndecl_with_name): Comment.
2179 (check_bases_and_members): Unnecessary {}.
2180 (layout_class_type): Comment.
2181 * cp-tree.def (UNBOUND_CLASS_TEMPLATE): Adjust comment.
2182 * decl.c: Fix some formatting & whitespace issues.
2183 (function_requirements_equivalent_p): Note why
2184 substitutions are needed.
2185 * decl2.c (no_linkage_error): Note that heroics about
2186 'typedef struct { ... };' are no longer needed.
2187 * method.c: Whitespace.
2188 * name-lookup.c: Whitespace.
2189 (add_decl_to_level): Reformat a line.
2190 (print_binding_stack): Mark as DEBUG_FUNCTION.
2191 (has_using_namespace_std_directive_p): Delete comment.
2192 * pt.c: Whitespace
2193 * ptree.c: Whitespace.
2194 * rtti.c: Whitespace & comment.
2195 * tree.c: Comment.
2196 * typeck.c (structural_comptypes): Add comment.
2197
ea69fcf9
GA
21982020-07-13 Nathan Sidwell <nathan@acm.org>
2199
2200 * Make-lang.in (c++.disclean): Likewise.
2201
22022020-07-13 Marek Polacek <polacek@redhat.com>
2203
2204 PR c++/96077
2205 * parser.c (cp_parser_enum_specifier): Commit to tentative parse
2206 after we've seen an opening brace.
2207
86536295
GA
22082020-07-10 Jason Merrill <jason@redhat.com>
2209
2210 * tree.c (structural_type_p): Allow unions.
2211 * mangle.c (write_expression): Express unions with a designator.
2212
22132020-07-10 Jason Merrill <jason@redhat.com>
2214
2215 * pt.c (convert_nontype_argument): Handle REAL_TYPE.
2216 (invalid_nontype_parm_type_p): Allow all structural types.
2217 * tree.c (structural_type_p): Use SCALAR_TYPE_P.
2218
22192020-07-10 Jason Merrill <jason@redhat.com>
2220
2221 PR c++/96105
2222 PR c++/96052
2223 PR c++/95976
2224 * class.c (check_field_decls): An array of empty classes is not an
2225 empty data member.
2226 (layout_empty_base_or_field): Handle explicit alignment.
2227 Fix union handling.
2228
3f8ca9cb
GA
22292020-07-09 Julian Brown <julian@codesourcery.com>
2230 Thomas Schwinge <thomas@codesourcery.com>
2231
2232 PR middle-end/95270
2233 * semantics.c (finish_omp_clauses): Likewise.
2234
22352020-07-09 Patrick Palka <ppalka@redhat.com>
2236
2237 PR c++/96132
2238 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
2239 Restore dependent_type_p check that guarded the call to
2240 is_really_empty_class.
2241
50873cc5
GA
22422020-07-08 Patrick Palka <ppalka@redhat.com>
2243
2244 PR c++/95497
2245 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
2246 When processing_template_decl, check COMPLETE_TYPE_P before
2247 calling is_really_empty_class. Don't check dependent_type_p.
2248
22492020-07-08 Marek Polacek <polacek@redhat.com>
2250
2251 PR c++/96103
2252 * parser.c (cp_parser_decltype): Print error about using decltype(auto)
2253 in C++11. Check that the token following "auto" is ")".
2254
f60ee68d
GA
22552020-07-07 Patrick Palka <ppalka@redhat.com>
2256
2257 PR c++/95303
2258 * cxx-pretty-print.c (pp_cxx_unqualified_id): Check
2259 PRIMARY_TEMPLATE_P before printing the innermost template
2260 arguments.
2261
22622020-07-07 Martin Sebor <msebor@redhat.com>
2263
2264 PR c++/96063
2265 * parser.c (class_decl_loc_t::diag_mismatched_tags): Print notes only
2266 if warning_at returns nonzero.
2267
4077d74c
GA
22682020-07-06 Martin Sebor <msebor@redhat.com>
2269
2270 PR c++/95984
2271 * call.c (build_over_call): Check calls only when tf_warning is set.
2272
22732020-07-06 Nathan Sidwell <nathan@acm.org>
2274
2275 * decl.c (push_library_fn): Return the decl pushdecl_toplevel returns.
2276 * except.c (verify_library_fn): Replace with ...
2277 (declare_library_fn_1): ... this fn. Always push the fn.
2278 (declare_library_fn): Call it.
2279 (build_throw): Call declare_library_fn_1.
2280
22812020-07-06 Jonathan Wakely <jwakely@redhat.com>
2282
2283 PR c++/96068
2284 * parser.c (cp_parser_toplevel_declaration): Only do pedwarn for
2285 empty-declaration in C++98.
2286
b5f24739
GA
22872020-07-02 Jason Merrill <jason@redhat.com>
2288 Jakub Jelinek <jakub@redhat.com>
2289
2290 * decl.c (grokfndecl): Allow consteval virtual.
2291 * search.c (check_final_overrider): Check consteval mismatch.
2292 * constexpr.c (cxx_eval_thunk_call): New.
2293 (cxx_eval_call_expression): Call it.
2294 * cvt.c (cp_get_fndecl_from_callee): Handle FDESC_EXPR.
2295 * decl2.c (mark_vtable_entries): Track vtables with consteval.
2296 (maybe_emit_vtables): Pass consteval_vtables through.
2297 (clear_consteval_vfns): Replace consteval with nullptr.
2298 (c_parse_final_cleanups): Call it.
2299
64f761e4
GA
23002020-07-01 Nathan Sidwell <nathan@acm.org>
2301
2302 * class.c (copy_fndecl_with_name): Add additional predicate args, do
2303 not deduce them locally.
2304 (copy_operator_fn): Adjust copy_fndecl_with_name call.
2305 (build_clone): Add vtt and inherited predicate args. Pass through
2306 to copy_fndecl_with_name call.
2307 (build_cdtor_clones): Likewise, pass through to build_clone as
2308 needed.
2309 (build_cdtor): Determine vtt and inherited here.
2310 * cp-tree.h (DECL_NEEDS_CTT_PARM_P): Delete.
2311
46fbb6c6
GA
23122020-06-30 Nathan Sidwell <nathan@acm.org>
2313
2314 * cp-tree.h (copy_fndecl_with_name): Rename to ...
2315 (copy_operatorn_fn): ... this. Change arg type.
2316 (clone_function_decl): Rename to ...
2317 (clone_cdtor): ... this.
2318 * class.c (copy_fndecl_with_name): Make static.
2319 (copy_operator_fn): New wrapper.
2320 (build_clones): Rename to ...
2321 (build_cdtor_clones): ... this.
2322 (clone_function_decl): Rename to ...
2323 (clone_cdtor): ... this. Adjust build_clones calls.
2324 (clone_constructors_and_destructors): Adjust clone_function_decl
2325 calls.
2326 * method.c (implicitly_declare_fn): Adjust copy_fndecl_with_name
2327 call.
2328 (lazily_declare_fn): Adjust clone_function_decl call.
2329 * pt.c (tsubst_function_decl): Likewise.
2330 (instantiate_template_1): Likewise.
2331
23322020-06-30 Iain Sandoe <iain@sandoe.co.uk>
2333
2334 * coroutines.cc (morph_fn_to_coro): Remove trailing
2335 space in a diagnostic.
2336
458f12ed
GA
23372020-06-30 Iain Sandoe <iain@sandoe.co.uk>
2338
2339 * coroutines.cc (expand_one_await_expression): Remove
2340 code dealing with initial suspend.
2341 (build_actor_fn): Remove code special-casing initial
2342 and final suspend. Handle the final suspend and marking
2343 of the coroutine as done.
2344 (coro_rewrite_function_body): New.
2345 (bind_expr_find_in_subtree): Remove.
2346 (coro_body_contains_bind_expr_p): Remove.
2347 (morph_fn_to_coro): Split the rewrite of the original
2348 function into coro_rewrite_function_body and call it.
2349
23502020-06-29 Marek Polacek <polacek@redhat.com>
2351
2352 PR c++/94553
2353 * decl.c (duplicate_decls): Make sure a concept or a variable
2354 template is unique in its declarative region.
2355
23562020-06-29 Marek Polacek <polacek@redhat.com>
2357
2358 PR c++/95568
2359 * pt.c (collect_ctor_idx_types): Use TREE_TYPE.
2360
69273534
GA
23612020-06-28 Iain Sandoe <iain@sandoe.co.uk>
2362
2363 PR c++/95711
2364 * coroutines.cc (register_local_var_uses): Skip past
2365 namespace decls.
2366
9a33c41f
GA
23672020-06-27 Iain Sandoe <iain@sandoe.co.uk>
2368
2369 PR c++/95736
2370 * coroutines.cc (get_awaitable_var): New helper.
2371 (build_co_await): Check more carefully before
2372 copying an awaitable.
2373 (expand_one_await_expression): No initializer
2374 is required when the awaitable is not a temp.
2375 (register_awaits): Remove handling that is now
2376 completed when the await expression is built.
2377
23782020-06-27 Iain Sandoe <iain@sandoe.co.uk>
2379
2380 * coroutines.cc (morph_fn_to_coro): Diagnose unavailable
2381 get_return_object_on_allocation_failure.
2382
c9c05f73
GA
23832020-06-26 Iain Sandoe <iain@sandoe.co.uk>
2384
2385 PR c++/95519
2386 * coroutines.cc (struct coroutine_info):Add a field
2387 to hold computed p.return_void expressions.
2388 (coro_build_promise_expression): New.
2389 (get_coroutine_return_void_expr): New.
2390 (finish_co_yield_expr): Build the promise expression
2391 using coro_build_promise_expression.
2392 (finish_co_return_stmt): Likewise.
2393 (build_init_or_final_await): Likewise.
2394 (morph_fn_to_coro): Likewise, for several cases.
2395
23962020-06-26 Iain Sandoe <iain@sandoe.co.uk>
2397
2398 * coroutines.cc (morph_fn_to_coro): Handle error
2399 returns in building g-r-o-o-a-f expressions.
2400
2e546c26
GA
24012020-06-24 Nicholas Krause <xerofoify@gmail.com>
2402
2403 PR c++/95672
2404 * typeck2.c (cxx_incomplete_type_diagnostic): Add missing
2405 TYPE_EXPANSION_PACK check for diagnosing incomplete types in
2406 cxx_incomplete_type_diagnostic.
2407
24082020-06-24 Iain Sandoe <iain@sandoe.co.uk>
2409
2410 PR c++/95518
2411 PR c++/95813
2412 * coroutines.cc (act_des_fn): Copy function
2413 attributes onto the outlined coroutine helpers.
2414
24152020-06-24 Jason Merrill <jason@redhat.com>
2416
2417 * call.c (build_over_call): Only call build_base_path once.
2418
24192020-06-24 Jason Merrill <jason@redhat.com>
2420
2421 PR c++/95719
2422 * call.c (build_over_call): Look up the overrider in base_binfo.
2423 * class.c (lookup_vfn_in_binfo): Look through BINFO_PRIMARY_P.
2424
4543acc8
GA
24252020-06-23 Jason Merrill <jason@redhat.com>
2426
2427 PR c++/93976
2428 Implement C++20 P2082R1, Fixing CTAD for aggregates.
2429 * cp-tree.h (TPARMS_PRIMARY_TEMPLATE): Split out from...
2430 (DECL_PRIMARY_TEMPLATE): ...here.
2431 (builtin_guide_p): Declare.
2432 * decl.c (reshape_init_class): Handle bases of a template.
2433 (reshape_init_r): An array with dependent bound takes a single
2434 initializer.
2435 * pt.c (tsubst_default_argument): Shortcut {}.
2436 (unify_pack_expansion): Allow omitted arguments to trailing pack.
2437 (builtin_guide_p): New.
2438 (collect_ctor_idx_types): Give a trailing pack a {} default
2439 argument. Handle arrays better.
2440
24412020-06-23 Iain Sandoe <iain@sandoe.co.uk>
2442
2443 PR c++/95477
2444 * coroutines.cc (morph_fn_to_coro): Apply a cleanup to
2445 the get return object when the DTOR is non-trivial.
2446
bbac3886
GA
24472020-06-20 Iain Sandoe <iain@sandoe.co.uk>
2448
2449 PR c++/95505
2450 * coroutines.cc (morph_fn_to_coro): Update handling of
2451 get-return-object-on-allocation-fail and diagnose missing
2452 std::nothrow.
2453
24542020-06-20 Jason Merrill <jason@redhat.com>
2455
2456 * call.c (joust): Only compare constraints for non-template
2457 candidates with matching parameters.
2458 * pt.c (tsubst_pack_expansion): Fix getting a type parameter
2459 pack.
2460 (more_specialized_fn): Only compare constraints for candidates with
2461 matching parameters.
2462
e37658df
GA
24632020-06-19 Jason Merrill <jason@redhat.com>
2464
2465 * method.c (early_check_defaulted_comparison): Allow defaulting
2466 comparison outside class. Complain if non-member operator isn't a
2467 friend.
2468
aae80e83
GA
24692020-06-18 Jason Merrill <jason@redhat.com>
2470
2471 * method.c (early_check_defaulted_comparison): Check for &&.
2472 (build_comparison_op): Allow empty union. Diagnose non-category
2473 type.
2474 (common_comparison_type): Remove handling for non-category type.
2475
24762020-06-18 Marek Polacek <polacek@redhat.com>
2477
2478 PR c++/95735
2479 * pt.c (finish_template_variable): Return if
2480 coerce_innermost_template_parms return error_mark_node.
2481
24822020-06-18 Marek Polacek <polacek@redhat.com>
2483
2484 PR c++/95728
2485 * pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
2486 if placement is erroneous.
2487
aff95ee7
GA
24882020-06-17 Jonathan Wakely <jwakely@redhat.com>
2489
2490 PR c++/66159
2491 * parser.c (cp_parser_elaborated_type_specifier): Do not warn
2492 unless in a declaration.
2493
24942020-06-17 Jason Merrill <jason@redhat.com>
2495
2496 * cp-tree.h (copy_fndecl_with_name): Declare.
2497 * class.c (copy_fndecl_with_name): Split out from...
2498 (build_clone): ...here.
2499 (add_implicitly_declared_members): Add op== to TYPE_FIELDS.
2500 * method.c (implicitly_declare_fn): Use copy_fndecl_with_name.
2501
25022020-06-17 Jason Merrill <jason@redhat.com>
2503
2504 * call.c (build_new_op_1): Don't look for a CALL_EXPR when
2505 calling a consteval function.
2506
25072020-06-17 Jason Merrill <jason@redhat.com>
2508
2509 * decl2.c (grokfield): Pass SD_DEFAULTED and SD_DELETED.
2510 * decl.c (duplicate_decls): Reduce error for delete
2511 after earlier declaration to pedwarn.
2512
25132020-06-17 Marek Polacek <polacek@redhat.com>
2514
2515 PR c++/95508
2516 * constexpr.c (maybe_fold_non_dependent_expr): New.
2517 * cp-tree.h (maybe_fold_non_dependent_expr): Declare.
2518 * typeck.c (cp_build_array_ref): Call maybe_fold_non_dependent_expr
2519 instead of maybe_constant_value.
2520
56638b9b
GA
25212020-06-16 Marek Polacek <polacek@redhat.com>
2522
2523 PR c++/95369
2524 * call.c (add_list_candidates): Return if a designated initializer
2525 is used with a non-aggregate.
2526 (implicit_conversion_error): Give an error for the case above.
2527
25282020-06-16 Marek Polacek <polacek@redhat.com>
2529
2530 PR c++/95560
2531 * name-lookup.c (check_local_shadow): Check if types are
2532 non-null before calling same_type_p.
2533
25342020-06-16 Jakub Jelinek <jakub@redhat.com>
2535
2536 * semantics.c (handle_omp_for_class_iterator): Adjust
2537 c_omp_check_loop_iv_exprs caller.
2538 (finish_omp_for): Likewise. Don't call fold_build_cleanup_point_expr
2539 before calling c_finish_omp_for and c_omp_check_loop_iv, move it
2540 after those calls.
2541 * pt.c (tsubst_omp_for_iterator): Handle non-rectangular loops.
2542
25432020-06-16 Jakub Jelinek <jakub@redhat.com>
2544
2545 * parser.c (cp_parser_omp_clause_schedule): Reject modifier separated
2546 from kind by comma rather than colon.
2547
25482020-06-16 Patrick Palka <ppalka@redhat.com>
2549
2550 * pt.c (perform_instantiation_time_access_checks): No need to
2551 tsubst into decl.
2552 * semantics.c (enforce_access): Verify that decl is not
2553 dependent.
2554
25552020-06-16 Patrick Palka <ppalka@redhat.com>
2556
2557 PR c++/41437
2558 PR c++/47346
2559 * cp-tree.h (qualified_typedef_usage_s): Delete.
2560 (qualified_typedef_usage_t): Delete.
2561 (deferred_access_check): Move up in file.
2562 (tree_template_info::typedefs_needing_access_checking): Delete.
2563 (tree_template_info::deferred_access_checks): New field.
2564 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): Rename to ...
2565 (TI_DEFERRED_ACCESS_CHECKS): ... this, and adjust accordingly.
2566 * pt.c (perform_typedefs_access_check): Rename to ...
2567 (perform_instantiation_time_access_checks): ... this, and adjust
2568 accordingly. Remove unnecessary tree tests.
2569 (instantiate_class_template_1): Adjust accordingly.
2570 (instantiate_decl): Likewise.
2571 * semantics.c (enforce_access): Likewise.
2572
25732020-06-16 Patrick Palka <ppalka@redhat.com>
2574
2575 PR c++/41437
2576 PR c++/47346
2577 * call.c (enforce_access): Move to semantics.c.
2578 * cp-tree.h (enforce_access): Delete.
2579 (get_types_needing_access_check): Delete.
2580 (add_typedef_to_current_template_for_access_check): Delete.
2581 * decl.c (make_typename_type): Adjust accordingly. Use
2582 check_accessibility_of_qualified_id instead of directly using
2583 perform_or_defer_access_check.
2584 * parser.c (cp_parser_template_declaration_after_parameters):
2585 Don't push a dk_no_check access state when parsing a template.
2586 * pt.c (get_types_needing_access_check): Delete.
2587 (append_type_to_template_for_access_check_1): Delete.
2588 (perform_typedefs_access_check): Adjust. If type_decl is a
2589 FIELD_DECL, also check its DECL_CONTEXT for dependence. Use
2590 tsubst_copy instead of tsubst to substitute into type_decl so
2591 that we substitute into the DECL_CONTEXT of a FIELD_DECL.
2592 (append_type_to_template_for_access_check): Delete.
2593 * search.c (accessible_p): Remove the processing_template_decl
2594 early exit.
2595 * semantics.c (enforce_access): Moved from call.c. If we're
2596 parsing a template and the access check failed, add the check to
2597 TI_TYPEDEFS_NEEDING_ACCESS_CHECKING.
2598 (perform_or_defer_access_check): Adjust comment.
2599 (add_typedef_to_current_template_for_access_check): Delete.
2600 (check_accessibility_of_qualified_id): Adjust accordingly.
2601 Exit early if the scope is dependent.
2602
e68e80c8
GA
26032020-06-11 Patrick Palka <ppalka@redhat.com>
2604
2605 PR c++/93467
2606 * constraint.cc (associate_classtype_constraints): If there is a
2607 discrepancy between the current template depth and the template
2608 depth of the original declaration, then adjust the template
2609 parameter depth within the current constraints appropriately.
2610 * pt.c (tsubst_friend_class): Substitute into and set the
2611 constraints on the injected declaration.
2612
26132020-06-11 Iain Sandoe <iain@sandoe.co.uk>
2614
2615 * coroutines.cc (instantiate_coro_traits): Pass a reference
2616 to lambda closure objects to traits instantiation.
2617 (morph_fn_to_coro): Likewise for promise parameter
2618 preview and allocator lookup.
2619
ec6ffbb9
GA
26202020-06-10 Iain Sandoe <iain@sandoe.co.uk>
2621
2622 PR c++/95440
2623 * call.c (add_candidates): Use vec_safe_length() for
2624 testing the arguments list.
2625 (build_new_method_call_1): Use vec_safe_is_empty() when
2626 checking for an empty args list.
2627
26282020-06-10 Marek Polacek <polacek@redhat.com>
2629
2630 PR c++/95562
2631 * parser.c (cp_parser_direct_declarator): Clear
2632 CP_PARSER_FLAGS_DELAY_NOEXCEPT if the declarator kind is not
2633 cdk_id.
2634
b952c2cf
GA
26352020-06-09 Iain Sandoe <iain@sandoe.co.uk>
2636
2637 PR c++/95137
2638 * coroutines.cc (expand_one_await_expression): Build separate
2639 DTOR trees for the awaitable object on the destroy and resume
2640 paths.
2641
26422020-06-09 Jason Merrill <jason@redhat.com>
2643
2644 PR c++/95552
2645 * cp-gimplify.c (predeclare_vla): Only predeclare a VLA if it's
2646 wrapped in a pointer type.
2647
1a59f3db
GA
26482020-06-05 Marek Polacek <polacek@redhat.com>
2649
2650 PR c++/95369
2651 * call.c (build_converted_constant_expr_internal): Allow
2652 list-initialization.
2653
26542020-06-05 Iain Sandoe <iain@sandoe.co.uk>
2655
2656 * cp-tree.def (CO_RETURN_EXPR): Correct the class
2657 to use tcc_statement.
2658
26592020-06-05 Jason Merrill <jason@redhat.com>
2660
2661 * error.c (dump_binary_op): Handle negative operand to
2662 POINTER_PLUS_EXPR.
2663
3add3425
GA
26642020-06-04 Jason Merrill <jason@redhat.com>
2665
2666 PR c++/93310
2667 * constexpr.c (cxx_eval_constant_expression) [OBJ_TYPE_REF]:
2668 Evaluate OBJ_TYPE_REF_EXPR.
2669
26702020-06-04 Jason Merrill <jason@redhat.com>
2671
2672 PR c++/95158
2673 * class.c (lookup_vfn_in_binfo): New.
2674 * call.c (build_over_call): Use it.
2675 * cp-tree.h (resolves_to_fixed_type_p): Add default argument.
2676 (lookup_vfn_in_binfo): Declare.
2677
26782020-06-04 Iain Sandoe <iain@sandoe.co.uk>
2679
2680 PR c++/95346
2681 * coroutines.cc (morph_fn_to_coro): Ensure that the get-
2682 return-object is constructed correctly; When it is not the
2683 final return value, pass it to the CTOR of the return type
2684 as an rvalue, per the standard comment.
2685
26862020-06-04 Jakub Jelinek <jakub@redhat.com>
2687
2688 PR c++/82304
2689 PR c++/95307
2690 * constexpr.c (cxx_eval_constant_expression): Diagnose CONVERT_EXPR
2691 conversions from pointer types to arithmetic types here...
2692 (cxx_eval_outermost_constant_expr): ... instead of here.
2693
9a5b7438
GA
26942020-06-03 Mark Wielaard <mark@klomp.org>
2695
2696 * parser.c (cp_lexer_safe_previous_token): New function.
2697 (cp_parser_error_1): Add name_hint if the previous token is
2698 a string literal and next token is a CPP_NAME and we have a
2699 missing header suggestion for the name.
2700
27012020-06-03 Patrick Palka <ppalka@redhat.com>
2702
2703 * pt.c (process_partial_specialization): Pass the full set of
2704 generic template arguments to strictly_subsumes.
2705
27062020-06-03 Patrick Palka <ppalka@redhat.com>
2707
2708 PR c++/92103
2709 * pt.c (most_specialized_partial_spec): Reorganize the loop over
2710 DECL_TEMPLATE_SPECIALIZATIONS. Check constraints_satisfied_p on
2711 the original template declaration, not on the tsubsted one.
2712
27132020-06-03 Iain Sandoe <iain@sandoe.co.uk>
2714
2715 PR c++/95345
2716 * coroutines.cc (finish_co_await_expr): Revise to allow for
2717 parameter packs.
2718 (finish_co_yield_expr): Likewise.
2719
27202020-06-03 Jason Merrill <jason@redhat.com>
2721
2722 PR c++/95232
2723 * cp-tree.h (predeclare_vla): Declare.
2724 * cp-gimplify.c (predeclare_vla): Handle getting a decl.
2725 * pt.c (tsubst_expr) [DECL_EXPR]: Use it.
2726
27272020-06-03 Tobias Burnus <tobias@codesourcery.com>
2728
2729 * cp-gimplify.c (cxx_omp_predetermined_mapping): New.
2730 * cp-objcp-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redfine.
2731 * cp-tree.h (cxx_omp_predetermined_mapping): Declare.
2732
a9312a79
GA
27332020-06-02 Jason Merrill <jason@redhat.com>
2734
2735 PR c++/95193
2736 * pt.c (tsubst_decl): Relax assert.
2737
27382020-06-02 Iain Sandoe <iain@sandoe.co.uk>
2739
2740 PR c++/95050
2741 * coroutines.cc (build_co_await): Wrap the co_await expression
2742 in a TARGET_EXPR, where needed.
2743 (finish_co_yield_expr): Likewise.
2744
27452020-06-02 Patrick Palka <ppalka@redhat.com>
2746
2747 PR c++/92633
2748 PR c++/92838
2749 * pt.c (tsubst_function_decl): Don't do set_constraints when
2750 regenerating a lambda.
2751 (tsubst_lambda_expr): Substitute into the lambda's constraints
2752 and do set_constraints here.
2753
4a9aa9de
GA
27542020-06-01 Jason Merrill <jason@redhat.com>
2755
2756 PR c++/95466
2757 PR c++/95311
2758 PR c++/95221
2759 * class.c (build_vfn_ref): Revert 95311 change.
2760 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): Build a
2761 COMPOUND_EXPR.
2762
27632020-06-01 Iain Sandoe <iain@sandoe.co.uk>
2764
2765 PR c++/95350
2766 * coroutines.cc (struct param_info): Remove rv_ref field.
2767 (build_actor_fn): Remove specifial rvalue ref handling.
2768 (morph_fn_to_coro): Likewise.
2769
e7340ed7
GA
27702020-05-31 Iain Sandoe <iain@sandoe.co.uk>
2771
2772 PR c++/95087
2773 * coroutines.cc (morph_fn_to_coro): If we see an
2774 early fatal error, drop the erroneous function body.
2775
27762020-05-31 Iain Sandoe <iain@sandoe.co.uk>
2777
2778 * coroutines.cc (build_co_await): Remove unused
2779 variable.
2780 (finish_co_await_expr): Likewise.
2781 (finish_co_yield_expr): Likewise; revise comment.
2782
945b53cc
GA
27832020-05-30 Iain Sandoe <iain@sandoe.co.uk>
2784
2785 * coroutines.cc (morph_fn_to_coro): Revise initialization
2786 of the frame pointer to avoid an unused value.
2787
27882020-05-30 Patrick Palka <ppalka@redhat.com>
2789
2790 PR c++/95386
2791 * constraint.cc (satisfaction_value): Accept INTEGER_CST of any
2792 boolean type.
2793
885ef72f
GA
27942020-05-29 Patrick Palka <ppalka@redhat.com>
2795 Jason Merrill <jason@redhat.com>
2796
2797 PR c++/95181
2798 * class.c (add_method): Let special member function templates
2799 coexist if they are not equivalently constrained, or in a class
2800 template.
2801
28022020-05-29 Jason Merrill <jason@redhat.com>
2803
2804 PR c++/95371
2805 * pt.c (process_template_parm): Set DECL_TEMPLATE_INFO
2806 on the DECL_TEMPLATE_RESULT.
2807
28082020-05-29 Marek Polacek <polacek@redhat.com>
2809
2810 PR c++/95344
2811 * cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set
2812 TREE_THIS_VOLATILE here.
2813 (cp_fold): Set it here along with TREE_NO_WARNING.
2814
28152020-05-29 Jason Merrill <jason@redhat.com>
2816
2817 PR c++/95311
2818 PR c++/95221
2819 * class.c (build_vfn_ref): Don't fold the INDIRECT_REF.
2820
28212020-05-29 Patrick Palka <ppalka@redhat.com>
2822
2823 PR c++/92652
2824 PR c++/93698
2825 PR c++/94128
2826 * parser.c (cp_parser_requires_clause_expression): Temporarily
2827 increment processing_template_decl only if it is 0.
2828 (cp_parser_constraint_expression): Likewise.
2829 (cp_parser_requires_expression): Likewise.
2830
28312020-05-29 Patrick Palka <ppalka@redhat.com>
2832
2833 PR c++/95241
2834 * constexpr.c (get_or_insert_ctor_field): Add limited support
2835 for RANGE_EXPR index lookups.
2836
53ffb43a
GA
28372020-05-28 Jakub Jelinek <jakub@redhat.com>
2838
2839 PR c++/95328
2840 * decl.c (cp_finish_decomp): Call complete_type before checking
2841 COMPLETE_TYPE_P.
2842
28432020-05-28 Jason Merrill <jason@redhat.com>
2844
2845 PR c++/94926
2846 * decl.c (cp_finish_decl): Revert r9-297 change.
2847 (check_static_variable_definition): Likewise.
2848 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
2849 * pt.c (instantiate_decl): Return early on type error.
2850
61f3b605
GA
28512020-05-27 Jason Merrill <jason@redhat.com>
2852
2853 PR c++/95319
2854 * decl.c (reshape_init_array_1): Don't reuse in overload context.
2855
28562020-05-27 Jason Merrill <jason@redhat.com>
2857
931fdcc5 2858 PR c++/95242
61f3b605
GA
2859 * call.c (build_new_op_1): Suppress
2860 warn_zero_as_null_pointer_constant across comparison of <=> result
2861 to 0.
2862
28632020-05-27 Jason Merrill <jason@redhat.com>
2864
2865 PR c++/95222
2866 * decl.c (grokdeclarator): Don't shift attributes in TYPENAME
2867 context.
2868
28692020-05-27 Nathan Sidwell <nathan@acm.org>
2870
2871 PR c++/95263
2872 * pt.c (lookup_template_class_1): Restore alias template mutation.
2873
c3a4169b
GA
28742020-05-26 Jakub Jelinek <jakub@redhat.com>
2875
2876 PR c++/95197
2877 * cp-gimplify.c: Include omp-general.h.
2878 (cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration
2879 variables in composite distribute parallel for, instantiate copy
2880 ctor of their types.
2881
6d1556ec
PP
28822020-05-23 Patrick Palka <ppalka@redhat.com>
2883
2884 PR c++/94038
2885 * constexpr.c (cxx_eval_constant_expression)
2886 <case TEMPLATE_ID_EXPR>: Don't evaluate the concept when
2887 constexpr evaluation is uid-sensitive.
2888
931fdcc5
JM
28892020-05-22 Jason Merrill <jason@redhat.com>
2890
2891 * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Don't preevaluate
2892 the function address if the call used operator syntax.
2893
28942020-05-21 Jason Merrill <jason@redhat.com>
2895
2896 PR c++/95221
2897 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): For a virtual
2898 call, instrument the OBJ_TYPE_REF.
2899
2900 * decl.c (compute_array_index_type_loc): Diagnose expressions
2901 in a template that can't be constant.
2902 * parser.c (cp_parser_direct_declarator): Don't check
2903 non-constant array bounds here.
2904
2905 * cp-tree.h (is_rvalue_constant_expression): Declare.
2906 * constexpr.c (is_rvalue_constant_expression): New.
2907 * parser.c (cp_parser_constant_expression): Use it.
2908 * decl.c (cp_finish_decl): Try to treat a constexpr initializer in a
2909 template as constant.
2910
2911 * typeck.c (build_x_modify_expr): Handle error_mark_node arguments.
2912
2913 * decl.c (grokparms): Return NULL_TREE if any parms were erroneous.
2914
29152020-05-21 Iain Sandoe <iain@sandoe.co.uk>
2916
2917 * coroutines.cc (finish_co_return_stmt): Revert change to use
2918 finish_expr_stmt.
2919
f65a3299
PP
29202020-05-21 Patrick Palka <ppalka@redhat.com>
2921
2922 PR c++/94038
2923 * constexpr.c (constexpr_ctx::uid_sensitive): Remove field.
2924 (uid_sensitive_constexpr_evaluation_value): Define.
2925 (uid_sensitive_constexpr_evaluation_true_counter): Define.
2926 (uid_sensitive_constexpr_evaluation_p): Define.
2927 (uid_sensitive_constexpr_evaluation_sentinel): Define its
2928 constructor.
2929 (uid_sensitive_constexpr_evaluation_checker): Define its
2930 constructor and its evaluation_restricted_p method.
2931 (get_fundef_copy): Remove 'ctx' parameter. Use u_s_c_e_p
2932 instead of constexpr_ctx::uid_sensitive.
2933 (cxx_eval_call_expression): Use u_s_c_e_p instead, and test it
2934 last. Adjust call to get_fundef_copy.
2935 (instantiate_cx_fn_r): Test u_s_c_e_p so that we increment the
2936 counter if necessary.
2937 (cxx_eval_outermost_constant_expr): Remove 'uid_sensitive'
2938 parameter. Adjust function body accordingly.
2939 (maybe_constant_value): Remove 'uid_sensitive' parameter and
2940 adjust function body accordingly. Set up a
2941 uid_sensitive_constexpr_evaluation_checker, and use it to
2942 conditionally update the cv_cache.
2943 * cp-gimplify.c (cp_fold): Set up a
2944 uid_sensitive_constexpr_evaluation_checker, and use it to
2945 conditionally update the fold_cache.
2946 * cp-tree.h (maybe_constant_value): Update declaration.
2947 (struct uid_sensitive_constexpr_evaluation_sentinel): Define.
2948 (struct sensitive_constexpr_evaluation_checker): Define.
2949 * expr.c (fold_for_warn): Set up a
2950 uid_sensitive_constexpr_evaluation_sentinel before calling
2951 the folding subroutines. Drop all but the first argument to
2952 maybe_constant_value.
2953
4b38d56d
MP
29542020-05-20 Marek Polacek <polacek@redhat.com>
2955
2956 DR 2237
2957 * parser.c (cp_parser_unqualified_id): Reject simple-template-id as
2958 the declarator-id of a destructor.
2959 (cp_parser_constructor_declarator_p): Reject simple-template-id as
2960 the declarator-id of a constructor.
2961
2a8565fa
MP
29622020-05-20 Marek Polacek <polacek@redhat.com>
2963
2964 DR 2289
2965 PR c++/94553
2966 * cp-tree.h (SD_DECOMPOSITION): New flag.
2967 * decl.c (duplicate_decls): Make sure a structured binding is unique
2968 in its declarative region.
2969 (start_decl): If INITIALIZED is SD_DECOMPOSITION, call
2970 fit_decomposition_lang_decl.
2971 (grokdeclarator): Compare INITIALIZED directly to SD_* flags.
2972 * parser.c (cp_parser_decomposition_declaration): Pass SD_DECOMPOSITION
2973 to start_decl.
2974
610ae2db
PP
29752020-05-20 Patrick Palka <ppalka@redhat.com>
2976
2977 PR c++/95223
2978 * typeck.c (structural_comptypes): Don't perform
2979 context-dependent resolution of TYPENAME_TYPEs when
2980 comparing_specializations.
2981
74744bb1
NS
29822020-05-19 Nathan Sidwell <nathan@acm.org>
2983
2984 * pt.c (lookup_template_class_1): Do not reinit template_info of an
2985 alias here.
2986
c0d8623c
MS
29872020-05-18 Martin Sebor <msebor@redhat.com>
2988
2989 PR c++/94923
2990 * call.c ((maybe_warn_class_memaccess): Use is_byte_access_type.
2991 * cp-tree.h (is_dummy_object): Return bool.
2992 (is_byte_access_type): Declare new function.
2993 * tree.c (is_dummy_object): Return bool.
2994 (is_byte_access_type): Define new function.
2995
864fed4a
PP
29962020-05-19 Patrick Palka <ppalka@redhat.com>
2997
573e5f05
PP
2998 PR c++/87847
2999 * pt.c (init_template_processing): Enable sanitization for
3000 decl_specializations and type_specializations.
3001
864fed4a
PP
3002 PR c++/66439
3003 * pt.c (fn_type_unification): Pass 'fn' instead of NULL_TREE as
3004 the 'in_decl' parameter to coerce_template_parms.
3005
2d4e1e14
MP
30062020-05-18 Marek Polacek <polacek@redhat.com>
3007
3008 PR c++/94955
3009 * typeck.c (cp_build_binary_op): Use fold_for_warn instead of
3010 cp_fold_rvalue.
3011
bf732686
MP
30122020-05-18 Marek Polacek <polacek@redhat.com>
3013
3014 PR c++/94937
3015 * cvt.c (cp_get_fndecl_from_callee): Return NULL_TREE if the function
3016 type is not INDIRECT_TYPE_P.
3017 * decl.c (omp_declare_variant_finalize_one): Call
3018 cp_get_callee_fndecl_nofold instead of looking for the function decl
3019 manually.
3020
5d2246a3
MP
30212020-05-18 Marek Polacek <polacek@redhat.com>
3022
3023 PR c++/90915
3024 * parser.c (cp_parser_has_attribute_expression): Sorry on a
3025 type-dependent argument.
3026
ae8ed736
MP
30272020-05-18 Marek Polacek <polacek@redhat.com>
3028
3029 DR 1512
3030 PR c++/87699
3031 * call.c (add_builtin_candidate) <case EQ_EXPR>: Create candidate
3032 operator functions when type is std::nullptr_t for ==/!=.
3033 * typeck.c (composite_pointer_type_r): Add a bool * parameter. Use it
3034 to maybe add "const" to the pointer type.
3035 (composite_pointer_type): Update the call to composite_pointer_type_r.
3036 (cp_build_binary_op): Turn two warning_at into error_at. Print the
3037 types.
3038
29579071
JM
30392020-05-18 Jason Merrill <jason@redhat.com>
3040
3041 * call.c (build_over_call): Remove unnecessary
3042 cp_stabilize_reference.
3043
100fdb1f
MP
30442020-05-18 Marek Polacek <polacek@redhat.com>
3045
3046 * call.c (add_builtin_candidate): Don't create a builtin overload
3047 candidate for ++ when type is bool in C++17.
3048
30492020-05-18 Marek Polacek <polacek@redhat.com>
642dc602
MP
3050
3051 * cfns.h: Regenerated.
3052
2b9a271b
IS
30532020-05-17 Iain Sandoe <iain@sandoe.co.uk>
3054
3055 * coroutines.cc (morph_fn_to_coro): Initialize the gro variable.
3056
5ef067eb
IS
30572020-05-16 Iain Sandoe <iain@sandoe.co.uk>
3058
3059 * coroutines.cc (finish_co_return_stmt): Implement rules
3060 from [class.copy.elision] /3.
3061
115232b7
PP
30622020-05-16 Patrick Palka <ppalka@redhat.com>
3063
3064 PR c++/57943
3065 * semantics.c (finish_decltype_type): Call
3066 instantiate_non_dependent_expr_sfinae on the expression.
3067
289fbbe7
PP
30682020-05-15 Patrick Palka <ppalka@redhat.com>
3069
3070 Revert:
3071
3072 2020-04-07 Patrick Palka <ppalka@redhat.com>
3073
3074 PR c++/90996
3075 * typeck2.c (process_init_constructor_array): Propagate
3076 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
3077 the array initializer.
3078
cda6396a
JM
30792020-05-15 Jason Merrill <jason@redhat.com>
3080
3081 PR c++/93286 - ICE with __is_constructible and variadic template.
3082 * pt.c (tsubst_tree_list): New.
3083 (tsubst, tsubst_copy_and_build): Use it.
3084 * decl2.c (is_late_template_attribute): Handle error_mark_node args.
3085
271e3da8
NS
30862020-05-15 Nathan Sidwell <nathan@acm.org>
3087
3088 * pt.c (template_args_equal): Fix thinkos in previous 'cleanup'.
3089
4e1592f8
JM
30902020-05-14 Jason Merrill <jason@redhat.com>
3091
3092 PR c++/93901
3093 * pt.c (maybe_instantiate_noexcept): Change clone handling.
3094
098cf31a
PP
30952020-05-14 Patrick Palka <ppalka@redhat.com>
3096
3097 PR c++/78446
3098 * call.c (build_op_call): Pass complain to lookup_fnfields.
3099 (build_special_member_call): Likewise.
3100 * class.c (type_requires_array_cookie): Pass tf_warning_or_error
3101 to lookup_fnfields.
3102 * cp-tree.h (lookup_fnfields): Add tsubst_flags_t parameter.
3103 * except.c (build_throw): Pass tf_warning_or_error to
3104 lookup_fnfields.
3105 * init.c (build_new_1): Pass complain to lookup_fnfields.
3106 * method.c (locate_fn_flags): Likewise.
3107 * name-lookup.c (lookup_name_real_1): Pass tf_warning_or_error
3108 to lookup_fnfields.
3109 * pt.c (tsubst_baselink): Pass complain to lookup_fnfields.
3110 * search.c (lookup_fnfields): New 'complain' parameter. Pass it
3111 to lookup_member.
3112
c4bff4c2
NS
31132020-05-14 Nathan Sidwell <nathan@acm.org>
3114
68f1d74f
NS
3115 * parser.c (cp_parser_diagnose_invalid_typename): Mention
3116 std=c++20 not 2a, reformat dependent binfo inform loops.
3117
f497e36a
NS
3118 * pt.c (tsubst_template_decl): Reorder and commonize some control
3119 paths.
3120
ddbaab13
NS
3121 * pt.c (tsubst_friend_function): Simplify control flow.
3122
ea5a33d4
NS
3123 * pt.c (lookup_template_class_1): Remove unnecessary else by
3124 simply grabbing TYPE_NAME earlier.
3125
5adbd090
NS
3126 * pt.c (push_template_decl_real): Adjust friend pushing logic.
3127 Reinit template type.
3128
c4bff4c2
NS
3129 * pt.c (build_template_decl): Init DECL_TEMPLATE_RESULT &
3130 TREE_TYPE here ...
3131 (process_partial_specialization): ... not here ...
3132 (push_template_decl_real, add_inherited_template_parms)
3133 (build_deduction_guide): ... or here.
3134
49ddde69
JJ
31352020-05-14 Jakub Jelinek <jakub@redhat.com>
3136
3137 * cp-gimplify.c (cp_genericize_r): Set cfun->has_omp_target.
3138
4924293a
PP
31392020-05-13 Patrick Palka <ppalka@redhat.com>
3140
3141 PR c++/79706
3142 * init.c (build_vec_delete_1): Just return error_mark_node if
3143 deallocate_expr is error_mark_node.
3144 (build_delete): Just return error_mark_node if do_delete is
3145 error_mark_node.
3146
7e52f8b1
PP
31472020-05-13 Patrick Palka <ppalka@redhat.com>
3148
3149 PR c++/95020
e12516e1 3150 * constraint.cc (tsubst_requires_expr): Produce a new
7e52f8b1
PP
3151 requires-expression when processing_template_decl, even if
3152 template arguments are not dependent.
3153
661232da
MP
31542020-05-13 Marek Polacek <polacek@redhat.com>
3155
3156 PR c++/95066
3157 * decl.c (duplicate_decls): Set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
3158
7e6a72cb
NS
31592020-05-13 Nathan Sidwell <nathan@acm.org>
3160
7040894c
NS
3161 * pt.c (template_args_equal): Reorder category checking for
3162 clarity.
3163
2bb30de6
NS
3164 * pt.c (perform_typedefs_access_check): Cache expensively
3165 calculated object references.
3166 (check_auto_in_tmpl_args): Just assert we do not get unexpected
3167 nodes, rather than silently do nothing.
3168 (append_type_to_template_for_access): Likewise, cache expensie
3169 object reference.
3170
833c7b4b
NS
3171 * pt.c (canonical_type_parameter): Simplify.
3172
7e6a72cb
NS
3173 Formatting fixups & some simplifications.
3174 * pt.c (spec_hash_table): New typedef.
3175 (decl_specializations, type_specializations): Use it.
3176 (retrieve_specialization): Likewise.
3177 (register_specialization): Remove unnecessary casts.
3178 (push_template_decl_real): Reformat.
3179 (instantiate_class_template_1): Use more RAII.
3180 (make_argument_pack): Simplify.
3181 (instantiate_template_1): Use gcc_checking_assert for expensive
3182 asserts.
3183 (instantiate_decl): Likewise.
3184 (resolve_typename_type): Reformat comment.
3185 * semantics.c (struct deferred_access): Remove unnecessary GTY on
3186 member.
3187 (begin_class_definition): Fix formatting.
3188
b04445d4
JM
31892020-05-13 Jason Merrill <jason@redhat.com>
3190
3191 * call.c, class.c, constexpr.c, constraint.cc, decl.c, init.c,
3192 lambda.c, lex.c, method.c, name-lookup.c, parser.c, pt.c, tree.c,
3193 typeck2.c: Change cxx2a to cxx20.
3194
90b160f8
MP
31952020-05-12 Marek Polacek <polacek@redhat.com>
3196
3197 PR c++/95074
3198 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: When
3199 looking for a block-scope function declaration, look through the whole
3200 set, not just the first function in the overload set.
3201
99b0c9ec
JJ
32022020-05-12 Jakub Jelinek <jakub@redhat.com>
3203
3204 PR c++/95063
3205 * pt.c (tsubst_decl): Deal with DECL_OMP_PRIVATIZED_MEMBER for
3206 a bit-field.
3207
52c5933f
JM
32082020-05-11 Jason Merrill <jason@redhat.com>
3209
3210 Resolve C++20 NB comment CA104
3211 * pt.c (determine_specialization): Compare constraints for
3212 specialization of member template of class instantiation.
3213
0f50f6da
JM
32142020-05-11 Jason Merrill <jason@redhat.com>
3215
3216 PR c++/92583
3217 PR c++/92654
3218 * tree.c (cp_walk_subtrees): Stop at typedefs.
3219 Handle TYPENAME_TYPE here.
3220 * pt.c (find_parameter_packs_r): Not here.
3221 (for_each_template_parm_r): Clear *walk_subtrees.
3222 * decl2.c (min_vis_r): Look through typedefs.
3223
42e9f80b
JM
32242020-05-11 Jason Merrill <jason@redhat.com>
3225
3226 * call.c (implicit_conversion_error): Split out from...
3227 (perform_implicit_conversion_flags): ...here.
3228 (build_converted_constant_expr_internal): Use it.
3229
f981395c
JM
32302020-05-11 Jason Merrill <jason@redhat.com>
3231
3232 PR c++/90748
3233 * parser.c (inject_parm_decls): Set current_class_ptr here.
3234 (cp_parser_direct_declarator): And here.
3235 (cp_parser_late_return_type_opt): Not here.
3236 (cp_parser_noexcept_specification_opt): Nor here.
3237 (cp_parser_exception_specification_opt)
3238 (cp_parser_late_noexcept_specifier): Remove unneeded parameters.
3239
aa2c9784
JM
32402020-05-11 Jason Merrill <jason@redhat.com>
3241
3242 * decl.c (cxx_init_decl_processing): Call declare_weak for
3243 __cxa_pure_virtual.
3244
e5ccab83
JM
32452020-05-11 Jason Merrill <jason@redhat.com>
3246
3247 * pt.c (instantiate_class_template_1): Call tsubst_expr for
3248 STATIC_ASSERT member.
3249 * ptree.c (cxx_print_xnode): Handle STATIC_ASSERT.
3250
f3f9cc41
JM
32512020-05-11 Jason Merrill <jason@redhat.com>
3252
3253 * pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Remove redundant
3254 walking of capture list.
3255
08434b02
JM
32562020-05-11 Jason Merrill <jason@redhat.com>
3257
3258 * cp-tree.h (LOOKUP_EXPLICIT_TMPL_ARGS): Remove.
3259 * call.c (build_new_function_call): Don't set it.
3260 (build_new_method_call_1): Likewise.
3261 (build_over_call): Check cand->explicit_targs instead.
3262
f315d147
JM
32632020-05-11 Jason Merrill <jason@redhat.com>
3264
3265 * decl.c (compute_array_index_type_loc): Stabilize before building
3266 the MINUS_EXPR.
3267
3a3e1ea9
JM
32682020-05-11 Jason Merrill <jason@redhat.com>
3269
3270 * decl.c (grokdeclarator): Adjust deprecated_state here.
3271 (start_decl): Not here.
3272
234681ea
IS
32732020-05-08 Iain Sandoe <iain@sandoe.co.uk>
3274
3275 PR c++/95003
3276 * coroutines.cc (build_actor_fn): Ensure that bind scopes
3277 are marked as having side-effects where necessary.
3278 (replace_statement_captures): Likewise.
3279 (morph_fn_to_coro): Likewise.
3280
debfaee5
NS
32812020-05-08 Nathan Sidwell <nathan@acm.org>
3282
810a2bd8
NS
3283 * NEWS: Delete, it is so stale.
3284
debfaee5
NS
3285 * parser.c (cp_lexer_set_source_position_from_token): EOF has a
3286 location too.
3287
c7100843
IS
32882020-05-07 Iain Sandoe <iain@sandoe.co.uk>
3289
3290 PR c++/94817
3291 PR c++/94829
3292 * coroutines.cc (morph_fn_to_coro): Set unformed outline
3293 functions to error_mark_node. For early error returns suppress
3294 warnings about missing ramp return values. Fix reinstatement
3295 of the function body on pre-existing initial error.
3296 * decl.c (finish_function): Use the normal error path for fails
3297 in the ramp function, do not try to compile the helpers if the
3298 transform fails.
3299
5d5dcc65
MP
33002020-05-07 Marek Polacek <polacek@redhat.com>
3301
3302 PR c++/94590 - Detect long double -> double narrowing.
3303 * typeck2.c (check_narrowing): Detect long double -> double
3304 narrowing even when double and long double have the same
3305 precision. Make it handle conversions to float too.
3306
21968d4a
MP
33072020-05-07 Marek Polacek <polacek@redhat.com>
3308
3309 PR c++/94255
3310 * parser.c (cp_parser_class_specifier_1): Check that the scope is
3311 nested inside current scope before pushing it.
3312
0ca22d02
MP
33132020-05-07 Marek Polacek <polacek@redhat.com>
3314
3315 P1957R2
3316 * typeck2.c (check_narrowing): Consider T* to bool narrowing
3317 in C++11 and up.
3318
d20b7173
MP
33192020-05-07 Marek Polacek <polacek@redhat.com>
3320
3321 * decl.c (grok_op_properties): Fix spelling of non-static.
3322 * typeck.c (build_class_member_access_expr): Likewise.
3323
eb72dc66
RB
33242020-05-07 Richard Biener <rguenther@suse.de>
3325
3326 PR middle-end/94703
3327 * optimize.c (update_cloned_parm): Copy DECL_NOT_GIMPLE_REG_P.
3328
1e891788
MP
33292020-05-06 Marek Polacek <polacek@redhat.com>
3330
3331 PR c++/94938
3332 * pt.c (tsubst_copy_and_build): Call type_dependent_expression_p_push
3333 instead of uses_template_parms. Move the warning_sentinels after the
3334 RECURs.
3335
25ee2155
JJ
33362020-05-06 Jakub Jelinek <jakub@redhat.com>
3337
46fcef99
JJ
3338 PR c++/94951
3339 * typeck.c (cp_strict_aliasing_warning): New function.
3340 (cp_build_indirect_ref_1, build_reinterpret_cast_1): Use
3341 it instead of strict_aliasing_warning.
3342
25ee2155
JJ
3343 PR c++/94907
3344 * method.c (defaulted_late_check): Don't call synthesize_method
3345 on constexpr sfk_comparison if it has been called on it already.
3346
bc95e478
NS
33472020-05-06 Nathan Sidwell <nathan@acm.org>
3348
3349 PR c++/94946
3350 * decl.c (grokdeclarator): Don't splice template attributes in
3351 parm context -- they can apply to the parm.
3352
80644a67
IS
33532020-05-05 Iain Sandoe <iain@sandoe.co.uk>
3354
3355 * coroutines.cc: Remove references to n4849 throughout.
3356
e42f3426
JM
33572020-05-05 Jason Merrill <jason@redhat.com>
3358
3359 CWG 2235
3360 * pt.c (more_specialized_fn): Do consider parms with no deducible
3361 template parameters.
3362
04b89192
JM
33632020-05-05 Jason Merrill <jason@redhat.com>
3364
3365 PR c++/90212
3366 * constexpr.c (potential_constant_expression_1): In a lambda
3367 function, consider a captured variable directly.
3368
f1656ae9
IS
33692020-05-05 Iain Sandoe <iain@sandoe.co.uk>
3370
3371 * coroutines.cc (transform_await_wrapper): Check that we have
3372 no unlowered co_yields.
3373 (captures_temporary): Likewise.
3374 (register_awaits): Likewise.
3375
733195e3
NS
33762020-05-05 Nathan Sidwell <nathan@acm.org>
3377
3378 PR c++/94807
3379 * coroutines.cc (morph_fn_to_coro): Just check for
3380 closure_identifier.
3381 * pt.c (tsubst_function_decl): Update lambda fn's this_ptr name.
3382
ef3479af
MP
33832020-05-05 Marek Polacek <polacek@redhat.com>
3384 Jason Merrill <jason@redhat.com>
3385
3386 PR c++/94799
3387 * parser.c (cp_parser_postfix_dot_deref_expression): If we have
3388 a type-dependent object of class type, stash it to
3389 parser->context->object_type. If the postfix expression doesn't have
3390 a type, use typeof.
3391 (cp_parser_class_name): Consider object scope too.
3392 (cp_parser_lookup_name): Remove code dealing with the case when
3393 object_type is unknown_type_node.
3394
a700b4a9
PP
33952020-05-04 Patrick Palka <ppalka@redhat.com>
3396
3397 PR c++/94038
3398 * cp-gimplify.c (cp_fold) <case CALL_EXPR>: Move some variable
3399 declarations closer to their uses. Copy the CALL_EXPR only
3400 when one of its arguments has changed.
3401 <case TREE_VEC>: Instead of first collecting the folded
3402 arguments into a releasing_vec, just make a copy of the TREE_VEC
3403 as soon as folding changes one of its arguments.
3404
0719055a
IS
34052020-05-04 Iain Sandoe <iain@sandoe.co.uk>
3406
3407 * coroutines.cc (morph_fn_to_coro): Mark the coro.gro variable
3408 as artificial and ignored.
3409
f1621d18
NS
34102020-05-04 Nathan Sidwell <nathan@acm.org>
3411
97268c37
NS
3412 pt.c (process_template_parm): Don't walk the template list twice,
3413 remember the final node instead.
3414 (end_template_parm_list): Refactor. Comment on why we do a pop
3415 and a push.
3416
f1621d18
NS
3417 PR c++/94827 -- don't save parms in nested requirement
3418 * constraint.cc (tsubst_nested_requirement): TYPE directly holds
3419 notmalized requirement.
3420 (finish_nested_requirement): Don't stash current tpl parms into
3421 the requirement.
3422 (diagnose_nested_requirement): TYPE directly holds notmalized
3423 requirement.
3424
4f6c1ca2
PP
34252020-05-01 Patrick Palka <ppalka@redhat.com>
3426
3427 PR c++/90880
3428 * cp-tree.h (check_accessibility_of_qualified_id): Add
3429 tsubst_flags_t parameter and change return type to bool.
3430 * parser.c (cp_parser_lookup_name): Pass tf_warning_to_error to
3431 check_accessibility_of_qualified_id.
3432 * pt.c (tsubst_qualified_id): Return error_mark_node if
3433 check_accessibility_of_qualified_id returns false.
3434 * semantics.c (check_accessibility_of_qualified_id): Add
3435 complain parameter. Pass complain instead of
3436 tf_warning_or_error to perform_or_defer_access_check. Return
3437 true unless perform_or_defer_access_check returns false.
3438
30da2906
MP
34392020-05-01 Marek Polacek <polacek@redhat.com>
3440
3441 PR c++/94885
3442 * typeck2.c (process_init_constructor_record): Return PICFLAG_ERRONEOUS
3443 if an initializer element was erroneous.
3444
82d5dece
JM
34452020-05-01 Jason Merrill <jason@redhat.com>
3446
3447 PR c++/90479
3448 * init.c (get_nsdmi): Don't push_to_top_level for a local class.
3449
a2f32550
JM
34502020-05-01 Jason Merrill <jason@redhat.com>
3451
3452 PR c++/91529
3453 * decl.c (cp_finish_decl): Also clear TREE_READONLY if
3454 -fmerge-all-constants.
3455
bcbf334a
JM
34562020-05-01 Jason Merrill <jason@redhat.com>
3457
3458 PR c++/93822
3459 * pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have
3460 the same type as the variable.
3461
c416c52b
NS
34622020-04-30 Jason Merrill <jason@redhat.com>
3463 Nathan Sidwell <nathan@acm.org>
3464
3465 PR c++/94827
3466 * constraint.cc (map_arguments): If ARGS is null, it's a
3467 self-mapping of parms.
3468 (finish_nested_requirement): Do not pass argified
3469 current_template_parms to normalization.
3470 (tsubst_nested_requirement): Don't assert no template parms.
3471
448c89d5
IS
34722020-04-30 Iain Sandoe <iain@sandoe.co.uk>
3473
3474 PR c++/94886
3475 * coroutines.cc (transform_local_var_uses): Defer walking
3476 the DECL_INITIALs of BIND_EXPR vars until all the frame
3477 allocations have been made.
3478
aa94a22f
IS
34792020-04-30 Iain Sandoe <iain@sandoe.co.uk>
3480
3481 PR c++/94883
3482 * coroutines.cc (register_awaits): Update target
3483 expressions for awaitable and suspend handle
3484 initializers.
3485
b16fd5fd
IS
34862020-04-30 Iain Sandoe <iain@sandoe.co.uk>
3487
3488 PR c++/94879
3489 * coroutines.cc (build_co_await): Account for variables
3490 with DECL_VALUE_EXPRs.
3491 (captures_temporary): Likewise.
3492 (register_awaits): Likewise.
3493
a7201a08
PP
34942020-04-29 Patrick Palka <ppalka@redhat.com>
3495
3496 PR c++/94830
3497 * pt.c (find_template_parameter_info::parm_list): New field.
3498 (keep_template_parm): Use the new field to build up the
3499 parameter list here instead of ...
3500 (find_template_parameters): ... here. Return ftpi.parm_list.
3501
575ac27f
JJ
35022020-04-29 Jakub Jelinek <jakub@redhat.com>
3503
3504 PR target/94707
3505 * class.c (build_base_field): Set DECL_FIELD_ABI_IGNORED on C++17 empty
3506 base artificial FIELD_DECLs.
3507 (layout_class_type): Set DECL_FIELD_ABI_IGNORED on empty class
3508 field_poverlapping_p FIELD_DECLs.
3509
43439d5e
PP
35102020-04-29 Patrick Palka <ppalka@redhat.com>
3511
1d2290ca
PP
3512 PR c++/94819
3513 * constraint.cc (satisfy_declaration_constraints): Use saved_t
3514 instead of t as the key to decl_satisfied_cache.
3515
43439d5e
PP
3516 PR c++/94808
3517 * error.c (print_requires_expression_info): Print the dependent
3518 form of the parameter list with its template parameter mapping,
3519 rather than printing the substituted form.
3520
bce54ed4
JM
35212020-04-28 Jason Merrill <jason@redhat.com>
3522
3523 PR c++/94583
3524 * decl.c (use_eh_spec_block): Check nothrow type after
3525 DECL_DEFAULTED_FN.
3526 * pt.c (maybe_instantiate_noexcept): Call synthesize_method for
3527 DECL_MAYBE_DELETED fns here.
3528 * decl2.c (mark_used): Not here.
3529 * method.c (get_defaulted_eh_spec): Reject DECL_MAYBE_DELETED here.
3530
f5edc76a
IS
35312020-04-28 Iain Sandoe <iain@sandoe.co.uk>
3532
3533 PR c++/94760
3534 * coroutines.cc (instantiate_coro_traits): Pass a reference to
3535 object type rather than a pointer type for 'this', for method
3536 coroutines.
3537 (struct param_info): Add a field to hold that the parm is a lambda
3538 closure pointer.
3539 (morph_fn_to_coro): Check for lambda closure pointers in the
3540 args. Use a reference to *this when building the args list for the
3541 promise allocator lookup.
3542
b9c91b7f
IS
35432020-04-28 Iain Sandoe <iain@sandoe.co.uk>
3544
3545 PR c++/94759
3546 * coroutines.cc (coro_promise_type_found_p): Do not
3547 exclude non-classes here (this needs to be handled in the
3548 coroutine header).
3549 (morph_fn_to_coro): Allow for the case where the coroutine
3550 returns void.
3551
174b6f73
IS
35522020-04-27 Iain Sandoe <iain@sandoe.co.uk>
3553
3554 PR c++/94701
3555 * coroutines.cc (struct local_var_info): Add fields for static
3556 variables and those with DECL_VALUE_EXPR redirection.
3557 (transform_local_var_uses): Skip past typedefs and static vars
3558 and then account for redirected variables.
3559 (register_local_var_uses): Likewise.
3560
5f1cd1da
JM
35612020-04-27 Jason Merrill <jason@redhat.com>
3562
3563 PR c++/90750
3564 PR c++/79585
3565 * decl.c (grokdeclarator): Move dependent attribute to decl.
3566 * decl2.c (splice_template_attributes): No longer static.
3567
64da1b76
PP
35682020-04-27 Patrick Palka <ppalka@redhat.com>
3569
3570 PR c++/94772
3571 * constexpr.c (cxx_eval_call_expression): Don't set new_obj if we're
3572 evaluating the target constructor of a delegating constructor.
3573 (cxx_eval_store_expression): Don't set TREE_READONLY if the LHS of the
3574 INIT_EXPR is '*this'.
3575
bfdea9ae 35762020-04-26 Marek Polacek <polacek@redhat.com>
feb801f6
MP
3577
3578 PR c++/90320
3579 * call.c (struct conversion): Add copy_init_p.
3580 (standard_conversion): Set copy_init_p in ck_base and ck_rvalue
3581 if FLAGS demands LOOKUP_ONLYCONVERTING.
3582 (convert_like_real) <case ck_base>: If copy_init_p is set, or
3583 LOOKUP_ONLYCONVERTING into FLAGS.
3584
29f55115
IS
35852020-04-26 Iain Sandoe <iain@sandoe.co.uk>
3586
3587 PR c++/94752
3588 * coroutines.cc (morph_fn_to_coro): Ensure that
3589 unnamed function params have a usable and distinct
3590 frame field name.
3591
35281187
JM
35922020-04-24 Jason Merrill <jason@redhat.com>
3593
3594 PR c++/94583
3595 * decl.c (redeclaration_error_message): Reject defaulted comparison
3596 operator that has been previously declared.
3597
5e7e8b98
PP
35982020-04-25 Patrick Palka <ppalka@redhat.com>
3599
3600 * parser.c (cp_parser_diagnose_invalid_type_name): Suggest enabling
3601 concepts if the invalid identifier is 'requires'.
3602
4ff685a8
JJ
36032020-04-25 Jakub Jelinek <jakub@redhat.com>
3604
3605 PR c++/94742
3606 * semantics.c (finish_call_expr): When looking if all overloads
3607 are noreturn, use STRIP_TEMPLATE to look through TEMPLATE_DECLs.
3608
6f6c7992
ML
36092020-04-24 Martin Liska <mliska@suse.cz>
3610
3611 * coroutines.cc: Fix compilation error for release checking
3612 where we miss declaration of ‘coro_body_contains_bind_expr_p’.
3613
f9f16625
PP
36142020-04-23 Patrick Palka <ppalka@redhat.com>
3615
9a453da5
PP
3616 * tree.c (zero_init_expr_p): Use uses_template_parms instead of
3617 dependent_type_p.
3618
f9f16625
PP
3619 PR c++/94645
3620 * pt.c (template_class_depth): Walk into the DECL_FRIEND_CONTEXT of a
3621 friend declaration rather than into its CP_DECL_CONTEXT.
3622
3dbc7721
IS
36232020-04-23 Iain Sandoe <iain@sandoe.co.uk>
3624
3625 PR c++/94288
3626 * coroutines.cc (await_statement_expander): Simplify cases.
3627 (struct susp_frame_data): Add fields for truth and/or if
3628 cases, rename one field.
3629 (analyze_expression_awaits): New.
3630 (expand_one_truth_if): New.
3631 (add_var_to_bind): New helper.
3632 (coro_build_add_if_not_cond_break): New helper.
3633 (await_statement_walker): Handle conditional expressions,
3634 handle expansion of truth-and/or-if cases.
3635 (bind_expr_find_in_subtree): New, checking-only.
3636 (coro_body_contains_bind_expr_p): New, checking-only.
3637 (morph_fn_to_coro): Ensure that we have a top level bind
3638 expression.
3639
cf88e25a
JW
36402020-04-22 Jonathan Wakely <jwakely@redhat.com>
3641
3642 PR translation/94698
3643 * class.c (check_field_decls): Change "define" to "declare" in
3644 -Weffc++ diagnostics.
3645
72d0ef73
PP
36462020-04-22 Patrick Palka <ppalka@redhat.com>
3647
3648 PR c++/94719
3649 PR c++/94549
3650 * constraint.cc (satisfy_declaration_constraints): If the inherited
3651 constructor points to an instantiation of a constructor template,
3652 remember and use its attached template arguments.
3653
c95d1dd7
JW
36542020-04-22 Jonathan Wakely <jwakely@redhat.com>
3655
3656 PR translation/94698
3657 * class.c (check_field_decls): Change "override" to "define" in
3658 -Weffc++ diagnostics.
3659
38644f81
IS
36602020-04-22 Iain Sandoe <iain@sandoe.co.uk>
3661
3662 PR c++/94682
3663 * coroutines.cc (struct param_info): Add a field to note that
3664 the param is 'this'.
3665 (morph_fn_to_coro): Convert this to a reference before using it
3666 in the promise parameter preview.
3667
aedd04ca
JM
36682020-04-22 Jason Merrill <jason@redhat.com>
3669
3670 PR c++/94546
3671 * pt.c (register_parameter_specializations): If the instantiation is
3672 still a parameter pack, don't wrap it in a NONTYPE_ARGUMENT_PACK.
3673 (tsubst_pack_expansion, tsubst_expr): Adjust.
3674
58797021
MS
36752020-04-22 Martin Sebor <msebor@redhat.com>
3676 Jason Merrill <jason@redhat.com>
3677
3678 PR c++/94510
3679 * decl.c (reshape_init_array_1): Avoid stripping redundant trailing
3680 zero initializers...
3681 * mangle.c (write_expression): ...and handle them here even for
3682 pointers to members by calling zero_init_expr_p.
3683 * cp-tree.h (zero_init_expr_p): Declare.
3684 * tree.c (zero_init_expr_p): Define.
3685 (type_initializer_zero_p): Remove.
3686 * pt.c (tparm_obj_values): New hash_map.
3687 (get_template_parm_object): Store to it.
3688 (tparm_object_argument): New.
3689
05f14938
PP
36902020-04-22 Patrick Palka <ppalka@redhat.com>
3691
3692 PR c++/67825
3693 * constraint.cc (diagnose_valid_expression): Check convert_to_void here
3694 as well as in tsubst_valid_expression_requirement.
3695
08d6ec14
PP
36962020-04-21 Patrick Palka <ppalka@redhat.com>
3697
0e665f25
PP
3698 PR c++/94549
3699 * constraint.cc (satisfy_declaration_constraints): Don't strip the
3700 inherited constructor if it already has template information.
3701
08d6ec14
PP
3702 PR c++/94597
3703 * pt.c (any_template_parm_r) <case IDENTIFIER_NODE>: New case. If this
3704 is a conversion operator, visit its TREE_TYPE.
3705
f2c8be18
NS
37062020-04-21 Nathan Sidwell <nathan@acm.org>
3707
3708 * pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
3709 error_mark_node.
3710
cd08718d
IS
37112020-04-21 Iain Sandoe <iain@sandoe.co.uk>
3712
3713 PR c++/94661
3714 * coroutines.cc (morph_fn_to_coro): Simplify return
3715 value computation.
3716
d419e176
MP
37172020-04-17 Marek Polacek <polacek@redhat.com>
3718
3719 PR c++/94592
3720 * constexpr.c (cxx_eval_outermost_constant_expr): Return when T is
3721 a BRACE_ENCLOSED_INITIALIZER_P.
3722 (is_nondependent_constant_expression): Don't check
3723 BRACE_ENCLOSED_INITIALIZER_P.
3724 (is_nondependent_static_init_expression): Likewise.
3725
a3a4f6be
PP
37262020-04-20 Patrick Palka <ppalka@redhat.com>
3727
3728 PR c++/94628
3729 * cp-tree.h (lss_policy::lss_nop): New enumerator.
3730 * pt.c (local_specialization_stack::local_specialization_stack): Handle
3731 an lss_nop policy.
3732 (local_specialization_stack::~local_specialization_stack): Likewise.
3733 (tsubst_pack_expansion): Use a local_specialization_stack instead of
3734 manually saving and restoring local_specializations. Conditionally
3735 replace local_specializations sooner, before the handling of the
3736 unsubstituted_packs case.
3737
5bdd4c5d
MP
37382020-04-20 Marek Polacek <polacek@redhat.com>
3739
3740 PR c++/94505 - bogus -Wparentheses warning with fold-expression.
3741 * pt.c (fold_expression): Add warning_sentinel for -Wparentheses
3742 before calling build_x_binary_op.
3743
c5e4be6b
MP
37442020-04-20 Marek Polacek <polacek@redhat.com>
3745
3746 * coroutines.cc (captures_temporary): Don't assign the result of
3747 STRIP_NOPS to the same variable.
3748
aa576f2a
NS
37492020-04-20 Nathan Sidwell <nathan@acm.org>
3750
f2c8be18 3751 PR c++/94454 - tpl-tpl-parms are not canonicalizable types
a6f40023
NS
3752 * pt.c (canonical_type_parameter): Assert not a tpl-tpl-parm.
3753 (process_template_parm): tpl-tpl-parms are structural.
3754 (rewrite_template_parm): Propagate structuralness.
3755
f2c8be18
NS
3756 PR c++/94454 - Expr pack expansion equality
3757 * tree.c (cp_tree_equal) [TEMPLATE_ID_EXPR, default]: Refactor.
7fcb9343
NS
3758 [EXPR_PACK_EXPANSION]: Add.
3759
aa576f2a
NS
3760 PR c++/94454 Template Argument Hashing
3761 * pt.c (iterative_hash_template_arg): Strip nodes as
3762 template_args_equal does.
3763 [ARGUMENT_PACK_SELECT, TREE_VEC, CONSTRUCTOR]: Refactor.
3764 [node_class:TEMPLATE_TEMPLATE_PARM]: Hash by level & index.
3765 [node_class:default]: Refactor.
3766
e43b28ae
PP
37672020-04-18 Patrick Palka <ppalka@redhat.com>
3768
f83adb68
PP
3769 PR c++/94632
3770 * tree.c (cp_tree_equal) <case PARM_DECL>: Ignore
3771 comparing_specializations if the parameters' contexts are identical.
3772
e43b28ae
PP
3773 PR c++/92187
3774 * pt.c (splice_late_return_type): Propagate cv-qualifiers and
3775 PLACEHOLDER_TYPE_CONSTRAINTS from the original auto node to the new one.
3776
3f5af3f7
PP
37772020-04-17 Patrick Palka <ppalka@redhat.com>
3778
a28edad3
PP
3779 PR c++/94483
3780 * lambda.c (lambda_capture_field_type): Avoid doing auto deduction if
3781 the explicit initializer has parameter packs.
3782
3f5af3f7
PP
3783 PR c++/88754
3784 * parser.c (cp_parser_check_template_parameters): Before issuing a hard
3785 error, first try simulating an error instead.
3786
2e389749
JJ
37872020-04-17 Jakub Jelinek <jakub@redhat.com>
3788
3789 PR other/94629
3790 * call.c (build_conditional_expr_1): Remove redundant assignment to
3791 arg2.
3792
effcb418
PP
37932020-04-16 Patrick Palka <ppalka@redhat.com>
3794
3795 PR c++/94475
3796 * cvt.c (ocp_convert): If the result of scalar_constant_value is
3797 erroneous, ignore it and use the original expression.
3798
e4658c7d
JJ
37992020-04-16 Jakub Jelinek <jakub@redhat.com>
3800
3801 PR c++/94571
3802 * parser.c (cp_parser_simple_declaration): Fix up a pasto in
3803 diagnostics.
3804
2dc9294c
JJ
38052020-04-15 Jakub Jelinek <jakub@redhat.com>
3806
3807 PR c/94593
3808 * parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
3809 requires directive when not at file or namespace scope.
3810
a126a157
IS
38112020-04-14 Iain Sandoe <iain@sandoe.co.uk>
3812
3813 PR c++/94359
3814 * coroutines.cc (build_actor_fn): Check that the target can
3815 support the resume tailcall before mandating it.
3816
b2562229
PP
38172020-04-14 Patrick Palka <ppalka@redhat.com>
3818
58a29af8
PP
3819 PR c++/85278
3820 * cxx-pretty-print.c (cxx_pretty_printer:simple_type_specifier)
3821 <case DECLTYPE_TYPE>: Handle DECLTYPE_TYPE here instead of ...
3822 (pp_cxx_type_specifier_seq) <case DECLTYPE_TYPE>: ... here.
3823 (cxx_pretty_printer::direct_abstract_declarator) <case DECLTYPE_TYPE>:
3824 New no-op case.
3825
b2562229
PP
3826 PR c++/94034
3827 * constexpr.c (replace_result_decl_data): New struct.
3828 (replace_result_decl_data_r): New function.
3829 (replace_result_decl): New function.
3830 (cxx_eval_call_expression): Use it.
3831 * tree.c (build_aggr_init_expr): Set the location of the AGGR_INIT_EXPR
3832 to that of its initializer.
3833
7eee265e
MP
38342020-04-13 Marek Polacek <polacek@redhat.com>
3835
3836 PR c++/94588
3837 * name-lookup.c (check_local_shadow): Add an inform call.
3838
077dd9b3
PP
38392020-04-13 Patrick Palka <ppalka@redhat.com>
3840
1dcb7799
PP
3841 PR c++/94521
3842 * error.c (dump_scope): Pass TFF_NO_FUNCTION_ARGUMENTS to
3843 dump_function_decl when printing a function template instantiation as a
3844 scope.
3845
077dd9b3
PP
3846 PR c++/94470
3847 * constexpr.c (get_or_insert_ctor_field): Set default value of parameter
3848 'pos_hint' to -1.
3849 (cxx_eval_bare_aggregate): Use get_or_insert_ctor_field instead of
3850 assuming the the next index belongs at the end of the new CONSTRUCTOR.
3851 (cxx_eval_store_expression): Revert PR c++/78572 fix.
3852
8d213cbb
NS
38532020-04-13 Nathan Sidwell <nathan@acm.org>
3854
3855 PR c++/94426 lambdas with internal linkage are different to no-linkage
3856 * decl2.c (determine_visibility): A lambda's visibility is
3857 affected by its extra scope.
3858 * pt.c (instantiate_decl): Determine var's visibility before
3859 instantiating its initializer.
3860 * tree.c (no_linkage_check): Revert code looking at visibility of
3861 lambda's extra scope.
3862`
0666767e
IS
38632020-04-10 Iain Sandoe <iain@sandoe.co.uk>
3864
a02558a3 3865 PR c++/94528
0666767e
IS
3866 * coroutines.cc (co_await_expander): Remove.
3867 (expand_one_await_expression): New.
3868 (process_one_statement): New.
3869 (await_statement_expander): New.
3870 (build_actor_fn): Revise to use per-statement expander.
3871 (struct susp_frame_data): Reorder and comment.
3872 (register_awaits): Factor code.
3873 (replace_statement_captures): New, factored from...
3874 (maybe_promote_captured_temps):.. here.
3875 (await_statement_walker): Revise to process per statement.
3876 (morph_fn_to_coro): Use revised susp_frame_data layout.
3877
62c25d7a
MP
38782020-04-10 Marek Polacek <polacek@redhat.com>
3879
3880 PR c++/94149
3881 * method.c (constructible_expr): In C++20, try using parenthesized
3882 initialization of aggregates to determine the result of
3883 __is_constructible.
3884
6c4a05f2
BC
38852020-04-10 Bin Cheng <bin.cheng@linux.alibaba.com>
3886
3887 * coroutines.cc (co_await_expander): Simplify.
3888
ef529765
JM
38892020-04-09 Jason Merrill <jason@redhat.com>
3890
3891 PR c++/94523
3892 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]: Look at
3893 ctx->object and ctx->global->values first.
3894
830c5724
MP
38952020-04-09 Marek Polacek <polacek@redhat.com>
3896
3897 PR c++/93790
3898 * call.c (initialize_reference): If the reference binding failed, maybe
3899 try initializing from { }.
3900 * decl.c (grok_reference_init): For T& t(e), set
3901 LOOKUP_AGGREGATE_PAREN_INIT but don't build up a constructor yet.
3902
926d39c3 39032020-04-08 Iain Sandoe <iain@sandoe.co.uk>
e4658c7d 3904 Jun Ma <JunMa@linux.alibaba.com>
926d39c3
IS
3905
3906 * coroutines.cc (maybe_promote_captured_temps): Add a cleanup
3907 expression, if needed, to any call from which we promoted
3908 temporaries captured by reference.
3909
77d6dfc9
MP
39102020-04-08 Marek Polacek <polacek@redhat.com>
3911
3912 PR c++/94507 - ICE-on-invalid with lambda template.
3913 * pt.c (tsubst_lambda_expr): Cope when tsubst_template_decl or
3914 tsubst_function_decl returns error_mark_node.
3915
70df40ca
ML
39162020-04-08 Martin Liska <mliska@suse.cz>
3917
3918 PR c++/94314
3919 * decl.c (duplicate_decls): Duplicate also DECL_IS_REPLACEABLE_OPERATOR.
3920 (cxx_init_decl_processing): Mark replaceable all implicitly defined
3921 operators.
3922
12f55e03
PP
39232020-04-08 Patrick Palka <ppalka@redhat.com>
3924
3925 Core issues 1001 and 1322
3926 PR c++/92010
3927 * pt.c (rebuild_function_or_method_type): Split function out from ...
3928 (tsubst_function_type): ... here.
3929 (maybe_rebuild_function_decl_type): New function.
3930 (tsubst_function_decl): Use it.
3931
4cf6b06c
JJ
39322020-04-08 Jakub Jelinek <jakub@redhat.com>
3933
3934 PR c++/94325
3935 * decl.c (begin_destructor_body): For CLASSTYPE_VBASECLASSES class
3936 dtors, if CLASSTYPE_PRIMARY_BINFO is non-NULL, but not BINFO_VIRTUAL_P,
3937 look at CLASSTYPE_PRIMARY_BINFO of its BINFO_TYPE if it is not
3938 BINFO_VIRTUAL_P, and so on.
3939
a6479aa4
MP
39402020-04-08 Marek Polacek <polacek@redhat.com>
3941
3942 PR c++/94478 - ICE with defaulted comparison operator
3943 * method.c (early_check_defaulted_comparison): Give an error when the
3944 context is null.
3945
13e41d8b
TB
39462020-04-08 Tobias Burnus <tobias@codesourcery.com>
3947
3948 PR middle-end/94120
3949 * paser.c (cp_parser_oacc_declare): Add check that variables
3950 are declared in the same scope as the directive.
3951
31449cf8
JM
39522020-04-07 Jason Merrill <jason@redhat.com>
3953
845d451e
JM
3954 PR c++/94480
3955 * parser.c (cp_parser_requires_expression): Use tentative_firewall.
3956
31449cf8
JM
3957 PR c++/94481
3958 * parser.c (cp_parser_placeholder_type_specifier): Use
3959 matching_parens.
3960
89b01e86
IS
39612020-04-07 Iain Sandoe <iain@sandoe.co.uk>
3962
3963 * coroutines.cc (maybe_promote_captured_temps): Ensure that
3964 reference capture placeholder vars are properly declared.
3965
23f1f679
PP
39662020-04-07 Patrick Palka <ppalka@redhat.com>
3967
3968 PR c++/90996
3969 * tree.c (replace_placeholders): Look through all handled components,
3970 not just COMPONENT_REFs.
3971 * typeck2.c (process_init_constructor_array): Propagate
3972 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
3973 the array initializer.
3974
4df50a05
JJ
39752020-04-07 Jakub Jelinek <jakub@redhat.com>
3976
3977 PR c++/94512
3978 * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
3979 if cp_parser_omp_master succeeded.
3980
467fc7c8
JM
39812020-04-06 Jason Merrill <jason@redhat.com>
3982
3983 PR c++/94462
3984 * decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.
3985
f84aded8
MP
39862020-04-04 Marek Polacek <polacek@redhat.com>
3987 Jason Merrill <jason@redhat.com>
3988
3989 PR c++/94155 - crash in gimplifier with paren init of aggregates.
3990 * init.c (build_vec_init): Fill in indexes.
3991
75c8d6e5
JM
39922020-04-04 Jason Merrill <jason@redhat.com>
3993
3994 PR c++/91377
3995 * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR.
3996
37244b21
PP
39972020-04-04 Patrick Palka <ppalka@redhat.com>
3998
49a86fce
PP
3999 PR c++/94205
4000 PR c++/79937
4001 * constexpr.c (struct constexpr_ctx): New field 'parent'.
4002 (cxx_eval_bare_aggregate): Propagate CONSTRUCTOR_PLACEHOLDER_BOUNDARY
4003 flag from the original constructor to the reduced constructor.
4004 (lookup_placeholder): Prefer to return the outermost matching object
4005 by recursively calling lookup_placeholder on the 'parent' context,
4006 but don't cross CONSTRUCTOR_PLACEHOLDER_BOUNDARY constructors.
4007 (cxx_eval_constant_expression): Link the 'ctx' context to the 'new_ctx'
4008 context via 'new_ctx.parent' when being expanded without an explicit
4009 target. Don't call replace_placeholders.
4010 (cxx_eval_outermost_constant_expr): Initialize 'ctx.parent' to NULL.
4011
37244b21
PP
4012 PR c++/94219
4013 PR c++/94205
4014 * constexpr.c (get_or_insert_ctor_field): Split out (while adding
4015 support for VECTOR_TYPEs, and optimizations for the common case)
4016 from ...
4017 (cxx_eval_store_expression): ... here. Rename local variable
4018 'changed_active_union_member_p' to 'activated_union_member_p'. Record
4019 the sequence of indexes into 'indexes' that yields the subobject we're
4020 assigning to. Record the integer offsets of the constructor indexes
4021 we're assigning through into 'index_pos_hints'. After evaluating the
4022 initializer of the store expression, recompute 'valp' using 'indexes'
4023 and using 'index_pos_hints' as hints.
4024 (cxx_eval_bare_aggregate): Tweak comments. Use get_or_insert_ctor_field
4025 to recompute the constructor_elt pointer we're assigning through after
4026 evaluating each initializer.
4027
f1ad7bac
JM
40282020-04-04 Jason Merrill <jason@redhat.com>
4029
4030 PR c++/67825
4031 * constraint.cc (tsubst_valid_expression_requirement): Call
4032 convert_to_void.
4033
9f143008
JM
40342020-04-04 Jason Merrill <jason@redhat.com>
4035
4036 PR c++/94453
4037 * constexpr.c (maybe_constant_value): Use break_out_target_exprs.
4038 * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in
4039 NON_LVALUE_EXPR.
4040
0c809f72
JJ
40412020-04-04 Jakub Jelinek <jakub@redhat.com>
4042
aae5d08a
JJ
4043 PR debug/94441
4044 * parser.c (cp_parser_omp_for_loop): Use
4045 protected_set_expr_location_if_unset.
4046 * cp-gimplify.c (genericize_if_stmt, genericize_cp_loop): Likewise.
4047
0c809f72
JJ
4048 PR c++/94477
4049 * pt.c (tsubst_expr) <case OMP_MASTER>: Clear
4050 omp_parallel_combined_clauses.
4051
bcafd874
JM
40522020-04-03 Jason Merrill <jason@redhat.com>
4053
4054 PR c++/91966
4055 * pt.c (complex_pack_expansion_r): New.
4056 (complex_alias_template_p): Use it.
4057
76f09260
JM
40582020-03-31 Jason Merrill <jason@redhat.com>
4059
4060 PR c++/94205
4061 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Call
4062 replace_placeholders.
4063 * typeck2.c (store_init_value): Fix arguments to
4064 fold_non_dependent_expr.
4065
595f1b12
JM
40662020-03-31 Jason Merrill <jason@redhat.com>
4067
4068 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Use
4069 local variables.
4070
5830f753
JM
40712020-03-30 Jason Merrill <jason@redhat.com>
4072
4073 PR c++/90711
4074 * tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
4075 (called_fns_equal): Check DECL_CONTEXT.
4076
1cb1986c
JJ
40772020-03-30 Jakub Jelinek <jakub@redhat.com>
4078
4079 PR c++/94385
4080 * semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with
4081 STATEMENT_CODE_P code.
4082
75defde9
PP
40832020-03-28 Patrick Palka <ppalka@redhat.com>
4084
7981c06a
PP
4085 PR c++/94306
4086 * parser.c (cp_parser_requires_clause_opt): Diagnose and recover from
4087 "requires {" when "requires requires {" was probably intended.
4088
a7ea3d2c
PP
4089 PR c++/94252
4090 * constraint.cc (tsubst_compound_requirement): Always suppress errors
4091 from type_deducible_p and expression_convertible_p, as they're not
4092 substitution errors.
4093 (diagnose_atomic_constraint) <case INTEGER_CST>: Remove this case so
4094 that we diagnose INTEGER_CST expressions of non-bool type via the
4095 default case.
4096 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: New case.
4097 * parser.c (cp_parser_requires_expression): Always parse the requirement
4098 body as if we're processing a template, by temporarily incrementing
4099 processing_template_decl. Afterwards, if we're not actually in a
4100 template context, perform semantic processing to diagnose any invalid
4101 types and expressions.
4102 * pt.c (tsubst_copy_and_build) <case REQUIRES_EXPR>: Remove dead code.
4103 * semantics.c (finish_static_assert): Explain an assertion failure
4104 when the condition is a REQUIRES_EXPR like we do when it is a concept
4105 check.
4106
cd68edf8
PP
4107 * constraint.cc (diagnose_compound_requirement): When diagnosing a
4108 compound requirement, maybe replay the satisfaction failure, subject to
4109 the current diagnosis depth.
4110
75defde9
PP
4111 * constraint.cc (finish_constraint_binary_op): Set the location of EXPR
4112 as well as its range, because build_x_binary_op doesn't always do so.
4113 (current_constraint_diagnosis_depth): New.
4114 (concepts_diagnostics_max_depth_exceeded_p): New.
4115 (collect_operands_of_disjunction): New.
4116 (satisfy_disjunction): When diagnosing a satisfaction failure, maybe
4117 replay each branch of the disjunction, subject to the current diagnosis
4118 depth.
4119 (diagnose_valid_expression): When diagnosing a satisfaction failure,
4120 maybe replay the substitution error, subject to the current diagnosis
4121 recursion.
4122 (diagnose_valid_type): Likewise.
4123 (diagnose_nested_requiremnet): Likewise.
4124 (diagnosing_failed_constraint::diagnosing_failed_constraint): Increment
4125 current_constraint_diagnosis_depth when diagnosing.
4126 (diagnosing_failed_constraint::~diagnosing_failed_constraint): Decrement
4127 current_constraint_diagnosis_depth when diagnosing.
4128 (diagnosing_failed_constraint::replay_errors_p): New static member
4129 function.
4130 (diagnose_constraints): Don't diagnose if concepts_diagnostics_max_depth
4131 is 0. Emit a one-off note to increase -fconcepts-diagnostics-depth if
4132 the limit was exceeded.
4133 * cp-tree.h (diagnosing_failed_constraint::replay_errors_p): Declare.
4134
c7fc15f5
NS
41352020-03-27 Nathan Sidwell <nathan@acm.org>
4136
4137 PR c++/84733
4138 * name-lookup.c (do_pushdecl): Look through cleanp levels.
4139
04dd734b
MS
41402020-03-27 Martin Sebor <msebor@redhat.com>
4141
4142 PR c++/94078
4143 PR c++/93824
4144 PR c++/93810
4145 * cp-tree.h (most_specialized_partial_spec): Declare.
4146 * parser.c (cp_parser_elaborated_type_specifier): Distinguish alias
4147 from declarations.
4148 (specialization_of): New function.
4149 (cp_parser_check_class_key): Move code...
4150 (class_decl_loc_t::add): ...to here. Add parameters. Avoid issuing
4151 -Wredundant-tags on first-time declarations in other declarators.
4152 Correct handling of template specializations.
4153 (class_decl_loc_t::diag_mismatched_tags): Also expect to be called
4154 when -Wredundant-tags is enabled. Use primary template or partial
4155 specialization as the guide for uses of implicit instantiations.
4156 * pt.c (most_specialized_partial_spec): Declare extern.
4157
9dba6013
NS
41582020-03-27 Nathan Sidwell <nathan@acm.org>
4159
4160 PR c++/94257
4161 * name-lookup.c (push_namespace): Triage ambiguous lookups that
4162 contain namespaces.
4163
72809d6f
JJ
41642020-03-27 Jakub Jelinek <jakub@redhat.com>
4165
2eea00c5
JJ
4166 PR c++/94326
4167 * call.c (set_flags_from_callee): Don't update
4168 cp_function_chain->can_throw or current_function_returns_abnormally
4169 if cp_unevaluated_operand.
4170
72809d6f
JJ
4171 PR c++/94339
4172 * cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
4173 operand and creating a new COMPOUND_EXPR if anything changed.
4174
71d69548
MP
41752020-03-26 Marek Polacek <polacek@redhat.com>
4176
4177 PR c++/94336 - template keyword accepted before destructor names.
4178 * parser.c (cp_parser_unqualified_id): Give an error when 'template'
4179 is followed by a destructor name.
4180
54f58e94
PP
41812020-03-27 Patrick Palka <ppalka@redhat.com>
4182
4183 * decl.c (compute_array_index_type_loc): Remove redundant
4184 type_dependent_expression_p check that is subsumed by
4185 value_dependent_expression_p.
4186 * decl2.c (is_late_template_attribute): Likewise.
4187 * pt.c (uses_template_parms): Likewise.
4188 (dependent_template_arg_p): Likewise.
4189
517f5356
MP
41902020-03-26 Marek Polacek <polacek@redhat.com>
4191
4192 DR 1710
4193 PR c++/94057 - template keyword in a typename-specifier.
4194 * parser.c (check_template_keyword_in_nested_name_spec): New.
4195 (cp_parser_nested_name_specifier_opt): Implement DR1710, optional
4196 'template'. Call check_template_keyword_in_nested_name_spec.
4197 (cp_parser_simple_type_specifier): Assume that a <
4198 following a qualified-id in a typename-specifier begins
4199 a template argument list.
4200
6d85947d
IS
42012020-03-26 Iain Sandoe <iain@sandoe.co.uk>
4202
4203 * coroutines.cc (coro_init_identifiers): Initialize an identifier
4204 for the cororoutine handle 'address' method name.
4205 (struct coro_aw_data): Add fields to cover the continuations.
4206 (co_await_expander): Determine the kind of await_suspend in use.
4207 If we have the case that returns a continuation handle, then save
4208 this and make the target for 'scope exit without cleanup' be the
4209 continuation resume label.
4210 (expand_co_awaits): Remove.
4211 (struct suspend_point_info): Remove fields that kept the returned
4212 await_suspend handle type.
4213 (transform_await_expr): Remove code tracking continuation handles.
4214 (build_actor_fn): Add the continuation handle as an actor-function
4215 scope var. Build the symmetric transfer continuation point. Call
4216 the tree walk for co_await expansion directly, rather than via a
4217 trivial shim function.
4218 (register_await_info): Remove fields tracking continuation handles.
4219 (get_await_suspend_return_type): Remove.
4220 (register_awaits): Remove code tracking continuation handles.
4221 (morph_fn_to_coro): Remove code tracking continuation handles.
4222
2a1f0f64
IS
42232020-03-26 Iain Sandoe <iain@sandoe.co.uk>
4224
4225 * coroutines.cc (co_await_expander): If we are expanding the
4226 initial await expression, set a boolean flag to show that we
4227 have now reached the initial await_resume() method call.
4228 (expand_co_awaits): Handle the 'initial await resume called' flag.
4229 (build_actor_fn): Insert the initial await expression into the
4230 start of the user-authored function-body. Handle the 'initial await
4231 resume called' flag.
4232 (morph_fn_to_coro): Initialise the 'initial await resume called'
4233 flag. Modify the unhandled exception catch clause to recognise
4234 exceptions that occur before the initial await_resume() and re-
4235 throw them.
4236
5a1706f6
JJ
42372020-03-26 Jakub Jelinek <jakub@redhat.com>
4238
dab932d1
JJ
4239 PR c++/81349
4240 * class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
4241 true for all TEMPLATE_DECLs.
4242
5a1706f6
JJ
4243 PR c++/94272
4244 * cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
4245
c7a252ba
PP
42462020-03-25 Patrick Palka <ppalka@redhat.com>
4247
4248 PR c++/94265
4249 * parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
4250 current condition chain when the if-statement has a non-empty
4251 init-statement.
4252
83dfa06c
IS
42532020-03-25 Iain Sandoe <iain@sandoe.co.uk>
4254
4255 PR c++/94319
4256 * coroutines.cc (captures_temporary): Fix a missing dereference.
4257
75b7b7fd
MP
42582020-03-24 Marek Polacek <polacek@redhat.com>
4259
4260 PR c++/94190 - wrong no post-decrement operator error in template.
4261 * call.c (convert_like_real): Use convert_from_reference on the result.
4262
fddfd3ce
JM
42632020-03-24 Jason Merrill <jason@redhat.com>
4264
4265 PR c++/94186
4266 * constraint.cc (constraint_satisfaction_value): Repeat noisily on
4267 error.
4268 (tsubst_nested_requirement): Likewise.
4269 (get_constraint_error_location): Allow missing context.
4270 (diagnose_atomic_constraint): Diagnose non-bool constraint here.
4271 (satisfy_atom): Not here. Only diagnose non-constant when noisy.
4272
5c161741
JM
42732020-03-24 Jason Merrill <jason@redhat.com>
4274
4275 * pt.c (any_template_parm_r): Look into the type of a non-type
4276 template parm.
4277
6e771c08
JM
42782020-03-24 Jason Merrill <jason@redhat.com>
4279
4280 * cp-tree.h (cp_expr): When constructing from an expr and a
4281 location, call protected_set_expr_location.
4282
1f6c1c82
PP
42832020-03-23 Patrick Palka <ppalka@redhat.com>
4284
4285 PR c++/93805
4286 * except.c (maybe_noexcept_warning): Add TODO.
4287 * method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
4288
26b3e568
NS
42892020-03-23 nathans <nathan@acm.org>
4290
4291 PR c++/94044
4292 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
4293 operand.
4294
b599bf9d
PP
42952020-03-21 Patrick Palka <ppalka@redhat.com>
4296
4297 PR c++/94066
4298 * constexpr.c (reduced_constant_expression_p) [CONSTRUCTOR]: Properly
4299 handle unions without an initializer.
4300 (cxx_eval_component_reference): Emit a different diagnostic when the
4301 constructor element corresponding to a union member is NULL.
4302 (cxx_eval_bare_aggregate): When constructing a union, always set the
4303 active union member before evaluating the initializer. Relax assertion
4304 that verifies the index of the constructor element we're initializing
4305 hasn't been changed.
4306 (cxx_eval_store_expression): Diagnose changing the active union member
4307 while the union is in the process of being initialized. After setting
4308 an active union member, clear CONSTRUCTOR_NO_CLEARING on the underlying
4309 CONSTRUCTOR.
4310 (cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
4311 CONSTRUCTOR returned by lookup_placeholder.
4312
828878c3
PP
43132020-03-20 Patrick Palka <ppalka@redhat.com>
4314
4315 * cxx-pretty-print.c (pp_cxx_parameter_mapping): Make extern. Move
4316 the "[with ]" bits to here from ...
4317 (pp_cxx_atomic_constraint): ... here.
4318 * cxx-pretty-print.h (pp_cxx_parameter_mapping): Declare.
4319 * error.c (rebuild_concept_check): Delete.
4320 (print_concept_check_info): Print the dependent form of the constraint and the
4321 preferably substituted parameter mapping alongside it.
4322
94e24187
JM
43232020-03-19 Jason Merrill <jason@redhat.com>
4324
4325 PR c++/94175
4326 * cp-gimplify.c (simple_empty_class_p): Look through
4327 SIMPLE_TARGET_EXPR_P.
4328 (cp_gimplify_expr) [MODIFY_EXPR]: Likewise.
4329 [RETURN_EXPR]: Avoid producing 'return *retval;'.
4330 * call.c (build_call_a): Strip TARGET_EXPR from empty class arg.
4331 * cp-tree.h (SIMPLE_TARGET_EXPR_P): Check that TARGET_EXPR_INITIAL
4332 is non-null.
4333
02f7334a
JJ
43342020-03-19 Jakub Jelinek <jakub@redhat.com>
4335
4336 PR c++/93931
4337 * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
4338 on outer_automatic_var_p decls.
4339 * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
4340 capture proxy decls.
4341
11cf25c4
NS
43422020-03-18 Nathan Sidwell <nathan@acm.org>
4343
4344 PR c++/94147 - mangling of lambdas assigned to globals
4345 * parser.c (cp_parser_init_declarator): Namespace-scope variables
4346 provide a lambda scope.
4347 * tree.c (no_linkage_check): Lambdas with a variable for extra
4348 scope have a linkage from the variable.
4349
af8656be
JJ
43502020-03-18 Jakub Jelinek <jakub@redhat.com>
4351
d5029d45
JJ
4352 * constraint.cc (resolve_function_concept_check, subsumes_constraints,
4353 strictly_subsumes): Fix up duplicated word issue in a comment.
4354 * coroutines.cc (build_init_or_final_await, captures_temporary):
4355 Likewise.
4356 * logic.cc (dnf_size_r, cnf_size_r): Likewise.
4357 * pt.c (append_type_to_template_for_access_check): Likewise.
4358
af8656be
JJ
4359 PR c++/91759
4360 * decl.c (grokfndecl): Restore old diagnostics about deduction
4361 guide declared in different scope if in_namespace is NULL_TREE.
4362
cd0b7124
JJ
43632020-03-17 Jakub Jelinek <jakub@redhat.com>
4364
4365 PR c++/90995
4366 * parser.c (cp_parser_enum_specifier): Use temp_override for
4367 parser->colon_corrects_to_scope_p, replace goto out with return.
4368 If scoped enum or enum with underlying type is not followed by
4369 { or ;, call cp_parser_commit_to_tentative_parse before calling
4370 cp_parser_error and make sure to return error_mark_node instead of
4371 NULL_TREE. Formatting fixes.
4372
887085be
VV
43732020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
4374
887085be 4375 PR c++/94197
1fef0148 4376 * method.c (assignable_expr): Use cp_unevaluated.
887085be
VV
4377 (is_xible_helper): Push a non-deferred access check for
4378 the stub objects created by assignable_expr and constructible_expr.
4379
700d4cb0
JJ
43802020-03-17 Jakub Jelinek <jakub@redhat.com>
4381
4382 * pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
4383 (lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
4384 in a comment.
4385 * parser.c (cp_parser_statement, cp_parser_linkage_specification,
4386 cp_parser_placeholder_type_specifier,
4387 cp_parser_constraint_requires_parens): Likewise.
4388 * name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
4389
ced66da3
IS
43902020-03-15 Iain Sandoe <iain@sandoe.co.uk>
4391
4392 * coroutines.cc (co_await_expander): Fix indentation.
4393
3a285529
JM
43942020-03-14 Jason Merrill <jason@redhat.com>
4395
4396 PR c++/92068
4397 * pt.c (process_partial_specialization): Error rather than crash on
4398 extra pack expansion.
4399
b3b0c671
JM
44002020-03-14 Jason Merrill <jason@redhat.com>
4401
4402 PR c++/92909
4403 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
4404 DECL_ORIGINAL_TYPE of a typedef.
4405
c393c99d
JM
44062020-03-14 Jason Merrill <jason@redhat.com>
4407
4408 PR c++/93248
4409 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
4410 substituting DECL_ARGUMENTS.
4411
53b28abf
JJ
44122020-03-14 Jakub Jelinek <jakub@redhat.com>
4413
4414 * logic.cc (formula::formula): Change "a an" to "an" in a comment.
4415 * parser.c (cp_debug_parser): Change "a an" to "an" in a string
4416 literal.
4417
80a13af7
PP
44182020-03-13 Patrick Palka <ppalka@redhat.com>
4419
4420 PR c++/67960
4421 * call.c (build_over_call): Use a warning_sentinel to disable
4422 warn_deprecated_decl before calling build_addr_func.
4423
4069adf4
JJ
44242020-03-12 Jakub Jelinek <jakub@redhat.com>
4425
4426 PR c++/94124
4427 * decl.c (reshape_init_array_1): Don't unshare constructor if there
4428 aren't any trailing zero elts, otherwise only unshare the first
4429 nelts.
4430
bde31a76
JM
44312020-03-11 Jason Merrill <jason@redhat.com>
4432
4433 PR c++/93907
4434 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
4435 argument.
4436
7eb5be6a
MP
44372020-03-11 Marek Polacek <polacek@redhat.com>
4438 Jason Merrill <jason@redhat.com>
4439
4440 PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
4441 * constexpr.c (cref_has_const_field): New function.
4442 (modifying_const_object_p): Consider a COMPONENT_REF
4443 const only if any of its fields are const.
4444 (cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
4445 as readonly after its initialization has been done.
4446
e11d05c1
MP
44472020-03-10 Marek Polacek <polacek@redhat.com>
4448
4449 PR c++/94124 - wrong conversion error with non-viable overload.
4450 * decl.c (reshape_init_array_1): Unshare a constructor if we
4451 stripped trailing zero-initializers.
4452
481fcfe6
JM
44532020-03-10 Jason Merrill <jason@redhat.com>
4454
4455 PR c++/93901
4456 * pt.c (maybe_instantiate_noexcept): Always update clones.
4457
df15a828
JM
44582020-03-10 Jason Merrill <jason@redhat.com>
4459
4069adf4 4460 PR c++/93596
df15a828
JM
4461 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
4462
14af5d9b
JM
44632020-03-10 Jason Merrill <jason@redhat.com>
4464
4465 PR c++/93922
4466 PR c++/94041
4467 PR c++/52320
4468 PR c++/66139
4469 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
4470 66139: Don't split_nonconstant_init. Remove pre_p parameter.
4471
d417b4f5
MP
44722020-03-09 Marek Polacek <polacek@redhat.com>
4473
4474 PR c++/92031 - bogus taking address of rvalue error.
4475 PR c++/91465 - ICE with template codes in check_narrowing.
4476 PR c++/93870 - wrong error when converting template non-type arg.
4477 PR c++/94068 - ICE with template codes in check_narrowing.
4478 * call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
4479 in a template when not ck_identity and we're dealing with a class.
4480 (convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
4481 in a template if we need a temporary.
4482 * decl.c (compute_array_index_type_loc): Remove
4483 instantiate_non_dependent_expr_sfinae call. Call
4484 fold_non_dependent_expr instead of maybe_constant_value.
4485 (build_explicit_specifier): Don't instantiate or create a sentinel
4486 before converting the expression.
4487 * except.c (build_noexcept_spec): Likewise.
4488 * pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
4489 Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
4490 build_converted_constant_expr returned.
4491 * typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
4492 of maybe_constant_value.
4493
81fa6d73
JJ
44942020-03-09 Jakub Jelinek <jakub@redhat.com>
4495
4496 PR c++/94067
4497 Revert
4498 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
4499
4500 * constexpr.c (cxx_eval_constant_expression): Do not handle
4501 RROTATE_EXPR and LROTATE_EXPR.
4502
8475f290
MP
45032020-03-09 Marek Polacek <polacek@redhat.com>
4504
4505 PR c++/94050 - ABI issue with alignas on armv7hl.
4506 * class.c (layout_class_type): Don't replace a class's
4507 CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
4508
016d0f9e
BC
45092020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
4510
4511 * coroutines.cc (build_actor_fn): Factor out code inserting the
4512 default return_void call to...
4513 (morph_fn_to_coro): ...here, also hoist local var declarations.
4514
ff0a6284
PP
45152020-03-08 Patrick Palka <ppalka@redhat.com>
4516
5e1b4e60
PP
4517 PR c++/93729
4518 * call.c (convert_like_real): Check complain before emitting an error
4519 about binding a bit-field to a reference.
4520
ff0a6284
PP
4521 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
4522 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
4523 TYPE_NAME.
4524
191bcd0f
NS
45252020-03-06 Nathan Sidwell <nathan@acm.org>
4526
4527 PR c++/94027
4528 * mangle.c (find_substitution): Don't call same_type_p on template
4529 args that cannot match.
4530
cb2409c6
MS
45312020-03-04 Martin Sebor <msebor@redhat.com>
4532
4533 PR c++/90938
4534 * tree.c (type_initializer_zero_p): Fail for structs initialized
4535 with non-structs.
4536
6876b269
JM
45372020-03-04 Jason Merrill <jason@redhat.com>
4538
4539 PR c++/90432
4540 * init.c (perform_member_init): Don't do aggregate initialization of
4541 empty field.
4542 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
4543 initialization of empty field.
4544
2e032851
ML
45452020-03-04 Martin Liska <mliska@suse.cz>
4546
4547 * method.c: Wrap array in ctor with braces in order
4548 to silent clang warnings.
4549
6b3302da
MP
45502020-03-03 Jason Merrill <jason@redhat.com>
4551 Marek Polacek <polacek@redhat.com>
4552
4553 PR c++/90505 - mismatch in template argument deduction.
4554 * pt.c (tsubst): Don't reduce the template level of template
4555 parameters when tf_partial.
4556
0e0ffbfc
JJ
45572020-03-03 Jakub Jelinek <jakub@redhat.com>
4558
4559 PR c++/93998
4560 * constexpr.c (cxx_eval_constant_expression)
4561 <case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
4562 *non_constant_p is true.
4563
45642020-03-03 Jun Ma <JunMa@linux.alibaba.com>
fd9e021c 4565
7f327e87
J
4566 * coroutines.cc (captures_temporary): Strip component_ref
4567 to its base object.
4568
e4658c7d 45692020-03-03 Jun Ma <JunMa@linux.alibaba.com>
7f327e87 4570
fd9e021c
J
4571 * coroutines.cc (finish_co_await_expr): Build co_await_expr
4572 with unknown_type_node.
4573 (finish_co_yield_expr): Ditto.
4574 *pt.c (type_dependent_expression_p): Set co_await/yield_expr
4575 with unknown type as dependent.
4576
cd14f288
IS
45772020-03-02 Iain Sandoe <iain@sandoe.co.uk>
4578
4579 * coroutines.cc (struct local_var_info): Adjust to remove the
4580 reference to the captured var, and just to note that this is a
4581 lambda capture proxy.
4582 (transform_local_var_uses): Handle lambda captures specially.
4583 (struct param_frame_data): Add a visited set.
4584 (register_param_uses): Also check for param uses in lambda
4585 capture proxies.
4586 (struct local_vars_frame_data): Remove captures list.
4587 (register_local_var_uses): Handle lambda capture proxies by
4588 noting and bypassing them.
4589 (morph_fn_to_coro): Update to remove lifetime extension of
4590 lambda capture-by-copy vars.
4591
005530eb
IS
45922020-03-02 Iain Sandoe <iain@sandoe.co.uk>
4593
4594 * coroutines.cc (build_co_await): Do not build frame
4595 awaitable proxy vars when the co_await expression is
4596 a function parameter or local var.
4597 (co_await_expander): Do not initialise a frame var with
4598 itself.
4599 (transform_await_expr): Only substitute the awaitable
4600 frame var if it's needed.
4601 (register_awaits): Do not make frame copies for param
4602 or local vars that are awaitables.
4603
586b016c
JM
46042020-02-28 Jason Merrill <jason@redhat.com>
4605
117baab8
JM
4606 Implement P2092R0, Disambiguating Nested-Requirements
4607 * parser.c (cp_parser_requirement_parameter_list): Pass
4608 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
4609
586b016c
JM
4610 * call.c (build_user_type_conversion_1): Don't look at the second
4611 conversion of a non-viable candidate.
4612
18396541
JJ
46132020-02-28 Jakub Jelinek <jakub@redhat.com>
4614
4615 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
4616 * typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
4617 functions in unevaluated contexts.
4618
da5f369d
NS
46192020-02-27 Nathan Sidwell <nathan@acm.org>
4620
9d2d2833
NS
4621 PR c++/93933
4622 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
4623 cp_tree_equal.
4624 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
4625 * typeck.c (comptypes): Assert we don't get any argument packs.
4626
da5f369d
NS
4627 * class.c (adjust_clone_args): Correct arg-checking assert.
4628 * typeck.c (comptypes): Assert not nulls.
4629
1231f71f
MP
46302020-02-26 Marek Polacek <polacek@redhat.com>
4631
4632 PR c++/93789 - ICE with invalid array bounds.
4633 * decl.c (compute_array_index_type_loc): Don't use the folded
4634 size when folding cleared TREE_CONSTANT.
4635
dc192bbd
IS
46362020-02-26 Iain Sandoe <iain@sandoe.co.uk>
4637
4638 * class.c (classtype_has_non_deleted_copy_ctor): New.
4639 * coroutines.cc (struct param_info): Keep track of params
4640 that are references, and cache the original type and whether
4641 the DTOR is trivial.
4642 (build_actor_fn): Handle param copies always, and adjust the
4643 handling for references.
4644 (register_param_uses): Only handle uses here.
4645 (classtype_has_non_deleted_copy_ctor): New.
4646 (morph_fn_to_coro): Adjust param copy handling to match n4849
4647 by reordering ahead of the promise CTOR and always making a
4648 frame copy, even if the param is unused in the coroutine body.
4649 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
4650
44f6b7fb
PP
46512020-02-26 Patrick Palka <ppalka@redhat.com>
4652
4653 * constraint.cc (finish_constraint_binary_op): Set expr's location range
4654 to the range of its operands.
4655 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
4656 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
4657 instead of the corresponding template arguments ARGS and adjust body
4658 accordingly.
4659 (diagnose_requires_expr): Likewise.
4660 (diagnose_atomic_constraint): Likewise. When printing an atomic
4661 constraint expression, print the instantiated parameter mapping
4662 alongside it.
4663 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
4664 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
4665 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
4666
38e10026
MP
46672020-02-26 Marek Polacek <polacek@redhat.com>
4668
4669 PR c++/93676 - value-init crash in template.
4670 * init.c (build_new_1): Don't call build_vec_init in a template.
4671
4a305fa2
MP
46722020-02-26 Marek Polacek <polacek@redhat.com>
4673
4674 PR c++/93862 - ICE with static_cast when converting from int[].
4675 * call.c (reference_compatible_p): No longer static.
4676 * cp-tree.h (reference_compatible_p): Declare.
4677 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
4678 of reference_related_p.
4679
d6ff2207
MP
46802020-02-26 Marek Polacek <polacek@redhat.com>
4681
4682 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
4683 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
4684 field.
4685
b73547e4
MS
46862020-02-24 Martin Sebor <msebor@redhat.com>
4687
4688 PR c++/93804
4689 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
4690 in shared C/C++ code in headers.
fb77bf1c 4691 Remove a duplicate hunk of code.
b73547e4 4692
cae5ff60
MP
46932020-02-24 Marek Polacek <polacek@redhat.com>
4694
4695 PR c++/93869 - ICE with -Wmismatched-tags.
4696 * parser.c (cp_parser_check_class_key): Check class_key earlier.
4697
b07c0855
MP
46982020-02-24 Marek Polacek <polacek@redhat.com>
4699
4700 PR c++/93712 - ICE with ill-formed array list-initialization.
4701 * call.c (next_conversion): Return NULL for ck_aggr.
4702 (build_aggr_conv): Set u.expr instead of u.next.
4703 (build_array_conv): Likewise.
4704 (build_complex_conv): Likewise.
4705 (conv_get_original_expr): Handle ck_aggr.
4706
fb6a8b23
JJ
47072020-02-24 Jakub Jelinek <jakub@redhat.com>
4708
4709 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
4710 * call.c (build_over_call): Don't evaluate immediate functions in
4711 unevaluated operands.
4712
32b8f5df
JM
47132020-02-24 Jason Merrill <jason@redhat.com>
4714
4715 P0780R2: Resolve lambda init-capture pack grammar.
4716 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
4717 ...&x=y.
4718
6cd5024c
MP
47192020-02-22 Marek Polacek <polacek@redhat.com>
4720
4721 PR c++/93882
4722 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
4723
dbfba41e
MS
47242020-02-21 Martin Sebor <msebor@redhat.com>
4725
4726 PR gcov-profile/93753
4727 * class.c (check_flexarrays): Tighten up a test for potential members
4728 of anonymous structs or unions.
4729
96cbc56e
MS
47302020-02-20 Martin Sebor <msebor@redhat.com>
4731
4732 PR c++/93801
4733 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
4734
4a172be3
ML
47352020-02-20 Martin Liska <mliska@suse.cz>
4736
4737 PR translation/93841
4738 * config/or1k/or1k.opt: Remove superfluous word.
4739 * doc/invoke.texi: Likewise.
4740
6c39d0b7
ML
47412020-02-20 Martin Liska <mliska@suse.cz>
4742
4743 PR translation/93838
4744 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
4745
8f9dd1b0
MP
47462020-02-19 Marek Polacek <polacek@redhat.com>
4747
4748 PR c++/93169 - wrong-code with a non-constexpr constructor.
4749 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
4750 on constant CONSTRUCTORs.
4751
eef65c47
MP
47522020-02-15 Marek Polacek <polacek@redhat.com>
4753
4754 PR c++/93710 - poor diagnostic for array initializer.
4755 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
4756 for an error call.
4757
d7136542
JM
47582020-02-15 Jason Merrill <jason@redhat.com>
4759
1e166191
JM
4760 PR c++/92556
4761 * pt.c (any_template_parm_r): Look into lambda body.
4762
d7136542
JM
4763 PR c++/92583
4764 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
4765
994e0ad4
JJ
47662020-02-14 Jakub Jelinek <jakub@redhat.com>
4767
519a33f9
JJ
4768 PR c++/61414
4769 * class.c (enum_min_precision): Change prec type from int to int &.
4770
994e0ad4
JJ
4771 PR libstdc++/92906
4772 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
4773 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
4774 (fallback_dfloat32_type, fallback_dfloat64_type,
4775 fallback_dfloat128_type): Define.
4776 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
4777 dfloat*_type_node.
4778 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
4779 is disabled for compatibility.
4780
abc79c64
JM
47812020-02-13 Jason Merrill <jason@redhat.com>
4782
9a0c4f5b
JM
4783 PR c++/93713
4784 * name-lookup.c (matching_fn_p): A function does not match a
4785 template.
4786
abc79c64
JM
4787 PR c++/93643
4788 PR c++/91476
4789 * tree.c (decl_linkage): Always lk_none for locals.
4790
c2368db5
JM
47912020-02-12 Jason Merrill <jason@redhat.com>
4792
4793 PR c++/92583
4794 PR c++/92654
4795 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
4796 * pt.c (find_parameter_packs_r): Not here.
4797
e4658c7d 47982020-02-12 Iain Sandoe <iain@sandoe.co.uk>
68bb7e3b
IS
4799
4800 * coroutines.cc (build_actor_fn): Implement deallocation function
4801 selection per n4849, dcl.fct.def.coroutine bullet 12.
4802 (morph_fn_to_coro): Implement allocation function selection per
4803 n4849, dcl.fct.def.coroutine bullets 9 and 10.
4804
e428a9cf
MP
48052020-02-12 Marek Polacek <polacek@redhat.com>
4806
4807 PR c++/93684 - ICE-on-invalid with broken attribute.
4808 * parser.c (cp_parser_std_attribute): Peek a token first before
4809 consuming it.
4810
d6ef77e0
JM
48112020-02-11 Jason Merrill <jason@redhat.com>
4812
4813 PR c++/93675
4814 * class.c (add_implicitly_declared_members): Use do_friend.
4815 * method.c (implicitly_declare_fn): Fix friend handling.
4816 (decl_remember_implicit_trigger_p): New.
4817 (synthesize_method): Use it.
4818 * decl2.c (mark_used): Use it.
4819
dfffecb8
JM
48202020-02-11 Jason Merrill <jason@redhat.com>
4821
4822 PR c++/93650
4823 PR c++/90691
4824 * constexpr.c (maybe_constant_value): Correct earlier change.
4825 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
4826 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
4827
91f4fc40
PP
48282020-02-12 Patrick Palka <ppalka@redhat.com>
4829
a6ee556c
PP
4830 PR c++/69448
4831 PR c++/80471
4832 * type-utils.h (find_type_usage): Refactor to take a tree * and to
4833 return a tree *, and update documentation accordingly.
4834 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
4835 decltype(auto) node.
4836 (make_constrained_decltype_auto): No need to explicitly set
4837 AUTO_IS_DECLTYPE anymore.
4838 (splice_late_return_type): Use find_type_usage to find and
4839 replace a possibly nested auto node instead of using is_auto.
4840 Check test for is_auto into an assert when deciding whether
4841 to late_return_type.
4842 (type_uses_auto): Adjust the call to find_type_usage.
4843 * parser.c (cp_parser_decltype): No need to explicitly set
4844 AUTO_IS_DECLTYPE anymore.
4845
91f4fc40
PP
4846 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
4847 (dump_simple_decl): Handle standard concept definitions as well as
4848 variable concept definitions.
4849
13686ece
JJ
48502020-02-10 Jakub Jelinek <jakub@redhat.com>
4851
4852 PR other/93641
4853 * error.c (dump_decl_name): Fix up last argument to strncmp.
4854
59dbb04d
JM
48552020-02-10 Jason Merrill <jason@redhat.com>
4856
4857 PR c++/93618
4858 * tree.c (array_of_unknown_bound_p): New.
4859 * init.c (perform_member_init): Do nothing for flexible arrays.
4860
81958cd6
JJ
48612020-02-09 Jakub Jelinek <jakub@redhat.com>
4862
4863 PR c++/93633
4864 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
4865 ARRAY_TYPE, use the element type. Punt if objtype after that is not
4866 a class type.
4867
c151a342
JM
48682020-02-08 Jason Merrill <jason@redhat.com>
4869
aaa26bf4
JM
4870 PR c++/90691
4871 * expr.c (fold_for_warn): Call maybe_constant_value.
4872 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
4873 (maybe_constant_value): Add uid_sensitive parm.
4874 (get_fundef_copy): Don't copy if it's true.
4875 (cxx_eval_call_expression): Don't instantiate if it's true.
4876 (cxx_eval_outermost_constant_expr): Likewise.
4877
173c8def
JM
4878 PR c++/92852
4879 * constexpr.c (maybe_constant_value): Don't unshare if the cached
4880 value is the same as the argument.
4881
61f5369f
JM
4882 * typeck.c (maybe_warn_about_returning_address_of_local): Add
4883 location parameter.
4884
c151a342
JM
4885 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
4886 if appropriate.
4887
c7c09af8
JJ
48882020-02-08 Jakub Jelinek <jakub@redhat.com>
4889
4890 PR c++/93549
4891 * constexpr.c (find_array_ctor_elt): If last element has no index,
4892 for flag_checking verify all elts have no index. If i is within the
4893 elts, return it directly, if it is right after the last elt, append
4894 if NULL index, otherwise force indexes on all elts.
4895 (cxx_eval_store_expression): Allow cep->index to be NULL.
4896
ac6eaa55
MP
48972020-02-07 Marek Polacek <polacek@redhat.com>
4898
4899 PR c++/92947 - Paren init of aggregates in unevaluated context.
4900 * call.c (build_new_method_call_1): Don't check
4901 cp_unevaluated_operand. Check the return value of digest_init.
4902
1e042b39
JM
49032020-02-06 Jason Merrill <jason@redhat.com>
4904
4905 PR c++/92654
4906 * tree.c (cp_walk_subtrees): Walk into type template arguments.
4907 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
4908 instead of TYPE_ALIAS_P.
4909 * pt.c (push_template_decl_real): Likewise.
4910 (find_parameter_packs_r): Likewise. Remove dead code.
4911 * error.c (find_typenames_r): Remove dead code.
4912
82aee6dd
JM
49132020-02-06 Jason Merrill <jason@redhat.com>
4914
4915 PR c++/92517
4916 * parser.c (cp_parser_constraint_primary_expression): Do the main
4917 parse non-tentatively.
4918
4a136a21
MP
49192020-02-06 Marek Polacek <polacek@redhat.com>
4920
4921 PR c++/93597 - ICE with lambda in operator function.
4922 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
4923
f6bef097
JM
49242020-02-05 Jason Merrill <jason@redhat.com>
4925
4926 PR c++/93140
4927 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
4928 handling of TREE_CHAIN for empty pack.
4929
f214002b
MP
49302020-02-05 Jakub Jelinek <jakub@redhat.com>
4931
4932 PR c++/93557
4933 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
4934 prior to passing it to c_build_vec_convert.
4935
78c4eb1c
MP
49362020-02-05 Marek Polacek <polacek@redhat.com>
4937
4938 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
4939 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
4940 TREE_SIDE_EFFECTS.
4941
fa0c6e29
JM
49422020-02-05 Jason Merrill <jason@redhat.com>
4943
4944 PR c++/92593
4945 * decl.c (grokdeclarator): Reject field of current class type even
4946 in a template.
4947
a2155f7d
BC
49482020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
4949
4950 * coroutines.cc (maybe_promote_captured_temps): Increase the index
4951 number for temporary variables' name.
4952
e4658c7d 49532020-02-05 Jun Ma <JunMa@linux.alibaba.com>
3ef39186
J
4954
4955 * coroutines.cc (build_co_await): Call convert_from_reference
4956 to wrap co_await_expr with indirect_ref which avoid
4957 reference/non-reference type confusion.
4958
4959 (co_await_expander): Sink to call_expr if await_resume
4960 is wrapped by indirect_ref.
4961
a1c9c9ff
JM
49622020-02-04 Jason Merrill <jason@redhat.com>
4963
85409531
JM
4964 PR c++/93551
4965 * constraint.cc (satisfy_declaration_constraints): Check return
4966 value of push_tinst_level.
4967
0712ea63
JM
4968 PR c++/90951
4969 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
4970 elements instead of value-initializing them.
4971
a1c9c9ff
JM
4972 PR c++/86917
4973 * init.c (perform_member_init): Simplify.
4974 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
4975 flexarray.
4976 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
4977
5bc9d2f5
IS
49782020-02-04 Iain Sandoe <iain@sandoe.co.uk>
4979
4980 * coroutines.cc (find_promise_type): Delete unused forward
4981 declaration.
4982 (struct coroutine_info): Add a bool for no promise type error.
4983 (coro_promise_type_found_p): Only emit the error for a missing
4984 promise once in each affected coroutine.
4985
87fbd534
JM
49862020-02-03 Jason Merrill <jason@redhat.com>
4987
4988 PR c++/66477
4989 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
4990 defer loading the value of a reference.
4991
8fda2c27
JM
49922020-02-03 Jason Merrill <jason@redhat.com>
4993
4994 PR c++/91953
4995 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
4996 empty class type.
4997 [COMPONENT_REF]: A member function reference doesn't use the object
4998 as an rvalue.
4999
d60c25fa
IS
50002020-02-03 Iain Sandoe <iain@sandoe.co.uk>
5001
5002 PR c++/93458
5003 * coroutines.cc (struct coroutine_info): Add a bool flag to note
5004 that we emitted an error for a bad function return type.
5005 (get_coroutine_info): Tolerate an unset info table in case of
5006 missing traits.
5007 (find_coro_traits_template_decl): In case of error or if we didn't
5008 find a type template, note we emitted the error and suppress
5009 duplicates.
5010 (find_coro_handle_template_decl): Likewise.
5011 (instantiate_coro_traits): Only check for error_mark_node in the
5012 return from lookup_qualified_name.
5013 (coro_promise_type_found_p): Reorder initialization so that we check
5014 for the traits and their usability before allocation of the info
5015 table. Check for a suitable return type and emit a diagnostic for
5016 here instead of relying on the lookup machinery. This allows the
5017 error to have a better location, and means we can suppress multiple
5018 copies.
5019 (coro_function_valid_p): Re-check for a valid promise (and thus the
5020 traits) before proceeding. Tolerate missing info as a fatal error.
5021
3539fc13
JM
50222020-02-03 Jason Merrill <jason@redhat.com>
5023
5024 PR c++/88256
5025 * cp-gimplify.c (predeclare_vla): New.
5026 (cp_genericize_r) [NOP_EXPR]: Call it.
5027
e4658c7d 50282020-02-03 Jun Ma <JunMa@linux.alibaba.com>
c3ccce5b
J
5029
5030 * coroutines.cc (transform_await_wrapper): Set actor funcion as
5031 new context of label_decl.
5032 (build_actor_fn): Fill new field of await_xform_data.
5033
b817be03
MP
50342020-02-02 Marek Polacek <polacek@redhat.com>
5035
5036 PR c++/93530 - ICE on invalid alignas in a template.
5037 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
5038 decl_attributes.
5039
d2b9548f
JM
50402020-01-31 Jason Merrill <jason@redhat.com>
5041
00a49cd8
JM
5042 PR c++/86216
5043 * semantics.c (process_outer_var_ref): Capture VLAs even in
5044 unevaluated context.
5045
e98ebda0
JM
5046 PR c++/14179
5047 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
5048 non-aggregate elements.
5049 (reshape_init_array): Add first_initializer_p parm.
5050 (reshape_init_r): Change first_initializer_p from bool to tree.
5051 (reshape_init): Pass init to it.
5052
d2b9548f
JM
5053 PR c++/14179
5054 * parser.c (cp_parser_initializer_list): Suppress location wrappers
5055 after 256 elements.
5056
4dd468a0
JM
50572020-01-29 Jason Merrill <jason@redhat.com>
5058
5059 PR c++/82521
5060 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
5061 the expression was dependent before substitution.
5062
3904cc10
BC
50632020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
5064
5065 * coroutines.cc (act_des_fn): New.
5066 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
5067 Access promise via actor function's frame pointer argument.
5068 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
5069
3b35b3d4
BC
50702020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
5071
5072 * coroutines.cc (co_await_expander): Handle type conversion case.
5073
245e40af
JM
50742020-01-29 Jason Merrill <jason@redhat.com>
5075
5076 PR c++/90333
5077 PR c++/89640
5078 PR c++/60503
5079 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
5080 a trailing return type.
5081 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
5082 parens.
5083
e3b60da8
MP
50842020-01-29 Marek Polacek <polacek@redhat.com>
5085
5086 PR c++/91754 - Fix template arguments comparison with class NTTP.
5087 * pt.c (class_nttp_const_wrapper_p): New.
5088 (template_args_equal): See through class_nttp_const_wrapper_p
5089 arguments.
5090
42328405
MP
50912020-01-29 Marek Polacek <polacek@redhat.com>
5092
5093 PR c++/92948 - Fix class NTTP with template arguments.
5094 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
5095 converting a value-dependent expression to a class type.
5096 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
5097 as the result of the tsubst_copy call.
5098
8d7c0bf8
JJ
50992020-01-29 Jakub Jelinek <jakub@redhat.com>
5100
5101 PR c++/91118
5102 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
5103 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
5104
0968f7da
JM
51052020-01-28 Jason Merrill <jason@redhat.com>
5106
a4b4b1e3
JM
5107 PR c++/93442
5108 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
5109
25d62480
JM
5110 PR c++/93477
5111 PR c++/91476
5112 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
5113
14e320db
JM
5114 PR c++/90546
5115 * call.c (build_user_type_conversion_1): Allow a template conversion
5116 returning an rvalue reference to bind directly to an lvalue.
5117
0968f7da
JM
5118 PR c++/90731
5119 * decl.c (grokdeclarator): Propagate eh spec from typedef.
5120
1d859307
ML
51212020-01-28 Martin Liska <mliska@suse.cz>
5122
5123 PR c++/92440
5124 * pt.c (redeclare_class_template): Group couple of
5125 errors and inform messages with auto_diagnostic_group.
5126
d3c00969
ML
51272020-01-28 Martin Liska <mliska@suse.cz>
5128
5129 PR c++/92440
5130 * pt.c (redeclare_class_template): Use inform
5131 for the second location.
5132
8f25c39c
JM
51332020-01-27 Jason Merrill <jason@redhat.com>
5134
5135 PR c++/90966
5136 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
5137
1f2e8423
IS
51382020-01-27 Iain Sandoe <iain@sandoe.co.uk>
5139
5140 PR c++/93443
5141 * coroutines.cc (morph_fn_to_coro): Check the ramp return
5142 value when it is constructed from the 'get return object'.
5143
feaa1640
NS
51442020-01-27 Nathan Sidwell <nathan@acm.org>
5145
5146 PR c++/91826
5147 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
5148
da11ffbb
JM
51492020-01-26 Jason Merrill <jason@redhat.com>
5150
5035cd66
JM
5151 PR c++/90992
5152 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
5153 temporarily enable -Wsystem-headers. Change second warning to
5154 conditional inform.
5155
da11ffbb
JM
5156 PR c++/90997
5157 * semantics.c (finish_call_expr): Don't call
5158 instantiate_non_dependent_expr before warn_for_memset.
5159
de0684bf
MP
51602020-01-25 Marek Polacek <polacek@redhat.com>
5161
5162 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
5163 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
5164 dynamic_cast diagnostic.
5165
9c1179c3
JM
51662020-01-24 Jason Merrill <jason@redhat.com>
5167
5168 PR c++/93400 - ICE with constrained friend.
5169 * constraint.cc (maybe_substitute_reqs_for): New.
5170 * decl.c (function_requirements_equivalent_p): Call it.
5171 * pt.c (tsubst_friend_function): Only substitute
5172 TEMPLATE_PARMS_CONSTRAINTS.
5173 (tsubst_template_parms): Copy constraints.
5174
8b91e848
JM
51752020-01-24 Jason Merrill <jason@redhat.com>
5176
5177 PR c++/93279 - ICE with lambda in member operator.
5178 * name-lookup.c (maybe_save_operator_binding): Don't remember
5179 class-scope bindings.
5180
55dd4453
JM
51812020-01-24 Jason Merrill <jason@redhat.com>
5182
5183 PR c++/93377 - ICE with member alias in constraint.
5184 * pt.c (any_template_parm_r): Look at template arguments for all
5185 aliases, not only alias templates.
5186
d54a86cd
MP
51872020-01-24 Marek Polacek <polacek@redhat.com>
5188
5189 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
5190 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
5191
28a5d5c3
JM
51922020-01-24 Jason Merrill <jason@redhat.com>
5193
5194 PR c++/92852 - ICE with generic lambda and reference var.
5195 * constexpr.c (maybe_constant_value): Likewise.
5196
c9107224
PC
51972020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
5198
5199 PR c++/92804
5200 * parser.c (cp_parser_nested_name_specifier_opt): Properly
5201 diagnose concept-ids.
5202
20afdcd3
JM
52032020-01-23 Jason Merrill <jason@redhat.com>
5204
6f346913
JM
5205 PR c++/93331 - ICE with __builtin_strchr.
5206 * constexpr.c (cxx_eval_builtin_function_call): Use the original
5207 argument if we didn't manage to extract a STRING_CST.
5208
20afdcd3
JM
5209 PR c++/93345 - ICE with defaulted dtor and template.
5210 PR c++/33799
5211 * decl.c (cxx_maybe_build_cleanup): Don't try to set
5212 throwing_cleanup in a template.
5213
e1fd0408
MP
52142020-01-22 Marek Polacek <polacek@redhat.com>
5215
5216 PR c++/92907 - noexcept does not consider "const" in member functions.
5217 * g++.dg/cpp0x/noexcept56.C: New test.
5218
15ed55ea
MP
52192020-01-22 Marek Polacek <polacek@redhat.com>
5220
5221 PR c++/93324 - ICE with -Wall on constexpr if.
5222 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
5223
bf91504d
PP
52242020-01-22 Patrick Palka <ppalka@redhat.com>
5225
5226 * constraint.cc (get_mapped_args): Avoid using auto_vec
5227 as a vector element. Release the vectors inside the lists
5228 vector.
5229 * parser.c (cp_literal_operator_id): Free the buffer.
5230
44a9d801 52312020-01-22 Jun Ma <JunMa@linux.alibaba.com>
6ac6529e
J
5232
5233 * coroutines.cc (finish_co_await_expr): Add error check on return
5234 value of build_co_await.
5235 (finish_co_yield_expr,): Ditto.
5236
44a9d801 52372020-01-22 Jun Ma <JunMa@linux.alibaba.com>
c75199b7
J
5238
5239 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
5240 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
5241 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
5242
27626519
JM
52432020-01-21 Jason Merrill <jason@redhat.com>
5244
ad09440a
JM
5245 PR c++/60855 - ICE with sizeof VLA capture.
5246 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
5247
27626519
JM
5248 PR c++/90732 - ICE with VLA capture and generic lambda.
5249 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
5250
a312c801
IS
52512020-01-21 Iain Sandoe <iain@sandoe.co.uk>
5252 Bin Cheng <bin.cheng@linux.alibaba.com>
5253
5254 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
5255 from complete_type_or_else.
5256 (register_param_uses): Likewise.
5257 (build_co_await): Do not try to use complete_type_or_else for void
5258 types, otherwise for incomplete types, check for NULL return from
5259 complete_type_or_else.
5260
8158a464
JM
52612020-01-21 Jason Merrill <jason@redhat.com>
5262
5263 PR c++/91476 - anon-namespace reference temp clash between TUs.
5264 * decl2.c (copy_linkage): Factor out of get_guard.
5265 * call.c (make_temporary_var_for_ref_to_temp): Use it.
5266 * decl.c (cp_finish_decomp): Use it.
5267 (cp_finish_decl): determine_visibility sooner.
5268
b313d3c4
BC
52692020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
5270
5271 * coroutines.cc (finish_co_await_expr): Set return value flag.
5272 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
5273
303484a7
JM
52742020-01-19 Jason Merrill <jason@redhat.com>
5275
bcfc2227
JM
5276 PR c++/33799 - destroy return value, take 2.
5277 * cp-tree.h (current_retval_sentinel): New macro.
5278 (struct language_function): Add throwing_cleanup bitfield.
5279 * decl.c (cxx_maybe_build_cleanup): Set it.
5280 * except.c (maybe_set_retval_sentinel)
5281 (maybe_splice_retval_cleanup): New functions.
5282 * parser.c (cp_parser_compound_statement): Call
5283 maybe_splice_retval_cleanup.
5284 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
5285
303484a7
JM
5286 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
5287
dba33cb7
JJ
52882020-01-18 Jakub Jelinek <jakub@redhat.com>
5289
5290 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
5291 but non-NO_DOLLAR_IN_LABEL case build.
5292
49789fd0
IS
52932020-01-18 Iain Sandoe <iain@sandoe.co.uk>
5294
5295 * Make-lang.in: Add coroutines.o.
5296 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
5297 (DECL_COROUTINE_P): New.
5298 * lex.c (init_reswords): Enable keywords when the coroutine flag
5299 is set,
5300 * operators.def (co_await): New operator.
5301 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
5302 (op_error): Likewise.
5303 (build_new_op_1): Likewise.
5304 (build_new_function_call): Validate coroutine builtin arguments.
5305 * constexpr.c (potential_constant_expression_1): Handle
5306 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
5307 * coroutines.cc: New file.
5308 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
5309 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
5310 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
5311 * cp-tree.h (coro_validate_builtin_call): New.
5312 * decl.c (emit_coro_helper): New.
5313 (finish_function): Handle the case when a function is found to
5314 be a coroutine, perform the outlining and emit the outlined
5315 functions. Set a bit to signal that this is a coroutine component.
5316 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
5317 (cp_parser_unary_expression): Handle co_await.
5318 (cp_parser_assignment_expression): Handle co_yield.
5319 (cp_parser_statement): Handle RID_CO_RETURN.
5320 (cp_parser_jump_statement): Handle co_return.
5321 (cp_parser_operator): Handle co_await operator.
5322 (cp_parser_yield_expression): New.
5323 (cp_parser_required_error): Handle RT_CO_YIELD.
5324 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
5325 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
5326 CO_RETURN_EXPRs.
5327 * tree.c (cp_walk_subtrees): Likewise.
5328
eff9c61d
JM
53292020-01-17 Jason Merrill <jason@redhat.com>
5330
5331 PR c++/92531 - ICE with noexcept(lambda).
5332 * pt.c (uses_template_parms): Don't try to enumerate all the
5333 expression cases.
5334
c60a18f8
JJ
53352020-01-17 Jakub Jelinek <jakub@redhat.com>
5336
5337 PR c++/93228
5338 * parser.c (cp_parser_template_name): Look up deprecated attribute
5339 in DECL_TEMPLATE_RESULT or its type's attributes.
5340
801f5b96
JM
53412020-01-16 Jason Merrill <jason@redhat.com>
5342
5194b51e
JM
5343 PR c++/93286 - ICE with __is_constructible and variadic template.
5344 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
5345 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
5346
801f5b96
JM
5347 PR c++/93280 - ICE with aggregate assignment and DMI.
5348 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
5349 * typeck2.c (digest_nsdmi_init): Not here.
5350
83fe2b92
PC
53512020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
5352
5353 PR c++/91073
5354 * cp-tree.h (is_constrained_auto): New.
5355 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
5356 handle concept-check expressions; take a cp_decl_specifier_seq*
5357 instead of a bool.
5358 (cp_parser_condition): Update call.
5359 (cp_parser_simple_declaration): Likewise.
5360 (cp_parser_placeholder_type_specifier): Correctly handle
5361 concept-check expressions.
5362
7192b1ec
JM
53632020-01-15 Jason Merrill <jason@redhat.com>
5364
299ddc61
JM
5365 Revert
5366 PR c++/33799 - destroy return value if local cleanup throws.
5367 * cp-tree.h (current_retval_sentinel): New macro.
5368 * decl.c (start_preparsed_function): Set up cleanup for retval.
5369 * typeck.c (check_return_expr): Set current_retval_sentinel.
5370
596334fa
JM
5371 PR c++/93257 - consteval void function.
5372 * constexpr.c (verify_constant): Allow void_node.
5373
7192b1ec
JM
5374 PR c++/92871 - bad code with xvalue and GNU ?: extension.
5375 * call.c (prevent_lifetime_extension): New.
5376 (build_conditional_expr_1): Use it.
5377
a5a3c2dc
NS
53782020-01-14 Nathan Sidwell <nathan@acm.org>
5379
1918e70d 5380 PR c++/90916
ddd792fa
NS
5381 * pt.c (retrieve_specialization): Use get_template_info, not open
5382 coding access.
5383
a5a3c2dc
NS
5384 PR c++/90916
5385 * pt.c (retrieve_specialization): Get the TI from the decl or the
5386 classtype as appropriate.
5387
7ca50de0
DM
53882020-01-14 David Malcolm <dmalcolm@redhat.com>
5389
5390 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
5391 New static constant.
5392 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
5393 (struct named_label_hash::empty_zero_p): Likewise.
5394 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
5395
80de0002
JM
53962020-01-14 Jason Merrill <jason@redhat.com>
5397
08c8c973
JM
5398 PR c++/92590 - wrong handling of inherited default ctor.
5399 * class.c (add_method): A constrained inherited ctor doesn't hide an
5400 implicit derived ctor.
5401 Revert:
5402 PR c++/92552 - ICE with inherited constrained default ctor.
5403 * pt.c (instantiate_class_template_1): Copy
5404 TYPE_HAS_USER_CONSTRUCTOR.
5405 PR c++/91930 - ICE with constrained inherited default ctor.
5406 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
5407 for inherited constructor.
5408 PR c++/92594 - ICE with inherited trivial default ctor.
5409 * method.c (trivial_fn_p): Treat an inherited default constructor
5410 like a normal default constructor.
5411
8982b553
JM
5412 PR c++/92594 - ICE with inherited trivial default ctor.
5413 * method.c (trivial_fn_p): Treat an inherited default constructor
5414 like a normal default constructor.
5415
80de0002
JM
5416 PR c++/92009 - ICE with punning of typeid.
5417 * rtti.c (get_tinfo_desc): Call xref_basetypes.
5418 * constexpr.c (cxx_fold_indirect_ref): Don't strip
5419 REINTERPRET_CAST_P.
5420
f1acad4e
JM
54212020-01-13 Jason Merrill <jason@redhat.com>
5422
edabbec3
JM
5423 PR c++/92746 - ICE with noexcept of function concept check.
5424 * except.c (check_noexcept_r): Handle concept-check.
5425
8ca4435f
JM
5426 PR c++/92582 - ICE with member template as requirement.
5427 * pt.c (struct find_template_parameter_info): Add ctx_parms.
5428 (any_template_parm_r): Handle TEMPLATE_DECL.
5429 (find_template_parameters): Take parms instead of their depth.
5430 * constraint.cc (build_parameter_mapping): Pass them.
5431
7c82dd6c
JM
5432 PR c++/33799 - destroy return value if local cleanup throws.
5433 * cp-tree.h (current_retval_sentinel): New macro.
5434 * decl.c (start_preparsed_function): Set up cleanup for retval.
5435 * typeck.c (check_return_expr): Set current_retval_sentinel.
5436
f1acad4e
JM
5437 PR c++/93238 - short right-shift with enum.
5438 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
5439
640b23d7
JM
54402020-01-10 Jason Merrill <jason@redhat.com>
5441
337ea6b2
JM
5442 * typeck.c (cp_build_binary_op): Restore short_shift code.
5443
e0804c9b
JM
5444 PR c++/93143 - incorrect tree sharing with constexpr.
5445 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
5446 CONSTRUCTORs are already unshared.
5447
640b23d7
JM
5448 PR c++/93173 - incorrect tree sharing.
5449 PR c++/93033
5450 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
5451 copy_if_shared after cp_genericize_tree.
5452 * typeck2.c (split_nonconstant_init): Don't unshare here.
5453
08f594eb
JM
54542020-01-08 Jason Merrill <jason@redhat.com>
5455
5456 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
5457 TARGET_EXPR_DIRECT_INIT_P.
5458 * constexpr.c (cxx_eval_constant_expression): Likewise.
5459
10d2f801
JM
54602020-01-08 Jason Merrill <jason@redhat.com>
5461
5462 PR c++/91369 - constexpr destructor and member initializer.
5463 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
5464 when not preevaluating.
5465
cd3ca6cb
JM
54662020-01-08 Jason Merrill <jason@redhat.com>
5467
5468 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
5469 support.
5470
87d3f828
PC
54712020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
5472
5473 * init.c (build_new): Add location_t parameter and use it throughout.
5474 (build_raw_new_expr): Likewise.
5475 * parser.c (cp_parser_new_expression): Pass the combined_loc.
5476 * pt.c (tsubst_copy_and_build): Adjust call.
5477 * cp-tree.h: Update declarations.
5478
bd65538a
JM
54792020-01-07 Jason Merrill <jason@redhat.com>
5480
5481 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
5482 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
5483 explicit class visibility for a template.
5484
c4b30920
RS
54852020-01-07 Richard Sandiford <richard.sandiford@arm.com>
5486
5487 * mangle.c (mangle_type_attribute_p): New function, split out from...
5488 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
5489 that contain a space.
5490
f74f6092
JJ
54912020-01-07 Jakub Jelinek <jakub@redhat.com>
5492
5493 PR c++/91369
5494 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
5495 member, initialize it to zero in ctor.
5496 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
5497 a heap object. Don't cache calls to functions which allocate some
5498 heap objects and don't deallocate them or deallocate some heap
5499 objects they didn't allocate.
5500
665e3b21
JM
55012020-01-06 Jason Merrill <jason@redhat.com>
5502
5503 PR c++/92552 - ICE with inherited constrained default ctor.
5504 * pt.c (instantiate_class_template_1): Copy
5505 TYPE_HAS_USER_CONSTRUCTOR.
5506 * class.c (one_inherited_ctor): Don't set it here.
5507
e4bcf1f5
AS
55082020-01-06 Andrew Sutton <asutton@lock3software.com>
5509
5510 PR c++/92739 - parsing requires clause with attributes.
5511 * parser.c (cp_parser_constraint_requires_parens): Exclude
5512 attributes as postfix expressions.
5513
39bec8cd
JJ
55142020-01-05 Jakub Jelinek <jakub@redhat.com>
5515
5516 PR c++/93138
5517 * parser.c (cp_parser_check_class_key): Disable access checks for the
5518 simple name lookup.
5519 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
5520 !warn_redundant_tags.
5521
72036b59
JJ
55222010-01-05 Jakub Jelinek <jakub@redhat.com>
5523
5524 PR c++/93046
5525 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
5526 TARGET_EXPR if it has been gimplified already.
5527
8b5d34fc
JM
55282020-01-03 Jason Merrill <jason@redhat.com>
5529
5530 PR c++/93033 - incorrect tree node sharing with array init.
5531 * typeck2.c (split_nonconstant_init): Unshare non-decl.
5532 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
5533
657fea97
JM
55342020-01-02 Jason Merrill <jason@redhat.com>
5535
5536 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
5537 C++17.
5538
4a08009e
JJ
55392020-01-02 Jakub Jelinek <jakub@redhat.com>
5540
5541 PR c/90677
5542 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
5543 has not been found, rather than error_mark_node.
5544
8d9254fc 55452020-01-01 Jakub Jelinek <jakub@redhat.com>
19c37faa 5546
85ec4feb 5547 Update copyright years.
ad41bd84 5548\f
8d9254fc 5549Copyright (C) 2020 Free Software Foundation, Inc.
ad41bd84
JM
5550
5551Copying and distribution of this file, with or without modification,
5552are permitted in any medium without royalty provided the copyright
5553notice and this notice are preserved.