]> gcc.gnu.org Git - gcc.git/blame - gcc/cp/ChangeLog
Daily bump.
[gcc.git] / gcc / cp / ChangeLog
CommitLineData
885ef72f
GA
12020-05-29 Patrick Palka <ppalka@redhat.com>
2 Jason Merrill <jason@redhat.com>
3
4 PR c++/95181
5 * class.c (add_method): Let special member function templates
6 coexist if they are not equivalently constrained, or in a class
7 template.
8
92020-05-29 Jason Merrill <jason@redhat.com>
10
11 PR c++/95371
12 * pt.c (process_template_parm): Set DECL_TEMPLATE_INFO
13 on the DECL_TEMPLATE_RESULT.
14
152020-05-29 Marek Polacek <polacek@redhat.com>
16
17 PR c++/95344
18 * cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set
19 TREE_THIS_VOLATILE here.
20 (cp_fold): Set it here along with TREE_NO_WARNING.
21
222020-05-29 Jason Merrill <jason@redhat.com>
23
24 PR c++/95311
25 PR c++/95221
26 * class.c (build_vfn_ref): Don't fold the INDIRECT_REF.
27
282020-05-29 Patrick Palka <ppalka@redhat.com>
29
30 PR c++/92652
31 PR c++/93698
32 PR c++/94128
33 * parser.c (cp_parser_requires_clause_expression): Temporarily
34 increment processing_template_decl only if it is 0.
35 (cp_parser_constraint_expression): Likewise.
36 (cp_parser_requires_expression): Likewise.
37
382020-05-29 Patrick Palka <ppalka@redhat.com>
39
40 PR c++/95241
41 * constexpr.c (get_or_insert_ctor_field): Add limited support
42 for RANGE_EXPR index lookups.
43
53ffb43a
GA
442020-05-28 Jakub Jelinek <jakub@redhat.com>
45
46 PR c++/95328
47 * decl.c (cp_finish_decomp): Call complete_type before checking
48 COMPLETE_TYPE_P.
49
502020-05-28 Jason Merrill <jason@redhat.com>
51
52 PR c++/94926
53 * decl.c (cp_finish_decl): Revert r9-297 change.
54 (check_static_variable_definition): Likewise.
55 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
56 * pt.c (instantiate_decl): Return early on type error.
57
61f3b605
GA
582020-05-27 Jason Merrill <jason@redhat.com>
59
60 PR c++/95319
61 * decl.c (reshape_init_array_1): Don't reuse in overload context.
62
632020-05-27 Jason Merrill <jason@redhat.com>
64
65 * call.c (build_new_op_1): Suppress
66 warn_zero_as_null_pointer_constant across comparison of <=> result
67 to 0.
68
692020-05-27 Jason Merrill <jason@redhat.com>
70
71 PR c++/95222
72 * decl.c (grokdeclarator): Don't shift attributes in TYPENAME
73 context.
74
752020-05-27 Nathan Sidwell <nathan@acm.org>
76
77 PR c++/95263
78 * pt.c (lookup_template_class_1): Restore alias template mutation.
79
c3a4169b
GA
802020-05-26 Jakub Jelinek <jakub@redhat.com>
81
82 PR c++/95197
83 * cp-gimplify.c: Include omp-general.h.
84 (cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration
85 variables in composite distribute parallel for, instantiate copy
86 ctor of their types.
87
6d1556ec
PP
882020-05-23 Patrick Palka <ppalka@redhat.com>
89
90 PR c++/94038
91 * constexpr.c (cxx_eval_constant_expression)
92 <case TEMPLATE_ID_EXPR>: Don't evaluate the concept when
93 constexpr evaluation is uid-sensitive.
94
f65a3299
PP
952020-05-21 Patrick Palka <ppalka@redhat.com>
96
97 PR c++/94038
98 * constexpr.c (constexpr_ctx::uid_sensitive): Remove field.
99 (uid_sensitive_constexpr_evaluation_value): Define.
100 (uid_sensitive_constexpr_evaluation_true_counter): Define.
101 (uid_sensitive_constexpr_evaluation_p): Define.
102 (uid_sensitive_constexpr_evaluation_sentinel): Define its
103 constructor.
104 (uid_sensitive_constexpr_evaluation_checker): Define its
105 constructor and its evaluation_restricted_p method.
106 (get_fundef_copy): Remove 'ctx' parameter. Use u_s_c_e_p
107 instead of constexpr_ctx::uid_sensitive.
108 (cxx_eval_call_expression): Use u_s_c_e_p instead, and test it
109 last. Adjust call to get_fundef_copy.
110 (instantiate_cx_fn_r): Test u_s_c_e_p so that we increment the
111 counter if necessary.
112 (cxx_eval_outermost_constant_expr): Remove 'uid_sensitive'
113 parameter. Adjust function body accordingly.
114 (maybe_constant_value): Remove 'uid_sensitive' parameter and
115 adjust function body accordingly. Set up a
116 uid_sensitive_constexpr_evaluation_checker, and use it to
117 conditionally update the cv_cache.
118 * cp-gimplify.c (cp_fold): Set up a
119 uid_sensitive_constexpr_evaluation_checker, and use it to
120 conditionally update the fold_cache.
121 * cp-tree.h (maybe_constant_value): Update declaration.
122 (struct uid_sensitive_constexpr_evaluation_sentinel): Define.
123 (struct sensitive_constexpr_evaluation_checker): Define.
124 * expr.c (fold_for_warn): Set up a
125 uid_sensitive_constexpr_evaluation_sentinel before calling
126 the folding subroutines. Drop all but the first argument to
127 maybe_constant_value.
128
4b38d56d
MP
1292020-05-20 Marek Polacek <polacek@redhat.com>
130
131 DR 2237
132 * parser.c (cp_parser_unqualified_id): Reject simple-template-id as
133 the declarator-id of a destructor.
134 (cp_parser_constructor_declarator_p): Reject simple-template-id as
135 the declarator-id of a constructor.
136
2a8565fa
MP
1372020-05-20 Marek Polacek <polacek@redhat.com>
138
139 DR 2289
140 PR c++/94553
141 * cp-tree.h (SD_DECOMPOSITION): New flag.
142 * decl.c (duplicate_decls): Make sure a structured binding is unique
143 in its declarative region.
144 (start_decl): If INITIALIZED is SD_DECOMPOSITION, call
145 fit_decomposition_lang_decl.
146 (grokdeclarator): Compare INITIALIZED directly to SD_* flags.
147 * parser.c (cp_parser_decomposition_declaration): Pass SD_DECOMPOSITION
148 to start_decl.
149
610ae2db
PP
1502020-05-20 Patrick Palka <ppalka@redhat.com>
151
152 PR c++/95223
153 * typeck.c (structural_comptypes): Don't perform
154 context-dependent resolution of TYPENAME_TYPEs when
155 comparing_specializations.
156
74744bb1
NS
1572020-05-19 Nathan Sidwell <nathan@acm.org>
158
159 * pt.c (lookup_template_class_1): Do not reinit template_info of an
160 alias here.
161
c0d8623c
MS
1622020-05-18 Martin Sebor <msebor@redhat.com>
163
164 PR c++/94923
165 * call.c ((maybe_warn_class_memaccess): Use is_byte_access_type.
166 * cp-tree.h (is_dummy_object): Return bool.
167 (is_byte_access_type): Declare new function.
168 * tree.c (is_dummy_object): Return bool.
169 (is_byte_access_type): Define new function.
170
864fed4a
PP
1712020-05-19 Patrick Palka <ppalka@redhat.com>
172
573e5f05
PP
173 PR c++/87847
174 * pt.c (init_template_processing): Enable sanitization for
175 decl_specializations and type_specializations.
176
864fed4a
PP
177 PR c++/66439
178 * pt.c (fn_type_unification): Pass 'fn' instead of NULL_TREE as
179 the 'in_decl' parameter to coerce_template_parms.
180
2d4e1e14
MP
1812020-05-18 Marek Polacek <polacek@redhat.com>
182
183 PR c++/94955
184 * typeck.c (cp_build_binary_op): Use fold_for_warn instead of
185 cp_fold_rvalue.
186
bf732686
MP
1872020-05-18 Marek Polacek <polacek@redhat.com>
188
189 PR c++/94937
190 * cvt.c (cp_get_fndecl_from_callee): Return NULL_TREE if the function
191 type is not INDIRECT_TYPE_P.
192 * decl.c (omp_declare_variant_finalize_one): Call
193 cp_get_callee_fndecl_nofold instead of looking for the function decl
194 manually.
195
5d2246a3
MP
1962020-05-18 Marek Polacek <polacek@redhat.com>
197
198 PR c++/90915
199 * parser.c (cp_parser_has_attribute_expression): Sorry on a
200 type-dependent argument.
201
ae8ed736
MP
2022020-05-18 Marek Polacek <polacek@redhat.com>
203
204 DR 1512
205 PR c++/87699
206 * call.c (add_builtin_candidate) <case EQ_EXPR>: Create candidate
207 operator functions when type is std::nullptr_t for ==/!=.
208 * typeck.c (composite_pointer_type_r): Add a bool * parameter. Use it
209 to maybe add "const" to the pointer type.
210 (composite_pointer_type): Update the call to composite_pointer_type_r.
211 (cp_build_binary_op): Turn two warning_at into error_at. Print the
212 types.
213
29579071
JM
2142020-05-18 Jason Merrill <jason@redhat.com>
215
216 * call.c (build_over_call): Remove unnecessary
217 cp_stabilize_reference.
218
100fdb1f
MP
2192020-05-18 Marek Polacek <polacek@redhat.com>
220
221 * call.c (add_builtin_candidate): Don't create a builtin overload
222 candidate for ++ when type is bool in C++17.
223
2242020-05-18 Marek Polacek <polacek@redhat.com>
642dc602
MP
225
226 * cfns.h: Regenerated.
227
2b9a271b
IS
2282020-05-17 Iain Sandoe <iain@sandoe.co.uk>
229
230 * coroutines.cc (morph_fn_to_coro): Initialize the gro variable.
231
5ef067eb
IS
2322020-05-16 Iain Sandoe <iain@sandoe.co.uk>
233
234 * coroutines.cc (finish_co_return_stmt): Implement rules
235 from [class.copy.elision] /3.
236
115232b7
PP
2372020-05-16 Patrick Palka <ppalka@redhat.com>
238
239 PR c++/57943
240 * semantics.c (finish_decltype_type): Call
241 instantiate_non_dependent_expr_sfinae on the expression.
242
289fbbe7
PP
2432020-05-15 Patrick Palka <ppalka@redhat.com>
244
245 Revert:
246
247 2020-04-07 Patrick Palka <ppalka@redhat.com>
248
249 PR c++/90996
250 * typeck2.c (process_init_constructor_array): Propagate
251 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
252 the array initializer.
253
cda6396a
JM
2542020-05-15 Jason Merrill <jason@redhat.com>
255
256 PR c++/93286 - ICE with __is_constructible and variadic template.
257 * pt.c (tsubst_tree_list): New.
258 (tsubst, tsubst_copy_and_build): Use it.
259 * decl2.c (is_late_template_attribute): Handle error_mark_node args.
260
271e3da8
NS
2612020-05-15 Nathan Sidwell <nathan@acm.org>
262
263 * pt.c (template_args_equal): Fix thinkos in previous 'cleanup'.
264
4e1592f8
JM
2652020-05-14 Jason Merrill <jason@redhat.com>
266
267 PR c++/93901
268 * pt.c (maybe_instantiate_noexcept): Change clone handling.
269
098cf31a
PP
2702020-05-14 Patrick Palka <ppalka@redhat.com>
271
272 PR c++/78446
273 * call.c (build_op_call): Pass complain to lookup_fnfields.
274 (build_special_member_call): Likewise.
275 * class.c (type_requires_array_cookie): Pass tf_warning_or_error
276 to lookup_fnfields.
277 * cp-tree.h (lookup_fnfields): Add tsubst_flags_t parameter.
278 * except.c (build_throw): Pass tf_warning_or_error to
279 lookup_fnfields.
280 * init.c (build_new_1): Pass complain to lookup_fnfields.
281 * method.c (locate_fn_flags): Likewise.
282 * name-lookup.c (lookup_name_real_1): Pass tf_warning_or_error
283 to lookup_fnfields.
284 * pt.c (tsubst_baselink): Pass complain to lookup_fnfields.
285 * search.c (lookup_fnfields): New 'complain' parameter. Pass it
286 to lookup_member.
287
c4bff4c2
NS
2882020-05-14 Nathan Sidwell <nathan@acm.org>
289
68f1d74f
NS
290 * parser.c (cp_parser_diagnose_invalid_typename): Mention
291 std=c++20 not 2a, reformat dependent binfo inform loops.
292
f497e36a
NS
293 * pt.c (tsubst_template_decl): Reorder and commonize some control
294 paths.
295
ddbaab13
NS
296 * pt.c (tsubst_friend_function): Simplify control flow.
297
ea5a33d4
NS
298 * pt.c (lookup_template_class_1): Remove unnecessary else by
299 simply grabbing TYPE_NAME earlier.
300
5adbd090
NS
301 * pt.c (push_template_decl_real): Adjust friend pushing logic.
302 Reinit template type.
303
c4bff4c2
NS
304 * pt.c (build_template_decl): Init DECL_TEMPLATE_RESULT &
305 TREE_TYPE here ...
306 (process_partial_specialization): ... not here ...
307 (push_template_decl_real, add_inherited_template_parms)
308 (build_deduction_guide): ... or here.
309
49ddde69
JJ
3102020-05-14 Jakub Jelinek <jakub@redhat.com>
311
312 * cp-gimplify.c (cp_genericize_r): Set cfun->has_omp_target.
313
4924293a
PP
3142020-05-13 Patrick Palka <ppalka@redhat.com>
315
316 PR c++/79706
317 * init.c (build_vec_delete_1): Just return error_mark_node if
318 deallocate_expr is error_mark_node.
319 (build_delete): Just return error_mark_node if do_delete is
320 error_mark_node.
321
7e52f8b1
PP
3222020-05-13 Patrick Palka <ppalka@redhat.com>
323
324 PR c++/95020
325 * constraint.c (tsubst_requires_expr): Produce a new
326 requires-expression when processing_template_decl, even if
327 template arguments are not dependent.
328
661232da
MP
3292020-05-13 Marek Polacek <polacek@redhat.com>
330
331 PR c++/95066
332 * decl.c (duplicate_decls): Set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
333
7e6a72cb
NS
3342020-05-13 Nathan Sidwell <nathan@acm.org>
335
7040894c
NS
336 * pt.c (template_args_equal): Reorder category checking for
337 clarity.
338
2bb30de6
NS
339 * pt.c (perform_typedefs_access_check): Cache expensively
340 calculated object references.
341 (check_auto_in_tmpl_args): Just assert we do not get unexpected
342 nodes, rather than silently do nothing.
343 (append_type_to_template_for_access): Likewise, cache expensie
344 object reference.
345
833c7b4b
NS
346 * pt.c (canonical_type_parameter): Simplify.
347
7e6a72cb
NS
348 Formatting fixups & some simplifications.
349 * pt.c (spec_hash_table): New typedef.
350 (decl_specializations, type_specializations): Use it.
351 (retrieve_specialization): Likewise.
352 (register_specialization): Remove unnecessary casts.
353 (push_template_decl_real): Reformat.
354 (instantiate_class_template_1): Use more RAII.
355 (make_argument_pack): Simplify.
356 (instantiate_template_1): Use gcc_checking_assert for expensive
357 asserts.
358 (instantiate_decl): Likewise.
359 (resolve_typename_type): Reformat comment.
360 * semantics.c (struct deferred_access): Remove unnecessary GTY on
361 member.
362 (begin_class_definition): Fix formatting.
363
b04445d4
JM
3642020-05-13 Jason Merrill <jason@redhat.com>
365
366 * call.c, class.c, constexpr.c, constraint.cc, decl.c, init.c,
367 lambda.c, lex.c, method.c, name-lookup.c, parser.c, pt.c, tree.c,
368 typeck2.c: Change cxx2a to cxx20.
369
90b160f8
MP
3702020-05-12 Marek Polacek <polacek@redhat.com>
371
372 PR c++/95074
373 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: When
374 looking for a block-scope function declaration, look through the whole
375 set, not just the first function in the overload set.
376
99b0c9ec
JJ
3772020-05-12 Jakub Jelinek <jakub@redhat.com>
378
379 PR c++/95063
380 * pt.c (tsubst_decl): Deal with DECL_OMP_PRIVATIZED_MEMBER for
381 a bit-field.
382
52c5933f
JM
3832020-05-11 Jason Merrill <jason@redhat.com>
384
385 Resolve C++20 NB comment CA104
386 * pt.c (determine_specialization): Compare constraints for
387 specialization of member template of class instantiation.
388
0f50f6da
JM
3892020-05-11 Jason Merrill <jason@redhat.com>
390
391 PR c++/92583
392 PR c++/92654
393 * tree.c (cp_walk_subtrees): Stop at typedefs.
394 Handle TYPENAME_TYPE here.
395 * pt.c (find_parameter_packs_r): Not here.
396 (for_each_template_parm_r): Clear *walk_subtrees.
397 * decl2.c (min_vis_r): Look through typedefs.
398
42e9f80b
JM
3992020-05-11 Jason Merrill <jason@redhat.com>
400
401 * call.c (implicit_conversion_error): Split out from...
402 (perform_implicit_conversion_flags): ...here.
403 (build_converted_constant_expr_internal): Use it.
404
f981395c
JM
4052020-05-11 Jason Merrill <jason@redhat.com>
406
407 PR c++/90748
408 * parser.c (inject_parm_decls): Set current_class_ptr here.
409 (cp_parser_direct_declarator): And here.
410 (cp_parser_late_return_type_opt): Not here.
411 (cp_parser_noexcept_specification_opt): Nor here.
412 (cp_parser_exception_specification_opt)
413 (cp_parser_late_noexcept_specifier): Remove unneeded parameters.
414
aa2c9784
JM
4152020-05-11 Jason Merrill <jason@redhat.com>
416
417 * decl.c (cxx_init_decl_processing): Call declare_weak for
418 __cxa_pure_virtual.
419
e5ccab83
JM
4202020-05-11 Jason Merrill <jason@redhat.com>
421
422 * pt.c (instantiate_class_template_1): Call tsubst_expr for
423 STATIC_ASSERT member.
424 * ptree.c (cxx_print_xnode): Handle STATIC_ASSERT.
425
f3f9cc41
JM
4262020-05-11 Jason Merrill <jason@redhat.com>
427
428 * pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Remove redundant
429 walking of capture list.
430
08434b02
JM
4312020-05-11 Jason Merrill <jason@redhat.com>
432
433 * cp-tree.h (LOOKUP_EXPLICIT_TMPL_ARGS): Remove.
434 * call.c (build_new_function_call): Don't set it.
435 (build_new_method_call_1): Likewise.
436 (build_over_call): Check cand->explicit_targs instead.
437
f315d147
JM
4382020-05-11 Jason Merrill <jason@redhat.com>
439
440 * decl.c (compute_array_index_type_loc): Stabilize before building
441 the MINUS_EXPR.
442
3a3e1ea9
JM
4432020-05-11 Jason Merrill <jason@redhat.com>
444
445 * decl.c (grokdeclarator): Adjust deprecated_state here.
446 (start_decl): Not here.
447
234681ea
IS
4482020-05-08 Iain Sandoe <iain@sandoe.co.uk>
449
450 PR c++/95003
451 * coroutines.cc (build_actor_fn): Ensure that bind scopes
452 are marked as having side-effects where necessary.
453 (replace_statement_captures): Likewise.
454 (morph_fn_to_coro): Likewise.
455
debfaee5
NS
4562020-05-08 Nathan Sidwell <nathan@acm.org>
457
810a2bd8
NS
458 * NEWS: Delete, it is so stale.
459
debfaee5
NS
460 * parser.c (cp_lexer_set_source_position_from_token): EOF has a
461 location too.
462
c7100843
IS
4632020-05-07 Iain Sandoe <iain@sandoe.co.uk>
464
465 PR c++/94817
466 PR c++/94829
467 * coroutines.cc (morph_fn_to_coro): Set unformed outline
468 functions to error_mark_node. For early error returns suppress
469 warnings about missing ramp return values. Fix reinstatement
470 of the function body on pre-existing initial error.
471 * decl.c (finish_function): Use the normal error path for fails
472 in the ramp function, do not try to compile the helpers if the
473 transform fails.
474
5d5dcc65
MP
4752020-05-07 Marek Polacek <polacek@redhat.com>
476
477 PR c++/94590 - Detect long double -> double narrowing.
478 * typeck2.c (check_narrowing): Detect long double -> double
479 narrowing even when double and long double have the same
480 precision. Make it handle conversions to float too.
481
21968d4a
MP
4822020-05-07 Marek Polacek <polacek@redhat.com>
483
484 PR c++/94255
485 * parser.c (cp_parser_class_specifier_1): Check that the scope is
486 nested inside current scope before pushing it.
487
0ca22d02
MP
4882020-05-07 Marek Polacek <polacek@redhat.com>
489
490 P1957R2
491 * typeck2.c (check_narrowing): Consider T* to bool narrowing
492 in C++11 and up.
493
d20b7173
MP
4942020-05-07 Marek Polacek <polacek@redhat.com>
495
496 * decl.c (grok_op_properties): Fix spelling of non-static.
497 * typeck.c (build_class_member_access_expr): Likewise.
498
eb72dc66
RB
4992020-05-07 Richard Biener <rguenther@suse.de>
500
501 PR middle-end/94703
502 * optimize.c (update_cloned_parm): Copy DECL_NOT_GIMPLE_REG_P.
503
1e891788
MP
5042020-05-06 Marek Polacek <polacek@redhat.com>
505
506 PR c++/94938
507 * pt.c (tsubst_copy_and_build): Call type_dependent_expression_p_push
508 instead of uses_template_parms. Move the warning_sentinels after the
509 RECURs.
510
25ee2155
JJ
5112020-05-06 Jakub Jelinek <jakub@redhat.com>
512
46fcef99
JJ
513 PR c++/94951
514 * typeck.c (cp_strict_aliasing_warning): New function.
515 (cp_build_indirect_ref_1, build_reinterpret_cast_1): Use
516 it instead of strict_aliasing_warning.
517
25ee2155
JJ
518 PR c++/94907
519 * method.c (defaulted_late_check): Don't call synthesize_method
520 on constexpr sfk_comparison if it has been called on it already.
521
bc95e478
NS
5222020-05-06 Nathan Sidwell <nathan@acm.org>
523
524 PR c++/94946
525 * decl.c (grokdeclarator): Don't splice template attributes in
526 parm context -- they can apply to the parm.
527
80644a67
IS
5282020-05-05 Iain Sandoe <iain@sandoe.co.uk>
529
530 * coroutines.cc: Remove references to n4849 throughout.
531
e42f3426
JM
5322020-05-05 Jason Merrill <jason@redhat.com>
533
534 CWG 2235
535 * pt.c (more_specialized_fn): Do consider parms with no deducible
536 template parameters.
537
04b89192
JM
5382020-05-05 Jason Merrill <jason@redhat.com>
539
540 PR c++/90212
541 * constexpr.c (potential_constant_expression_1): In a lambda
542 function, consider a captured variable directly.
543
f1656ae9
IS
5442020-05-05 Iain Sandoe <iain@sandoe.co.uk>
545
546 * coroutines.cc (transform_await_wrapper): Check that we have
547 no unlowered co_yields.
548 (captures_temporary): Likewise.
549 (register_awaits): Likewise.
550
733195e3
NS
5512020-05-05 Nathan Sidwell <nathan@acm.org>
552
553 PR c++/94807
554 * coroutines.cc (morph_fn_to_coro): Just check for
555 closure_identifier.
556 * pt.c (tsubst_function_decl): Update lambda fn's this_ptr name.
557
ef3479af
MP
5582020-05-05 Marek Polacek <polacek@redhat.com>
559 Jason Merrill <jason@redhat.com>
560
561 PR c++/94799
562 * parser.c (cp_parser_postfix_dot_deref_expression): If we have
563 a type-dependent object of class type, stash it to
564 parser->context->object_type. If the postfix expression doesn't have
565 a type, use typeof.
566 (cp_parser_class_name): Consider object scope too.
567 (cp_parser_lookup_name): Remove code dealing with the case when
568 object_type is unknown_type_node.
569
a700b4a9
PP
5702020-05-04 Patrick Palka <ppalka@redhat.com>
571
572 PR c++/94038
573 * cp-gimplify.c (cp_fold) <case CALL_EXPR>: Move some variable
574 declarations closer to their uses. Copy the CALL_EXPR only
575 when one of its arguments has changed.
576 <case TREE_VEC>: Instead of first collecting the folded
577 arguments into a releasing_vec, just make a copy of the TREE_VEC
578 as soon as folding changes one of its arguments.
579
0719055a
IS
5802020-05-04 Iain Sandoe <iain@sandoe.co.uk>
581
582 * coroutines.cc (morph_fn_to_coro): Mark the coro.gro variable
583 as artificial and ignored.
584
f1621d18
NS
5852020-05-04 Nathan Sidwell <nathan@acm.org>
586
97268c37
NS
587 pt.c (process_template_parm): Don't walk the template list twice,
588 remember the final node instead.
589 (end_template_parm_list): Refactor. Comment on why we do a pop
590 and a push.
591
f1621d18
NS
592 PR c++/94827 -- don't save parms in nested requirement
593 * constraint.cc (tsubst_nested_requirement): TYPE directly holds
594 notmalized requirement.
595 (finish_nested_requirement): Don't stash current tpl parms into
596 the requirement.
597 (diagnose_nested_requirement): TYPE directly holds notmalized
598 requirement.
599
4f6c1ca2
PP
6002020-05-01 Patrick Palka <ppalka@redhat.com>
601
602 PR c++/90880
603 * cp-tree.h (check_accessibility_of_qualified_id): Add
604 tsubst_flags_t parameter and change return type to bool.
605 * parser.c (cp_parser_lookup_name): Pass tf_warning_to_error to
606 check_accessibility_of_qualified_id.
607 * pt.c (tsubst_qualified_id): Return error_mark_node if
608 check_accessibility_of_qualified_id returns false.
609 * semantics.c (check_accessibility_of_qualified_id): Add
610 complain parameter. Pass complain instead of
611 tf_warning_or_error to perform_or_defer_access_check. Return
612 true unless perform_or_defer_access_check returns false.
613
30da2906
MP
6142020-05-01 Marek Polacek <polacek@redhat.com>
615
616 PR c++/94885
617 * typeck2.c (process_init_constructor_record): Return PICFLAG_ERRONEOUS
618 if an initializer element was erroneous.
619
82d5dece
JM
6202020-05-01 Jason Merrill <jason@redhat.com>
621
622 PR c++/90479
623 * init.c (get_nsdmi): Don't push_to_top_level for a local class.
624
a2f32550
JM
6252020-05-01 Jason Merrill <jason@redhat.com>
626
627 PR c++/91529
628 * decl.c (cp_finish_decl): Also clear TREE_READONLY if
629 -fmerge-all-constants.
630
bcbf334a
JM
6312020-05-01 Jason Merrill <jason@redhat.com>
632
633 PR c++/93822
634 * pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have
635 the same type as the variable.
636
c416c52b
NS
6372020-04-30 Jason Merrill <jason@redhat.com>
638 Nathan Sidwell <nathan@acm.org>
639
640 PR c++/94827
641 * constraint.cc (map_arguments): If ARGS is null, it's a
642 self-mapping of parms.
643 (finish_nested_requirement): Do not pass argified
644 current_template_parms to normalization.
645 (tsubst_nested_requirement): Don't assert no template parms.
646
448c89d5
IS
6472020-04-30 Iain Sandoe <iain@sandoe.co.uk>
648
649 PR c++/94886
650 * coroutines.cc (transform_local_var_uses): Defer walking
651 the DECL_INITIALs of BIND_EXPR vars until all the frame
652 allocations have been made.
653
aa94a22f
IS
6542020-04-30 Iain Sandoe <iain@sandoe.co.uk>
655
656 PR c++/94883
657 * coroutines.cc (register_awaits): Update target
658 expressions for awaitable and suspend handle
659 initializers.
660
b16fd5fd
IS
6612020-04-30 Iain Sandoe <iain@sandoe.co.uk>
662
663 PR c++/94879
664 * coroutines.cc (build_co_await): Account for variables
665 with DECL_VALUE_EXPRs.
666 (captures_temporary): Likewise.
667 (register_awaits): Likewise.
668
a7201a08
PP
6692020-04-29 Patrick Palka <ppalka@redhat.com>
670
671 PR c++/94830
672 * pt.c (find_template_parameter_info::parm_list): New field.
673 (keep_template_parm): Use the new field to build up the
674 parameter list here instead of ...
675 (find_template_parameters): ... here. Return ftpi.parm_list.
676
575ac27f
JJ
6772020-04-29 Jakub Jelinek <jakub@redhat.com>
678
679 PR target/94707
680 * class.c (build_base_field): Set DECL_FIELD_ABI_IGNORED on C++17 empty
681 base artificial FIELD_DECLs.
682 (layout_class_type): Set DECL_FIELD_ABI_IGNORED on empty class
683 field_poverlapping_p FIELD_DECLs.
684
43439d5e
PP
6852020-04-29 Patrick Palka <ppalka@redhat.com>
686
1d2290ca
PP
687 PR c++/94819
688 * constraint.cc (satisfy_declaration_constraints): Use saved_t
689 instead of t as the key to decl_satisfied_cache.
690
43439d5e
PP
691 PR c++/94808
692 * error.c (print_requires_expression_info): Print the dependent
693 form of the parameter list with its template parameter mapping,
694 rather than printing the substituted form.
695
bce54ed4
JM
6962020-04-28 Jason Merrill <jason@redhat.com>
697
698 PR c++/94583
699 * decl.c (use_eh_spec_block): Check nothrow type after
700 DECL_DEFAULTED_FN.
701 * pt.c (maybe_instantiate_noexcept): Call synthesize_method for
702 DECL_MAYBE_DELETED fns here.
703 * decl2.c (mark_used): Not here.
704 * method.c (get_defaulted_eh_spec): Reject DECL_MAYBE_DELETED here.
705
f5edc76a
IS
7062020-04-28 Iain Sandoe <iain@sandoe.co.uk>
707
708 PR c++/94760
709 * coroutines.cc (instantiate_coro_traits): Pass a reference to
710 object type rather than a pointer type for 'this', for method
711 coroutines.
712 (struct param_info): Add a field to hold that the parm is a lambda
713 closure pointer.
714 (morph_fn_to_coro): Check for lambda closure pointers in the
715 args. Use a reference to *this when building the args list for the
716 promise allocator lookup.
717
b9c91b7f
IS
7182020-04-28 Iain Sandoe <iain@sandoe.co.uk>
719
720 PR c++/94759
721 * coroutines.cc (coro_promise_type_found_p): Do not
722 exclude non-classes here (this needs to be handled in the
723 coroutine header).
724 (morph_fn_to_coro): Allow for the case where the coroutine
725 returns void.
726
174b6f73
IS
7272020-04-27 Iain Sandoe <iain@sandoe.co.uk>
728
729 PR c++/94701
730 * coroutines.cc (struct local_var_info): Add fields for static
731 variables and those with DECL_VALUE_EXPR redirection.
732 (transform_local_var_uses): Skip past typedefs and static vars
733 and then account for redirected variables.
734 (register_local_var_uses): Likewise.
735
5f1cd1da
JM
7362020-04-27 Jason Merrill <jason@redhat.com>
737
738 PR c++/90750
739 PR c++/79585
740 * decl.c (grokdeclarator): Move dependent attribute to decl.
741 * decl2.c (splice_template_attributes): No longer static.
742
64da1b76
PP
7432020-04-27 Patrick Palka <ppalka@redhat.com>
744
745 PR c++/94772
746 * constexpr.c (cxx_eval_call_expression): Don't set new_obj if we're
747 evaluating the target constructor of a delegating constructor.
748 (cxx_eval_store_expression): Don't set TREE_READONLY if the LHS of the
749 INIT_EXPR is '*this'.
750
bfdea9ae 7512020-04-26 Marek Polacek <polacek@redhat.com>
feb801f6
MP
752
753 PR c++/90320
754 * call.c (struct conversion): Add copy_init_p.
755 (standard_conversion): Set copy_init_p in ck_base and ck_rvalue
756 if FLAGS demands LOOKUP_ONLYCONVERTING.
757 (convert_like_real) <case ck_base>: If copy_init_p is set, or
758 LOOKUP_ONLYCONVERTING into FLAGS.
759
29f55115
IS
7602020-04-26 Iain Sandoe <iain@sandoe.co.uk>
761
762 PR c++/94752
763 * coroutines.cc (morph_fn_to_coro): Ensure that
764 unnamed function params have a usable and distinct
765 frame field name.
766
35281187
JM
7672020-04-24 Jason Merrill <jason@redhat.com>
768
769 PR c++/94583
770 * decl.c (redeclaration_error_message): Reject defaulted comparison
771 operator that has been previously declared.
772
5e7e8b98
PP
7732020-04-25 Patrick Palka <ppalka@redhat.com>
774
775 * parser.c (cp_parser_diagnose_invalid_type_name): Suggest enabling
776 concepts if the invalid identifier is 'requires'.
777
4ff685a8
JJ
7782020-04-25 Jakub Jelinek <jakub@redhat.com>
779
780 PR c++/94742
781 * semantics.c (finish_call_expr): When looking if all overloads
782 are noreturn, use STRIP_TEMPLATE to look through TEMPLATE_DECLs.
783
6f6c7992
ML
7842020-04-24 Martin Liska <mliska@suse.cz>
785
786 * coroutines.cc: Fix compilation error for release checking
787 where we miss declaration of ‘coro_body_contains_bind_expr_p’.
788
f9f16625
PP
7892020-04-23 Patrick Palka <ppalka@redhat.com>
790
9a453da5
PP
791 * tree.c (zero_init_expr_p): Use uses_template_parms instead of
792 dependent_type_p.
793
f9f16625
PP
794 PR c++/94645
795 * pt.c (template_class_depth): Walk into the DECL_FRIEND_CONTEXT of a
796 friend declaration rather than into its CP_DECL_CONTEXT.
797
3dbc7721
IS
7982020-04-23 Iain Sandoe <iain@sandoe.co.uk>
799
800 PR c++/94288
801 * coroutines.cc (await_statement_expander): Simplify cases.
802 (struct susp_frame_data): Add fields for truth and/or if
803 cases, rename one field.
804 (analyze_expression_awaits): New.
805 (expand_one_truth_if): New.
806 (add_var_to_bind): New helper.
807 (coro_build_add_if_not_cond_break): New helper.
808 (await_statement_walker): Handle conditional expressions,
809 handle expansion of truth-and/or-if cases.
810 (bind_expr_find_in_subtree): New, checking-only.
811 (coro_body_contains_bind_expr_p): New, checking-only.
812 (morph_fn_to_coro): Ensure that we have a top level bind
813 expression.
814
cf88e25a
JW
8152020-04-22 Jonathan Wakely <jwakely@redhat.com>
816
817 PR translation/94698
818 * class.c (check_field_decls): Change "define" to "declare" in
819 -Weffc++ diagnostics.
820
72d0ef73
PP
8212020-04-22 Patrick Palka <ppalka@redhat.com>
822
823 PR c++/94719
824 PR c++/94549
825 * constraint.cc (satisfy_declaration_constraints): If the inherited
826 constructor points to an instantiation of a constructor template,
827 remember and use its attached template arguments.
828
c95d1dd7
JW
8292020-04-22 Jonathan Wakely <jwakely@redhat.com>
830
831 PR translation/94698
832 * class.c (check_field_decls): Change "override" to "define" in
833 -Weffc++ diagnostics.
834
38644f81
IS
8352020-04-22 Iain Sandoe <iain@sandoe.co.uk>
836
837 PR c++/94682
838 * coroutines.cc (struct param_info): Add a field to note that
839 the param is 'this'.
840 (morph_fn_to_coro): Convert this to a reference before using it
841 in the promise parameter preview.
842
aedd04ca
JM
8432020-04-22 Jason Merrill <jason@redhat.com>
844
845 PR c++/94546
846 * pt.c (register_parameter_specializations): If the instantiation is
847 still a parameter pack, don't wrap it in a NONTYPE_ARGUMENT_PACK.
848 (tsubst_pack_expansion, tsubst_expr): Adjust.
849
58797021
MS
8502020-04-22 Martin Sebor <msebor@redhat.com>
851 Jason Merrill <jason@redhat.com>
852
853 PR c++/94510
854 * decl.c (reshape_init_array_1): Avoid stripping redundant trailing
855 zero initializers...
856 * mangle.c (write_expression): ...and handle them here even for
857 pointers to members by calling zero_init_expr_p.
858 * cp-tree.h (zero_init_expr_p): Declare.
859 * tree.c (zero_init_expr_p): Define.
860 (type_initializer_zero_p): Remove.
861 * pt.c (tparm_obj_values): New hash_map.
862 (get_template_parm_object): Store to it.
863 (tparm_object_argument): New.
864
05f14938
PP
8652020-04-22 Patrick Palka <ppalka@redhat.com>
866
867 PR c++/67825
868 * constraint.cc (diagnose_valid_expression): Check convert_to_void here
869 as well as in tsubst_valid_expression_requirement.
870
08d6ec14
PP
8712020-04-21 Patrick Palka <ppalka@redhat.com>
872
0e665f25
PP
873 PR c++/94549
874 * constraint.cc (satisfy_declaration_constraints): Don't strip the
875 inherited constructor if it already has template information.
876
08d6ec14
PP
877 PR c++/94597
878 * pt.c (any_template_parm_r) <case IDENTIFIER_NODE>: New case. If this
879 is a conversion operator, visit its TREE_TYPE.
880
f2c8be18
NS
8812020-04-21 Nathan Sidwell <nathan@acm.org>
882
883 * pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
884 error_mark_node.
885
cd08718d
IS
8862020-04-21 Iain Sandoe <iain@sandoe.co.uk>
887
888 PR c++/94661
889 * coroutines.cc (morph_fn_to_coro): Simplify return
890 value computation.
891
d419e176
MP
8922020-04-17 Marek Polacek <polacek@redhat.com>
893
894 PR c++/94592
895 * constexpr.c (cxx_eval_outermost_constant_expr): Return when T is
896 a BRACE_ENCLOSED_INITIALIZER_P.
897 (is_nondependent_constant_expression): Don't check
898 BRACE_ENCLOSED_INITIALIZER_P.
899 (is_nondependent_static_init_expression): Likewise.
900
a3a4f6be
PP
9012020-04-20 Patrick Palka <ppalka@redhat.com>
902
903 PR c++/94628
904 * cp-tree.h (lss_policy::lss_nop): New enumerator.
905 * pt.c (local_specialization_stack::local_specialization_stack): Handle
906 an lss_nop policy.
907 (local_specialization_stack::~local_specialization_stack): Likewise.
908 (tsubst_pack_expansion): Use a local_specialization_stack instead of
909 manually saving and restoring local_specializations. Conditionally
910 replace local_specializations sooner, before the handling of the
911 unsubstituted_packs case.
912
5bdd4c5d
MP
9132020-04-20 Marek Polacek <polacek@redhat.com>
914
915 PR c++/94505 - bogus -Wparentheses warning with fold-expression.
916 * pt.c (fold_expression): Add warning_sentinel for -Wparentheses
917 before calling build_x_binary_op.
918
c5e4be6b
MP
9192020-04-20 Marek Polacek <polacek@redhat.com>
920
921 * coroutines.cc (captures_temporary): Don't assign the result of
922 STRIP_NOPS to the same variable.
923
aa576f2a
NS
9242020-04-20 Nathan Sidwell <nathan@acm.org>
925
f2c8be18 926 PR c++/94454 - tpl-tpl-parms are not canonicalizable types
a6f40023
NS
927 * pt.c (canonical_type_parameter): Assert not a tpl-tpl-parm.
928 (process_template_parm): tpl-tpl-parms are structural.
929 (rewrite_template_parm): Propagate structuralness.
930
f2c8be18
NS
931 PR c++/94454 - Expr pack expansion equality
932 * tree.c (cp_tree_equal) [TEMPLATE_ID_EXPR, default]: Refactor.
7fcb9343
NS
933 [EXPR_PACK_EXPANSION]: Add.
934
aa576f2a
NS
935 PR c++/94454 Template Argument Hashing
936 * pt.c (iterative_hash_template_arg): Strip nodes as
937 template_args_equal does.
938 [ARGUMENT_PACK_SELECT, TREE_VEC, CONSTRUCTOR]: Refactor.
939 [node_class:TEMPLATE_TEMPLATE_PARM]: Hash by level & index.
940 [node_class:default]: Refactor.
941
e43b28ae
PP
9422020-04-18 Patrick Palka <ppalka@redhat.com>
943
f83adb68
PP
944 PR c++/94632
945 * tree.c (cp_tree_equal) <case PARM_DECL>: Ignore
946 comparing_specializations if the parameters' contexts are identical.
947
e43b28ae
PP
948 PR c++/92187
949 * pt.c (splice_late_return_type): Propagate cv-qualifiers and
950 PLACEHOLDER_TYPE_CONSTRAINTS from the original auto node to the new one.
951
3f5af3f7
PP
9522020-04-17 Patrick Palka <ppalka@redhat.com>
953
a28edad3
PP
954 PR c++/94483
955 * lambda.c (lambda_capture_field_type): Avoid doing auto deduction if
956 the explicit initializer has parameter packs.
957
3f5af3f7
PP
958 PR c++/88754
959 * parser.c (cp_parser_check_template_parameters): Before issuing a hard
960 error, first try simulating an error instead.
961
2e389749
JJ
9622020-04-17 Jakub Jelinek <jakub@redhat.com>
963
964 PR other/94629
965 * call.c (build_conditional_expr_1): Remove redundant assignment to
966 arg2.
967
effcb418
PP
9682020-04-16 Patrick Palka <ppalka@redhat.com>
969
970 PR c++/94475
971 * cvt.c (ocp_convert): If the result of scalar_constant_value is
972 erroneous, ignore it and use the original expression.
973
e4658c7d
JJ
9742020-04-16 Jakub Jelinek <jakub@redhat.com>
975
976 PR c++/94571
977 * parser.c (cp_parser_simple_declaration): Fix up a pasto in
978 diagnostics.
979
2dc9294c
JJ
9802020-04-15 Jakub Jelinek <jakub@redhat.com>
981
982 PR c/94593
983 * parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
984 requires directive when not at file or namespace scope.
985
a126a157
IS
9862020-04-14 Iain Sandoe <iain@sandoe.co.uk>
987
988 PR c++/94359
989 * coroutines.cc (build_actor_fn): Check that the target can
990 support the resume tailcall before mandating it.
991
b2562229
PP
9922020-04-14 Patrick Palka <ppalka@redhat.com>
993
58a29af8
PP
994 PR c++/85278
995 * cxx-pretty-print.c (cxx_pretty_printer:simple_type_specifier)
996 <case DECLTYPE_TYPE>: Handle DECLTYPE_TYPE here instead of ...
997 (pp_cxx_type_specifier_seq) <case DECLTYPE_TYPE>: ... here.
998 (cxx_pretty_printer::direct_abstract_declarator) <case DECLTYPE_TYPE>:
999 New no-op case.
1000
b2562229
PP
1001 PR c++/94034
1002 * constexpr.c (replace_result_decl_data): New struct.
1003 (replace_result_decl_data_r): New function.
1004 (replace_result_decl): New function.
1005 (cxx_eval_call_expression): Use it.
1006 * tree.c (build_aggr_init_expr): Set the location of the AGGR_INIT_EXPR
1007 to that of its initializer.
1008
7eee265e
MP
10092020-04-13 Marek Polacek <polacek@redhat.com>
1010
1011 PR c++/94588
1012 * name-lookup.c (check_local_shadow): Add an inform call.
1013
077dd9b3
PP
10142020-04-13 Patrick Palka <ppalka@redhat.com>
1015
1dcb7799
PP
1016 PR c++/94521
1017 * error.c (dump_scope): Pass TFF_NO_FUNCTION_ARGUMENTS to
1018 dump_function_decl when printing a function template instantiation as a
1019 scope.
1020
077dd9b3
PP
1021 PR c++/94470
1022 * constexpr.c (get_or_insert_ctor_field): Set default value of parameter
1023 'pos_hint' to -1.
1024 (cxx_eval_bare_aggregate): Use get_or_insert_ctor_field instead of
1025 assuming the the next index belongs at the end of the new CONSTRUCTOR.
1026 (cxx_eval_store_expression): Revert PR c++/78572 fix.
1027
8d213cbb
NS
10282020-04-13 Nathan Sidwell <nathan@acm.org>
1029
1030 PR c++/94426 lambdas with internal linkage are different to no-linkage
1031 * decl2.c (determine_visibility): A lambda's visibility is
1032 affected by its extra scope.
1033 * pt.c (instantiate_decl): Determine var's visibility before
1034 instantiating its initializer.
1035 * tree.c (no_linkage_check): Revert code looking at visibility of
1036 lambda's extra scope.
1037`
0666767e
IS
10382020-04-10 Iain Sandoe <iain@sandoe.co.uk>
1039
a02558a3 1040 PR c++/94528
0666767e
IS
1041 * coroutines.cc (co_await_expander): Remove.
1042 (expand_one_await_expression): New.
1043 (process_one_statement): New.
1044 (await_statement_expander): New.
1045 (build_actor_fn): Revise to use per-statement expander.
1046 (struct susp_frame_data): Reorder and comment.
1047 (register_awaits): Factor code.
1048 (replace_statement_captures): New, factored from...
1049 (maybe_promote_captured_temps):.. here.
1050 (await_statement_walker): Revise to process per statement.
1051 (morph_fn_to_coro): Use revised susp_frame_data layout.
1052
62c25d7a
MP
10532020-04-10 Marek Polacek <polacek@redhat.com>
1054
1055 PR c++/94149
1056 * method.c (constructible_expr): In C++20, try using parenthesized
1057 initialization of aggregates to determine the result of
1058 __is_constructible.
1059
6c4a05f2
BC
10602020-04-10 Bin Cheng <bin.cheng@linux.alibaba.com>
1061
1062 * coroutines.cc (co_await_expander): Simplify.
1063
ef529765
JM
10642020-04-09 Jason Merrill <jason@redhat.com>
1065
1066 PR c++/94523
1067 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]: Look at
1068 ctx->object and ctx->global->values first.
1069
830c5724
MP
10702020-04-09 Marek Polacek <polacek@redhat.com>
1071
1072 PR c++/93790
1073 * call.c (initialize_reference): If the reference binding failed, maybe
1074 try initializing from { }.
1075 * decl.c (grok_reference_init): For T& t(e), set
1076 LOOKUP_AGGREGATE_PAREN_INIT but don't build up a constructor yet.
1077
926d39c3 10782020-04-08 Iain Sandoe <iain@sandoe.co.uk>
e4658c7d 1079 Jun Ma <JunMa@linux.alibaba.com>
926d39c3
IS
1080
1081 * coroutines.cc (maybe_promote_captured_temps): Add a cleanup
1082 expression, if needed, to any call from which we promoted
1083 temporaries captured by reference.
1084
77d6dfc9
MP
10852020-04-08 Marek Polacek <polacek@redhat.com>
1086
1087 PR c++/94507 - ICE-on-invalid with lambda template.
1088 * pt.c (tsubst_lambda_expr): Cope when tsubst_template_decl or
1089 tsubst_function_decl returns error_mark_node.
1090
70df40ca
ML
10912020-04-08 Martin Liska <mliska@suse.cz>
1092
1093 PR c++/94314
1094 * decl.c (duplicate_decls): Duplicate also DECL_IS_REPLACEABLE_OPERATOR.
1095 (cxx_init_decl_processing): Mark replaceable all implicitly defined
1096 operators.
1097
12f55e03
PP
10982020-04-08 Patrick Palka <ppalka@redhat.com>
1099
1100 Core issues 1001 and 1322
1101 PR c++/92010
1102 * pt.c (rebuild_function_or_method_type): Split function out from ...
1103 (tsubst_function_type): ... here.
1104 (maybe_rebuild_function_decl_type): New function.
1105 (tsubst_function_decl): Use it.
1106
4cf6b06c
JJ
11072020-04-08 Jakub Jelinek <jakub@redhat.com>
1108
1109 PR c++/94325
1110 * decl.c (begin_destructor_body): For CLASSTYPE_VBASECLASSES class
1111 dtors, if CLASSTYPE_PRIMARY_BINFO is non-NULL, but not BINFO_VIRTUAL_P,
1112 look at CLASSTYPE_PRIMARY_BINFO of its BINFO_TYPE if it is not
1113 BINFO_VIRTUAL_P, and so on.
1114
a6479aa4
MP
11152020-04-08 Marek Polacek <polacek@redhat.com>
1116
1117 PR c++/94478 - ICE with defaulted comparison operator
1118 * method.c (early_check_defaulted_comparison): Give an error when the
1119 context is null.
1120
13e41d8b
TB
11212020-04-08 Tobias Burnus <tobias@codesourcery.com>
1122
1123 PR middle-end/94120
1124 * paser.c (cp_parser_oacc_declare): Add check that variables
1125 are declared in the same scope as the directive.
1126
31449cf8
JM
11272020-04-07 Jason Merrill <jason@redhat.com>
1128
845d451e
JM
1129 PR c++/94480
1130 * parser.c (cp_parser_requires_expression): Use tentative_firewall.
1131
31449cf8
JM
1132 PR c++/94481
1133 * parser.c (cp_parser_placeholder_type_specifier): Use
1134 matching_parens.
1135
89b01e86
IS
11362020-04-07 Iain Sandoe <iain@sandoe.co.uk>
1137
1138 * coroutines.cc (maybe_promote_captured_temps): Ensure that
1139 reference capture placeholder vars are properly declared.
1140
23f1f679
PP
11412020-04-07 Patrick Palka <ppalka@redhat.com>
1142
1143 PR c++/90996
1144 * tree.c (replace_placeholders): Look through all handled components,
1145 not just COMPONENT_REFs.
1146 * typeck2.c (process_init_constructor_array): Propagate
1147 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
1148 the array initializer.
1149
4df50a05
JJ
11502020-04-07 Jakub Jelinek <jakub@redhat.com>
1151
1152 PR c++/94512
1153 * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
1154 if cp_parser_omp_master succeeded.
1155
467fc7c8
JM
11562020-04-06 Jason Merrill <jason@redhat.com>
1157
1158 PR c++/94462
1159 * decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.
1160
f84aded8
MP
11612020-04-04 Marek Polacek <polacek@redhat.com>
1162 Jason Merrill <jason@redhat.com>
1163
1164 PR c++/94155 - crash in gimplifier with paren init of aggregates.
1165 * init.c (build_vec_init): Fill in indexes.
1166
75c8d6e5
JM
11672020-04-04 Jason Merrill <jason@redhat.com>
1168
1169 PR c++/91377
1170 * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR.
1171
37244b21
PP
11722020-04-04 Patrick Palka <ppalka@redhat.com>
1173
49a86fce
PP
1174 PR c++/94205
1175 PR c++/79937
1176 * constexpr.c (struct constexpr_ctx): New field 'parent'.
1177 (cxx_eval_bare_aggregate): Propagate CONSTRUCTOR_PLACEHOLDER_BOUNDARY
1178 flag from the original constructor to the reduced constructor.
1179 (lookup_placeholder): Prefer to return the outermost matching object
1180 by recursively calling lookup_placeholder on the 'parent' context,
1181 but don't cross CONSTRUCTOR_PLACEHOLDER_BOUNDARY constructors.
1182 (cxx_eval_constant_expression): Link the 'ctx' context to the 'new_ctx'
1183 context via 'new_ctx.parent' when being expanded without an explicit
1184 target. Don't call replace_placeholders.
1185 (cxx_eval_outermost_constant_expr): Initialize 'ctx.parent' to NULL.
1186
37244b21
PP
1187 PR c++/94219
1188 PR c++/94205
1189 * constexpr.c (get_or_insert_ctor_field): Split out (while adding
1190 support for VECTOR_TYPEs, and optimizations for the common case)
1191 from ...
1192 (cxx_eval_store_expression): ... here. Rename local variable
1193 'changed_active_union_member_p' to 'activated_union_member_p'. Record
1194 the sequence of indexes into 'indexes' that yields the subobject we're
1195 assigning to. Record the integer offsets of the constructor indexes
1196 we're assigning through into 'index_pos_hints'. After evaluating the
1197 initializer of the store expression, recompute 'valp' using 'indexes'
1198 and using 'index_pos_hints' as hints.
1199 (cxx_eval_bare_aggregate): Tweak comments. Use get_or_insert_ctor_field
1200 to recompute the constructor_elt pointer we're assigning through after
1201 evaluating each initializer.
1202
f1ad7bac
JM
12032020-04-04 Jason Merrill <jason@redhat.com>
1204
1205 PR c++/67825
1206 * constraint.cc (tsubst_valid_expression_requirement): Call
1207 convert_to_void.
1208
9f143008
JM
12092020-04-04 Jason Merrill <jason@redhat.com>
1210
1211 PR c++/94453
1212 * constexpr.c (maybe_constant_value): Use break_out_target_exprs.
1213 * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in
1214 NON_LVALUE_EXPR.
1215
0c809f72
JJ
12162020-04-04 Jakub Jelinek <jakub@redhat.com>
1217
aae5d08a
JJ
1218 PR debug/94441
1219 * parser.c (cp_parser_omp_for_loop): Use
1220 protected_set_expr_location_if_unset.
1221 * cp-gimplify.c (genericize_if_stmt, genericize_cp_loop): Likewise.
1222
0c809f72
JJ
1223 PR c++/94477
1224 * pt.c (tsubst_expr) <case OMP_MASTER>: Clear
1225 omp_parallel_combined_clauses.
1226
bcafd874
JM
12272020-04-03 Jason Merrill <jason@redhat.com>
1228
1229 PR c++/91966
1230 * pt.c (complex_pack_expansion_r): New.
1231 (complex_alias_template_p): Use it.
1232
76f09260
JM
12332020-03-31 Jason Merrill <jason@redhat.com>
1234
1235 PR c++/94205
1236 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Call
1237 replace_placeholders.
1238 * typeck2.c (store_init_value): Fix arguments to
1239 fold_non_dependent_expr.
1240
595f1b12
JM
12412020-03-31 Jason Merrill <jason@redhat.com>
1242
1243 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Use
1244 local variables.
1245
5830f753
JM
12462020-03-30 Jason Merrill <jason@redhat.com>
1247
1248 PR c++/90711
1249 * tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
1250 (called_fns_equal): Check DECL_CONTEXT.
1251
1cb1986c
JJ
12522020-03-30 Jakub Jelinek <jakub@redhat.com>
1253
1254 PR c++/94385
1255 * semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with
1256 STATEMENT_CODE_P code.
1257
75defde9
PP
12582020-03-28 Patrick Palka <ppalka@redhat.com>
1259
7981c06a
PP
1260 PR c++/94306
1261 * parser.c (cp_parser_requires_clause_opt): Diagnose and recover from
1262 "requires {" when "requires requires {" was probably intended.
1263
a7ea3d2c
PP
1264 PR c++/94252
1265 * constraint.cc (tsubst_compound_requirement): Always suppress errors
1266 from type_deducible_p and expression_convertible_p, as they're not
1267 substitution errors.
1268 (diagnose_atomic_constraint) <case INTEGER_CST>: Remove this case so
1269 that we diagnose INTEGER_CST expressions of non-bool type via the
1270 default case.
1271 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: New case.
1272 * parser.c (cp_parser_requires_expression): Always parse the requirement
1273 body as if we're processing a template, by temporarily incrementing
1274 processing_template_decl. Afterwards, if we're not actually in a
1275 template context, perform semantic processing to diagnose any invalid
1276 types and expressions.
1277 * pt.c (tsubst_copy_and_build) <case REQUIRES_EXPR>: Remove dead code.
1278 * semantics.c (finish_static_assert): Explain an assertion failure
1279 when the condition is a REQUIRES_EXPR like we do when it is a concept
1280 check.
1281
cd68edf8
PP
1282 * constraint.cc (diagnose_compound_requirement): When diagnosing a
1283 compound requirement, maybe replay the satisfaction failure, subject to
1284 the current diagnosis depth.
1285
75defde9
PP
1286 * constraint.cc (finish_constraint_binary_op): Set the location of EXPR
1287 as well as its range, because build_x_binary_op doesn't always do so.
1288 (current_constraint_diagnosis_depth): New.
1289 (concepts_diagnostics_max_depth_exceeded_p): New.
1290 (collect_operands_of_disjunction): New.
1291 (satisfy_disjunction): When diagnosing a satisfaction failure, maybe
1292 replay each branch of the disjunction, subject to the current diagnosis
1293 depth.
1294 (diagnose_valid_expression): When diagnosing a satisfaction failure,
1295 maybe replay the substitution error, subject to the current diagnosis
1296 recursion.
1297 (diagnose_valid_type): Likewise.
1298 (diagnose_nested_requiremnet): Likewise.
1299 (diagnosing_failed_constraint::diagnosing_failed_constraint): Increment
1300 current_constraint_diagnosis_depth when diagnosing.
1301 (diagnosing_failed_constraint::~diagnosing_failed_constraint): Decrement
1302 current_constraint_diagnosis_depth when diagnosing.
1303 (diagnosing_failed_constraint::replay_errors_p): New static member
1304 function.
1305 (diagnose_constraints): Don't diagnose if concepts_diagnostics_max_depth
1306 is 0. Emit a one-off note to increase -fconcepts-diagnostics-depth if
1307 the limit was exceeded.
1308 * cp-tree.h (diagnosing_failed_constraint::replay_errors_p): Declare.
1309
c7fc15f5
NS
13102020-03-27 Nathan Sidwell <nathan@acm.org>
1311
1312 PR c++/84733
1313 * name-lookup.c (do_pushdecl): Look through cleanp levels.
1314
04dd734b
MS
13152020-03-27 Martin Sebor <msebor@redhat.com>
1316
1317 PR c++/94078
1318 PR c++/93824
1319 PR c++/93810
1320 * cp-tree.h (most_specialized_partial_spec): Declare.
1321 * parser.c (cp_parser_elaborated_type_specifier): Distinguish alias
1322 from declarations.
1323 (specialization_of): New function.
1324 (cp_parser_check_class_key): Move code...
1325 (class_decl_loc_t::add): ...to here. Add parameters. Avoid issuing
1326 -Wredundant-tags on first-time declarations in other declarators.
1327 Correct handling of template specializations.
1328 (class_decl_loc_t::diag_mismatched_tags): Also expect to be called
1329 when -Wredundant-tags is enabled. Use primary template or partial
1330 specialization as the guide for uses of implicit instantiations.
1331 * pt.c (most_specialized_partial_spec): Declare extern.
1332
9dba6013
NS
13332020-03-27 Nathan Sidwell <nathan@acm.org>
1334
1335 PR c++/94257
1336 * name-lookup.c (push_namespace): Triage ambiguous lookups that
1337 contain namespaces.
1338
72809d6f
JJ
13392020-03-27 Jakub Jelinek <jakub@redhat.com>
1340
2eea00c5
JJ
1341 PR c++/94326
1342 * call.c (set_flags_from_callee): Don't update
1343 cp_function_chain->can_throw or current_function_returns_abnormally
1344 if cp_unevaluated_operand.
1345
72809d6f
JJ
1346 PR c++/94339
1347 * cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
1348 operand and creating a new COMPOUND_EXPR if anything changed.
1349
71d69548
MP
13502020-03-26 Marek Polacek <polacek@redhat.com>
1351
1352 PR c++/94336 - template keyword accepted before destructor names.
1353 * parser.c (cp_parser_unqualified_id): Give an error when 'template'
1354 is followed by a destructor name.
1355
54f58e94
PP
13562020-03-27 Patrick Palka <ppalka@redhat.com>
1357
1358 * decl.c (compute_array_index_type_loc): Remove redundant
1359 type_dependent_expression_p check that is subsumed by
1360 value_dependent_expression_p.
1361 * decl2.c (is_late_template_attribute): Likewise.
1362 * pt.c (uses_template_parms): Likewise.
1363 (dependent_template_arg_p): Likewise.
1364
517f5356
MP
13652020-03-26 Marek Polacek <polacek@redhat.com>
1366
1367 DR 1710
1368 PR c++/94057 - template keyword in a typename-specifier.
1369 * parser.c (check_template_keyword_in_nested_name_spec): New.
1370 (cp_parser_nested_name_specifier_opt): Implement DR1710, optional
1371 'template'. Call check_template_keyword_in_nested_name_spec.
1372 (cp_parser_simple_type_specifier): Assume that a <
1373 following a qualified-id in a typename-specifier begins
1374 a template argument list.
1375
6d85947d
IS
13762020-03-26 Iain Sandoe <iain@sandoe.co.uk>
1377
1378 * coroutines.cc (coro_init_identifiers): Initialize an identifier
1379 for the cororoutine handle 'address' method name.
1380 (struct coro_aw_data): Add fields to cover the continuations.
1381 (co_await_expander): Determine the kind of await_suspend in use.
1382 If we have the case that returns a continuation handle, then save
1383 this and make the target for 'scope exit without cleanup' be the
1384 continuation resume label.
1385 (expand_co_awaits): Remove.
1386 (struct suspend_point_info): Remove fields that kept the returned
1387 await_suspend handle type.
1388 (transform_await_expr): Remove code tracking continuation handles.
1389 (build_actor_fn): Add the continuation handle as an actor-function
1390 scope var. Build the symmetric transfer continuation point. Call
1391 the tree walk for co_await expansion directly, rather than via a
1392 trivial shim function.
1393 (register_await_info): Remove fields tracking continuation handles.
1394 (get_await_suspend_return_type): Remove.
1395 (register_awaits): Remove code tracking continuation handles.
1396 (morph_fn_to_coro): Remove code tracking continuation handles.
1397
2a1f0f64
IS
13982020-03-26 Iain Sandoe <iain@sandoe.co.uk>
1399
1400 * coroutines.cc (co_await_expander): If we are expanding the
1401 initial await expression, set a boolean flag to show that we
1402 have now reached the initial await_resume() method call.
1403 (expand_co_awaits): Handle the 'initial await resume called' flag.
1404 (build_actor_fn): Insert the initial await expression into the
1405 start of the user-authored function-body. Handle the 'initial await
1406 resume called' flag.
1407 (morph_fn_to_coro): Initialise the 'initial await resume called'
1408 flag. Modify the unhandled exception catch clause to recognise
1409 exceptions that occur before the initial await_resume() and re-
1410 throw them.
1411
5a1706f6
JJ
14122020-03-26 Jakub Jelinek <jakub@redhat.com>
1413
dab932d1
JJ
1414 PR c++/81349
1415 * class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
1416 true for all TEMPLATE_DECLs.
1417
5a1706f6
JJ
1418 PR c++/94272
1419 * cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
1420
c7a252ba
PP
14212020-03-25 Patrick Palka <ppalka@redhat.com>
1422
1423 PR c++/94265
1424 * parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
1425 current condition chain when the if-statement has a non-empty
1426 init-statement.
1427
83dfa06c
IS
14282020-03-25 Iain Sandoe <iain@sandoe.co.uk>
1429
1430 PR c++/94319
1431 * coroutines.cc (captures_temporary): Fix a missing dereference.
1432
75b7b7fd
MP
14332020-03-24 Marek Polacek <polacek@redhat.com>
1434
1435 PR c++/94190 - wrong no post-decrement operator error in template.
1436 * call.c (convert_like_real): Use convert_from_reference on the result.
1437
fddfd3ce
JM
14382020-03-24 Jason Merrill <jason@redhat.com>
1439
1440 PR c++/94186
1441 * constraint.cc (constraint_satisfaction_value): Repeat noisily on
1442 error.
1443 (tsubst_nested_requirement): Likewise.
1444 (get_constraint_error_location): Allow missing context.
1445 (diagnose_atomic_constraint): Diagnose non-bool constraint here.
1446 (satisfy_atom): Not here. Only diagnose non-constant when noisy.
1447
5c161741
JM
14482020-03-24 Jason Merrill <jason@redhat.com>
1449
1450 * pt.c (any_template_parm_r): Look into the type of a non-type
1451 template parm.
1452
6e771c08
JM
14532020-03-24 Jason Merrill <jason@redhat.com>
1454
1455 * cp-tree.h (cp_expr): When constructing from an expr and a
1456 location, call protected_set_expr_location.
1457
1f6c1c82
PP
14582020-03-23 Patrick Palka <ppalka@redhat.com>
1459
1460 PR c++/93805
1461 * except.c (maybe_noexcept_warning): Add TODO.
1462 * method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
1463
26b3e568
NS
14642020-03-23 nathans <nathan@acm.org>
1465
1466 PR c++/94044
1467 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
1468 operand.
1469
b599bf9d
PP
14702020-03-21 Patrick Palka <ppalka@redhat.com>
1471
1472 PR c++/94066
1473 * constexpr.c (reduced_constant_expression_p) [CONSTRUCTOR]: Properly
1474 handle unions without an initializer.
1475 (cxx_eval_component_reference): Emit a different diagnostic when the
1476 constructor element corresponding to a union member is NULL.
1477 (cxx_eval_bare_aggregate): When constructing a union, always set the
1478 active union member before evaluating the initializer. Relax assertion
1479 that verifies the index of the constructor element we're initializing
1480 hasn't been changed.
1481 (cxx_eval_store_expression): Diagnose changing the active union member
1482 while the union is in the process of being initialized. After setting
1483 an active union member, clear CONSTRUCTOR_NO_CLEARING on the underlying
1484 CONSTRUCTOR.
1485 (cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
1486 CONSTRUCTOR returned by lookup_placeholder.
1487
828878c3
PP
14882020-03-20 Patrick Palka <ppalka@redhat.com>
1489
1490 * cxx-pretty-print.c (pp_cxx_parameter_mapping): Make extern. Move
1491 the "[with ]" bits to here from ...
1492 (pp_cxx_atomic_constraint): ... here.
1493 * cxx-pretty-print.h (pp_cxx_parameter_mapping): Declare.
1494 * error.c (rebuild_concept_check): Delete.
1495 (print_concept_check_info): Print the dependent form of the constraint and the
1496 preferably substituted parameter mapping alongside it.
1497
94e24187
JM
14982020-03-19 Jason Merrill <jason@redhat.com>
1499
1500 PR c++/94175
1501 * cp-gimplify.c (simple_empty_class_p): Look through
1502 SIMPLE_TARGET_EXPR_P.
1503 (cp_gimplify_expr) [MODIFY_EXPR]: Likewise.
1504 [RETURN_EXPR]: Avoid producing 'return *retval;'.
1505 * call.c (build_call_a): Strip TARGET_EXPR from empty class arg.
1506 * cp-tree.h (SIMPLE_TARGET_EXPR_P): Check that TARGET_EXPR_INITIAL
1507 is non-null.
1508
02f7334a
JJ
15092020-03-19 Jakub Jelinek <jakub@redhat.com>
1510
1511 PR c++/93931
1512 * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
1513 on outer_automatic_var_p decls.
1514 * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
1515 capture proxy decls.
1516
11cf25c4
NS
15172020-03-18 Nathan Sidwell <nathan@acm.org>
1518
1519 PR c++/94147 - mangling of lambdas assigned to globals
1520 * parser.c (cp_parser_init_declarator): Namespace-scope variables
1521 provide a lambda scope.
1522 * tree.c (no_linkage_check): Lambdas with a variable for extra
1523 scope have a linkage from the variable.
1524
af8656be
JJ
15252020-03-18 Jakub Jelinek <jakub@redhat.com>
1526
d5029d45
JJ
1527 * constraint.cc (resolve_function_concept_check, subsumes_constraints,
1528 strictly_subsumes): Fix up duplicated word issue in a comment.
1529 * coroutines.cc (build_init_or_final_await, captures_temporary):
1530 Likewise.
1531 * logic.cc (dnf_size_r, cnf_size_r): Likewise.
1532 * pt.c (append_type_to_template_for_access_check): Likewise.
1533
af8656be
JJ
1534 PR c++/91759
1535 * decl.c (grokfndecl): Restore old diagnostics about deduction
1536 guide declared in different scope if in_namespace is NULL_TREE.
1537
cd0b7124
JJ
15382020-03-17 Jakub Jelinek <jakub@redhat.com>
1539
1540 PR c++/90995
1541 * parser.c (cp_parser_enum_specifier): Use temp_override for
1542 parser->colon_corrects_to_scope_p, replace goto out with return.
1543 If scoped enum or enum with underlying type is not followed by
1544 { or ;, call cp_parser_commit_to_tentative_parse before calling
1545 cp_parser_error and make sure to return error_mark_node instead of
1546 NULL_TREE. Formatting fixes.
1547
887085be
VV
15482020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
1549
887085be 1550 PR c++/94197
1fef0148 1551 * method.c (assignable_expr): Use cp_unevaluated.
887085be
VV
1552 (is_xible_helper): Push a non-deferred access check for
1553 the stub objects created by assignable_expr and constructible_expr.
1554
700d4cb0
JJ
15552020-03-17 Jakub Jelinek <jakub@redhat.com>
1556
1557 * pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
1558 (lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
1559 in a comment.
1560 * parser.c (cp_parser_statement, cp_parser_linkage_specification,
1561 cp_parser_placeholder_type_specifier,
1562 cp_parser_constraint_requires_parens): Likewise.
1563 * name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
1564
ced66da3
IS
15652020-03-15 Iain Sandoe <iain@sandoe.co.uk>
1566
1567 * coroutines.cc (co_await_expander): Fix indentation.
1568
3a285529
JM
15692020-03-14 Jason Merrill <jason@redhat.com>
1570
1571 PR c++/92068
1572 * pt.c (process_partial_specialization): Error rather than crash on
1573 extra pack expansion.
1574
b3b0c671
JM
15752020-03-14 Jason Merrill <jason@redhat.com>
1576
1577 PR c++/92909
1578 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
1579 DECL_ORIGINAL_TYPE of a typedef.
1580
c393c99d
JM
15812020-03-14 Jason Merrill <jason@redhat.com>
1582
1583 PR c++/93248
1584 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
1585 substituting DECL_ARGUMENTS.
1586
53b28abf
JJ
15872020-03-14 Jakub Jelinek <jakub@redhat.com>
1588
1589 * logic.cc (formula::formula): Change "a an" to "an" in a comment.
1590 * parser.c (cp_debug_parser): Change "a an" to "an" in a string
1591 literal.
1592
80a13af7
PP
15932020-03-13 Patrick Palka <ppalka@redhat.com>
1594
1595 PR c++/67960
1596 * call.c (build_over_call): Use a warning_sentinel to disable
1597 warn_deprecated_decl before calling build_addr_func.
1598
4069adf4
JJ
15992020-03-12 Jakub Jelinek <jakub@redhat.com>
1600
1601 PR c++/94124
1602 * decl.c (reshape_init_array_1): Don't unshare constructor if there
1603 aren't any trailing zero elts, otherwise only unshare the first
1604 nelts.
1605
bde31a76
JM
16062020-03-11 Jason Merrill <jason@redhat.com>
1607
1608 PR c++/93907
1609 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
1610 argument.
1611
7eb5be6a
MP
16122020-03-11 Marek Polacek <polacek@redhat.com>
1613 Jason Merrill <jason@redhat.com>
1614
1615 PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
1616 * constexpr.c (cref_has_const_field): New function.
1617 (modifying_const_object_p): Consider a COMPONENT_REF
1618 const only if any of its fields are const.
1619 (cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
1620 as readonly after its initialization has been done.
1621
e11d05c1
MP
16222020-03-10 Marek Polacek <polacek@redhat.com>
1623
1624 PR c++/94124 - wrong conversion error with non-viable overload.
1625 * decl.c (reshape_init_array_1): Unshare a constructor if we
1626 stripped trailing zero-initializers.
1627
481fcfe6
JM
16282020-03-10 Jason Merrill <jason@redhat.com>
1629
1630 PR c++/93901
1631 * pt.c (maybe_instantiate_noexcept): Always update clones.
1632
df15a828
JM
16332020-03-10 Jason Merrill <jason@redhat.com>
1634
4069adf4 1635 PR c++/93596
df15a828
JM
1636 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
1637
14af5d9b
JM
16382020-03-10 Jason Merrill <jason@redhat.com>
1639
1640 PR c++/93922
1641 PR c++/94041
1642 PR c++/52320
1643 PR c++/66139
1644 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
1645 66139: Don't split_nonconstant_init. Remove pre_p parameter.
1646
d417b4f5
MP
16472020-03-09 Marek Polacek <polacek@redhat.com>
1648
1649 PR c++/92031 - bogus taking address of rvalue error.
1650 PR c++/91465 - ICE with template codes in check_narrowing.
1651 PR c++/93870 - wrong error when converting template non-type arg.
1652 PR c++/94068 - ICE with template codes in check_narrowing.
1653 * call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
1654 in a template when not ck_identity and we're dealing with a class.
1655 (convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
1656 in a template if we need a temporary.
1657 * decl.c (compute_array_index_type_loc): Remove
1658 instantiate_non_dependent_expr_sfinae call. Call
1659 fold_non_dependent_expr instead of maybe_constant_value.
1660 (build_explicit_specifier): Don't instantiate or create a sentinel
1661 before converting the expression.
1662 * except.c (build_noexcept_spec): Likewise.
1663 * pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
1664 Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
1665 build_converted_constant_expr returned.
1666 * typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
1667 of maybe_constant_value.
1668
81fa6d73
JJ
16692020-03-09 Jakub Jelinek <jakub@redhat.com>
1670
1671 PR c++/94067
1672 Revert
1673 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
1674
1675 * constexpr.c (cxx_eval_constant_expression): Do not handle
1676 RROTATE_EXPR and LROTATE_EXPR.
1677
8475f290
MP
16782020-03-09 Marek Polacek <polacek@redhat.com>
1679
1680 PR c++/94050 - ABI issue with alignas on armv7hl.
1681 * class.c (layout_class_type): Don't replace a class's
1682 CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
1683
016d0f9e
BC
16842020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
1685
1686 * coroutines.cc (build_actor_fn): Factor out code inserting the
1687 default return_void call to...
1688 (morph_fn_to_coro): ...here, also hoist local var declarations.
1689
ff0a6284
PP
16902020-03-08 Patrick Palka <ppalka@redhat.com>
1691
5e1b4e60
PP
1692 PR c++/93729
1693 * call.c (convert_like_real): Check complain before emitting an error
1694 about binding a bit-field to a reference.
1695
ff0a6284
PP
1696 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
1697 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
1698 TYPE_NAME.
1699
191bcd0f
NS
17002020-03-06 Nathan Sidwell <nathan@acm.org>
1701
1702 PR c++/94027
1703 * mangle.c (find_substitution): Don't call same_type_p on template
1704 args that cannot match.
1705
cb2409c6
MS
17062020-03-04 Martin Sebor <msebor@redhat.com>
1707
1708 PR c++/90938
1709 * tree.c (type_initializer_zero_p): Fail for structs initialized
1710 with non-structs.
1711
6876b269
JM
17122020-03-04 Jason Merrill <jason@redhat.com>
1713
1714 PR c++/90432
1715 * init.c (perform_member_init): Don't do aggregate initialization of
1716 empty field.
1717 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
1718 initialization of empty field.
1719
2e032851
ML
17202020-03-04 Martin Liska <mliska@suse.cz>
1721
1722 * method.c: Wrap array in ctor with braces in order
1723 to silent clang warnings.
1724
6b3302da
MP
17252020-03-03 Jason Merrill <jason@redhat.com>
1726 Marek Polacek <polacek@redhat.com>
1727
1728 PR c++/90505 - mismatch in template argument deduction.
1729 * pt.c (tsubst): Don't reduce the template level of template
1730 parameters when tf_partial.
1731
0e0ffbfc
JJ
17322020-03-03 Jakub Jelinek <jakub@redhat.com>
1733
1734 PR c++/93998
1735 * constexpr.c (cxx_eval_constant_expression)
1736 <case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
1737 *non_constant_p is true.
1738
17392020-03-03 Jun Ma <JunMa@linux.alibaba.com>
fd9e021c 1740
7f327e87
J
1741 * coroutines.cc (captures_temporary): Strip component_ref
1742 to its base object.
1743
e4658c7d 17442020-03-03 Jun Ma <JunMa@linux.alibaba.com>
7f327e87 1745
fd9e021c
J
1746 * coroutines.cc (finish_co_await_expr): Build co_await_expr
1747 with unknown_type_node.
1748 (finish_co_yield_expr): Ditto.
1749 *pt.c (type_dependent_expression_p): Set co_await/yield_expr
1750 with unknown type as dependent.
1751
cd14f288
IS
17522020-03-02 Iain Sandoe <iain@sandoe.co.uk>
1753
1754 * coroutines.cc (struct local_var_info): Adjust to remove the
1755 reference to the captured var, and just to note that this is a
1756 lambda capture proxy.
1757 (transform_local_var_uses): Handle lambda captures specially.
1758 (struct param_frame_data): Add a visited set.
1759 (register_param_uses): Also check for param uses in lambda
1760 capture proxies.
1761 (struct local_vars_frame_data): Remove captures list.
1762 (register_local_var_uses): Handle lambda capture proxies by
1763 noting and bypassing them.
1764 (morph_fn_to_coro): Update to remove lifetime extension of
1765 lambda capture-by-copy vars.
1766
005530eb
IS
17672020-03-02 Iain Sandoe <iain@sandoe.co.uk>
1768
1769 * coroutines.cc (build_co_await): Do not build frame
1770 awaitable proxy vars when the co_await expression is
1771 a function parameter or local var.
1772 (co_await_expander): Do not initialise a frame var with
1773 itself.
1774 (transform_await_expr): Only substitute the awaitable
1775 frame var if it's needed.
1776 (register_awaits): Do not make frame copies for param
1777 or local vars that are awaitables.
1778
586b016c
JM
17792020-02-28 Jason Merrill <jason@redhat.com>
1780
117baab8
JM
1781 Implement P2092R0, Disambiguating Nested-Requirements
1782 * parser.c (cp_parser_requirement_parameter_list): Pass
1783 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
1784
586b016c
JM
1785 * call.c (build_user_type_conversion_1): Don't look at the second
1786 conversion of a non-viable candidate.
1787
18396541
JJ
17882020-02-28 Jakub Jelinek <jakub@redhat.com>
1789
1790 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
1791 * typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
1792 functions in unevaluated contexts.
1793
da5f369d
NS
17942020-02-27 Nathan Sidwell <nathan@acm.org>
1795
9d2d2833
NS
1796 PR c++/93933
1797 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
1798 cp_tree_equal.
1799 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
1800 * typeck.c (comptypes): Assert we don't get any argument packs.
1801
da5f369d
NS
1802 * class.c (adjust_clone_args): Correct arg-checking assert.
1803 * typeck.c (comptypes): Assert not nulls.
1804
1231f71f
MP
18052020-02-26 Marek Polacek <polacek@redhat.com>
1806
1807 PR c++/93789 - ICE with invalid array bounds.
1808 * decl.c (compute_array_index_type_loc): Don't use the folded
1809 size when folding cleared TREE_CONSTANT.
1810
dc192bbd
IS
18112020-02-26 Iain Sandoe <iain@sandoe.co.uk>
1812
1813 * class.c (classtype_has_non_deleted_copy_ctor): New.
1814 * coroutines.cc (struct param_info): Keep track of params
1815 that are references, and cache the original type and whether
1816 the DTOR is trivial.
1817 (build_actor_fn): Handle param copies always, and adjust the
1818 handling for references.
1819 (register_param_uses): Only handle uses here.
1820 (classtype_has_non_deleted_copy_ctor): New.
1821 (morph_fn_to_coro): Adjust param copy handling to match n4849
1822 by reordering ahead of the promise CTOR and always making a
1823 frame copy, even if the param is unused in the coroutine body.
1824 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
1825
44f6b7fb
PP
18262020-02-26 Patrick Palka <ppalka@redhat.com>
1827
1828 * constraint.cc (finish_constraint_binary_op): Set expr's location range
1829 to the range of its operands.
1830 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
1831 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
1832 instead of the corresponding template arguments ARGS and adjust body
1833 accordingly.
1834 (diagnose_requires_expr): Likewise.
1835 (diagnose_atomic_constraint): Likewise. When printing an atomic
1836 constraint expression, print the instantiated parameter mapping
1837 alongside it.
1838 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
1839 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
1840 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
1841
38e10026
MP
18422020-02-26 Marek Polacek <polacek@redhat.com>
1843
1844 PR c++/93676 - value-init crash in template.
1845 * init.c (build_new_1): Don't call build_vec_init in a template.
1846
4a305fa2
MP
18472020-02-26 Marek Polacek <polacek@redhat.com>
1848
1849 PR c++/93862 - ICE with static_cast when converting from int[].
1850 * call.c (reference_compatible_p): No longer static.
1851 * cp-tree.h (reference_compatible_p): Declare.
1852 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
1853 of reference_related_p.
1854
d6ff2207
MP
18552020-02-26 Marek Polacek <polacek@redhat.com>
1856
1857 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
1858 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
1859 field.
1860
b73547e4
MS
18612020-02-24 Martin Sebor <msebor@redhat.com>
1862
1863 PR c++/93804
1864 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
1865 in shared C/C++ code in headers.
fb77bf1c 1866 Remove a duplicate hunk of code.
b73547e4 1867
cae5ff60
MP
18682020-02-24 Marek Polacek <polacek@redhat.com>
1869
1870 PR c++/93869 - ICE with -Wmismatched-tags.
1871 * parser.c (cp_parser_check_class_key): Check class_key earlier.
1872
b07c0855
MP
18732020-02-24 Marek Polacek <polacek@redhat.com>
1874
1875 PR c++/93712 - ICE with ill-formed array list-initialization.
1876 * call.c (next_conversion): Return NULL for ck_aggr.
1877 (build_aggr_conv): Set u.expr instead of u.next.
1878 (build_array_conv): Likewise.
1879 (build_complex_conv): Likewise.
1880 (conv_get_original_expr): Handle ck_aggr.
1881
fb6a8b23
JJ
18822020-02-24 Jakub Jelinek <jakub@redhat.com>
1883
1884 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
1885 * call.c (build_over_call): Don't evaluate immediate functions in
1886 unevaluated operands.
1887
32b8f5df
JM
18882020-02-24 Jason Merrill <jason@redhat.com>
1889
1890 P0780R2: Resolve lambda init-capture pack grammar.
1891 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
1892 ...&x=y.
1893
6cd5024c
MP
18942020-02-22 Marek Polacek <polacek@redhat.com>
1895
1896 PR c++/93882
1897 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
1898
dbfba41e
MS
18992020-02-21 Martin Sebor <msebor@redhat.com>
1900
1901 PR gcov-profile/93753
1902 * class.c (check_flexarrays): Tighten up a test for potential members
1903 of anonymous structs or unions.
1904
96cbc56e
MS
19052020-02-20 Martin Sebor <msebor@redhat.com>
1906
1907 PR c++/93801
1908 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
1909
4a172be3
ML
19102020-02-20 Martin Liska <mliska@suse.cz>
1911
1912 PR translation/93841
1913 * config/or1k/or1k.opt: Remove superfluous word.
1914 * doc/invoke.texi: Likewise.
1915
6c39d0b7
ML
19162020-02-20 Martin Liska <mliska@suse.cz>
1917
1918 PR translation/93838
1919 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
1920
8f9dd1b0
MP
19212020-02-19 Marek Polacek <polacek@redhat.com>
1922
1923 PR c++/93169 - wrong-code with a non-constexpr constructor.
1924 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
1925 on constant CONSTRUCTORs.
1926
eef65c47
MP
19272020-02-15 Marek Polacek <polacek@redhat.com>
1928
1929 PR c++/93710 - poor diagnostic for array initializer.
1930 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
1931 for an error call.
1932
d7136542
JM
19332020-02-15 Jason Merrill <jason@redhat.com>
1934
1e166191
JM
1935 PR c++/92556
1936 * pt.c (any_template_parm_r): Look into lambda body.
1937
d7136542
JM
1938 PR c++/92583
1939 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
1940
994e0ad4
JJ
19412020-02-14 Jakub Jelinek <jakub@redhat.com>
1942
519a33f9
JJ
1943 PR c++/61414
1944 * class.c (enum_min_precision): Change prec type from int to int &.
1945
994e0ad4
JJ
1946 PR libstdc++/92906
1947 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
1948 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
1949 (fallback_dfloat32_type, fallback_dfloat64_type,
1950 fallback_dfloat128_type): Define.
1951 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
1952 dfloat*_type_node.
1953 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
1954 is disabled for compatibility.
1955
abc79c64
JM
19562020-02-13 Jason Merrill <jason@redhat.com>
1957
9a0c4f5b
JM
1958 PR c++/93713
1959 * name-lookup.c (matching_fn_p): A function does not match a
1960 template.
1961
abc79c64
JM
1962 PR c++/93643
1963 PR c++/91476
1964 * tree.c (decl_linkage): Always lk_none for locals.
1965
c2368db5
JM
19662020-02-12 Jason Merrill <jason@redhat.com>
1967
1968 PR c++/92583
1969 PR c++/92654
1970 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
1971 * pt.c (find_parameter_packs_r): Not here.
1972
e4658c7d 19732020-02-12 Iain Sandoe <iain@sandoe.co.uk>
68bb7e3b
IS
1974
1975 * coroutines.cc (build_actor_fn): Implement deallocation function
1976 selection per n4849, dcl.fct.def.coroutine bullet 12.
1977 (morph_fn_to_coro): Implement allocation function selection per
1978 n4849, dcl.fct.def.coroutine bullets 9 and 10.
1979
e428a9cf
MP
19802020-02-12 Marek Polacek <polacek@redhat.com>
1981
1982 PR c++/93684 - ICE-on-invalid with broken attribute.
1983 * parser.c (cp_parser_std_attribute): Peek a token first before
1984 consuming it.
1985
d6ef77e0
JM
19862020-02-11 Jason Merrill <jason@redhat.com>
1987
1988 PR c++/93675
1989 * class.c (add_implicitly_declared_members): Use do_friend.
1990 * method.c (implicitly_declare_fn): Fix friend handling.
1991 (decl_remember_implicit_trigger_p): New.
1992 (synthesize_method): Use it.
1993 * decl2.c (mark_used): Use it.
1994
dfffecb8
JM
19952020-02-11 Jason Merrill <jason@redhat.com>
1996
1997 PR c++/93650
1998 PR c++/90691
1999 * constexpr.c (maybe_constant_value): Correct earlier change.
2000 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
2001 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
2002
91f4fc40
PP
20032020-02-12 Patrick Palka <ppalka@redhat.com>
2004
a6ee556c
PP
2005 PR c++/69448
2006 PR c++/80471
2007 * type-utils.h (find_type_usage): Refactor to take a tree * and to
2008 return a tree *, and update documentation accordingly.
2009 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
2010 decltype(auto) node.
2011 (make_constrained_decltype_auto): No need to explicitly set
2012 AUTO_IS_DECLTYPE anymore.
2013 (splice_late_return_type): Use find_type_usage to find and
2014 replace a possibly nested auto node instead of using is_auto.
2015 Check test for is_auto into an assert when deciding whether
2016 to late_return_type.
2017 (type_uses_auto): Adjust the call to find_type_usage.
2018 * parser.c (cp_parser_decltype): No need to explicitly set
2019 AUTO_IS_DECLTYPE anymore.
2020
91f4fc40
PP
2021 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
2022 (dump_simple_decl): Handle standard concept definitions as well as
2023 variable concept definitions.
2024
13686ece
JJ
20252020-02-10 Jakub Jelinek <jakub@redhat.com>
2026
2027 PR other/93641
2028 * error.c (dump_decl_name): Fix up last argument to strncmp.
2029
59dbb04d
JM
20302020-02-10 Jason Merrill <jason@redhat.com>
2031
2032 PR c++/93618
2033 * tree.c (array_of_unknown_bound_p): New.
2034 * init.c (perform_member_init): Do nothing for flexible arrays.
2035
81958cd6
JJ
20362020-02-09 Jakub Jelinek <jakub@redhat.com>
2037
2038 PR c++/93633
2039 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
2040 ARRAY_TYPE, use the element type. Punt if objtype after that is not
2041 a class type.
2042
c151a342
JM
20432020-02-08 Jason Merrill <jason@redhat.com>
2044
aaa26bf4
JM
2045 PR c++/90691
2046 * expr.c (fold_for_warn): Call maybe_constant_value.
2047 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
2048 (maybe_constant_value): Add uid_sensitive parm.
2049 (get_fundef_copy): Don't copy if it's true.
2050 (cxx_eval_call_expression): Don't instantiate if it's true.
2051 (cxx_eval_outermost_constant_expr): Likewise.
2052
173c8def
JM
2053 PR c++/92852
2054 * constexpr.c (maybe_constant_value): Don't unshare if the cached
2055 value is the same as the argument.
2056
61f5369f
JM
2057 * typeck.c (maybe_warn_about_returning_address_of_local): Add
2058 location parameter.
2059
c151a342
JM
2060 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
2061 if appropriate.
2062
c7c09af8
JJ
20632020-02-08 Jakub Jelinek <jakub@redhat.com>
2064
2065 PR c++/93549
2066 * constexpr.c (find_array_ctor_elt): If last element has no index,
2067 for flag_checking verify all elts have no index. If i is within the
2068 elts, return it directly, if it is right after the last elt, append
2069 if NULL index, otherwise force indexes on all elts.
2070 (cxx_eval_store_expression): Allow cep->index to be NULL.
2071
ac6eaa55
MP
20722020-02-07 Marek Polacek <polacek@redhat.com>
2073
2074 PR c++/92947 - Paren init of aggregates in unevaluated context.
2075 * call.c (build_new_method_call_1): Don't check
2076 cp_unevaluated_operand. Check the return value of digest_init.
2077
1e042b39
JM
20782020-02-06 Jason Merrill <jason@redhat.com>
2079
2080 PR c++/92654
2081 * tree.c (cp_walk_subtrees): Walk into type template arguments.
2082 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
2083 instead of TYPE_ALIAS_P.
2084 * pt.c (push_template_decl_real): Likewise.
2085 (find_parameter_packs_r): Likewise. Remove dead code.
2086 * error.c (find_typenames_r): Remove dead code.
2087
82aee6dd
JM
20882020-02-06 Jason Merrill <jason@redhat.com>
2089
2090 PR c++/92517
2091 * parser.c (cp_parser_constraint_primary_expression): Do the main
2092 parse non-tentatively.
2093
4a136a21
MP
20942020-02-06 Marek Polacek <polacek@redhat.com>
2095
2096 PR c++/93597 - ICE with lambda in operator function.
2097 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
2098
f6bef097
JM
20992020-02-05 Jason Merrill <jason@redhat.com>
2100
2101 PR c++/93140
2102 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
2103 handling of TREE_CHAIN for empty pack.
2104
f214002b
MP
21052020-02-05 Jakub Jelinek <jakub@redhat.com>
2106
2107 PR c++/93557
2108 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
2109 prior to passing it to c_build_vec_convert.
2110
78c4eb1c
MP
21112020-02-05 Marek Polacek <polacek@redhat.com>
2112
2113 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
2114 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
2115 TREE_SIDE_EFFECTS.
2116
fa0c6e29
JM
21172020-02-05 Jason Merrill <jason@redhat.com>
2118
2119 PR c++/92593
2120 * decl.c (grokdeclarator): Reject field of current class type even
2121 in a template.
2122
a2155f7d
BC
21232020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
2124
2125 * coroutines.cc (maybe_promote_captured_temps): Increase the index
2126 number for temporary variables' name.
2127
e4658c7d 21282020-02-05 Jun Ma <JunMa@linux.alibaba.com>
3ef39186
J
2129
2130 * coroutines.cc (build_co_await): Call convert_from_reference
2131 to wrap co_await_expr with indirect_ref which avoid
2132 reference/non-reference type confusion.
2133
2134 (co_await_expander): Sink to call_expr if await_resume
2135 is wrapped by indirect_ref.
2136
a1c9c9ff
JM
21372020-02-04 Jason Merrill <jason@redhat.com>
2138
85409531
JM
2139 PR c++/93551
2140 * constraint.cc (satisfy_declaration_constraints): Check return
2141 value of push_tinst_level.
2142
0712ea63
JM
2143 PR c++/90951
2144 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
2145 elements instead of value-initializing them.
2146
a1c9c9ff
JM
2147 PR c++/86917
2148 * init.c (perform_member_init): Simplify.
2149 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
2150 flexarray.
2151 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
2152
5bc9d2f5
IS
21532020-02-04 Iain Sandoe <iain@sandoe.co.uk>
2154
2155 * coroutines.cc (find_promise_type): Delete unused forward
2156 declaration.
2157 (struct coroutine_info): Add a bool for no promise type error.
2158 (coro_promise_type_found_p): Only emit the error for a missing
2159 promise once in each affected coroutine.
2160
87fbd534
JM
21612020-02-03 Jason Merrill <jason@redhat.com>
2162
2163 PR c++/66477
2164 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
2165 defer loading the value of a reference.
2166
8fda2c27
JM
21672020-02-03 Jason Merrill <jason@redhat.com>
2168
2169 PR c++/91953
2170 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
2171 empty class type.
2172 [COMPONENT_REF]: A member function reference doesn't use the object
2173 as an rvalue.
2174
d60c25fa
IS
21752020-02-03 Iain Sandoe <iain@sandoe.co.uk>
2176
2177 PR c++/93458
2178 * coroutines.cc (struct coroutine_info): Add a bool flag to note
2179 that we emitted an error for a bad function return type.
2180 (get_coroutine_info): Tolerate an unset info table in case of
2181 missing traits.
2182 (find_coro_traits_template_decl): In case of error or if we didn't
2183 find a type template, note we emitted the error and suppress
2184 duplicates.
2185 (find_coro_handle_template_decl): Likewise.
2186 (instantiate_coro_traits): Only check for error_mark_node in the
2187 return from lookup_qualified_name.
2188 (coro_promise_type_found_p): Reorder initialization so that we check
2189 for the traits and their usability before allocation of the info
2190 table. Check for a suitable return type and emit a diagnostic for
2191 here instead of relying on the lookup machinery. This allows the
2192 error to have a better location, and means we can suppress multiple
2193 copies.
2194 (coro_function_valid_p): Re-check for a valid promise (and thus the
2195 traits) before proceeding. Tolerate missing info as a fatal error.
2196
3539fc13
JM
21972020-02-03 Jason Merrill <jason@redhat.com>
2198
2199 PR c++/88256
2200 * cp-gimplify.c (predeclare_vla): New.
2201 (cp_genericize_r) [NOP_EXPR]: Call it.
2202
e4658c7d 22032020-02-03 Jun Ma <JunMa@linux.alibaba.com>
c3ccce5b
J
2204
2205 * coroutines.cc (transform_await_wrapper): Set actor funcion as
2206 new context of label_decl.
2207 (build_actor_fn): Fill new field of await_xform_data.
2208
b817be03
MP
22092020-02-02 Marek Polacek <polacek@redhat.com>
2210
2211 PR c++/93530 - ICE on invalid alignas in a template.
2212 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
2213 decl_attributes.
2214
d2b9548f
JM
22152020-01-31 Jason Merrill <jason@redhat.com>
2216
00a49cd8
JM
2217 PR c++/86216
2218 * semantics.c (process_outer_var_ref): Capture VLAs even in
2219 unevaluated context.
2220
e98ebda0
JM
2221 PR c++/14179
2222 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
2223 non-aggregate elements.
2224 (reshape_init_array): Add first_initializer_p parm.
2225 (reshape_init_r): Change first_initializer_p from bool to tree.
2226 (reshape_init): Pass init to it.
2227
d2b9548f
JM
2228 PR c++/14179
2229 * parser.c (cp_parser_initializer_list): Suppress location wrappers
2230 after 256 elements.
2231
4dd468a0
JM
22322020-01-29 Jason Merrill <jason@redhat.com>
2233
2234 PR c++/82521
2235 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
2236 the expression was dependent before substitution.
2237
3904cc10
BC
22382020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
2239
2240 * coroutines.cc (act_des_fn): New.
2241 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
2242 Access promise via actor function's frame pointer argument.
2243 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
2244
3b35b3d4
BC
22452020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
2246
2247 * coroutines.cc (co_await_expander): Handle type conversion case.
2248
245e40af
JM
22492020-01-29 Jason Merrill <jason@redhat.com>
2250
2251 PR c++/90333
2252 PR c++/89640
2253 PR c++/60503
2254 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
2255 a trailing return type.
2256 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
2257 parens.
2258
e3b60da8
MP
22592020-01-29 Marek Polacek <polacek@redhat.com>
2260
2261 PR c++/91754 - Fix template arguments comparison with class NTTP.
2262 * pt.c (class_nttp_const_wrapper_p): New.
2263 (template_args_equal): See through class_nttp_const_wrapper_p
2264 arguments.
2265
42328405
MP
22662020-01-29 Marek Polacek <polacek@redhat.com>
2267
2268 PR c++/92948 - Fix class NTTP with template arguments.
2269 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
2270 converting a value-dependent expression to a class type.
2271 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
2272 as the result of the tsubst_copy call.
2273
8d7c0bf8
JJ
22742020-01-29 Jakub Jelinek <jakub@redhat.com>
2275
2276 PR c++/91118
2277 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
2278 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
2279
0968f7da
JM
22802020-01-28 Jason Merrill <jason@redhat.com>
2281
a4b4b1e3
JM
2282 PR c++/93442
2283 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
2284
25d62480
JM
2285 PR c++/93477
2286 PR c++/91476
2287 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
2288
14e320db
JM
2289 PR c++/90546
2290 * call.c (build_user_type_conversion_1): Allow a template conversion
2291 returning an rvalue reference to bind directly to an lvalue.
2292
0968f7da
JM
2293 PR c++/90731
2294 * decl.c (grokdeclarator): Propagate eh spec from typedef.
2295
1d859307
ML
22962020-01-28 Martin Liska <mliska@suse.cz>
2297
2298 PR c++/92440
2299 * pt.c (redeclare_class_template): Group couple of
2300 errors and inform messages with auto_diagnostic_group.
2301
d3c00969
ML
23022020-01-28 Martin Liska <mliska@suse.cz>
2303
2304 PR c++/92440
2305 * pt.c (redeclare_class_template): Use inform
2306 for the second location.
2307
8f25c39c
JM
23082020-01-27 Jason Merrill <jason@redhat.com>
2309
2310 PR c++/90966
2311 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
2312
1f2e8423
IS
23132020-01-27 Iain Sandoe <iain@sandoe.co.uk>
2314
2315 PR c++/93443
2316 * coroutines.cc (morph_fn_to_coro): Check the ramp return
2317 value when it is constructed from the 'get return object'.
2318
feaa1640
NS
23192020-01-27 Nathan Sidwell <nathan@acm.org>
2320
2321 PR c++/91826
2322 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
2323
da11ffbb
JM
23242020-01-26 Jason Merrill <jason@redhat.com>
2325
5035cd66
JM
2326 PR c++/90992
2327 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
2328 temporarily enable -Wsystem-headers. Change second warning to
2329 conditional inform.
2330
da11ffbb
JM
2331 PR c++/90997
2332 * semantics.c (finish_call_expr): Don't call
2333 instantiate_non_dependent_expr before warn_for_memset.
2334
de0684bf
MP
23352020-01-25 Marek Polacek <polacek@redhat.com>
2336
2337 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
2338 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
2339 dynamic_cast diagnostic.
2340
9c1179c3
JM
23412020-01-24 Jason Merrill <jason@redhat.com>
2342
2343 PR c++/93400 - ICE with constrained friend.
2344 * constraint.cc (maybe_substitute_reqs_for): New.
2345 * decl.c (function_requirements_equivalent_p): Call it.
2346 * pt.c (tsubst_friend_function): Only substitute
2347 TEMPLATE_PARMS_CONSTRAINTS.
2348 (tsubst_template_parms): Copy constraints.
2349
8b91e848
JM
23502020-01-24 Jason Merrill <jason@redhat.com>
2351
2352 PR c++/93279 - ICE with lambda in member operator.
2353 * name-lookup.c (maybe_save_operator_binding): Don't remember
2354 class-scope bindings.
2355
55dd4453
JM
23562020-01-24 Jason Merrill <jason@redhat.com>
2357
2358 PR c++/93377 - ICE with member alias in constraint.
2359 * pt.c (any_template_parm_r): Look at template arguments for all
2360 aliases, not only alias templates.
2361
d54a86cd
MP
23622020-01-24 Marek Polacek <polacek@redhat.com>
2363
2364 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
2365 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
2366
28a5d5c3
JM
23672020-01-24 Jason Merrill <jason@redhat.com>
2368
2369 PR c++/92852 - ICE with generic lambda and reference var.
2370 * constexpr.c (maybe_constant_value): Likewise.
2371
c9107224
PC
23722020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
2373
2374 PR c++/92804
2375 * parser.c (cp_parser_nested_name_specifier_opt): Properly
2376 diagnose concept-ids.
2377
20afdcd3
JM
23782020-01-23 Jason Merrill <jason@redhat.com>
2379
6f346913
JM
2380 PR c++/93331 - ICE with __builtin_strchr.
2381 * constexpr.c (cxx_eval_builtin_function_call): Use the original
2382 argument if we didn't manage to extract a STRING_CST.
2383
20afdcd3
JM
2384 PR c++/93345 - ICE with defaulted dtor and template.
2385 PR c++/33799
2386 * decl.c (cxx_maybe_build_cleanup): Don't try to set
2387 throwing_cleanup in a template.
2388
e1fd0408
MP
23892020-01-22 Marek Polacek <polacek@redhat.com>
2390
2391 PR c++/92907 - noexcept does not consider "const" in member functions.
2392 * g++.dg/cpp0x/noexcept56.C: New test.
2393
15ed55ea
MP
23942020-01-22 Marek Polacek <polacek@redhat.com>
2395
2396 PR c++/93324 - ICE with -Wall on constexpr if.
2397 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
2398
bf91504d
PP
23992020-01-22 Patrick Palka <ppalka@redhat.com>
2400
2401 * constraint.cc (get_mapped_args): Avoid using auto_vec
2402 as a vector element. Release the vectors inside the lists
2403 vector.
2404 * parser.c (cp_literal_operator_id): Free the buffer.
2405
44a9d801 24062020-01-22 Jun Ma <JunMa@linux.alibaba.com>
6ac6529e
J
2407
2408 * coroutines.cc (finish_co_await_expr): Add error check on return
2409 value of build_co_await.
2410 (finish_co_yield_expr,): Ditto.
2411
44a9d801 24122020-01-22 Jun Ma <JunMa@linux.alibaba.com>
c75199b7
J
2413
2414 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
2415 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
2416 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
2417
27626519
JM
24182020-01-21 Jason Merrill <jason@redhat.com>
2419
ad09440a
JM
2420 PR c++/60855 - ICE with sizeof VLA capture.
2421 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
2422
27626519
JM
2423 PR c++/90732 - ICE with VLA capture and generic lambda.
2424 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
2425
a312c801
IS
24262020-01-21 Iain Sandoe <iain@sandoe.co.uk>
2427 Bin Cheng <bin.cheng@linux.alibaba.com>
2428
2429 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
2430 from complete_type_or_else.
2431 (register_param_uses): Likewise.
2432 (build_co_await): Do not try to use complete_type_or_else for void
2433 types, otherwise for incomplete types, check for NULL return from
2434 complete_type_or_else.
2435
8158a464
JM
24362020-01-21 Jason Merrill <jason@redhat.com>
2437
2438 PR c++/91476 - anon-namespace reference temp clash between TUs.
2439 * decl2.c (copy_linkage): Factor out of get_guard.
2440 * call.c (make_temporary_var_for_ref_to_temp): Use it.
2441 * decl.c (cp_finish_decomp): Use it.
2442 (cp_finish_decl): determine_visibility sooner.
2443
b313d3c4
BC
24442020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
2445
2446 * coroutines.cc (finish_co_await_expr): Set return value flag.
2447 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
2448
303484a7
JM
24492020-01-19 Jason Merrill <jason@redhat.com>
2450
bcfc2227
JM
2451 PR c++/33799 - destroy return value, take 2.
2452 * cp-tree.h (current_retval_sentinel): New macro.
2453 (struct language_function): Add throwing_cleanup bitfield.
2454 * decl.c (cxx_maybe_build_cleanup): Set it.
2455 * except.c (maybe_set_retval_sentinel)
2456 (maybe_splice_retval_cleanup): New functions.
2457 * parser.c (cp_parser_compound_statement): Call
2458 maybe_splice_retval_cleanup.
2459 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
2460
303484a7
JM
2461 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
2462
dba33cb7
JJ
24632020-01-18 Jakub Jelinek <jakub@redhat.com>
2464
2465 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
2466 but non-NO_DOLLAR_IN_LABEL case build.
2467
49789fd0
IS
24682020-01-18 Iain Sandoe <iain@sandoe.co.uk>
2469
2470 * Make-lang.in: Add coroutines.o.
2471 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
2472 (DECL_COROUTINE_P): New.
2473 * lex.c (init_reswords): Enable keywords when the coroutine flag
2474 is set,
2475 * operators.def (co_await): New operator.
2476 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
2477 (op_error): Likewise.
2478 (build_new_op_1): Likewise.
2479 (build_new_function_call): Validate coroutine builtin arguments.
2480 * constexpr.c (potential_constant_expression_1): Handle
2481 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
2482 * coroutines.cc: New file.
2483 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
2484 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
2485 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
2486 * cp-tree.h (coro_validate_builtin_call): New.
2487 * decl.c (emit_coro_helper): New.
2488 (finish_function): Handle the case when a function is found to
2489 be a coroutine, perform the outlining and emit the outlined
2490 functions. Set a bit to signal that this is a coroutine component.
2491 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
2492 (cp_parser_unary_expression): Handle co_await.
2493 (cp_parser_assignment_expression): Handle co_yield.
2494 (cp_parser_statement): Handle RID_CO_RETURN.
2495 (cp_parser_jump_statement): Handle co_return.
2496 (cp_parser_operator): Handle co_await operator.
2497 (cp_parser_yield_expression): New.
2498 (cp_parser_required_error): Handle RT_CO_YIELD.
2499 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
2500 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
2501 CO_RETURN_EXPRs.
2502 * tree.c (cp_walk_subtrees): Likewise.
2503
eff9c61d
JM
25042020-01-17 Jason Merrill <jason@redhat.com>
2505
2506 PR c++/92531 - ICE with noexcept(lambda).
2507 * pt.c (uses_template_parms): Don't try to enumerate all the
2508 expression cases.
2509
c60a18f8
JJ
25102020-01-17 Jakub Jelinek <jakub@redhat.com>
2511
2512 PR c++/93228
2513 * parser.c (cp_parser_template_name): Look up deprecated attribute
2514 in DECL_TEMPLATE_RESULT or its type's attributes.
2515
801f5b96
JM
25162020-01-16 Jason Merrill <jason@redhat.com>
2517
5194b51e
JM
2518 PR c++/93286 - ICE with __is_constructible and variadic template.
2519 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
2520 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
2521
801f5b96
JM
2522 PR c++/93280 - ICE with aggregate assignment and DMI.
2523 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
2524 * typeck2.c (digest_nsdmi_init): Not here.
2525
83fe2b92
PC
25262020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
2527
2528 PR c++/91073
2529 * cp-tree.h (is_constrained_auto): New.
2530 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
2531 handle concept-check expressions; take a cp_decl_specifier_seq*
2532 instead of a bool.
2533 (cp_parser_condition): Update call.
2534 (cp_parser_simple_declaration): Likewise.
2535 (cp_parser_placeholder_type_specifier): Correctly handle
2536 concept-check expressions.
2537
7192b1ec
JM
25382020-01-15 Jason Merrill <jason@redhat.com>
2539
299ddc61
JM
2540 Revert
2541 PR c++/33799 - destroy return value if local cleanup throws.
2542 * cp-tree.h (current_retval_sentinel): New macro.
2543 * decl.c (start_preparsed_function): Set up cleanup for retval.
2544 * typeck.c (check_return_expr): Set current_retval_sentinel.
2545
596334fa
JM
2546 PR c++/93257 - consteval void function.
2547 * constexpr.c (verify_constant): Allow void_node.
2548
7192b1ec
JM
2549 PR c++/92871 - bad code with xvalue and GNU ?: extension.
2550 * call.c (prevent_lifetime_extension): New.
2551 (build_conditional_expr_1): Use it.
2552
a5a3c2dc
NS
25532020-01-14 Nathan Sidwell <nathan@acm.org>
2554
1918e70d 2555 PR c++/90916
ddd792fa
NS
2556 * pt.c (retrieve_specialization): Use get_template_info, not open
2557 coding access.
2558
a5a3c2dc
NS
2559 PR c++/90916
2560 * pt.c (retrieve_specialization): Get the TI from the decl or the
2561 classtype as appropriate.
2562
7ca50de0
DM
25632020-01-14 David Malcolm <dmalcolm@redhat.com>
2564
2565 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
2566 New static constant.
2567 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
2568 (struct named_label_hash::empty_zero_p): Likewise.
2569 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
2570
80de0002
JM
25712020-01-14 Jason Merrill <jason@redhat.com>
2572
08c8c973
JM
2573 PR c++/92590 - wrong handling of inherited default ctor.
2574 * class.c (add_method): A constrained inherited ctor doesn't hide an
2575 implicit derived ctor.
2576 Revert:
2577 PR c++/92552 - ICE with inherited constrained default ctor.
2578 * pt.c (instantiate_class_template_1): Copy
2579 TYPE_HAS_USER_CONSTRUCTOR.
2580 PR c++/91930 - ICE with constrained inherited default ctor.
2581 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
2582 for inherited constructor.
2583 PR c++/92594 - ICE with inherited trivial default ctor.
2584 * method.c (trivial_fn_p): Treat an inherited default constructor
2585 like a normal default constructor.
2586
8982b553
JM
2587 PR c++/92594 - ICE with inherited trivial default ctor.
2588 * method.c (trivial_fn_p): Treat an inherited default constructor
2589 like a normal default constructor.
2590
80de0002
JM
2591 PR c++/92009 - ICE with punning of typeid.
2592 * rtti.c (get_tinfo_desc): Call xref_basetypes.
2593 * constexpr.c (cxx_fold_indirect_ref): Don't strip
2594 REINTERPRET_CAST_P.
2595
f1acad4e
JM
25962020-01-13 Jason Merrill <jason@redhat.com>
2597
edabbec3
JM
2598 PR c++/92746 - ICE with noexcept of function concept check.
2599 * except.c (check_noexcept_r): Handle concept-check.
2600
8ca4435f
JM
2601 PR c++/92582 - ICE with member template as requirement.
2602 * pt.c (struct find_template_parameter_info): Add ctx_parms.
2603 (any_template_parm_r): Handle TEMPLATE_DECL.
2604 (find_template_parameters): Take parms instead of their depth.
2605 * constraint.cc (build_parameter_mapping): Pass them.
2606
7c82dd6c
JM
2607 PR c++/33799 - destroy return value if local cleanup throws.
2608 * cp-tree.h (current_retval_sentinel): New macro.
2609 * decl.c (start_preparsed_function): Set up cleanup for retval.
2610 * typeck.c (check_return_expr): Set current_retval_sentinel.
2611
f1acad4e
JM
2612 PR c++/93238 - short right-shift with enum.
2613 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
2614
640b23d7
JM
26152020-01-10 Jason Merrill <jason@redhat.com>
2616
337ea6b2
JM
2617 * typeck.c (cp_build_binary_op): Restore short_shift code.
2618
e0804c9b
JM
2619 PR c++/93143 - incorrect tree sharing with constexpr.
2620 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
2621 CONSTRUCTORs are already unshared.
2622
640b23d7
JM
2623 PR c++/93173 - incorrect tree sharing.
2624 PR c++/93033
2625 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
2626 copy_if_shared after cp_genericize_tree.
2627 * typeck2.c (split_nonconstant_init): Don't unshare here.
2628
08f594eb
JM
26292020-01-08 Jason Merrill <jason@redhat.com>
2630
2631 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
2632 TARGET_EXPR_DIRECT_INIT_P.
2633 * constexpr.c (cxx_eval_constant_expression): Likewise.
2634
10d2f801
JM
26352020-01-08 Jason Merrill <jason@redhat.com>
2636
2637 PR c++/91369 - constexpr destructor and member initializer.
2638 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
2639 when not preevaluating.
2640
cd3ca6cb
JM
26412020-01-08 Jason Merrill <jason@redhat.com>
2642
2643 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
2644 support.
2645
87d3f828
PC
26462020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
2647
2648 * init.c (build_new): Add location_t parameter and use it throughout.
2649 (build_raw_new_expr): Likewise.
2650 * parser.c (cp_parser_new_expression): Pass the combined_loc.
2651 * pt.c (tsubst_copy_and_build): Adjust call.
2652 * cp-tree.h: Update declarations.
2653
bd65538a
JM
26542020-01-07 Jason Merrill <jason@redhat.com>
2655
2656 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
2657 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
2658 explicit class visibility for a template.
2659
c4b30920
RS
26602020-01-07 Richard Sandiford <richard.sandiford@arm.com>
2661
2662 * mangle.c (mangle_type_attribute_p): New function, split out from...
2663 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
2664 that contain a space.
2665
f74f6092
JJ
26662020-01-07 Jakub Jelinek <jakub@redhat.com>
2667
2668 PR c++/91369
2669 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
2670 member, initialize it to zero in ctor.
2671 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
2672 a heap object. Don't cache calls to functions which allocate some
2673 heap objects and don't deallocate them or deallocate some heap
2674 objects they didn't allocate.
2675
665e3b21
JM
26762020-01-06 Jason Merrill <jason@redhat.com>
2677
2678 PR c++/92552 - ICE with inherited constrained default ctor.
2679 * pt.c (instantiate_class_template_1): Copy
2680 TYPE_HAS_USER_CONSTRUCTOR.
2681 * class.c (one_inherited_ctor): Don't set it here.
2682
e4bcf1f5
AS
26832020-01-06 Andrew Sutton <asutton@lock3software.com>
2684
2685 PR c++/92739 - parsing requires clause with attributes.
2686 * parser.c (cp_parser_constraint_requires_parens): Exclude
2687 attributes as postfix expressions.
2688
39bec8cd
JJ
26892020-01-05 Jakub Jelinek <jakub@redhat.com>
2690
2691 PR c++/93138
2692 * parser.c (cp_parser_check_class_key): Disable access checks for the
2693 simple name lookup.
2694 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
2695 !warn_redundant_tags.
2696
72036b59
JJ
26972010-01-05 Jakub Jelinek <jakub@redhat.com>
2698
2699 PR c++/93046
2700 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
2701 TARGET_EXPR if it has been gimplified already.
2702
8b5d34fc
JM
27032020-01-03 Jason Merrill <jason@redhat.com>
2704
2705 PR c++/93033 - incorrect tree node sharing with array init.
2706 * typeck2.c (split_nonconstant_init): Unshare non-decl.
2707 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
2708
657fea97
JM
27092020-01-02 Jason Merrill <jason@redhat.com>
2710
2711 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
2712 C++17.
2713
4a08009e
JJ
27142020-01-02 Jakub Jelinek <jakub@redhat.com>
2715
2716 PR c/90677
2717 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
2718 has not been found, rather than error_mark_node.
2719
8d9254fc 27202020-01-01 Jakub Jelinek <jakub@redhat.com>
19c37faa 2721
85ec4feb 2722 Update copyright years.
ad41bd84 2723\f
8d9254fc 2724Copyright (C) 2020 Free Software Foundation, Inc.
ad41bd84
JM
2725
2726Copying and distribution of this file, with or without modification,
2727are permitted in any medium without royalty provided the copyright
2728notice and this notice are preserved.
This page took 4.390546 seconds and 5 git commands to generate.