]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/cp/ChangeLog
Daily bump.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
1 2021-05-25 Jakub Jelinek <jakub@redhat.com>
2
3 PR c++/100666
4 * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
5 and side-effects, temporarily disable -Wunused-result warning when
6 building COMPOUND_EXPR.
7
8 2021-05-21 Jakub Jelinek <jakub@redhat.com>
9
10 PR middle-end/99928
11 * semantics.c (finish_omp_clauses): Move firstprivate clauses with
12 OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain. Don't error
13 if a decl is mentioned both in map clause and in such firstprivate
14 clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
15
16 2021-05-20 Jason Merrill <jason@redhat.com>
17
18 * call.c (reference_binding): Check for designator.
19 (implicit_conversion_1, build_special_member_call): Likewise.
20 * decl.c (reshape_init_r): Likewise.
21 * pt.c (do_class_deduction): Likewise.
22 * typeck2.c (digest_init_r): Likewise.
23
24 2021-05-20 Jason Merrill <jason@redhat.com>
25
26 PR c++/100489
27 * decl.c (reshape_init_class): Handle designator for
28 member of anonymous aggregate here.
29 * typeck2.c (process_init_constructor_record): Not here.
30
31 2021-05-20 Jonathan Wakely <jwakely@redhat.com>
32
33 * call.c (maybe_warn_array_conv): Use new warning option.
34 * decl.c (mark_inline_variable, grokdeclarator): Likewise.
35 * error.c (maybe_warn_cpp0x): Likewise.
36 * parser.c (cp_parser_primary_expression)
37 (cp_parser_unqualified_id)
38 (cp_parser_pseudo_destructor_name)
39 (cp_parser_lambda_introducer)
40 (cp_parser_lambda_declarator_opt)
41 (cp_parser_selection_statement)
42 (cp_parser_init_statement)
43 (cp_parser_decomposition_declaration)
44 (cp_parser_function_specifier_opt)
45 (cp_parser_static_assert)
46 (cp_parser_namespace_definition)
47 (cp_parser_using_declaration)
48 (cp_parser_asm_definition)
49 (cp_parser_ctor_initializer_opt_and_function_body)
50 (cp_parser_initializer_list)
51 (cp_parser_type_parameter_key)
52 (cp_parser_member_declaration)
53 (cp_parser_try_block)
54 (cp_parser_std_attribute_spec): Likewise.
55 * pt.c (check_template_variable): Likewise.
56
57 2021-05-20 Jason Merrill <jason@redhat.com>
58
59 PR c++/100634
60 * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
61
62 2021-05-20 Jason Merrill <jason@redhat.com>
63
64 PR c++/100659
65 * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
66
67 2021-05-19 Jason Merrill <jason@redhat.com>
68
69 PR c++/100367
70 PR c++/96299
71 * method.c (genericize_spaceship): Use fold_build2 for scalar
72 operands.
73
74 2021-05-19 Jason Merrill <jason@redhat.com>
75
76 * pt.c (build_deduction_guide): Treat the implicit deduction guide
77 as a member of the class.
78
79 2021-05-19 Marek Polacek <polacek@redhat.com>
80
81 PR c++/100596
82 * cp-tree.h (any_non_type_attribute_p): Remove.
83 * decl.c (grokdeclarator): Turn an error into a warning and only
84 warn for standard attributes.
85 * decl2.c (any_non_type_attribute_p): Remove.
86 * parser.c (cp_parser_elaborated_type_specifier): Turn an error
87 into a warning and only warn for standard attributes.
88 (cp_parser_member_declaration): Likewise.
89
90 2021-05-19 Martin Liska <mliska@suse.cz>
91
92 PR testsuite/100658
93 * mangle.c (write_encoding): Fix typos.
94
95 2021-05-19 Jakub Jelinek <jakub@redhat.com>
96
97 PR middle-end/99928
98 * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
99 master when combined with taskloop.
100 (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
101 parallel master when not combined with taskloop.
102
103 2021-05-19 Jason Merrill <jason@redhat.com>
104
105 PR c++/100261
106 * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
107
108 2021-05-19 Jason Merrill <jason@redhat.com>
109
110 PR c++/100372
111 * tree.c (strip_typedefs): Only look at the pattern of a
112 TYPE_PACK_EXPANSION if it's a type.
113
114 2021-05-18 Marek Polacek <polacek@redhat.com>
115
116 * class.c (classtype_has_non_deleted_copy_ctor): Remove.
117 * constraint.cc (contains_wildcard_p): Likewise.
118 (get_template_head_requirements): Likewise.
119 (check_constrained_friend): Likewise.
120 (subsumes_constraints): Likewise.
121 * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
122 (push_void_library_fn): Likewise.
123 (get_pattern_parm): Likewise.
124 (get_template_parms_at_level): Likewise.
125 (lambda_return_type): Likewise.
126 (get_template_head_requirements): Likewise.
127 (check_constrained_friend): Likewise.
128 (subsumes_constraints): Likewise.
129 * decl.c (push_void_library_fn): Likewise.
130 * lambda.c (lambda_return_type): Likewise.
131 * pt.c (get_template_parms_at_level): Likewise.
132 (get_pattern_parm): Likewise.
133
134 2021-05-18 Jason Merrill <jason@redhat.com>
135
136 PR c++/100644
137 * call.c (perfect_candidate_p): An implicitly deleted move
138 is not perfect.
139
140 2021-05-18 Andreas Krebbel <krebbel@linux.ibm.com>
141
142 PR c++/100281
143 * cvt.c (cp_convert_to_pointer): Use the size of the target
144 pointer type.
145 * tree.c (cp_build_reference_type): Call
146 cp_build_reference_type_for_mode with VOIDmode.
147 (cp_build_reference_type_for_mode): Rename from
148 cp_build_reference_type. Add MODE argument and invoke
149 build_reference_type_for_mode.
150 (strip_typedefs): Use build_pointer_type_for_mode and
151 cp_build_reference_type_for_mode for pointers and references.
152
153 2021-05-17 Jonathan Wakely <jwakely@redhat.com>
154
155 PR c++/100635
156 * call.c (convert_like_internal): Print different diagnostic if
157 the lvalue reference is const.
158
159 2021-05-14 Jason Merrill <jason@redhat.com>
160
161 PR c++/95870
162 * pt.c (enclosing_instantiation_of): Just compare
163 DECL_SOURCE_LOCATION.
164 (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
165
166 2021-05-14 Marek Polacek <polacek@redhat.com>
167 Jason Merrill <jason@redhat.com>
168
169 PR c++/99032
170 * cp-tree.h (any_non_type_attribute_p): Declare.
171 * decl.c (grokdeclarator): Diagnose when an attribute appertains to
172 a friend declaration that is not a definition.
173 * decl2.c (any_non_type_attribute_p): New.
174 * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
175 in the middle of decl-specifiers.
176 (cp_parser_elaborated_type_specifier): Diagnose when an attribute
177 appertains to a friend declaration that is not a definition.
178 (cp_parser_member_declaration): Likewise.
179
180 2021-05-12 Marek Polacek <polacek@redhat.com>
181
182 * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
183 sentinel.
184
185 2021-05-12 Marcel Vollweiler <marcel@codesourcery.com>
186
187 * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
188 'close'.
189
190 2021-05-11 Jason Merrill <jason@redhat.com>
191
192 PR c++/100517
193 * typeck.c (build_reinterpret_cast_1): Check intype on
194 cast to vector.
195
196 2021-05-11 Patrick Palka <ppalka@redhat.com>
197
198 PR c++/51577
199 * name-lookup.c (maybe_save_operator_binding): Unconditionally
200 enable for all function templates, not just generic lambdas.
201 Handle compound-assignment operator expressions.
202 * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
203 in the type-dependent case.
204 (build_x_modify_expr): Likewise. Move declaration of 'op' closer
205 to its first use.
206
207 2021-05-11 Patrick Palka <ppalka@redhat.com>
208
209 PR c++/100138
210 * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
211 (satisfy_atom): Set up iloc_sentinel before calling
212 cxx_constant_value.
213 * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
214 expansion, carry over PACK_EXPANSION_LOCAL_P and
215 PACK_EXPANSION_SIZEOF_P from the original pack expansion.
216
217 2021-05-10 Richard Biener <rguenther@suse.de>
218
219 PR middle-end/100464
220 PR c++/100468
221 * call.c (set_up_extended_ref_temp): Mark the temporary
222 addressable if the TARGET_EXPR was.
223
224 2021-05-10 Martin Liska <mliska@suse.cz>
225
226 * decl.c (duplicate_decls): Use startswith
227 function instead of strncmp.
228 (cxx_builtin_function): Likewise.
229 (omp_declare_variant_finalize_one): Likewise.
230 (grokfndecl): Likewise.
231 * error.c (dump_decl_name): Likewise.
232 * mangle.c (find_decomp_unqualified_name): Likewise.
233 (write_guarded_var_name): Likewise.
234 (decl_tls_wrapper_p): Likewise.
235 * parser.c (cp_parser_simple_type_specifier): Likewise.
236 (cp_parser_tx_qualifier_opt): Likewise.
237 * pt.c (template_parm_object_p): Likewise.
238 (dguide_name_p): Likewise.
239
240 2021-05-10 Martin Liska <mliska@suse.cz>
241
242 PR c++/99616
243 * decl.c (grokdeclarator): Remove redundant NULL check.
244
245 2021-05-07 Jason Merrill <jason@redhat.com>
246
247 * tree.c (rvalue): Assert expr is not a class lvalue.
248
249 2021-05-07 Jason Merrill <jason@redhat.com>
250
251 * cp-tree.h (build_stub_object): Declare.
252 * method.c (build_stub_object): No longer static.
253 * call.c (can_convert): Use it.
254 * tree.c (build_dummy_object): Adjust comment.
255 * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
256 TARGET_EXPR.
257
258 2021-05-07 Jason Merrill <jason@redhat.com>
259
260 * coroutines.cc (build_co_await): Don't call 'rvalue'.
261 (flatten_await_stmt): Simplify initialization.
262 (morph_fn_to_coro): Change 'rvalue' to 'move'. Simplify.
263
264 2021-05-04 Tobias Burnus <tobias@codesourcery.com>
265
266 * semantics.c (finish_omp_reduction_clause): Accept float + complex
267 for || and && reductions.
268
269 2021-05-03 Patrick Palka <ppalka@redhat.com>
270
271 PR c++/100362
272 * parser.c (cp_parser_class_head): Reinstate calls to pushclass
273 and popclass when parsing the base-clause that were removed in
274 r11-6815.
275
276 2021-05-03 Patrick Palka <ppalka@redhat.com>
277
278 PR c++/68942
279 PR c++/100344
280 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
281 only when the callee is a FUNCTION_DECL.
282
283 2021-05-03 Marek Polacek <polacek@redhat.com>
284
285 PR c++/100055
286 * decl.c (grokfndecl): Check current_template_parms.
287
288 2021-05-03 Marek Polacek <polacek@redhat.com>
289
290 DR 1312
291 * constexpr.c (cxx_eval_constant_expression): Don't check
292 integer_zerop.
293
294 2021-05-01 Jason Merrill <jason@redhat.com>
295
296 * cp-tree.h (class ovl_iterator): Allow copying. Add op==.
297 (class ovl_range, class lkp_range): New.
298 * call.c (build_op_call_1, add_candidates): Use them.
299 (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
300 (has_trivial_copy_p): Likewise.
301 * class.c (handle_using_decl, get_basefndecls): Likewise.
302 (maybe_warn_about_overly_private_class): Likewise.
303 (warn_hidden, add_implicitly_declared_members): Likewise.
304 (check_methods, clone_constructors_and_destructors): Likewise.
305 (type_has_user_nondefault_constructor): Likewise.
306
307 2021-04-29 Jason Merrill <jason@redhat.com>
308
309 * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
310 don't find a field.
311
312 2021-04-29 Jason Merrill <jason@redhat.com>
313
314 PR c++/51344
315 * decl2.c (grokfield): Call cplus_decl_attributes for friend.
316 (save_template_attributes): Use chainon.
317 * friend.c (do_friend): Remove attrlist parm.
318 * cp-tree.h (do_friend): Adjust.
319 * class.c (add_implicitly_declared_members): Adjust.
320 * decl.c (grokdeclarator): Adjust.
321 * pt.c (apply_late_template_attributes): Optimize.
322
323 2021-04-29 Jason Merrill <jason@redhat.com>
324
325 PR c++/97974
326 * class.c (finish_struct_anon_r): Drop complain parm.
327 Remove non-field diagnostic.
328 (finish_struct_anon): Adjust.
329 * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
330
331 2021-04-29 Jason Merrill <jason@redhat.com>
332
333 * cp-tree.h (cp_evaluated): Add reset parm to constructor.
334 * parser.c (cp_parser_constant_expression): Change
335 allow_non_constant_p to int. Use cp_evaluated.
336 (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
337 * semantics.c (finish_id_expression_1): Don't mess with
338 cp_unevaluated_operand here.
339
340 2021-04-29 Jason Merrill <jason@redhat.com>
341
342 * cp-tree.h: Clarify comments.
343 * pt.c (get_template_parm_object): Add assert.
344 * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
345 * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
346 * typeck2.c (store_init_value): Likewise.
347
348 2021-04-29 Patrick Palka <ppalka@redhat.com>
349
350 PR c++/68942
351 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
352 set tf_conv during the initial substitution into the function.
353
354 2021-04-29 Jakub Jelinek <jakub@redhat.com>
355
356 PR c++/100319
357 * semantics.c (finish_omp_clauses): Fix up check that variable
358 mentioned in detach clause doesn't appear in data-sharing clauses.
359
360 2021-04-28 Jakub Jelinek <jakub@redhat.com>
361
362 * module.cc: Remove #error that triggers if DEV-PHASE is empty.
363
364 2021-04-27 Jason Merrill <jason@redhat.com>
365
366 PR c++/92145
367 * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
368 of operator=.
369
370 2021-04-27 Patrick Palka <ppalka@redhat.com>
371
372 PR c++/88580
373 * pt.c (tsubst_initializer_list): Correctly handle the case
374 where an argument inside a base initializer pack expansion is
375 itself a pack expansion.
376
377 2021-04-26 Patrick Palka <ppalka@redhat.com>
378
379 PR c++/100209
380 * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
381 object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
382 with a negative offset into one whose offset is nonnegative
383 before calling cxx_fold_indirect_ref_1.
384
385 2021-04-24 Patrick Palka <ppalka@redhat.com>
386
387 PR c++/89565
388 PR c++/93383
389 PR c++/95291
390 PR c++/99200
391 PR c++/99683
392 * pt.c (do_class_deduction): Punt if the initializer is
393 type-dependent.
394
395 2021-04-24 Patrick Palka <ppalka@redhat.com>
396
397 PR c++/87709
398 * parser.c (cp_parser_type_id_1): If we see a template
399 placeholder, first try simulating an error before issuing
400 a real error.
401
402 2021-04-23 Patrick Palka <ppalka@redhat.com>
403
404 PR c++/98767
405 * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
406 Adjust parameter list loop to iterate over 'types' instead of
407 'args'. Output the trailing '...' for a variadic function.
408 Remove PARM_DECL support.
409 (pp_cxx_requires_expr): Pretty print the parameter list directly
410 instead of going through pp_cxx_parameter_declaration_clause.
411
412 2021-04-23 Patrick Palka <ppalka@redhat.com>
413
414 DR 2374
415 * decl.c (is_direct_enum_init): Check the implicit
416 convertibility requirement added by CWG 2374.
417
418 2021-04-23 Martin Liska <mliska@suse.cz>
419
420 * cp-tree.h (STATIC_ASSERT): Prefer static assert.
421 * lex.c (init_operators): Remove run-time check.
422
423 2021-04-22 Marek Polacek <polacek@redhat.com>
424
425 PR c++/100161
426 * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
427 op1 separately for value- or type-dependence.
428
429 2021-04-21 Marek Polacek <polacek@redhat.com>
430
431 PR c++/96380
432 * parser.c (cp_parser_enum_specifier): Don't allow defining
433 types in enum-base.
434
435 2021-04-21 Martin Liska <mliska@suse.cz>
436
437 Revert:
438 2021-04-21 Martin Liska <mliska@suse.cz>
439
440 * error.c (dump_decl): Use flags in dump_generic_node call.
441
442 2021-04-21 Martin Liska <mliska@suse.cz>
443
444 * error.c (dump_decl): Use flags in dump_generic_node call.
445
446 2021-04-21 Martin Liska <mliska@suse.cz>
447
448 * error.c (dump_decl): Support anonymous labels.
449
450 2021-04-20 Jason Merrill <jason@redhat.com>
451
452 PR c++/100109
453 * pt.c (find_parameter_packs_r): Look into enum initializers.
454
455 2021-04-19 Marek Polacek <polacek@redhat.com>
456
457 PR c++/97536
458 * decl.c (grokvardecl): Given an error when a concept is not defined
459 at namespace scope.
460
461 2021-04-16 Jakub Jelinek <jakub@redhat.com>
462
463 PR c++/100111
464 * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
465 for empty classes into *valp when types don't match even when *valp
466 is NULL.
467
468 2021-04-16 Marek Polacek <polacek@redhat.com>
469
470 PR c++/99803
471 * decl.c (make_typename_type): Give an error and return when
472 name is is_overloaded_fn.
473 * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
474 before calling make_typename_type.
475
476 2021-04-16 Patrick Palka <ppalka@redhat.com>
477
478 PR c++/99700
479 * constexpr.c (reduced_constant_expression_p): For array
480 CONSTRUCTORs, use a dedicated loop that additionally verifies
481 the CONSTRUCTOR spans the entire array.
482
483 2021-04-16 Jakub Jelinek <jakub@redhat.com>
484
485 PR c++/99850
486 * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
487 If lambda_p, return pce_ok instead of pce_maybe_postfix.
488
489 2021-04-16 Jakub Jelinek <jakub@redhat.com>
490
491 PR c++/99833
492 * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
493 binding, add to data.internal also all corresponding structured
494 binding decls.
495
496 2021-04-16 Jason Merrill <jason@redhat.com>
497
498 PR c++/100079
499 * cp-tree.h (first_field): Declare.
500 * mangle.c (range_expr_nelts): New.
501 (write_expression): Improve class NTTP mangling.
502 * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
503 * tree.c (zero_init_expr_p): Improve class NTTP handling.
504 * decl.c: Adjust comment.
505
506 2021-04-15 Jason Merrill <jason@redhat.com>
507
508 PR c++/80456
509 * call.c (build_new_method_call_1): Check again for side-effects
510 with a volatile object.
511
512 2021-04-15 Jason Merrill <jason@redhat.com>
513
514 PR c++/100101
515 PR c++/99583
516 * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
517 TYPE_RAISES_EXCEPTIONS here.
518 * tree.c (cp_walk_subtrees): Not here.
519
520 2021-04-15 Jason Merrill <jason@redhat.com>
521
522 PR c++/100091
523 PR c++/99478
524 * parser.c (cp_parser_default_type_template_argument): Set
525 parser->local_variables_forbidden_p.
526
527 2021-04-15 Richard Sandiford <richard.sandiford@arm.com>
528
529 PR c++/98852
530 * typeck.c (merge_type_attributes_from): New function.
531 (cp_common_type): Use it for vector types.
532
533 2021-04-14 Jason Merrill <jason@redhat.com>
534
535 PR c++/100078
536 PR c++/93085
537 * pt.c (uses_outer_template_parms): Also look at default
538 template argument.
539
540 2021-04-14 Jason Merrill <jason@redhat.com>
541
542 PR c++/93314
543 * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
544 for a non-static data member in a constant-expression.
545
546 2021-04-14 Patrick Palka <ppalka@redhat.com>
547
548 PR c++/83476
549 PR c++/99885
550 * pt.c (deducible_expression): Look through implicit
551 INDIRECT_REFs as well.
552
553 2021-04-14 Jason Merrill <jason@redhat.com>
554
555 PR c++/99478
556 * parser.c (cp_parser_lambda_expression): Reject lambda
557 in template parameter type.
558
559 2021-04-14 Jason Merrill <jason@redhat.com>
560
561 PR c++/90674
562 * decl.c (duplicate_decls): Don't propagate
563 DECL_INITIALIZED_IN_CLASS_P to a specialization.
564
565 2021-04-14 Jason Merrill <jason@redhat.com>
566
567 PR c++/88742
568 PR c++/49951
569 PR c++/58123
570 * semantics.c (set_cleanup_locs): New.
571 (do_poplevel): Call it.
572 * parser.c (cp_parser_compound_statement): Consume the }
573 before finish_compound_stmt.
574
575 2021-04-13 Jason Merrill <jason@redhat.com>
576
577 PR c++/100032
578 * pt.c (get_underlying_template): Compare TYPE_QUALS.
579
580 2021-04-13 Jason Merrill <jason@redhat.com>
581
582 PR c++/100054
583 PR c++/90479
584 * init.c (get_nsdmi): Do more context adjustment for local classes.
585
586 2021-04-13 Patrick Palka <ppalka@redhat.com>
587
588 PR c++/99008
589 * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
590 rather than issuing a pedwarn.
591 * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
592 for consistent diagnostics.
593
594 2021-04-13 Jason Merrill <jason@redhat.com>
595
596 PR c++/91933
597 * class.c (build_base_path): Shortcut simple non-pointer case.
598
599 2021-04-13 Eric Botcazou <ebotcazou@adacore.com>
600
601 * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
602 of the linemap.
603 (module_state::write_location): Likewise.
604
605 2021-04-13 Patrick Palka <ppalka@redhat.com>
606
607 PR c++/97134
608 * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
609 when checking if the initializer is an equivalent class
610 placeholder template parameter.
611
612 2021-04-13 Patrick Palka <ppalka@redhat.com>
613
614 PR c++/99961
615 PR c++/99994
616 * constraint.cc (satisfy_normalized_constraints): Set
617 cp_unevaluated.
618 * parser.c (cp_parser_concept_definition): Likewise.
619 (cp_parser_requires_clause_opt): Likewise.
620
621 2021-04-12 Jason Merrill <jason@redhat.com>
622
623 PR c++/93085
624 * pt.c (uses_outer_template_parms): Handle non-type and template
625 template parameters specifically.
626
627 2021-04-11 Jason Merrill <jason@redhat.com>
628
629 PR c++/97974
630 * decl.c (fixup_anonymous_aggr): Prune all functions from
631 CLASSTYPE_MEMBER_VEC.
632
633 2021-04-10 Jason Merrill <jason@redhat.com>
634
635 PR c++/98800
636 PR c++/97399
637 * parser.c (cp_parser_direct_declarator): Don't
638 inject_this_parameter if static_p.
639 (cp_parser_omp_var_list_no_open): Parse 'this' even if
640 current_class_ptr isn't set for a better diagnostic.
641
642 2021-04-10 Jason Merrill <jason@redhat.com>
643
644 PR c++/99180
645 PR c++/93295
646 PR c++/93867
647 PR c++/99118
648 PR c++/96873
649 * pt.c (alias_ctad_tweaks): Handle failure better.
650
651 2021-04-10 Jason Merrill <jason@redhat.com>
652
653 PR c++/100006
654 * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
655
656 2021-04-09 Patrick Palka <ppalka@redhat.com>
657
658 * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
659 (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
660 (LAMBDA_EXPR_REGEN_INFO): ... this.
661 (tree_lambda_expr::regenerated_from)
662 (tree_lambda_expr::regenerating_targs): Replace these with ...
663 (tree_lambda_expr::regen_info): ... this.
664 * constraint.cc (satisfy_declaration_constraints): Adjust
665 accordingly.
666 * lambda.c (build_lambda_expr): Likewise.
667 * pt.c (regenerated_lambda_fn_p): Likewise.
668 (most_general_lambda): Likewise.
669 (tsubst_lambda_expr): Likewise.
670
671 2021-04-09 Marek Polacek <polacek@redhat.com>
672
673 PR c++/99806
674 * parser.c (cp_parser_member_declaration): Call
675 cp_parser_save_default_args even for function templates. Use
676 STRIP_TEMPLATE on the declaration we're passing.
677
678 2021-04-08 Patrick Palka <ppalka@redhat.com>
679
680 PR c++/99874
681 * constraint.cc (get_normalized_constraints_from_decl): Handle
682 regenerated lambdas.
683 (satisfy_declaration_constraints): Likewise. Check for
684 dependent args later.
685 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
686 (LAMBDA_EXPR_REGENERATED_FROM): ... this.
687 (LAMBDA_EXPR_REGENERATING_TARGS): New.
688 (tree_lambda_expr::regenerated_from): New data member.
689 (tree_lambda_expr::regenerating_targs): New data member.
690 (add_to_template_args): Declare.
691 (regenerated_lambda_fn_p): Likewise.
692 (most_general_lambda): Likewise.
693 * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
694 and LAMBDA_EXPR_REGENERATING_TARGS.
695 * pt.c (add_to_template_args): No longer static.
696 (tsubst_function_decl): Unconditionally propagate constraints on
697 the substituted function decl.
698 (instantiated_lambda_fn_p): Rename to ...
699 (regenerated_lambda_fn_p): ... this. Check
700 LAMBDA_EXPR_REGENERATED_FROM instead of
701 LAMBDA_EXPR_INSTANTIATED.
702 (most_general_lambda): Define.
703 (enclosing_instantiation_of): Adjust after renaming
704 instantiated_lambda_fn_p.
705 (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED. Set
706 LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
707 Don't substitute or set constraints on the regenerated lambda.
708
709 2021-04-08 Patrick Palka <ppalka@redhat.com>
710
711 PR c++/97679
712 * pt.c (build_deduction_guide): Document OUTER_ARGS. Substitute
713 them into the propagated constraints.
714
715 2021-04-08 Jason Merrill <jason@redhat.com>
716
717 PR c++/91849
718 * call.c (convert_like_internal): Improve reference diagnostic.
719
720 2021-04-08 Jakub Jelinek <jakub@redhat.com>
721
722 PR c++/99859
723 * constexpr.c (addr_of_non_const_var): New function.
724 (cxx_bind_parameters_in_call): Set *non_constant_args to true
725 even if cp_walk_tree on arg with addr_of_non_const_var callback
726 returns true.
727
728 2021-04-08 Jason Merrill <jason@redhat.com>
729
730 PR c++/94529
731 * pt.c (determine_specialization): Improve diagnostic.
732
733 2021-04-08 Marek Polacek <polacek@redhat.com>
734
735 PR c++/99844
736 * decl.c (build_explicit_specifier): Call
737 check_for_bare_parameter_packs.
738 * except.c (build_noexcept_spec): Likewise.
739
740 2021-04-07 Jason Merrill <jason@redhat.com>
741
742 PR c++/41723
743 * parser.c (cp_parser_class_name): Check dependent_scope_p.
744
745 2021-04-07 Jason Merrill <jason@redhat.com>
746
747 PR c++/52625
748 * pt.c (maybe_process_partial_specialization): Check
749 DECL_SELF_REFERENCE_P.
750
751 2021-04-07 Jason Merrill <jason@redhat.com>
752
753 PR c++/92918
754 * name-lookup.c (push_class_level_binding_1): Do overload a new
755 function with a previous using-declaration.
756
757 2021-04-06 Jason Merrill <jason@redhat.com>
758
759 PR c++/96673
760 * init.c (get_nsdmi): Don't defer access checking.
761
762 2021-04-06 Jason Merrill <jason@redhat.com>
763
764 PR c++/99901
765 * decl.c (cp_finish_decl): mark_needed an implicitly inline
766 static data member with an out-of-class redeclaration.
767
768 2021-04-06 Jason Merrill <jason@redhat.com>
769
770 PR c++/91241
771 * mangle.c (write_compact_number): Add sanity check.
772 (write_local_name): Use list_length for parm number.
773
774 2021-04-06 Patrick Palka <ppalka@redhat.com>
775
776 PR c++/99899
777 * pt.c (do_auto_deduction): Don't exit early when deducing the
778 array type of a structured binding. Also handle adc_decomp_type
779 during constraint checking.
780
781 2021-04-05 Jason Merrill <jason@redhat.com>
782
783 PR c++/96311
784 * typeck.c (check_return_expr): Call mark_exp_read in dependent
785 case.
786
787 2021-04-05 Jason Merrill <jason@redhat.com>
788
789 PR c++/98440
790 * typeck.c (build_reinterpret_cast_1): Don't perform
791 temporary materialization.
792
793 2021-04-05 Jason Merrill <jason@redhat.com>
794
795 PR c++/95317
796 * pt.c (lookup_template_class_1): Do tsubst_enum when
797 tsubsting a generic lambda.
798
799 2021-04-05 Jason Merrill <jason@redhat.com>
800
801 PR c++/95870
802 * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
803 there is no enclosing non-lambda function.
804
805 2021-04-05 Nathan Sidwell <nathan@acm.org>
806
807 PR c++/99380
808 * module.cc (name_pending_imports): Drop 'atend' parm. Don't
809 query export when not needed.
810 (preprocess_module, preprocessed_module): Adjust.
811
812 2021-04-05 Jason Merrill <jason@redhat.com>
813
814 PR c++/99066
815 * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
816
817 2021-04-05 Jason Merrill <jason@redhat.com>
818
819 PR c++/99201
820 * pt.c (class el_data): Add visited field.
821 (extract_local_specs): Pass it to cp_walk_tree.
822 (extract_locals_r): Walk into the body of a lambda.
823
824 2021-04-05 Jason Merrill <jason@redhat.com>
825
826 * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
827 template result.
828
829 2021-04-04 Jason Merrill <jason@redhat.com>
830
831 PR c++/99643
832 * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
833
834 2021-04-03 Marek Polacek <polacek@redhat.com>
835
836 PR c++/91416
837 * parser.c: Create a GC root for attributes in a decl specifier.
838 (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
839
840 2021-04-03 Jason Merrill <jason@redhat.com>
841
842 PR c++/91217
843 * pt.c (tsubst_lambda_expr): Skip the body block from
844 DECL_SAVED_TREE.
845
846 2021-04-03 Jason Merrill <jason@redhat.com>
847
848 PR c++/90664
849 * cvt.c (can_convert_qual): Check fnptr_conv_p.
850
851 2021-04-03 Jason Merrill <jason@redhat.com>
852
853 PR c++/97900
854 * pt.c (regenerate_decl_from_template): tsubst_decl
855 the parms.
856
857 2021-04-02 Patrick Palka <ppalka@redhat.com>
858
859 PR c++/99869
860 * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
861 to do_auto_deduction.
862
863 2021-04-02 Patrick Palka <ppalka@redhat.com>
864
865 PR c++/99586
866 * semantics.c (finish_compound_literal): Check
867 template_placeholder_p instead of type_uses_auto.
868
869 2021-04-02 Jason Merrill <jason@redhat.com>
870
871 PR c++/97938
872 * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
873 * lambda.c (add_capture): Set it.
874 * pt.c (tsubst_pack_expansion): Handle it.
875
876 2021-04-02 Nathan Sidwell <nathan@acm.org>
877
878 * cp-tree.h (lang_decl_base): Correct module flag comment.
879 * module.cc (trees_in::assert_definition): Break out
880 not_tmpl var.
881 (trees_out::lang_decl_bools): Do not write purview for header units.
882
883 2021-04-01 Marek Polacek <polacek@redhat.com>
884
885 PR c++/99831
886 * method.c (defaulted_late_check): ++ and -- function_depth around
887 the call to synthesize_method.
888 * pt.c: Remove the saved_trees global.
889
890 2021-04-01 Jason Merrill <jason@redhat.com>
891
892 PR c++/99583
893 PR c++/99584
894 * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
895 TYPE_RAISES_EXCEPTIONS.
896
897 2021-04-01 Iain Sandoe <iain@sandoe.co.uk>
898
899 * mapper-client.cc (INCLUDE_MAP): New; require map to be
900 included from system.h.
901 * mapper-resolver.cc (INCLUDE_MAP): Likewise.
902
903 2021-04-01 Jason Merrill <jason@redhat.com>
904
905 PR c++/98481
906 * mangle.c (write_expression): Adjust.
907 * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
908 (mark_abi_tags_r): Likewise.
909
910 2021-04-01 Nathan Sidwell <nathan@acm.org>
911
912 PR c++/99283
913 * module.cc (trees_out::decl_node): Adjust importedness reference
914 assert.
915 (module_state::intercluster_seed): New. Seed both imports and
916 inter-cluster references. Broken out of ...
917 (module_state::write_cluster): ... here. Call it.
918
919 2021-03-31 Jason Merrill <jason@redhat.com>
920
921 PR c++/99445
922 * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
923
924 2021-03-31 Patrick Palka <ppalka@redhat.com>
925
926 PR c++/88115
927 * mangle.c (write_expression): Adjust the mangling of
928 __alignof__.
929
930 2021-03-31 Patrick Palka <ppalka@redhat.com>
931
932 PR c++/99815
933 * pt.c (placeholder_type_constraint_dependent_p): Expand
934 argument packs to separate the first non-pack argument
935 from the rest.
936
937 2021-03-30 Nathan Sidwell <nathan@acm.org>
938
939 PR c++/99283
940 * module.cc (dumper::operator): Make less brittle.
941 (trees_out::core_bools): VAR_DECLs always have a context.
942 (trees_out::key_mergeable): Use same_type_p for asserting.
943 (trees_in::read_var_def): Propagate
944 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
945
946 2021-03-30 Jakub Jelinek <jakub@redhat.com>
947
948 PR c++/99790
949 * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
950
951 2021-03-26 Marek Polacek <polacek@redhat.com>
952
953 PR c++/98352
954 * method.c (implicitly_declare_fn): Pass &raises to
955 synthesized_method_walk.
956
957 2021-03-26 Nathan Sidwell <nathan@acm.org>
958
959 PR c++/99283
960 * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
961 (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
962 * decl.c (duplicate_decls): Remove template_decl module flag
963 propagation.
964 * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
965 (dumper::impl::nested_name): Adjust for template-decl module flag
966 change.
967 (trees_in::assert_definition): Likewise.
968 (trees_in::install_entity): Likewise.
969 (trees_out::decl_value): Likewise. Remove alias template
970 separation of template and type_decl.
971 (trees_in::decl_value): Likewise.
972 (trees_out::key_mergeable): Likewise,
973 (trees_in::key_mergeable): Likewise.
974 (trees_out::decl_node): Adjust for template-decl module flag
975 change.
976 (depset::hash::make_dependency): Likewise.
977 (get_originating_module, module_may_redeclare): Likewise.
978 (set_instantiating_module, set_defining_module): Likewise.
979 * name-lookup.c (name_lookup::search_adl): Likewise.
980 (do_pushdecl): Likewise.
981 * pt.c (build_template_decl): Likewise.
982 (lookup_template_class_1): Remove special alias_template handling
983 of DECL_TI_TEMPLATE.
984 (tsubst_template_decl): Likewise.
985
986 2021-03-26 Jakub Jelinek <jakub@redhat.com>
987
988 PR c++/99705
989 * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
990 in DECL_EXPR or in BIND_EXPR_VARS.
991
992 2021-03-25 Jakub Jelinek <jakub@redhat.com>
993
994 PR c++/99672
995 * parser.c (cp_parser_postfix_expression): For calls, create
996 combined_loc and temporarily set input_location to it before
997 calling finish_call_expr.
998
999 2021-03-25 Marek Polacek <polacek@redhat.com>
1000
1001 PR c++/94751
1002 * call.c (build_over_call): Maybe call mark_used in case
1003 deduce_inheriting_ctor fails and return error_mark_node.
1004 * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
1005 * method.c (deduce_inheriting_ctor): Return bool if the deduction
1006 fails.
1007 (implicitly_declare_fn): If raises is error_mark_node, call
1008 synthesized_method_walk with diag being true.
1009
1010 2021-03-25 Jakub Jelinek <jakub@redhat.com>
1011
1012 PR c++/99745
1013 * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
1014 packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
1015
1016 2021-03-25 Marek Polacek <polacek@redhat.com>
1017
1018 PR c++/99331
1019 * call.c (build_converted_constant_expr_internal): Don't emit
1020 -Wconversion warnings.
1021
1022 2021-03-25 Jakub Jelinek <jakub@redhat.com>
1023
1024 PR c++/99565
1025 * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
1026 to operand_equal_p.
1027 * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
1028 or COMPOUND_EXPR.
1029
1030 2021-03-23 Nathan Sidwell <nathan@acm.org>
1031
1032 PR c++/99283
1033 * name-lookup.c (check_module_override): Set global or partition
1034 DUP on the binding vector.
1035
1036 2021-03-23 Marek Polacek <polacek@redhat.com>
1037
1038 PR c++/99318
1039 * decl2.c (cp_warn_deprecated_use_scopes): Only call
1040 cp_warn_deprecated_use when decl is a namespace, class, or enum.
1041
1042 2021-03-23 Nathan Sidwell <nathan@acm.org>
1043
1044 PR c++/99239
1045 * decl.c (duplicate_decls): Remove assert about maybe-imported
1046 artificial decls.
1047
1048 2021-03-23 Jakub Jelinek <jakub@redhat.com>
1049
1050 PR c++/99650
1051 * decl.c (cp_finish_decomp): Diagnose void initializers when
1052 using tuple_element and get.
1053
1054 2021-03-22 Nathan Sidwell <nathan@acm.org>
1055
1056 PR c++/99480
1057 * module.cc (depset::hash::make_dependency): Propagate flags for
1058 partial specialization.
1059 (module_may_redeclare): Handle partial specialization.
1060
1061 2021-03-22 Nathan Sidwell <nathan@acm.org>
1062
1063 PR c++/99425
1064 * cp-tree.h (map_context_from, map_context_to): Delete.
1065 (add_mergeable_specialization): Add is_alias parm.
1066 * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
1067 * module.cc (map_context_from, map_context_to): Delete.
1068 (trees_in::decl_value): Add specializations later, adjust call.
1069 Drop useless alias lookup. Set duplicate fn parm context.
1070 (check_mergeable_decl): Drop context mapping.
1071 (trees_in::is_matching_decl): Likewise.
1072 (trees_in::read_function_def): Drop parameter context adjustment
1073 here.
1074
1075 2021-03-22 Martin Liska <mliska@suse.cz>
1076
1077 PR c++/99687
1078 * module.cc (fini_modules): Call vec_free instead of delete.
1079
1080 2021-03-20 Jakub Jelinek <jakub@redhat.com>
1081
1082 PR debug/99230
1083 * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
1084 special code, instead call c_genericize_control_stmt.
1085
1086 2021-03-19 Jakub Jelinek <jakub@redhat.com>
1087
1088 PR c++/99456
1089 * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
1090 INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
1091 don't diagnose it, set *non_constant_p nor return t.
1092
1093 2021-03-19 Marek Polacek <polacek@redhat.com>
1094
1095 PR c++/99500
1096 * parser.c (cp_parser_requirement_parameter_list): Handle
1097 error_mark_node.
1098
1099 2021-03-18 Marek Polacek <polacek@redhat.com>
1100
1101 * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
1102
1103 2021-03-18 Marek Polacek <polacek@redhat.com>
1104
1105 * pt.c (tsubst_copy_and_build): Add assert.
1106
1107 2021-03-18 Iain Sandoe <iain@sandoe.co.uk>
1108
1109 PR objc++/49070
1110 * parser.c (cp_debug_parser): Add Objective-C++ message
1111 state flag.
1112 (cp_parser_nested_name_specifier_opt): Allow colon to
1113 terminate an assignment-expression when parsing Objective-
1114 C++ messages.
1115 (cp_parser_objc_message_expression): Set and clear message
1116 parsing state on entry and exit.
1117 * parser.h (struct cp_parser): Add a context flag for
1118 Objective-C++ message state.
1119
1120 2021-03-18 Martin Liska <mliska@suse.cz>
1121
1122 PR c++/99617
1123 * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
1124 to NULL.
1125
1126 2021-03-17 Marek Polacek <polacek@redhat.com>
1127
1128 PR c++/97973
1129 * call.c (conv_unsafe_in_template_p): New.
1130 (convert_like): Use it.
1131
1132 2021-03-17 Anthony Sharp <anthonysharp15@gmail.com>
1133 Jason Merrill <jason@redhat.com>
1134
1135 * semantics.c (get_class_access_diagnostic_decl): New
1136 function that examines special cases when a parent
1137 class causes a private access failure.
1138 (enforce_access): Slightly modified to call function
1139 above.
1140
1141 2021-03-16 Jason Merrill <jason@redhat.com>
1142
1143 * tree.c (cp_tree_equal): Use real_identical.
1144
1145 2021-03-16 Jakub Jelinek <jakub@redhat.com>
1146
1147 PR c++/99613
1148 * decl.c (expand_static_init): For thread guards, call __cxa_atexit
1149 before calling __cxa_guard_release rather than after it. Formatting
1150 fixes.
1151
1152 2021-03-16 Martin Liska <mliska@suse.cz>
1153 Jason Merrill <jason@redhat.com>
1154
1155 PR c++/99108
1156 * call.c (get_function_version_dispatcher): Handle
1157 DECL_LOCAL_DECL_P.
1158 * decl.c (maybe_version_functions): Likewise.
1159 (maybe_mark_function_versioned): New.
1160 * name-lookup.c (push_local_extern_decl_alias): No longer static.
1161 * name-lookup.h (push_local_extern_decl_alias): Adjust.
1162
1163 2021-03-16 Nathan Sidwell <nathan@acm.org>
1164
1165 PR c++/99496
1166 * module.cc (trees_out::decl_value): Adjust typedef streaming,
1167 indicate whether it is a dependent alias.
1168 (trees_in::decl_value): Likewise. Set as dependent alias, if it
1169 is one.
1170
1171 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
1172
1173 PR c++/99047
1174 * coroutines.cc (expand_one_await_expression): If the
1175 await_ready() expression is not a boolean then convert it
1176 as required.
1177
1178 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
1179
1180 PR c++/98704
1181 * coroutines.cc (build_actor_fn): Make destroy index 1
1182 correspond to the abnormal unhandled_exception() exit.
1183 Substitute the proxy for the resume index.
1184 (coro_rewrite_function_body): Arrange to reset the resume
1185 index and make done = true for a rethrown exception from
1186 unhandled_exception ().
1187 (morph_fn_to_coro): Adjust calls to build_actor_fn and
1188 coro_rewrite_function_body.
1189
1190 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
1191
1192 PR c++/98480
1193 * coroutines.cc (replace_continue): Rewrite continue into
1194 'goto label'.
1195 (await_statement_walker): Handle await expressions in the
1196 initializer, condition and iteration expressions of for
1197 loops.
1198
1199 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
1200
1201 PR c++/96749
1202 * coroutines.cc (flatten_await_stmt): Allow for the case
1203 where a target expression variable only has uses in the
1204 second part of a compound expression.
1205 (maybe_promote_temps): Avoid emiting empty statements.
1206
1207 2021-03-15 Tobias Burnus <tobias@codesourcery.com>
1208
1209 PR c++/99509
1210 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
1211 ensure that the varpool node is marked as offloadable.
1212
1213 2021-03-12 Nathan Sidwell <nathan@acm.org>
1214
1215 PR c++/99238
1216 * module.cc (depset::hash::add_binding_entity): Assert not
1217 visited.
1218 (depset::add::add_specializations): Likewise.
1219 * name-lookup.c (name_lookup::dedup): New.
1220 (name_lookup::~name_lookup): Assert not deduping.
1221 (name_lookup::restore_state): Likewise.
1222 (name_lookup::add_overload): Replace outlined code with dedup
1223 call.
1224 (name_lookup::add_value): Likewise.
1225 (name_lookup::search_namespace_only): Likewise.
1226 (name_lookup::adl_namespace_fns): Likewise.
1227 (name_lookup::adl_class_fns): Likewise.
1228 (name_lookup::search_adl): Likewise. Add clearing dedup call.
1229 (name_lookup::search_qualified): Likewise.
1230 (name_lookup::search_unqualified): Likewise.
1231
1232 2021-03-12 Jakub Jelinek <jakub@redhat.com>
1233
1234 PR c++/99507
1235 * call.c (build_over_call): For immediate evaluation of functions
1236 that return references, undo convert_from_reference effects before
1237 calling cxx_constant_value and call convert_from_reference
1238 afterwards.
1239
1240 2021-03-11 Nathan Sidwell <nathan@acm.org>
1241
1242 PR c++/99248
1243 * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
1244 when there's a binding vector.
1245 * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
1246
1247 2021-03-11 Nathan Sidwell <nathan@acm.org>
1248
1249 PR c++/99528
1250 * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
1251 MK_decl_tmpl_spec.
1252 (trees_in::decl_value): Adjust add_mergeable_specialization call.
1253 (trees_out::get_merge_kind): Adjust detecting a partial template
1254 instantiation.
1255 (trees_out::key_mergeable): Adjust handling same.
1256 (trees_in::key_mergeabvle): Likewise.
1257
1258 2021-03-10 Nathan Sidwell <nathan@acm.org>
1259
1260 PR c++/99423
1261 * module.cc (post_load_processing): Assert not gcable.
1262 (laxy_load_pendings): Extend no-gc region around
1263 post_load_processing.
1264
1265 2021-03-10 Nathan Sidwell <nathan@acm.org>
1266
1267 PR c++/99508
1268 * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
1269 assembler name to the ns alias.
1270
1271 2021-03-09 Jakub Jelinek <jakub@redhat.com>
1272
1273 PR c++/99459
1274 * coroutines.cc (build_co_await): Look through NOP_EXPRs in
1275 build_special_member_call return value to find the CALL_EXPR.
1276 Simplify.
1277
1278 2021-03-09 Nathan Sidwell <nathan@acm.org>
1279
1280 PR c++/99472
1281 * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
1282 that C++20 does not yet imply modules.
1283
1284 2021-03-08 Nathan Sidwell <nathan@acm.org>
1285
1286 PR c++/99436
1287 * name-lookup.c (get_cxx_dialect_name): Add cxx23.
1288
1289 2021-03-08 Nathan Sidwell <nathan@acm.org>
1290
1291 * lex.c (module_token_filter::resume): Ignore module-decls inside
1292 header-unit.
1293 * parser.c (cp_parser_module_declaration): Reject in header-unit.
1294
1295 2021-03-08 Nathan Sidwell <nathan@acm.org>
1296
1297 PR c++/99285
1298 * cp-tree.h (match_mergeable_specialization)
1299 (add_mergeable_specialization): Adjust parms.
1300 * module.cc (trees_in::decl_value): Adjust
1301 add_mergeable_specialization calls.
1302 (trees_out::key_mergeable): Adjust match_mergeable_specialization
1303 calls.
1304 (specialization_add): Likewise.
1305 * pt.c (match_mergeable_specialization): Do not insert.
1306 (add_mergeable_specialization): Add to hash table here.
1307
1308 2021-03-06 Patrick Palka <ppalka@redhat.com>
1309 Jakub Jelinek <jakub@redhat.com>
1310
1311 PR c++/99287
1312 * constexpr.c (cxx_eval_increment_expression): Pass lval when
1313 evaluating the MODIFY_EXPR, and update 'mod' with the result of
1314 this evaluation. Check *non_constant_p afterwards. For prefix
1315 ops, just return 'mod'.
1316
1317 2021-03-06 Patrick Palka <ppalka@redhat.com>
1318 Jakub Jelinek <jakub@redhat.com>
1319
1320 PR c++/96330
1321 * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
1322 variable 'fn' to 'tmpl'. Handle a variable template-id by
1323 calling lookup_template_variable.
1324
1325 2021-03-06 Patrick Palka <ppalka@redhat.com>
1326
1327 PR c++/99365
1328 * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
1329 outer_targs to do_auto_deduction.
1330 (placeholder_type_constraint_dependent_p): Define.
1331 (do_auto_deduction): When processing_template_decl != 0
1332 and context is adc_unify and we have constraints, pretend the
1333 constraints are satisfied instead of punting. Otherwise don't
1334 punt unless placeholder_type_constraint_dependent_p holds.
1335 Add some clarifying sanity checks. Add a hack to add missing
1336 outermost template levels to outer_args before checking
1337 satisfaction. Don't substitute outer_targs into type if it's
1338 already been done.
1339
1340 2021-03-05 Marek Polacek <polacek@redhat.com>
1341
1342 PR c++/99374
1343 * call.c (standard_conversion): When converting pointers to
1344 member, don't return NULL when the bases are equivalent but
1345 incomplete.
1346
1347 2021-03-05 Marek Polacek <polacek@redhat.com>
1348
1349 PR c++/99120
1350 * name-lookup.c (check_local_shadow): Check if the type of decl
1351 is non-null before checking TYPE_PTR*.
1352
1353 2021-03-05 Nathan Sidwell <nathan@acm.org>
1354
1355 PR c++/99245
1356 * module.cc (module_state::write_cluster): Relax binding assert.
1357
1358 2021-03-05 Nathan Sidwell <nathan@acm.org>
1359
1360 PR c++/99377
1361 * pt.c (instantiate_decl): Call set_instantiating_module.
1362
1363 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
1364
1365 PR c++/98118
1366 * coroutines.cc (build_co_await): Use type_build_ctor_call()
1367 to determine cases when a CTOR needs to be built.
1368 (flatten_await_stmt): Likewise.
1369 (morph_fn_to_coro): Likewise.
1370
1371 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
1372
1373 PR c++/95616
1374 * coroutines.cc (coro_diagnose_throwing_fn): New helper.
1375 (coro_diagnose_throwing_final_aw_expr): New helper.
1376 (build_co_await): Diagnose throwing final await expression
1377 components.
1378 (build_init_or_final_await): Diagnose a throwing promise
1379 final_suspend() call.
1380
1381 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
1382
1383 PR c++/95615
1384 * coroutines.cc (struct param_info): Track parameter copies that need
1385 a DTOR.
1386 (coro_get_frame_dtor): New helper function factored from build_actor().
1387 (build_actor_fn): Use coro_get_frame_dtor().
1388 (morph_fn_to_coro): Track parameters that need DTORs on exception,
1389 likewise the frame promise and the return object. On exception, run the
1390 DTORs for these, destroy the frame and then rethrow the exception.
1391
1392 2021-03-05 Nathan Sidwell <nathan@acm.org>
1393
1394 PR c++/99389
1395 * pt.c (instantiate_class_template_1): Set instantiating module
1396 here.
1397
1398 2021-03-05 Tobias Burnus <tobias@codesourcery.com>
1399
1400 PR c/99137
1401 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
1402
1403 2021-03-04 Jakub Jelinek <jakub@redhat.com>
1404
1405 PR c++/88146
1406 PR c++/99362
1407 * cvt.c (convert_to_void): Revert 2019-10-17 changes. Clarify
1408 comment.
1409
1410 2021-03-04 Nathan Sidwell <nathan@acm.org>
1411
1412 PR c++/99170
1413 * module.cc (class uintset): Delete.
1414 (typedef attached_map_t): A hash map.
1415 (attached_table): Use attached_map_t. Adjust uses ...
1416 (trees_out::decl_value, trees_in::decl_value): ... here ...
1417 (trees_out::key_mergeable): ... here ...
1418 (trees_in::key_mergeable): ... here ...
1419 (maybe_attach_decl): ... here ...
1420 (direct_import): ... and here.
1421
1422 2021-03-04 Nathan Sidwell <nathan@acm.org>
1423
1424 PR c++/99170
1425 * cp-tree.h
1426 * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
1427 rename.
1428 * module.cc (class pending_key): New.
1429 (default_hash_traits<pending_key>): New specialization.
1430 (pending_map_t): New typedef.
1431 (pending_table): Replace old table.
1432 (trees_out::lang_decl_bools): Adjust.
1433 (trees_in::lang_decl_bools): Adjust.
1434 (trees_in::install_entity): Drop pending member and specialization
1435 handling.
1436 (find_pending_key): New.
1437 (depset::hash::fiund_dependencies): Use it.
1438 (pendset_lazy_load): Delete.
1439 (module_state::write_cluster): Don't count pendings here. Bye
1440 Duff's device-like thing.
1441 (module_state::write_pendings): Reimplement.
1442 (module_state::read_pendings): Reimplement.
1443 (lazy_specializations_p): Delete.
1444 (module_state::write): Adjust write_pendings call.
1445 (lazy_load_pendings): New.
1446 (lazy_load_specializations): Delete.
1447 (lazy_load_members): Delete.
1448 (init_modules): Adjust.
1449 * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
1450 not lazy_load_members.
1451 (note_pending_specializations): Delete.
1452 (load_pending_specializations): Delete.
1453 * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
1454 (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
1455 (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
1456 (note_pending_specializations): Delete.
1457 (load_pending_specializations): Delete.
1458 * pt.c (lookup_template_class_1): Call lazy_load_pendings not
1459 lazy_load_specializations.
1460 (instantiate_template_class_1): Likewise.
1461 (instantiate_decl): Call lazy_load_pendings.
1462 * typeck.c (complete_type): Likewise.
1463
1464 2021-03-03 Nathan Sidwell <nathan@acm.org>
1465
1466 PR c++/99170
1467 * module.cc (post_load_decls): New.
1468 (lazy_snum, recursive_lazy): Move earlier.
1469 (module_state::read_cluster): Push cloning onto post_load_decls.
1470 (post_load_processing): New. Do the cloning here.
1471 (module_state::read_inits): Call post_load_processing.
1472 (module_state::read_language): Likewise.
1473 (lazy_load_binding, lazy_load_specializations): Likewise
1474 (lazy_load_members): Likewise
1475
1476 2021-03-03 Nathan Sidwell <nathan@acm.org>
1477
1478 PR c++/99170
1479 * module.cc (trees_out::decl_value): Stream specialization keys
1480 after decl.
1481 (trees_in::decl_value): Stream them back and insert after
1482 completing the decl.
1483 (trees_out::key_mergeable): Drop some streaming here ...
1484 (trees_in::key_mergeable): ... and here. Don't insert into
1485 specialization tables.
1486
1487 2021-03-03 Patrick Palka <ppalka@redhat.com>
1488
1489 * constraint.cc (struct sat_info): Document the different
1490 meanings of noisy() and diagnose_unsatisfaction_p() during
1491 satisfaction and requires-expression evaluation.
1492 (tsubst_valid_expression_requirement): Take a sat_info instead
1493 of a subst_info. Perform the substitution quietly first. Fold
1494 in error-replaying code from diagnose_valid_expression.
1495 (tsubst_simple_requirement): Take a sat_info instead of a
1496 subst_info.
1497 (tsubst_type_requirement_1): New. Fold in error-replaying code
1498 from diagnose_valid_type.
1499 (tsubst_type_requirement): Use the above. Take a sat_info
1500 instead of a subst_info.
1501 (tsubst_compound_requirement): Likewise. Fold in
1502 error-replaying code from diagnose_compound_requirement.
1503 (tsubst_nested_requirement): Take a sat_info instead of a
1504 subst_info. Fold in error-replaying code from
1505 diagnose_nested_requirement.
1506 (tsubst_requirement): Take a sat_info instead of a subst_info.
1507 (tsubst_requires_expr): Split into two versions, one that takes
1508 a sat_info argument and another that takes a complain and
1509 in_decl argument. Remove outdated documentation. Document the
1510 effects of the sat_info argument. Don't short-circuit
1511 processing of requirements when diagnosing unsatisfaction,
1512 mirroring diagnose_requires_expr.
1513 (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
1514 assert, and se the three-parameter version of tsubst_requires_expr.
1515 (diagnose_trait_expr): Make static. Take a template argument
1516 vector instead of a parameter mapping.
1517 (diagnose_valid_expression): Remove.
1518 (diagnose_valid_type): Remove.
1519 (diagnose_simple_requirement): Remove.
1520 (diagnose_compound_requirement): Remove.
1521 (diagnose_type_requirement): Remove.
1522 (diagnose_nested_requirement): Remove.
1523 (diagnose_requirement): Remove.
1524 (diagnose_requires_expr): Remove.
1525 (diagnose_atomic_constraint): Take a sat_info instead of a
1526 subst_info. Adjust call to diagnose_trait_expr. Call
1527 tsubst_requires_expr instead of diagnose_requires_expr.
1528 (diagnose_constraints): Remove special casing of REQUIRES_EXPR
1529 and just always call constraint_satisfaction_value.
1530
1531 2021-03-03 Patrick Palka <ppalka@redhat.com>
1532
1533 * constexpr.c (cxx_eval_call_expression): Adjust call to
1534 evaluate_concept_check.
1535 (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
1536 evaluate_requires_expression instead of
1537 satisfy_constraint_expression.
1538 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
1539 * constraint.cc (struct sat_info): Adjust comment about which
1540 satisfaction entrypoints use noisy-unsat.
1541 (normalize_template_requirements): Remove (and adjust callers
1542 appropriately).
1543 (normalize_nontemplate_requirements): Likewise.
1544 (tsubst_nested_requirement): Use constraint_satisfaction_value
1545 instead of satisfy_constraint_expression, which'll do the
1546 noisy replaying of ill-formed quiet satisfaction for us.
1547 (decl_satisfied_cache): Adjust comment.
1548 (satisfy_constraint): Rename to ...
1549 (satisfy_normalized_constraints): ... this.
1550 (satisfy_associated_constraints): Remove (and make its
1551 callers check for dependent arguments).
1552 (satisfy_constraint_expression): Rename to ...
1553 (satisfy_nondeclaration_constraints): ... this. Assert that
1554 'args' is empty when 't' is a concept-id. Removing handling
1555 bare constraint-expressions, and handle REQUIRES_EXPRs
1556 specially. Adjust comment accordingly.
1557 (satisfy_declaration_constraints): Assert in the two-parameter
1558 version that 't' is not a TEMPLATE_DECL. Adjust following
1559 removal of normalize_(non)?template_requirements and
1560 satisfy_asociated_constraints.
1561 (constraint_satisfaction_value): Combine the two- and
1562 three-parameter versions in the natural way.
1563 (constraints_satisfied_p): Combine the one- and two-parameter
1564 versions in the natural way. Improve documentation.
1565 (evaluate_requires_expr): Define.
1566 (evaluate_concept_check): Remove 'complain' parameter. Use
1567 constraint_satisfaction_value instead of
1568 satisfy_constraint_expression.
1569 (diagnose_nested_requirement): Adjust following renaming of
1570 satisfy_constraint_expression.
1571 (diagnose_constraints): Handle REQUIRES_EXPR by going through
1572 diagnose_requires_expr directly instead of treating it as a
1573 constraint-expression. Improve documentation.
1574 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
1575 to evaluate_concept_check.
1576 <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
1577 constraints_satisfied_p.
1578 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
1579 * cp-tree.h (evaluate_requires_expr): Declare.
1580 (evaluate_concept_check): Remove tsubst_flag_t parameter.
1581 (satisfy_constraint_expression): Remove declaration.
1582 (constraints_satisfied_p): Remove one-parameter declaration.
1583 Add a default argument to the two-parameter declaration.
1584 * cvt.c (convert_to_void): Adjust call to
1585 evaluate_concept_check.
1586
1587 2021-03-03 Jakub Jelinek <jakub@redhat.com>
1588
1589 PR c++/82959
1590 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
1591 and COMPOUND_EXPR.
1592
1593 2021-03-03 Marek Polacek <polacek@redhat.com>
1594
1595 PR c++/97034
1596 PR c++/99009
1597 * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
1598 (maybe_aggr_guide): Use the original template type where needed. In
1599 a class member template, partially instantiate the result of
1600 collect_ctor_idx_types.
1601 (do_class_deduction): Defer the deduction until the enclosing
1602 scope is non-dependent.
1603
1604 2021-03-03 Jason Merrill <jason@redhat.com>
1605
1606 PR c++/95675
1607 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
1608 if it didn't get one before.
1609
1610 2021-03-03 Nathan Sidwell <nathan@acm.org>
1611
1612 PR c++/99344
1613 * module.cc (trees_out::decl_node): Small refactor.
1614 (depset::hash::add_binding_entity): Return true on meeting an
1615 import. Set namespace's import here.
1616 (module_state:write_namespaces): Inform of purview too.
1617 (module_state:read_namespaces): Adjust.
1618 * name-lookup.c (implicitly_export_namespace): Delete.
1619 (do_pushdecl): Don't call it.
1620 (push_namespace): Likewise, set purview.
1621 (add_imported_namespace): Reorder parms.
1622 * name-lookup.h (add_imported_namespace): Alter param ordering.
1623
1624 2021-03-02 Martin Sebor <msebor@redhat.com>
1625
1626 PR c++/99251
1627 * class.c (build_base_path): Call build_if_nonnull.
1628 * cp-tree.h (build_if_nonnull): Declare.
1629 * rtti.c (ifnonnull): Rename...
1630 (build_if_nonnull): ...to this. Set no-warning bit on COND_EXPR.
1631 (build_dynamic_cast_1): Adjust to name change.
1632
1633 2021-03-02 Patrick Palka <ppalka@redhat.com>
1634
1635 PR c++/96443
1636 PR c++/96960
1637 * constraint.cc (type_deducible_p): Don't substitute into the
1638 constraints, and instead just pass 'args' to do_auto_deduction
1639 as the outer template arguments.
1640 (tsubst_parameter_mapping): Remove confused code for handling
1641 placeholder type arguments.
1642 (normalize_placeholder_type_constraint): Define.
1643 (satisfy_constraint_expression): Use it to handle placeholder
1644 'auto' types.
1645 * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
1646 (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
1647 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
1648 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
1649 (make_constrained_placeholder_type): Set
1650 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
1651 (do_auto_deduction): Clarify comments about the outer_targs
1652 parameter. Rework satisfaction of a placeholder type constraint
1653 to pass in the complete set of template arguments directly to
1654 constraints_satisfied_p.
1655 (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
1656 instead. Also rebuild the the constraint info on the new auto.
1657
1658 2021-03-02 Patrick Palka <ppalka@redhat.com>
1659
1660 * constraint.cc (build_parameter_mapping): Rely on the caller to
1661 determine the in-scope template parameters.
1662 (norm_info::norm_info): Delegate the tsubst_flags_t constructor
1663 to the two-parameter constructor. In the two-parameter
1664 constructor, fold in the definition of make_context, set
1665 initial_parms appropriately, and don't set the now-removed
1666 orig_decl member.
1667 (norm_info::make_context): Remove, now that its only use is
1668 inlined into the caller.
1669 (norm_info::update_context): Adjust call to
1670 build_parameter_mapping to pass in the relevant set of in-scope
1671 template parameters.
1672 (norm_info::ctx_parms): Define this member function.
1673 (norm_info::context): Initialize to NULL_TREE.
1674 (norm_info::orig_decl): Remove this data member.
1675 (norm_info::initial_parms): Define this data member.
1676 (normalize_atom): Adjust call to build_parameter_mapping to pass
1677 in the relevant set of in-scope template parameters. Use
1678 info.initial_parms instead of info.orig_decl.
1679 (normalize_constraint_expression): Take a norm_info object
1680 instead of a bool. Cache the result of normalization.
1681 (tsubst_nested_requirement): Call satisfy_constraint_expression
1682 instead of satisfy_constraint, so that we normalize on demand.
1683 (satisfy_constraint_expression): Handle a NESTED_REQ argument.
1684 Adjust call to normalize_constraint_expression.
1685 (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
1686 to current_template_parms.
1687 (diagnose_nested_requirements): Go through
1688 satisfy_constraint_expression, as with tsubst_nested_requirement.
1689
1690 2021-03-02 Patrick Palka <ppalka@redhat.com>
1691
1692 * constraint.cc (tsubst_parameter_mapping): Canonicalize the
1693 arguments of a substituted TYPE_ARGUMENT_PACK even if we've
1694 started with a TYPE_ARGUMENT_PACK.
1695 (finish_requires_expr): Don't set DECL_CONTEXT and
1696 CONSTRAINT_VAR_P on each of the introduced parameters here.
1697 * parser.c (cp_parser_requirement_parameter_list): Instead set
1698 these fields earlier, here.
1699 * pt.c (do_auto_deduction): Canonicalize the result of
1700 do_auto_deduction. Pass 'complain' to finish_decltype_type.
1701
1702 2021-03-02 Patrick Palka <ppalka@redhat.com>
1703
1704 * constraint.cc (tsubst_simple_requirement): Just return
1705 boolean_true_node on success.
1706 (tsubst_type_requirement): Likewise.
1707 (tsubst_compound_requirement): Likewise.
1708 (tsubst_nested_requirement): Likewise.
1709 (tsubst_requirement_body): Remove.
1710 (check_constaint_variables): Rename to ...
1711 (check_constraint_variables): ... this.
1712 (tsubst_constraint_variables): Adjust.
1713 (tsubst_requires_expr): Fold tsubst_requirement_body into here.
1714
1715 2021-03-01 Nathan Sidwell <nathan@acm.org>
1716
1717 PR c++/99294
1718 * class.c (fixup_type_variants): Propagate mode, precision,
1719 alignment & emptiness.
1720 * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
1721 (trees_in::tree_node): Rematerialize alignment here.
1722
1723 2021-02-27 Jason Merrill <jason@redhat.com>
1724
1725 PR c++/90333
1726 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
1727 between () and ->.
1728
1729 2021-02-26 Jakub Jelinek <jakub@redhat.com>
1730
1731 * parser.c (cp_parser_lambda_declarator_opt): Implement
1732 P1102R2 - Down with ()! Make ()s optional before lambda specifiers
1733 for -std={c,gnu}++2b or with pedwarn in earlier versions.
1734
1735 2021-02-26 Jakub Jelinek <jakub@redhat.com>
1736
1737 PR c++/95451
1738 * lambda.c (is_lambda_ignored_entity): Before checking for
1739 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check.
1740
1741 2021-02-26 Jason Merrill <jason@redhat.com>
1742
1743 PR c++/98810
1744 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
1745 to a class non-type template argument that needs it.
1746
1747 2021-02-26 Patrick Palka <ppalka@redhat.com>
1748
1749 PR c++/98990
1750 * pt.c (splice_late_return_type): Rebuild the entire return type
1751 if we have to adjust the level of an auto within.
1752 (type_uses_auto): Adjust call to find_type_usage.
1753 * type-utils.h (find_type_usage): Revert r10-6571 change that
1754 made this function return a pointer to the auto node.
1755
1756 2021-02-25 Patrick Palka <ppalka@redhat.com>
1757
1758 PR c++/99213
1759 PR c++/94521
1760 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
1761 TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
1762
1763 2021-02-25 Patrick Palka <ppalka@redhat.com>
1764
1765 PR c++/99103
1766 * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
1767 (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
1768
1769 2021-02-25 Marek Polacek <polacek@redhat.com>
1770
1771 DR 1312
1772 PR c++/99176
1773 * constexpr.c (is_std_construct_at): New overload.
1774 (is_std_allocator_allocate): New overload.
1775 (cxx_eval_call_expression): Use the new overloads.
1776 (cxx_eval_constant_expression): Reject casting
1777 from void * as per DR 1312. Don't check can_convert.
1778
1779 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
1780
1781 PR c++/97587
1782 * coroutines.cc (struct param_info): Track rvalue refs.
1783 (morph_fn_to_coro): Track rvalue refs, and call the promise
1784 CTOR with the frame copy of passed parms.
1785
1786 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
1787
1788 PR c++/95822
1789 * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
1790 set throwing_cleanup marker.
1791
1792 2021-02-25 Nathan Sidwell <nathan@acm.org>
1793
1794 PR c++/99166
1795 * module.cc (module_state::inform_cmi_p): Renamed field.
1796 (module_state::do_import): Adjust.
1797 (init_modules, finish_module_processing): Likewise.
1798 (handle_module_option): Likewise.
1799
1800 2021-02-25 Nathan Sidwell <nathan@acm.org>
1801
1802 PR c++/98318
1803 * mapper-client.cc (module_client::open_module_client): Fix typo
1804 of fd init.
1805
1806 2021-02-24 Nathan Sidwell <nathan@acm.org>
1807
1808 PR c++/98718
1809 * module.cc (ool): New indirection vector.
1810 (loc_spans::maybe_propagate): Location is not optional.
1811 (loc_spans::open): Likewise. Assert monotonically advancing.
1812 (module_for_ordinary_loc): Use ool indirection vector.
1813 (module_state::write_prepare_maps): Do not count empty macro
1814 expansions. Elide empty spans.
1815 (module_state::write_macro_maps): Skip empty expansions.
1816 (ool_cmp): New qsort comparator.
1817 (module_state::write): Create and destroy ool vector.
1818 (name_pending_imports): Fix dump push/pop.
1819 (preprocess_module): Likewise. Add more dumping.
1820 (preprocessed_module): Likewise.
1821
1822 2021-02-24 Iain Sandoe <iain@sandoe.co.uk>
1823
1824 PR c++/96251
1825 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
1826 error reporting when instantiating for a constexpr.
1827
1828 2021-02-23 Nathan Sidwell <nathan@acm.org>
1829
1830 PR c++/99208
1831 * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
1832 identity.
1833
1834 2021-02-23 Patrick Palka <ppalka@redhat.com>
1835
1836 PR c++/95468
1837 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
1838 over from tsubst_copy.
1839
1840 2021-02-23 Patrick Palka <ppalka@redhat.com>
1841
1842 * pt.c (instantiation_dependent_expression_p): Check
1843 processing_template_decl before calling
1844 potential_constant_expression.
1845
1846 2021-02-22 Nathan Sidwell <nathan@acm.org>
1847
1848 PR c++/99174
1849 * module.cc (struct module_state): Add visited_p flag.
1850 (name_pending_imports): Use it to avoid duplicate requests.
1851 (preprocess_module): Don't read preprocessor state if we failed to
1852 load a module's config.
1853
1854 2021-02-22 Nathan Sidwell <nathan@acm.org>
1855
1856 PR c++/99153
1857 * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
1858 to common-path.
1859 * module.cc (set_defining_module): Add assert.
1860
1861 2021-02-19 Nathan Sidwell <nathan@acm.org>
1862
1863 PR c++/98741
1864 * module.cc (pending_imports): New.
1865 (declare_module): Adjust test condition.
1866 (name_pending_imports): New.
1867 (preprocess_module): Reimplement using pending_imports.
1868 (preprocessed_module): Move name-getting to name_pending_imports.
1869 * name-lookup.c (append_imported_binding_slot): Assert module
1870 ordering is increasing.
1871
1872 2021-02-19 Nathan Sidwell <nathan@acm.org>
1873
1874 * module.cc (note_cmis): New.
1875 (struct module_state): Add inform_read_p bit.
1876 (module_state::do_import): Inform of CMI location, if enabled.
1877 (init_modules): Canonicalize note_cmis entries.
1878 (handle_module_option): Handle -flang-info-module-read=FOO.
1879
1880 2021-02-19 Jason Merrill <jason@redhat.com>
1881
1882 PR c++/96926
1883 * call.c (perfect_conversion_p): Limit rvalueness
1884 test to reference bindings.
1885
1886 2021-02-19 Jason Merrill <jason@redhat.com>
1887
1888 PR c++/96926
1889 * call.c (perfect_conversion_p): New.
1890 (perfect_candidate_p): New.
1891 (add_candidates): Ignore templates after a perfect non-template.
1892
1893 2021-02-18 Nathan Sidwell <nathan@acm.org>
1894
1895 PR c++/99023
1896 * module.cc (canonicalize_header_name): Use
1897 cpp_probe_header_unit.
1898 (maybe_translate_include): Fix note_includes comparison.
1899 (init_modules): Fix note_includes string termination.
1900
1901 2021-02-18 Jakub Jelinek <jakub@redhat.com>
1902
1903 PR c++/99132
1904 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
1905 cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
1906 for immediate function calls.
1907
1908 2021-02-17 Nathan Sidwell <nathan@acm.org>
1909
1910 PR c++/99023
1911 * module.cc (struct macro_export): Add GTY markers.
1912 (macro_exports): Likewise, us a va_gc Vector.
1913
1914 2021-02-17 Jakub Jelinek <jakub@redhat.com>
1915
1916 PR sanitizer/99106
1917 * init.c (build_zero_init_1): For flexible array members just return
1918 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
1919 ARRAY_TYPE.
1920
1921 2021-02-17 Nathan Sidwell <nathan@acm.org>
1922
1923 PR c++/99116
1924 * name-lookup.c (do_pushdecl): Don't peek under template_parm
1925 bindings here ...
1926 (set_identifier_type_value_with_scope): ... or here.
1927 (do_pushtag): Only set_identifier_type_value_with_scope at
1928 non-class template parm scope, and use parent scope.
1929
1930 2021-02-17 Nathan Sidwell <nathan@acm.org>
1931
1932 PR c++/99071
1933 * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
1934 pointer.
1935
1936 2021-02-17 Patrick Palka <ppalka@redhat.com>
1937
1938 PR debug/96997
1939 PR c++/94034
1940 * tree.c (build_aggr_init_expr): Revert r10-7718 change.
1941
1942 2021-02-12 Nathan Sidwell <nathan@acm.org>
1943
1944 * module.cc (module_state::write_cluster): Check bindings for
1945 imported using-decls.
1946
1947 2021-02-12 Nathan Sidwell <nathan@acm.org>
1948
1949 PR c++/99040
1950 * module.cc (trees_in::decl_value): Call add_module_namespace_decl
1951 for new namespace-scope entities.
1952 (module_state::read_cluster): Don't call add_module_decl here.
1953 * name-lookup.h (add_module_decl): Rename to ...
1954 (add_module_namespace_decl): ... this.
1955 * name-lookup.c (newbinding_bookkeeping): Move into ...
1956 (do_pushdecl): ... here. Its only remaining caller.
1957 (add_module_decl): Rename to ...
1958 (add_module_namespace_decl): ... here. Add checking-assert for
1959 circularity. Don't call newbinding_bookkeeping, just extern_c
1960 checking and incomplete var checking.
1961
1962 2021-02-12 Nathan Sidwell <nathan@acm.org>
1963
1964 PR c++/99039
1965 PR c++/99040
1966 * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
1967 (global_type_node): Delete.
1968 (IDENTIFIER_TYPE_VALUE): Delete.
1969 (IDENTIFIER_HAS_TYPE_VALUE): Delete.
1970 (get_type_value): Delete.
1971 * name-lookup.h (identifier_type_value): Delete.
1972 * name-lookup.c (check_module_override): Don't
1973 SET_IDENTIFIER_TYPE_VALUE here.
1974 (do_pushdecl): Nor here.
1975 (identifier_type_value_1, identifier_type_value): Delete.
1976 (set_identifier_type_value_with_scope): Only
1977 SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
1978 (pushdecl_nanmespace_level): Remove shadow stack nadgering.
1979 (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
1980 * call.c (check_dtor_name): Use lookup_name.
1981 * decl.c (cxx_init_decl_processing): Drop global_type_node.
1982 * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
1983 here.
1984 * init.c (get_type_value): Delete.
1985 * pt.c (instantiate_class_template_1): Don't call pushtag or
1986 SET_IDENTIFIER_TYPE_VALUE here.
1987 (tsubst): Assert never an identifier.
1988 (dependent_type_p): Drop global_type_node assert.
1989 * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
1990 to determine ctorness.
1991
1992 2021-02-12 Jakub Jelinek <jakub@redhat.com>
1993
1994 PR c++/97742
1995 * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
1996 CPP_EOF.
1997
1998 2021-02-12 Jason Merrill <jason@redhat.com>
1999
2000 PR c++/97246
2001 PR c++/94546
2002 * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
2003 (register_parameter_specializations): Not here.
2004
2005 2021-02-11 Marek Polacek <polacek@redhat.com>
2006
2007 PR c++/95888
2008 * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
2009 for the partial instantiation.
2010
2011 2021-02-11 Jakub Jelinek <jakub@redhat.com>
2012
2013 PR c++/99033
2014 * init.c (build_zero_init_1): Handle zero initialiation of
2015 flexible array members like initialization of [0] arrays.
2016 Use integer_minus_onep instead of comparison to integer_minus_one_node
2017 and integer_zerop instead of comparison against size_zero_node.
2018 Formatting fixes.
2019
2020 2021-02-11 Marek Polacek <polacek@redhat.com>
2021
2022 PR c++/99063
2023 * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
2024
2025 2021-02-11 Patrick Palka <ppalka@redhat.com>
2026
2027 PR c++/97582
2028 * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
2029 lookup result by discarding it if the first element is a
2030 class-scope declaration, otherwise return it.
2031 (push_operator_bindings): Handle an ambiguous lookup result by
2032 doing push_local_binding on each element in the list.
2033
2034 2021-02-11 Marek Polacek <polacek@redhat.com>
2035
2036 * parser.c (cp_parser_selection_statement): Use vec_free.
2037
2038 2021-02-10 Jakub Jelinek <jakub@redhat.com>
2039
2040 PR c++/98988
2041 PR c++/99031
2042 * constexpr.c: Include cgraph.h.
2043 (cxx_eval_call_expression): Call varpool_node::finalize_decl on
2044 heap artificial vars.
2045 (cxx_eval_outermost_constant_expr): Remove varpool nodes for
2046 heap artificial vars.
2047
2048 2021-02-10 Nathan Sidwell <nathan@acm.org>
2049
2050 PR c++/99030
2051 * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
2052 answer if there's no local specialization.
2053
2054 2021-02-09 Nathan Sidwell <nathan@acm.org>
2055
2056 PR c++/98944
2057 * module.cc (module_state::is_rooted): Rename to ...
2058 (module_state::has_location): ... here. Adjust callers.
2059 (module_state::read_partitions): Adjust validity check.
2060 Don't overwrite a known location.
2061
2062 2021-02-09 Jason Merrill <jason@redhat.com>
2063
2064 PR c++/96905
2065 * pt.c (mark_decl_instantiated): Exit early if consteval.
2066
2067 2021-02-09 Jason Merrill <jason@redhat.com>
2068
2069 PR c++/98326
2070 PR c++/20408
2071 * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
2072 parm.
2073
2074 2021-02-09 Jason Merrill <jason@redhat.com>
2075
2076 PR c++/98994
2077 PR c++/97566
2078 * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
2079 RECORD_TYPE.
2080
2081 2021-02-08 Nathan Sidwell <nathan@acm.org>
2082
2083 * decl.c (start_cleanup_fn): Push function into
2084 namespace.
2085
2086 2021-02-08 Nathan Sidwell <nathan@acm.org>
2087
2088 PR c++/98531
2089 * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
2090 * decl.c (push_abi_namespace, pop_abi_namespace): Moved
2091 from rtti.c, add default namespace arg.
2092 (check_redeclaration_exception_specification): Allow a lazy
2093 builtin's eh spec to differ from an lready-declared user
2094 declaration.
2095 (declare_global_var): Use push/pop_abi_namespace.
2096 (get_atexit_node): Push the fndecl into a namespace.
2097 * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
2098 decl.c.
2099
2100 2021-02-08 Marek Polacek <polacek@redhat.com>
2101
2102 * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
2103
2104 2021-02-05 Marek Polacek <polacek@redhat.com>
2105
2106 PR c++/98947
2107 * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
2108 on arg2/arg3.
2109 * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
2110 issuing the -Wvolatile warning. Only set TREE_THIS_VOLATILE if
2111 a warning was emitted.
2112
2113 2021-02-05 Marek Polacek <polacek@redhat.com>
2114
2115 PR c++/96462
2116 * name-lookup.c (lookup_using_decl): Hoist the destructor check.
2117
2118 2021-02-05 Jakub Jelinek <jakub@redhat.com>
2119
2120 PR c++/97878
2121 * decl.c (check_array_initializer): For structured bindings, require
2122 the array type to be complete.
2123
2124 2021-02-04 Jason Merrill <jason@redhat.com>
2125
2126 PR c++/98717
2127 * constraint.cc (build_concept_check_arguments): Remove assert.
2128 (build_concept_check): Allow empty args.
2129
2130 2021-02-04 Tom Greenslade (thomgree) <thomgree@cisco.com>
2131
2132 PR c++/90926
2133 * call.c (can_convert_array): Extend to handle all valid aggregate
2134 initializers of an array; including by string literals, not just by
2135 brace-init-list.
2136 (build_aggr_conv): Call can_convert_array more often, not just in
2137 brace-init-list case.
2138 * typeck2.c (array_string_literal_compatible_p): New function.
2139 (digest_init_r): call array_string_literal_compatible_p
2140 * cp-tree.h: (array_string_literal_compatible_p): Declare.
2141
2142 2021-02-04 Jason Merrill <jason@redhat.com>
2143
2144 PR c++/98802
2145 * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
2146
2147 2021-02-04 Jason Merrill <jason@redhat.com>
2148
2149 PR c++/95192
2150 * pt.c (tsubst_attribute): Handle error.
2151 (apply_late_template_attributes): Return false on error.
2152 (tsubst_function_decl): Check its return value.
2153 (tsubst_decl): Likewise.
2154 (push_template_decl): Assert current_template_parms.
2155 (tsubst_template_decl): Set current_template_parms.
2156
2157 2021-02-03 Marek Polacek <polacek@redhat.com>
2158
2159 PR c++/98951
2160 * call.c (struct z_candidate): Mark rewritten and reversed as const.
2161 (struct NonPublicField): Mark operator() as const.
2162 (struct NonTrivialField): Likewise.
2163
2164 2021-02-03 Jason Merrill <jason@redhat.com>
2165
2166 PR c++/98926
2167 PR c++/98570
2168 * pt.c (spec_hasher::equal): Set processing_template_decl.
2169 * Make-lang.in (check-g++-strict-gc): Add --param
2170 hash-table-verification-limit=10000.
2171
2172 2021-02-03 Marek Polacek <polacek@redhat.com>
2173
2174 PR c++/98899
2175 * parser.c (cp_parser_class_specifier_1): Use any possible
2176 DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
2177 (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
2178 * pt.c (tsubst_exception_specification): Stash new_specs into
2179 DEFPARSE_INSTANTIATIONS.
2180 * tree.c (fixup_deferred_exception_variants): Use
2181 UNPARSED_NOEXCEPT_SPEC_P.
2182
2183 2021-02-02 Jason Merrill <jason@redhat.com>
2184
2185 PR c++/98929
2186 PR c++/96199
2187 * error.c (dump_expr): Ignore dummy object.
2188 * pt.c (tsubst_baselink): Handle dependent scope.
2189
2190 2021-02-01 Patrick Palka <ppalka@redhat.com>
2191
2192 PR c++/98295
2193 * constexpr.c (cxx_eval_array_reference): Also set
2194 new_ctx.object when setting new_ctx.ctor.
2195
2196 2021-02-01 Marek Polacek <polacek@redhat.com>
2197
2198 PR c++/98355
2199 * parser.c (cp_parser_has_attribute_expression): Use
2200 uses_template_parms instead of type_dependent_expression_p.
2201
2202 2021-02-01 Jason Merrill <jason@redhat.com>
2203
2204 PR c++/98570
2205 * cp-tree.h: Declare it.
2206 * pt.c (comparing_dependent_aliases): New flag.
2207 (template_args_equal, spec_hasher::equal): Set it.
2208 (dependent_alias_template_spec_p): Assert that we don't
2209 get non-types other than error_mark_node.
2210 (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
2211 on complex alias specializations. Set TYPE_DEPENDENT_P here.
2212 (tsubst_decl): Not here.
2213 * module.cc (module_state::read_cluster): Set
2214 comparing_dependent_aliases instead of
2215 comparing_specializations.
2216 * tree.c (cp_tree_equal): Remove comparing_specializations
2217 module handling.
2218 * typeck.c (structural_comptypes): Adjust.
2219 (comptypes): Remove comparing_specializations handling.
2220
2221 2021-01-29 Nathan Sidwell <nathan@acm.org>
2222
2223 PR c++/98843
2224 * module.cc (module_state_config): Add num_entities field.
2225 (module_state::read_entities): The entity_ary span is
2226 already allocated.
2227 (module_state::write_config): Write num_entities.
2228 (module_state::read_config): Read num_entities.
2229 (module_state::write): Set config's num_entities.
2230 (module_state::read_initial): Allocate the entity ary
2231 span here.
2232 (module_state::read_language): Do not set entity_lwm
2233 here.
2234
2235 2021-01-29 Marek Polacek <polacek@redhat.com>
2236
2237 PR c++/96137
2238 * parser.c (cp_parser_class_name): If parser->scope is
2239 error_mark_node, return it, otherwise continue.
2240
2241 2021-01-28 Jakub Jelinek <jakub@redhat.com>
2242
2243 PR c++/98841
2244 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
2245
2246 2021-01-28 Jakub Jelinek <jakub@redhat.com>
2247
2248 PR c++/33661
2249 PR c++/98847
2250 * decl.c (cp_finish_decl): For register vars with asmspec in templates
2251 call set_user_assembler_name and set DECL_HARD_REGISTER.
2252 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
2253 pass asmspec_tree to cp_finish_decl.
2254
2255 2021-01-28 Nathan Sidwell <nathan@acm.org>
2256
2257 PR c++/98770
2258 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
2259 check order.
2260 (trees_in::decl_value): Do typedef frobbing only when installing
2261 a new typedef, adjust is_matching_decl call. Swap is_typedef
2262 & TYPE_NAME check.
2263 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
2264 names and deal with typedef checking.
2265
2266 2021-01-27 Jason Merrill <jason@redhat.com>
2267
2268 PR c++/97874
2269 * name-lookup.c (lookup_using_decl): Clean up handling
2270 of dependency and inherited constructors.
2271 (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
2272 * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
2273
2274 2021-01-26 Jason Merrill <jason@redhat.com>
2275
2276 PR c++/97474
2277 * call.c (type_passed_as): Don't mark invisiref restrict.
2278
2279 2021-01-26 Jason Merrill <jason@redhat.com>
2280
2281 PR c++/97566
2282 PR c++/98463
2283 * class.c (layout_class_type): An empty field gets size 0.
2284 (is_empty_field): New.
2285 (check_bases): Check it.
2286 * cp-tree.h (is_empty_field): Declare it.
2287 * constexpr.c (cxx_eval_store_expression): Check it.
2288 (cx_check_missing_mem_inits): Likewise.
2289 * init.c (perform_member_init): Likewise.
2290 * typeck2.c (process_init_constructor_record): Likewise.
2291
2292 2021-01-25 Martin Sebor <msebor@redhat.com>
2293
2294 PR c++/98646
2295 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
2296
2297 2021-01-25 Jason Merrill <jason@redhat.com>
2298
2299 PR c++/98463
2300 * constexpr.c (get_or_insert_ctor_field): Add check.
2301 (cxx_eval_store_expression): Handle discontinuity of refs.
2302
2303 2021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
2304
2305 * call.c (complain_about_access): Altered function.
2306 * cp-tree.h (complain_about_access): Changed parameters of function.
2307 (get_parent_with_private_access): Declared new function.
2308 * search.c (get_parent_with_private_access): Defined new function.
2309 * semantics.c (enforce_access): Modified function.
2310 * typeck.c (complain_about_unrecognized_member): Updated function
2311 arguments in complain_about_access.
2312
2313 2021-01-23 Patrick Palka <ppalka@redhat.com>
2314
2315 PR c++/97399
2316 * cp-tree.h (shared_member_p): Adjust declaration.
2317 * parser.c (cp_parser_init_declarator): If the storage class
2318 specifier is sc_static, pass true for static_p to
2319 cp_parser_declarator.
2320 (cp_parser_direct_declarator): Don't do inject_this_parm when
2321 the declarator is a friend.
2322 * search.c (shared_member_p): Change return type to bool and
2323 adjust function body accordingly. Return false for a dependent
2324 USING_DECL instead of aborting.
2325 * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
2326 even when type-dependent.
2327
2328 2021-01-22 Marek Polacek <polacek@redhat.com>
2329
2330 PR c++/96623
2331 * parser.c (inject_parm_decls): Remove a redundant assignment.
2332 (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
2333 before calling inject_parm_decls.
2334
2335 2021-01-22 Jason Merrill <jason@redhat.com>
2336
2337 PR c++/98744
2338 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
2339
2340 2021-01-22 Jakub Jelinek <jakub@redhat.com>
2341
2342 PR sanitizer/95693
2343 * init.c (build_zero_init_1): Revert the 2018-03-06 change to
2344 return build_zero_cst for reference types.
2345 * typeck2.c (process_init_constructor_record): Instead call
2346 build_zero_cst here during error recovery instead of build_zero_init.
2347
2348 2021-01-22 Marek Polacek <polacek@redhat.com>
2349
2350 PR c++/98545
2351 * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
2352 warnings regardless of abi_version_at_least.
2353 (write_expression): When the expression is a dependent name
2354 and an operator name, write "on" before writing its name.
2355
2356 2021-01-22 Marek Polacek <polacek@redhat.com>
2357
2358 PR c++/97966
2359 * pt.c (instantiate_class_template_1): Instantiate members
2360 marked with attribute used only after we're done instantiating
2361 the class.
2362
2363 2021-01-21 Patrick Palka <ppalka@redhat.com>
2364
2365 PR c++/71879
2366 * semantics.c (finish_decltype_type): Set up a cp_unevaluated
2367 sentinel at the start of the function. Remove a now-redundant
2368 manual adjustment of cp_unevaluated_operand.
2369
2370 2021-01-21 Nathan Sidwell <nathan@acm.org>
2371
2372 PR c++/98624
2373 * module.cc (depset::hash::find_dependencies): Add
2374 module arg.
2375 (trees_out::core_vals): Check state before calling
2376 write_location.
2377 (sort_cluster, module_state::write): Adjust
2378 find_dependencies call.
2379
2380 2021-01-21 Jakub Jelinek <jakub@redhat.com>
2381
2382 PR c++/98672
2383 * constexpr.c (check_for_return_continue_data): Add break_stmt member.
2384 (check_for_return_continue): Also look for BREAK_STMT. Handle
2385 SWITCH_STMT by ignoring break_stmt from its body.
2386 (potential_constant_expression_1) <case FOR_STMT>,
2387 <case WHILE_STMT>: If the condition isn't constant true, check if
2388 the loop body can contain a return stmt.
2389 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
2390 <case IF_STMT>: If recursion with tf_none is successful,
2391 merge *jump_target from the branches - returns with highest priority,
2392 breaks or continues lower. If then branch is potentially constant and
2393 doesn't return, check the else branch if it could return, break or
2394 continue.
2395
2396 2021-01-21 Nathan Sidwell <nathan@acm.org>
2397
2398 PR c++/98530
2399 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
2400
2401 2021-01-20 Nathan Sidwell <nathan@acm.org>
2402
2403 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
2404 signed type.
2405
2406 2021-01-20 Patrick Palka <ppalka@redhat.com>
2407
2408 PR c++/95434
2409 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
2410 CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
2411 adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
2412
2413 2021-01-20 Patrick Palka <ppalka@redhat.com>
2414
2415 PR c++/82613
2416 * parser.c (cp_parser_class_head): Defer access checking when
2417 parsing the base-clause until all bases are seen and attached
2418 to the class type.
2419 * pt.c (instantiate_class_template): Likewise when substituting
2420 into dependent bases.
2421
2422 2021-01-20 Jakub Jelinek <jakub@redhat.com>
2423
2424 PR c++/98742
2425 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
2426 error_operand_p, remove clause without further checking. Check
2427 for non-NULL TYPE_NAME.
2428
2429 2021-01-19 Marek Polacek <polacek@redhat.com>
2430
2431 PR c++/98659
2432 * pt.c (maybe_instantiate_noexcept): Return false if FN is
2433 error_mark_node.
2434
2435 2021-01-19 Marek Polacek <polacek@redhat.com>
2436
2437 PR c++/98687
2438 * name-lookup.c (push_using_decl_bindings): New, broken out of...
2439 (finish_nonmember_using_decl): ...here.
2440 * name-lookup.h (push_using_decl_bindings): Update declaration.
2441 * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
2442
2443 2021-01-19 Patrick Palka <ppalka@redhat.com>
2444
2445 PR c++/41437
2446 PR c++/58993
2447 * search.c (friend_accessible_p): If scope is a hidden friend
2448 defined inside a dependent class, consider access from the
2449 class.
2450 * parser.c (cp_parser_late_parsing_for_member): Don't push a
2451 dk_no_check access state.
2452
2453 2021-01-19 Marek Polacek <polacek@redhat.com>
2454
2455 PR c++/98333
2456 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
2457 of NSDMIs before late-parsing of noexcept-specifiers.
2458
2459 2021-01-19 Nathan Sidwell <nathan@acm.org>
2460
2461 * module.cc (identifier): Merge overloads.
2462
2463 2021-01-19 Nathan Sidwell <nathan@acm.org>
2464
2465 PR c++/98624
2466 * module.cc (trees_out::write_location): Make static.
2467
2468 2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
2469
2470 * parser.c (cp_parser_omp_clause_detach): New.
2471 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
2472 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
2473 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
2474 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
2475 Prevent use of detach with mergeable and overriding the data sharing
2476 mode of the event handle.
2477
2478 2021-01-15 Nathan Sidwell <nathan@acm.org>
2479
2480 PR c++/98538
2481 * tree.c (cp_build_qualified_type_real): Propagate an array's
2482 dependentness to the copy, if known.
2483
2484 2021-01-15 Jason Merrill <jason@redhat.com>
2485
2486 PR c++/98642
2487 * call.c (unsafe_return_slot_p): Return int.
2488 (init_by_return_slot_p): Split out from...
2489 (unsafe_copy_elision_p): ...here.
2490 (unsafe_copy_elision_p_opt): New name for old meaning.
2491 (build_over_call): Adjust.
2492 (make_safe_copy_elision): New.
2493 * typeck2.c (split_nonconstant_init_1): Elide copy from safe
2494 list-initialization.
2495 * cp-tree.h: Adjust.
2496
2497 2021-01-15 Jason Merrill <jason@redhat.com>
2498
2499 * call.c (base_ctor_for, make_base_init_ok): New.
2500 (build_over_call): Use make_base_init_ok.
2501
2502 2021-01-15 Jason Merrill <jason@redhat.com>
2503
2504 PR c++/63707
2505 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
2506 if we got a CONSTRUCTOR.
2507
2508 2021-01-15 Nathan Sidwell <nathan@acm.org>
2509
2510 PR c++/98591
2511 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
2512
2513 2021-01-14 Jason Merrill <jason@redhat.com>
2514
2515 * typeck2.c (process_init_constructor_record): Use fldtype
2516 variable consistently.
2517
2518 2021-01-14 Nathan Sidwell <nathan@acm.org>
2519
2520 PR c++/98372
2521 * tree.c (cp_tree_equal): Correct map_context logic.
2522
2523 2021-01-13 Marek Polacek <polacek@redhat.com>
2524
2525 PR c++/98231
2526 * name-lookup.c (push_using_decl_bindings): New.
2527 * name-lookup.h (push_using_decl_bindings): Declare.
2528 * pt.c (tsubst_expr): Call push_using_decl_bindings.
2529
2530 2021-01-13 Nathan Sidwell <nathan@acm.org>
2531
2532 PR c++/98626
2533 * module.cc (module_add_import_initializers): Pass a
2534 zero-element argument vector.
2535
2536 2021-01-12 Patrick Palka <ppalka@redhat.com>
2537
2538 PR c++/98611
2539 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
2540 the template of a CTAD placeholder.
2541
2542 2021-01-12 Marek Polacek <polacek@redhat.com>
2543
2544 PR c++/98620
2545 * typeck2.c (process_init_constructor_record): Don't emit
2546 -Wmissing-field-initializers warnings in unevaluated contexts.
2547
2548 2021-01-11 Jakub Jelinek <jakub@redhat.com>
2549
2550 PR c++/98481
2551 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
2552 for types.
2553 (mark_abi_tags_r): Likewise.
2554 * decl2.c (min_vis_r): Likewise.
2555 * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
2556 typedefs.
2557
2558 2021-01-08 Patrick Palka <ppalka@redhat.com>
2559
2560 PR c++/98551
2561 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
2562 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
2563
2564 2021-01-08 Patrick Palka <ppalka@redhat.com>
2565
2566 PR c++/98515
2567 * semantics.c (check_accessibility_of_qualified_id): Punt if
2568 we're checking access of a scoped non-static member inside a
2569 class template.
2570
2571 2021-01-07 Jakub Jelinek <jakub@redhat.com>
2572
2573 PR c++/98329
2574 * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
2575 cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
2576 its location.
2577 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
2578
2579 2021-01-07 Marek Polacek <polacek@redhat.com>
2580
2581 PR c++/98441
2582 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
2583 !late_return_type block.
2584
2585 2021-01-07 Jason Merrill <jason@redhat.com>
2586
2587 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
2588 (cxx_eval_store_expression): Add comment.
2589
2590 2021-01-07 Jason Merrill <jason@redhat.com>
2591
2592 * call.c (has_next): Factor out from...
2593 (next_conversion): ...here.
2594 (strip_standard_conversion): And here.
2595 (is_subseq): And here.
2596 (build_conv): Check it.
2597 (standard_conversion): Don't call build_conv
2598 for ck_identity.
2599
2600 2021-01-06 Martin Sebor <msebor@redhat.com>
2601
2602 PR c++/95768
2603 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
2604
2605 2021-01-05 Patrick Palka <ppalka@redhat.com>
2606
2607 * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
2608 the type of the NTTP, substitute into the type again. If the
2609 type is still dependent, don't unify the NTTP.
2610
2611 2021-01-05 Jakub Jelinek <jakub@redhat.com>
2612
2613 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
2614 $(CODYLIB) after $(BACKEND).
2615
2616 2021-01-05 Jakub Jelinek <jakub@redhat.com>
2617
2618 PR c++/98469
2619 * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
2620 Punt if lval is true.
2621 * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
2622 the result if it has a class type.
2623
2624 2021-01-05 Marek Polacek <polacek@redhat.com>
2625
2626 PR c++/82099
2627 * pt.c (resolve_overloaded_unification): Call
2628 maybe_instantiate_noexcept after instantiating the function
2629 decl.
2630
2631 2021-01-05 Nathan Sidwell <nathan@acm.org>
2632
2633 * parser.c (cp_parser_module_declaration): Alter diagnostic
2634 text to say where is permissable.
2635
2636 2021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2637
2638 PR c++/98316
2639 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
2640
2641 2021-01-02 Jan Hubicka <jh@suse.cz>
2642
2643 * cp-tree.h (cp_tree_c_finish_parsing): Declare.
2644 * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
2645 * tree.c (cp_tree_c_finish_parsing): New function.
2646
2647 2021-01-01 Jakub Jelinek <jakub@redhat.com>
2648
2649 * ChangeLog-2020: Rotate ChangeLog. New file.
2650
2651 \f
2652 Copyright (C) 2021 Free Software Foundation, Inc.
2653
2654 Copying and distribution of this file, with or without modification,
2655 are permitted in any medium without royalty provided the copyright
2656 notice and this notice are preserved.