c++: Error recovery with erroneous DECL_INITIAL [PR94475]
[gcc.git] / gcc / cp / ChangeLog
1 2020-04-16 Patrick Palka <ppalka@redhat.com>
2
3 PR c++/94475
4 * cvt.c (ocp_convert): If the result of scalar_constant_value is
5 erroneous, ignore it and use the original expression.
6
7 2020-04-16 Jakub Jelinek <jakub@redhat.com>
8
9 PR c++/94571
10 * parser.c (cp_parser_simple_declaration): Fix up a pasto in
11 diagnostics.
12
13 2020-04-15 Jakub Jelinek <jakub@redhat.com>
14
15 PR c/94593
16 * parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
17 requires directive when not at file or namespace scope.
18
19 2020-04-14 Iain Sandoe <iain@sandoe.co.uk>
20
21 PR c++/94359
22 * coroutines.cc (build_actor_fn): Check that the target can
23 support the resume tailcall before mandating it.
24
25 2020-04-14 Patrick Palka <ppalka@redhat.com>
26
27 PR c++/85278
28 * cxx-pretty-print.c (cxx_pretty_printer:simple_type_specifier)
29 <case DECLTYPE_TYPE>: Handle DECLTYPE_TYPE here instead of ...
30 (pp_cxx_type_specifier_seq) <case DECLTYPE_TYPE>: ... here.
31 (cxx_pretty_printer::direct_abstract_declarator) <case DECLTYPE_TYPE>:
32 New no-op case.
33
34 PR c++/94034
35 * constexpr.c (replace_result_decl_data): New struct.
36 (replace_result_decl_data_r): New function.
37 (replace_result_decl): New function.
38 (cxx_eval_call_expression): Use it.
39 * tree.c (build_aggr_init_expr): Set the location of the AGGR_INIT_EXPR
40 to that of its initializer.
41
42 2020-04-13 Marek Polacek <polacek@redhat.com>
43
44 PR c++/94588
45 * name-lookup.c (check_local_shadow): Add an inform call.
46
47 2020-04-13 Patrick Palka <ppalka@redhat.com>
48
49 PR c++/94521
50 * error.c (dump_scope): Pass TFF_NO_FUNCTION_ARGUMENTS to
51 dump_function_decl when printing a function template instantiation as a
52 scope.
53
54 PR c++/94470
55 * constexpr.c (get_or_insert_ctor_field): Set default value of parameter
56 'pos_hint' to -1.
57 (cxx_eval_bare_aggregate): Use get_or_insert_ctor_field instead of
58 assuming the the next index belongs at the end of the new CONSTRUCTOR.
59 (cxx_eval_store_expression): Revert PR c++/78572 fix.
60
61 2020-04-13 Nathan Sidwell <nathan@acm.org>
62
63 PR c++/94426 lambdas with internal linkage are different to no-linkage
64 * decl2.c (determine_visibility): A lambda's visibility is
65 affected by its extra scope.
66 * pt.c (instantiate_decl): Determine var's visibility before
67 instantiating its initializer.
68 * tree.c (no_linkage_check): Revert code looking at visibility of
69 lambda's extra scope.
70 `
71 2020-04-10 Iain Sandoe <iain@sandoe.co.uk>
72
73 PR c++/94528
74 * coroutines.cc (co_await_expander): Remove.
75 (expand_one_await_expression): New.
76 (process_one_statement): New.
77 (await_statement_expander): New.
78 (build_actor_fn): Revise to use per-statement expander.
79 (struct susp_frame_data): Reorder and comment.
80 (register_awaits): Factor code.
81 (replace_statement_captures): New, factored from...
82 (maybe_promote_captured_temps):.. here.
83 (await_statement_walker): Revise to process per statement.
84 (morph_fn_to_coro): Use revised susp_frame_data layout.
85
86 2020-04-10 Marek Polacek <polacek@redhat.com>
87
88 PR c++/94149
89 * method.c (constructible_expr): In C++20, try using parenthesized
90 initialization of aggregates to determine the result of
91 __is_constructible.
92
93 2020-04-10 Bin Cheng <bin.cheng@linux.alibaba.com>
94
95 * coroutines.cc (co_await_expander): Simplify.
96
97 2020-04-09 Jason Merrill <jason@redhat.com>
98
99 PR c++/94523
100 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]: Look at
101 ctx->object and ctx->global->values first.
102
103 2020-04-09 Marek Polacek <polacek@redhat.com>
104
105 PR c++/93790
106 * call.c (initialize_reference): If the reference binding failed, maybe
107 try initializing from { }.
108 * decl.c (grok_reference_init): For T& t(e), set
109 LOOKUP_AGGREGATE_PAREN_INIT but don't build up a constructor yet.
110
111 2020-04-08 Iain Sandoe <iain@sandoe.co.uk>
112 Jun Ma <JunMa@linux.alibaba.com>
113
114 * coroutines.cc (maybe_promote_captured_temps): Add a cleanup
115 expression, if needed, to any call from which we promoted
116 temporaries captured by reference.
117
118 2020-04-08 Marek Polacek <polacek@redhat.com>
119
120 PR c++/94507 - ICE-on-invalid with lambda template.
121 * pt.c (tsubst_lambda_expr): Cope when tsubst_template_decl or
122 tsubst_function_decl returns error_mark_node.
123
124 2020-04-08 Martin Liska <mliska@suse.cz>
125
126 PR c++/94314
127 * decl.c (duplicate_decls): Duplicate also DECL_IS_REPLACEABLE_OPERATOR.
128 (cxx_init_decl_processing): Mark replaceable all implicitly defined
129 operators.
130
131 2020-04-08 Patrick Palka <ppalka@redhat.com>
132
133 Core issues 1001 and 1322
134 PR c++/92010
135 * pt.c (rebuild_function_or_method_type): Split function out from ...
136 (tsubst_function_type): ... here.
137 (maybe_rebuild_function_decl_type): New function.
138 (tsubst_function_decl): Use it.
139
140 2020-04-08 Jakub Jelinek <jakub@redhat.com>
141
142 PR c++/94325
143 * decl.c (begin_destructor_body): For CLASSTYPE_VBASECLASSES class
144 dtors, if CLASSTYPE_PRIMARY_BINFO is non-NULL, but not BINFO_VIRTUAL_P,
145 look at CLASSTYPE_PRIMARY_BINFO of its BINFO_TYPE if it is not
146 BINFO_VIRTUAL_P, and so on.
147
148 2020-04-08 Marek Polacek <polacek@redhat.com>
149
150 PR c++/94478 - ICE with defaulted comparison operator
151 * method.c (early_check_defaulted_comparison): Give an error when the
152 context is null.
153
154 2020-04-08 Tobias Burnus <tobias@codesourcery.com>
155
156 PR middle-end/94120
157 * paser.c (cp_parser_oacc_declare): Add check that variables
158 are declared in the same scope as the directive.
159
160 2020-04-07 Jason Merrill <jason@redhat.com>
161
162 PR c++/94480
163 * parser.c (cp_parser_requires_expression): Use tentative_firewall.
164
165 PR c++/94481
166 * parser.c (cp_parser_placeholder_type_specifier): Use
167 matching_parens.
168
169 2020-04-07 Iain Sandoe <iain@sandoe.co.uk>
170
171 * coroutines.cc (maybe_promote_captured_temps): Ensure that
172 reference capture placeholder vars are properly declared.
173
174 2020-04-07 Patrick Palka <ppalka@redhat.com>
175
176 PR c++/90996
177 * tree.c (replace_placeholders): Look through all handled components,
178 not just COMPONENT_REFs.
179 * typeck2.c (process_init_constructor_array): Propagate
180 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
181 the array initializer.
182
183 2020-04-07 Jakub Jelinek <jakub@redhat.com>
184
185 PR c++/94512
186 * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
187 if cp_parser_omp_master succeeded.
188
189 2020-04-06 Jason Merrill <jason@redhat.com>
190
191 PR c++/94462
192 * decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.
193
194 2020-04-04 Marek Polacek <polacek@redhat.com>
195 Jason Merrill <jason@redhat.com>
196
197 PR c++/94155 - crash in gimplifier with paren init of aggregates.
198 * init.c (build_vec_init): Fill in indexes.
199
200 2020-04-04 Jason Merrill <jason@redhat.com>
201
202 PR c++/91377
203 * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR.
204
205 2020-04-04 Patrick Palka <ppalka@redhat.com>
206
207 PR c++/94205
208 PR c++/79937
209 * constexpr.c (struct constexpr_ctx): New field 'parent'.
210 (cxx_eval_bare_aggregate): Propagate CONSTRUCTOR_PLACEHOLDER_BOUNDARY
211 flag from the original constructor to the reduced constructor.
212 (lookup_placeholder): Prefer to return the outermost matching object
213 by recursively calling lookup_placeholder on the 'parent' context,
214 but don't cross CONSTRUCTOR_PLACEHOLDER_BOUNDARY constructors.
215 (cxx_eval_constant_expression): Link the 'ctx' context to the 'new_ctx'
216 context via 'new_ctx.parent' when being expanded without an explicit
217 target. Don't call replace_placeholders.
218 (cxx_eval_outermost_constant_expr): Initialize 'ctx.parent' to NULL.
219
220 PR c++/94219
221 PR c++/94205
222 * constexpr.c (get_or_insert_ctor_field): Split out (while adding
223 support for VECTOR_TYPEs, and optimizations for the common case)
224 from ...
225 (cxx_eval_store_expression): ... here. Rename local variable
226 'changed_active_union_member_p' to 'activated_union_member_p'. Record
227 the sequence of indexes into 'indexes' that yields the subobject we're
228 assigning to. Record the integer offsets of the constructor indexes
229 we're assigning through into 'index_pos_hints'. After evaluating the
230 initializer of the store expression, recompute 'valp' using 'indexes'
231 and using 'index_pos_hints' as hints.
232 (cxx_eval_bare_aggregate): Tweak comments. Use get_or_insert_ctor_field
233 to recompute the constructor_elt pointer we're assigning through after
234 evaluating each initializer.
235
236 2020-04-04 Jason Merrill <jason@redhat.com>
237
238 PR c++/67825
239 * constraint.cc (tsubst_valid_expression_requirement): Call
240 convert_to_void.
241
242 2020-04-04 Jason Merrill <jason@redhat.com>
243
244 PR c++/94453
245 * constexpr.c (maybe_constant_value): Use break_out_target_exprs.
246 * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in
247 NON_LVALUE_EXPR.
248
249 2020-04-04 Jakub Jelinek <jakub@redhat.com>
250
251 PR debug/94441
252 * parser.c (cp_parser_omp_for_loop): Use
253 protected_set_expr_location_if_unset.
254 * cp-gimplify.c (genericize_if_stmt, genericize_cp_loop): Likewise.
255
256 PR c++/94477
257 * pt.c (tsubst_expr) <case OMP_MASTER>: Clear
258 omp_parallel_combined_clauses.
259
260 2020-04-03 Jason Merrill <jason@redhat.com>
261
262 PR c++/91966
263 * pt.c (complex_pack_expansion_r): New.
264 (complex_alias_template_p): Use it.
265
266 2020-03-31 Jason Merrill <jason@redhat.com>
267
268 PR c++/94205
269 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Call
270 replace_placeholders.
271 * typeck2.c (store_init_value): Fix arguments to
272 fold_non_dependent_expr.
273
274 2020-03-31 Jason Merrill <jason@redhat.com>
275
276 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Use
277 local variables.
278
279 2020-03-30 Jason Merrill <jason@redhat.com>
280
281 PR c++/90711
282 * tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
283 (called_fns_equal): Check DECL_CONTEXT.
284
285 2020-03-30 Jakub Jelinek <jakub@redhat.com>
286
287 PR c++/94385
288 * semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with
289 STATEMENT_CODE_P code.
290
291 2020-03-28 Patrick Palka <ppalka@redhat.com>
292
293 PR c++/94306
294 * parser.c (cp_parser_requires_clause_opt): Diagnose and recover from
295 "requires {" when "requires requires {" was probably intended.
296
297 PR c++/94252
298 * constraint.cc (tsubst_compound_requirement): Always suppress errors
299 from type_deducible_p and expression_convertible_p, as they're not
300 substitution errors.
301 (diagnose_atomic_constraint) <case INTEGER_CST>: Remove this case so
302 that we diagnose INTEGER_CST expressions of non-bool type via the
303 default case.
304 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: New case.
305 * parser.c (cp_parser_requires_expression): Always parse the requirement
306 body as if we're processing a template, by temporarily incrementing
307 processing_template_decl. Afterwards, if we're not actually in a
308 template context, perform semantic processing to diagnose any invalid
309 types and expressions.
310 * pt.c (tsubst_copy_and_build) <case REQUIRES_EXPR>: Remove dead code.
311 * semantics.c (finish_static_assert): Explain an assertion failure
312 when the condition is a REQUIRES_EXPR like we do when it is a concept
313 check.
314
315 * constraint.cc (diagnose_compound_requirement): When diagnosing a
316 compound requirement, maybe replay the satisfaction failure, subject to
317 the current diagnosis depth.
318
319 * constraint.cc (finish_constraint_binary_op): Set the location of EXPR
320 as well as its range, because build_x_binary_op doesn't always do so.
321 (current_constraint_diagnosis_depth): New.
322 (concepts_diagnostics_max_depth_exceeded_p): New.
323 (collect_operands_of_disjunction): New.
324 (satisfy_disjunction): When diagnosing a satisfaction failure, maybe
325 replay each branch of the disjunction, subject to the current diagnosis
326 depth.
327 (diagnose_valid_expression): When diagnosing a satisfaction failure,
328 maybe replay the substitution error, subject to the current diagnosis
329 recursion.
330 (diagnose_valid_type): Likewise.
331 (diagnose_nested_requiremnet): Likewise.
332 (diagnosing_failed_constraint::diagnosing_failed_constraint): Increment
333 current_constraint_diagnosis_depth when diagnosing.
334 (diagnosing_failed_constraint::~diagnosing_failed_constraint): Decrement
335 current_constraint_diagnosis_depth when diagnosing.
336 (diagnosing_failed_constraint::replay_errors_p): New static member
337 function.
338 (diagnose_constraints): Don't diagnose if concepts_diagnostics_max_depth
339 is 0. Emit a one-off note to increase -fconcepts-diagnostics-depth if
340 the limit was exceeded.
341 * cp-tree.h (diagnosing_failed_constraint::replay_errors_p): Declare.
342
343 2020-03-27 Nathan Sidwell <nathan@acm.org>
344
345 PR c++/84733
346 * name-lookup.c (do_pushdecl): Look through cleanp levels.
347
348 2020-03-27 Martin Sebor <msebor@redhat.com>
349
350 PR c++/94078
351 PR c++/93824
352 PR c++/93810
353 * cp-tree.h (most_specialized_partial_spec): Declare.
354 * parser.c (cp_parser_elaborated_type_specifier): Distinguish alias
355 from declarations.
356 (specialization_of): New function.
357 (cp_parser_check_class_key): Move code...
358 (class_decl_loc_t::add): ...to here. Add parameters. Avoid issuing
359 -Wredundant-tags on first-time declarations in other declarators.
360 Correct handling of template specializations.
361 (class_decl_loc_t::diag_mismatched_tags): Also expect to be called
362 when -Wredundant-tags is enabled. Use primary template or partial
363 specialization as the guide for uses of implicit instantiations.
364 * pt.c (most_specialized_partial_spec): Declare extern.
365
366 2020-03-27 Nathan Sidwell <nathan@acm.org>
367
368 PR c++/94257
369 * name-lookup.c (push_namespace): Triage ambiguous lookups that
370 contain namespaces.
371
372 2020-03-27 Jakub Jelinek <jakub@redhat.com>
373
374 PR c++/94326
375 * call.c (set_flags_from_callee): Don't update
376 cp_function_chain->can_throw or current_function_returns_abnormally
377 if cp_unevaluated_operand.
378
379 PR c++/94339
380 * cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
381 operand and creating a new COMPOUND_EXPR if anything changed.
382
383 2020-03-26 Marek Polacek <polacek@redhat.com>
384
385 PR c++/94336 - template keyword accepted before destructor names.
386 * parser.c (cp_parser_unqualified_id): Give an error when 'template'
387 is followed by a destructor name.
388
389 2020-03-27 Patrick Palka <ppalka@redhat.com>
390
391 * decl.c (compute_array_index_type_loc): Remove redundant
392 type_dependent_expression_p check that is subsumed by
393 value_dependent_expression_p.
394 * decl2.c (is_late_template_attribute): Likewise.
395 * pt.c (uses_template_parms): Likewise.
396 (dependent_template_arg_p): Likewise.
397
398 2020-03-26 Marek Polacek <polacek@redhat.com>
399
400 DR 1710
401 PR c++/94057 - template keyword in a typename-specifier.
402 * parser.c (check_template_keyword_in_nested_name_spec): New.
403 (cp_parser_nested_name_specifier_opt): Implement DR1710, optional
404 'template'. Call check_template_keyword_in_nested_name_spec.
405 (cp_parser_simple_type_specifier): Assume that a <
406 following a qualified-id in a typename-specifier begins
407 a template argument list.
408
409 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
410
411 * coroutines.cc (coro_init_identifiers): Initialize an identifier
412 for the cororoutine handle 'address' method name.
413 (struct coro_aw_data): Add fields to cover the continuations.
414 (co_await_expander): Determine the kind of await_suspend in use.
415 If we have the case that returns a continuation handle, then save
416 this and make the target for 'scope exit without cleanup' be the
417 continuation resume label.
418 (expand_co_awaits): Remove.
419 (struct suspend_point_info): Remove fields that kept the returned
420 await_suspend handle type.
421 (transform_await_expr): Remove code tracking continuation handles.
422 (build_actor_fn): Add the continuation handle as an actor-function
423 scope var. Build the symmetric transfer continuation point. Call
424 the tree walk for co_await expansion directly, rather than via a
425 trivial shim function.
426 (register_await_info): Remove fields tracking continuation handles.
427 (get_await_suspend_return_type): Remove.
428 (register_awaits): Remove code tracking continuation handles.
429 (morph_fn_to_coro): Remove code tracking continuation handles.
430
431 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
432
433 * coroutines.cc (co_await_expander): If we are expanding the
434 initial await expression, set a boolean flag to show that we
435 have now reached the initial await_resume() method call.
436 (expand_co_awaits): Handle the 'initial await resume called' flag.
437 (build_actor_fn): Insert the initial await expression into the
438 start of the user-authored function-body. Handle the 'initial await
439 resume called' flag.
440 (morph_fn_to_coro): Initialise the 'initial await resume called'
441 flag. Modify the unhandled exception catch clause to recognise
442 exceptions that occur before the initial await_resume() and re-
443 throw them.
444
445 2020-03-26 Jakub Jelinek <jakub@redhat.com>
446
447 PR c++/81349
448 * class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
449 true for all TEMPLATE_DECLs.
450
451 PR c++/94272
452 * cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
453
454 2020-03-25 Patrick Palka <ppalka@redhat.com>
455
456 PR c++/94265
457 * parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
458 current condition chain when the if-statement has a non-empty
459 init-statement.
460
461 2020-03-25 Iain Sandoe <iain@sandoe.co.uk>
462
463 PR c++/94319
464 * coroutines.cc (captures_temporary): Fix a missing dereference.
465
466 2020-03-24 Marek Polacek <polacek@redhat.com>
467
468 PR c++/94190 - wrong no post-decrement operator error in template.
469 * call.c (convert_like_real): Use convert_from_reference on the result.
470
471 2020-03-24 Jason Merrill <jason@redhat.com>
472
473 PR c++/94186
474 * constraint.cc (constraint_satisfaction_value): Repeat noisily on
475 error.
476 (tsubst_nested_requirement): Likewise.
477 (get_constraint_error_location): Allow missing context.
478 (diagnose_atomic_constraint): Diagnose non-bool constraint here.
479 (satisfy_atom): Not here. Only diagnose non-constant when noisy.
480
481 2020-03-24 Jason Merrill <jason@redhat.com>
482
483 * pt.c (any_template_parm_r): Look into the type of a non-type
484 template parm.
485
486 2020-03-24 Jason Merrill <jason@redhat.com>
487
488 * cp-tree.h (cp_expr): When constructing from an expr and a
489 location, call protected_set_expr_location.
490
491 2020-03-23 Patrick Palka <ppalka@redhat.com>
492
493 PR c++/93805
494 * except.c (maybe_noexcept_warning): Add TODO.
495 * method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
496
497 2020-03-23 nathans <nathan@acm.org>
498
499 PR c++/94044
500 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
501 operand.
502
503 2020-03-21 Patrick Palka <ppalka@redhat.com>
504
505 PR c++/94066
506 * constexpr.c (reduced_constant_expression_p) [CONSTRUCTOR]: Properly
507 handle unions without an initializer.
508 (cxx_eval_component_reference): Emit a different diagnostic when the
509 constructor element corresponding to a union member is NULL.
510 (cxx_eval_bare_aggregate): When constructing a union, always set the
511 active union member before evaluating the initializer. Relax assertion
512 that verifies the index of the constructor element we're initializing
513 hasn't been changed.
514 (cxx_eval_store_expression): Diagnose changing the active union member
515 while the union is in the process of being initialized. After setting
516 an active union member, clear CONSTRUCTOR_NO_CLEARING on the underlying
517 CONSTRUCTOR.
518 (cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
519 CONSTRUCTOR returned by lookup_placeholder.
520
521 2020-03-20 Patrick Palka <ppalka@redhat.com>
522
523 * cxx-pretty-print.c (pp_cxx_parameter_mapping): Make extern. Move
524 the "[with ]" bits to here from ...
525 (pp_cxx_atomic_constraint): ... here.
526 * cxx-pretty-print.h (pp_cxx_parameter_mapping): Declare.
527 * error.c (rebuild_concept_check): Delete.
528 (print_concept_check_info): Print the dependent form of the constraint and the
529 preferably substituted parameter mapping alongside it.
530
531 2020-03-19 Jason Merrill <jason@redhat.com>
532
533 PR c++/94175
534 * cp-gimplify.c (simple_empty_class_p): Look through
535 SIMPLE_TARGET_EXPR_P.
536 (cp_gimplify_expr) [MODIFY_EXPR]: Likewise.
537 [RETURN_EXPR]: Avoid producing 'return *retval;'.
538 * call.c (build_call_a): Strip TARGET_EXPR from empty class arg.
539 * cp-tree.h (SIMPLE_TARGET_EXPR_P): Check that TARGET_EXPR_INITIAL
540 is non-null.
541
542 2020-03-19 Jakub Jelinek <jakub@redhat.com>
543
544 PR c++/93931
545 * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
546 on outer_automatic_var_p decls.
547 * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
548 capture proxy decls.
549
550 2020-03-18 Nathan Sidwell <nathan@acm.org>
551
552 PR c++/94147 - mangling of lambdas assigned to globals
553 * parser.c (cp_parser_init_declarator): Namespace-scope variables
554 provide a lambda scope.
555 * tree.c (no_linkage_check): Lambdas with a variable for extra
556 scope have a linkage from the variable.
557
558 2020-03-18 Jakub Jelinek <jakub@redhat.com>
559
560 * constraint.cc (resolve_function_concept_check, subsumes_constraints,
561 strictly_subsumes): Fix up duplicated word issue in a comment.
562 * coroutines.cc (build_init_or_final_await, captures_temporary):
563 Likewise.
564 * logic.cc (dnf_size_r, cnf_size_r): Likewise.
565 * pt.c (append_type_to_template_for_access_check): Likewise.
566
567 PR c++/91759
568 * decl.c (grokfndecl): Restore old diagnostics about deduction
569 guide declared in different scope if in_namespace is NULL_TREE.
570
571 2020-03-17 Jakub Jelinek <jakub@redhat.com>
572
573 PR c++/90995
574 * parser.c (cp_parser_enum_specifier): Use temp_override for
575 parser->colon_corrects_to_scope_p, replace goto out with return.
576 If scoped enum or enum with underlying type is not followed by
577 { or ;, call cp_parser_commit_to_tentative_parse before calling
578 cp_parser_error and make sure to return error_mark_node instead of
579 NULL_TREE. Formatting fixes.
580
581 2020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
582
583 PR c++/94197
584 * method.c (assignable_expr): Use cp_unevaluated.
585 (is_xible_helper): Push a non-deferred access check for
586 the stub objects created by assignable_expr and constructible_expr.
587
588 2020-03-17 Jakub Jelinek <jakub@redhat.com>
589
590 * pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
591 (lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
592 in a comment.
593 * parser.c (cp_parser_statement, cp_parser_linkage_specification,
594 cp_parser_placeholder_type_specifier,
595 cp_parser_constraint_requires_parens): Likewise.
596 * name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
597
598 2020-03-15 Iain Sandoe <iain@sandoe.co.uk>
599
600 * coroutines.cc (co_await_expander): Fix indentation.
601
602 2020-03-14 Jason Merrill <jason@redhat.com>
603
604 PR c++/92068
605 * pt.c (process_partial_specialization): Error rather than crash on
606 extra pack expansion.
607
608 2020-03-14 Jason Merrill <jason@redhat.com>
609
610 PR c++/92909
611 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
612 DECL_ORIGINAL_TYPE of a typedef.
613
614 2020-03-14 Jason Merrill <jason@redhat.com>
615
616 PR c++/93248
617 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
618 substituting DECL_ARGUMENTS.
619
620 2020-03-14 Jakub Jelinek <jakub@redhat.com>
621
622 * logic.cc (formula::formula): Change "a an" to "an" in a comment.
623 * parser.c (cp_debug_parser): Change "a an" to "an" in a string
624 literal.
625
626 2020-03-13 Patrick Palka <ppalka@redhat.com>
627
628 PR c++/67960
629 * call.c (build_over_call): Use a warning_sentinel to disable
630 warn_deprecated_decl before calling build_addr_func.
631
632 2020-03-12 Jakub Jelinek <jakub@redhat.com>
633
634 PR c++/94124
635 * decl.c (reshape_init_array_1): Don't unshare constructor if there
636 aren't any trailing zero elts, otherwise only unshare the first
637 nelts.
638
639 2020-03-11 Jason Merrill <jason@redhat.com>
640
641 PR c++/93907
642 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
643 argument.
644
645 2020-03-11 Marek Polacek <polacek@redhat.com>
646 Jason Merrill <jason@redhat.com>
647
648 PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
649 * constexpr.c (cref_has_const_field): New function.
650 (modifying_const_object_p): Consider a COMPONENT_REF
651 const only if any of its fields are const.
652 (cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
653 as readonly after its initialization has been done.
654
655 2020-03-10 Marek Polacek <polacek@redhat.com>
656
657 PR c++/94124 - wrong conversion error with non-viable overload.
658 * decl.c (reshape_init_array_1): Unshare a constructor if we
659 stripped trailing zero-initializers.
660
661 2020-03-10 Jason Merrill <jason@redhat.com>
662
663 PR c++/93901
664 * pt.c (maybe_instantiate_noexcept): Always update clones.
665
666 2020-03-10 Jason Merrill <jason@redhat.com>
667
668 PR c++/93596
669 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
670
671 2020-03-10 Jason Merrill <jason@redhat.com>
672
673 PR c++/93922
674 PR c++/94041
675 PR c++/52320
676 PR c++/66139
677 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
678 66139: Don't split_nonconstant_init. Remove pre_p parameter.
679
680 2020-03-09 Marek Polacek <polacek@redhat.com>
681
682 PR c++/92031 - bogus taking address of rvalue error.
683 PR c++/91465 - ICE with template codes in check_narrowing.
684 PR c++/93870 - wrong error when converting template non-type arg.
685 PR c++/94068 - ICE with template codes in check_narrowing.
686 * call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
687 in a template when not ck_identity and we're dealing with a class.
688 (convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
689 in a template if we need a temporary.
690 * decl.c (compute_array_index_type_loc): Remove
691 instantiate_non_dependent_expr_sfinae call. Call
692 fold_non_dependent_expr instead of maybe_constant_value.
693 (build_explicit_specifier): Don't instantiate or create a sentinel
694 before converting the expression.
695 * except.c (build_noexcept_spec): Likewise.
696 * pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
697 Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
698 build_converted_constant_expr returned.
699 * typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
700 of maybe_constant_value.
701
702 2020-03-09 Jakub Jelinek <jakub@redhat.com>
703
704 PR c++/94067
705 Revert
706 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
707
708 * constexpr.c (cxx_eval_constant_expression): Do not handle
709 RROTATE_EXPR and LROTATE_EXPR.
710
711 2020-03-09 Marek Polacek <polacek@redhat.com>
712
713 PR c++/94050 - ABI issue with alignas on armv7hl.
714 * class.c (layout_class_type): Don't replace a class's
715 CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
716
717 2020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
718
719 * coroutines.cc (build_actor_fn): Factor out code inserting the
720 default return_void call to...
721 (morph_fn_to_coro): ...here, also hoist local var declarations.
722
723 2020-03-08 Patrick Palka <ppalka@redhat.com>
724
725 PR c++/93729
726 * call.c (convert_like_real): Check complain before emitting an error
727 about binding a bit-field to a reference.
728
729 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
730 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
731 TYPE_NAME.
732
733 2020-03-06 Nathan Sidwell <nathan@acm.org>
734
735 PR c++/94027
736 * mangle.c (find_substitution): Don't call same_type_p on template
737 args that cannot match.
738
739 2020-03-04 Martin Sebor <msebor@redhat.com>
740
741 PR c++/90938
742 * tree.c (type_initializer_zero_p): Fail for structs initialized
743 with non-structs.
744
745 2020-03-04 Jason Merrill <jason@redhat.com>
746
747 PR c++/90432
748 * init.c (perform_member_init): Don't do aggregate initialization of
749 empty field.
750 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
751 initialization of empty field.
752
753 2020-03-04 Martin Liska <mliska@suse.cz>
754
755 * method.c: Wrap array in ctor with braces in order
756 to silent clang warnings.
757
758 2020-03-03 Jason Merrill <jason@redhat.com>
759 Marek Polacek <polacek@redhat.com>
760
761 PR c++/90505 - mismatch in template argument deduction.
762 * pt.c (tsubst): Don't reduce the template level of template
763 parameters when tf_partial.
764
765 2020-03-03 Jakub Jelinek <jakub@redhat.com>
766
767 PR c++/93998
768 * constexpr.c (cxx_eval_constant_expression)
769 <case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
770 *non_constant_p is true.
771
772 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
773
774 * coroutines.cc (captures_temporary): Strip component_ref
775 to its base object.
776
777 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
778
779 * coroutines.cc (finish_co_await_expr): Build co_await_expr
780 with unknown_type_node.
781 (finish_co_yield_expr): Ditto.
782 *pt.c (type_dependent_expression_p): Set co_await/yield_expr
783 with unknown type as dependent.
784
785 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
786
787 * coroutines.cc (struct local_var_info): Adjust to remove the
788 reference to the captured var, and just to note that this is a
789 lambda capture proxy.
790 (transform_local_var_uses): Handle lambda captures specially.
791 (struct param_frame_data): Add a visited set.
792 (register_param_uses): Also check for param uses in lambda
793 capture proxies.
794 (struct local_vars_frame_data): Remove captures list.
795 (register_local_var_uses): Handle lambda capture proxies by
796 noting and bypassing them.
797 (morph_fn_to_coro): Update to remove lifetime extension of
798 lambda capture-by-copy vars.
799
800 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
801
802 * coroutines.cc (build_co_await): Do not build frame
803 awaitable proxy vars when the co_await expression is
804 a function parameter or local var.
805 (co_await_expander): Do not initialise a frame var with
806 itself.
807 (transform_await_expr): Only substitute the awaitable
808 frame var if it's needed.
809 (register_awaits): Do not make frame copies for param
810 or local vars that are awaitables.
811
812 2020-02-28 Jason Merrill <jason@redhat.com>
813
814 Implement P2092R0, Disambiguating Nested-Requirements
815 * parser.c (cp_parser_requirement_parameter_list): Pass
816 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
817
818 * call.c (build_user_type_conversion_1): Don't look at the second
819 conversion of a non-viable candidate.
820
821 2020-02-28 Jakub Jelinek <jakub@redhat.com>
822
823 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
824 * typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
825 functions in unevaluated contexts.
826
827 2020-02-27 Nathan Sidwell <nathan@acm.org>
828
829 PR c++/93933
830 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
831 cp_tree_equal.
832 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
833 * typeck.c (comptypes): Assert we don't get any argument packs.
834
835 * class.c (adjust_clone_args): Correct arg-checking assert.
836 * typeck.c (comptypes): Assert not nulls.
837
838 2020-02-26 Marek Polacek <polacek@redhat.com>
839
840 PR c++/93789 - ICE with invalid array bounds.
841 * decl.c (compute_array_index_type_loc): Don't use the folded
842 size when folding cleared TREE_CONSTANT.
843
844 2020-02-26 Iain Sandoe <iain@sandoe.co.uk>
845
846 * class.c (classtype_has_non_deleted_copy_ctor): New.
847 * coroutines.cc (struct param_info): Keep track of params
848 that are references, and cache the original type and whether
849 the DTOR is trivial.
850 (build_actor_fn): Handle param copies always, and adjust the
851 handling for references.
852 (register_param_uses): Only handle uses here.
853 (classtype_has_non_deleted_copy_ctor): New.
854 (morph_fn_to_coro): Adjust param copy handling to match n4849
855 by reordering ahead of the promise CTOR and always making a
856 frame copy, even if the param is unused in the coroutine body.
857 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
858
859 2020-02-26 Patrick Palka <ppalka@redhat.com>
860
861 * constraint.cc (finish_constraint_binary_op): Set expr's location range
862 to the range of its operands.
863 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
864 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
865 instead of the corresponding template arguments ARGS and adjust body
866 accordingly.
867 (diagnose_requires_expr): Likewise.
868 (diagnose_atomic_constraint): Likewise. When printing an atomic
869 constraint expression, print the instantiated parameter mapping
870 alongside it.
871 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
872 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
873 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
874
875 2020-02-26 Marek Polacek <polacek@redhat.com>
876
877 PR c++/93676 - value-init crash in template.
878 * init.c (build_new_1): Don't call build_vec_init in a template.
879
880 2020-02-26 Marek Polacek <polacek@redhat.com>
881
882 PR c++/93862 - ICE with static_cast when converting from int[].
883 * call.c (reference_compatible_p): No longer static.
884 * cp-tree.h (reference_compatible_p): Declare.
885 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
886 of reference_related_p.
887
888 2020-02-26 Marek Polacek <polacek@redhat.com>
889
890 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
891 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
892 field.
893
894 2020-02-24 Martin Sebor <msebor@redhat.com>
895
896 PR c++/93804
897 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
898 in shared C/C++ code in headers.
899 Remove a duplicate hunk of code.
900
901 2020-02-24 Marek Polacek <polacek@redhat.com>
902
903 PR c++/93869 - ICE with -Wmismatched-tags.
904 * parser.c (cp_parser_check_class_key): Check class_key earlier.
905
906 2020-02-24 Marek Polacek <polacek@redhat.com>
907
908 PR c++/93712 - ICE with ill-formed array list-initialization.
909 * call.c (next_conversion): Return NULL for ck_aggr.
910 (build_aggr_conv): Set u.expr instead of u.next.
911 (build_array_conv): Likewise.
912 (build_complex_conv): Likewise.
913 (conv_get_original_expr): Handle ck_aggr.
914
915 2020-02-24 Jakub Jelinek <jakub@redhat.com>
916
917 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
918 * call.c (build_over_call): Don't evaluate immediate functions in
919 unevaluated operands.
920
921 2020-02-24 Jason Merrill <jason@redhat.com>
922
923 P0780R2: Resolve lambda init-capture pack grammar.
924 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
925 ...&x=y.
926
927 2020-02-22 Marek Polacek <polacek@redhat.com>
928
929 PR c++/93882
930 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
931
932 2020-02-21 Martin Sebor <msebor@redhat.com>
933
934 PR gcov-profile/93753
935 * class.c (check_flexarrays): Tighten up a test for potential members
936 of anonymous structs or unions.
937
938 2020-02-20 Martin Sebor <msebor@redhat.com>
939
940 PR c++/93801
941 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
942
943 2020-02-20 Martin Liska <mliska@suse.cz>
944
945 PR translation/93841
946 * config/or1k/or1k.opt: Remove superfluous word.
947 * doc/invoke.texi: Likewise.
948
949 2020-02-20 Martin Liska <mliska@suse.cz>
950
951 PR translation/93838
952 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
953
954 2020-02-19 Marek Polacek <polacek@redhat.com>
955
956 PR c++/93169 - wrong-code with a non-constexpr constructor.
957 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
958 on constant CONSTRUCTORs.
959
960 2020-02-15 Marek Polacek <polacek@redhat.com>
961
962 PR c++/93710 - poor diagnostic for array initializer.
963 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
964 for an error call.
965
966 2020-02-15 Jason Merrill <jason@redhat.com>
967
968 PR c++/92556
969 * pt.c (any_template_parm_r): Look into lambda body.
970
971 PR c++/92583
972 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
973
974 2020-02-14 Jakub Jelinek <jakub@redhat.com>
975
976 PR c++/61414
977 * class.c (enum_min_precision): Change prec type from int to int &.
978
979 PR libstdc++/92906
980 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
981 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
982 (fallback_dfloat32_type, fallback_dfloat64_type,
983 fallback_dfloat128_type): Define.
984 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
985 dfloat*_type_node.
986 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
987 is disabled for compatibility.
988
989 2020-02-13 Jason Merrill <jason@redhat.com>
990
991 PR c++/93713
992 * name-lookup.c (matching_fn_p): A function does not match a
993 template.
994
995 PR c++/93643
996 PR c++/91476
997 * tree.c (decl_linkage): Always lk_none for locals.
998
999 2020-02-12 Jason Merrill <jason@redhat.com>
1000
1001 PR c++/92583
1002 PR c++/92654
1003 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
1004 * pt.c (find_parameter_packs_r): Not here.
1005
1006 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
1007
1008 * coroutines.cc (build_actor_fn): Implement deallocation function
1009 selection per n4849, dcl.fct.def.coroutine bullet 12.
1010 (morph_fn_to_coro): Implement allocation function selection per
1011 n4849, dcl.fct.def.coroutine bullets 9 and 10.
1012
1013 2020-02-12 Marek Polacek <polacek@redhat.com>
1014
1015 PR c++/93684 - ICE-on-invalid with broken attribute.
1016 * parser.c (cp_parser_std_attribute): Peek a token first before
1017 consuming it.
1018
1019 2020-02-11 Jason Merrill <jason@redhat.com>
1020
1021 PR c++/93675
1022 * class.c (add_implicitly_declared_members): Use do_friend.
1023 * method.c (implicitly_declare_fn): Fix friend handling.
1024 (decl_remember_implicit_trigger_p): New.
1025 (synthesize_method): Use it.
1026 * decl2.c (mark_used): Use it.
1027
1028 2020-02-11 Jason Merrill <jason@redhat.com>
1029
1030 PR c++/93650
1031 PR c++/90691
1032 * constexpr.c (maybe_constant_value): Correct earlier change.
1033 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
1034 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
1035
1036 2020-02-12 Patrick Palka <ppalka@redhat.com>
1037
1038 PR c++/69448
1039 PR c++/80471
1040 * type-utils.h (find_type_usage): Refactor to take a tree * and to
1041 return a tree *, and update documentation accordingly.
1042 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
1043 decltype(auto) node.
1044 (make_constrained_decltype_auto): No need to explicitly set
1045 AUTO_IS_DECLTYPE anymore.
1046 (splice_late_return_type): Use find_type_usage to find and
1047 replace a possibly nested auto node instead of using is_auto.
1048 Check test for is_auto into an assert when deciding whether
1049 to late_return_type.
1050 (type_uses_auto): Adjust the call to find_type_usage.
1051 * parser.c (cp_parser_decltype): No need to explicitly set
1052 AUTO_IS_DECLTYPE anymore.
1053
1054 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
1055 (dump_simple_decl): Handle standard concept definitions as well as
1056 variable concept definitions.
1057
1058 2020-02-10 Jakub Jelinek <jakub@redhat.com>
1059
1060 PR other/93641
1061 * error.c (dump_decl_name): Fix up last argument to strncmp.
1062
1063 2020-02-10 Jason Merrill <jason@redhat.com>
1064
1065 PR c++/93618
1066 * tree.c (array_of_unknown_bound_p): New.
1067 * init.c (perform_member_init): Do nothing for flexible arrays.
1068
1069 2020-02-09 Jakub Jelinek <jakub@redhat.com>
1070
1071 PR c++/93633
1072 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
1073 ARRAY_TYPE, use the element type. Punt if objtype after that is not
1074 a class type.
1075
1076 2020-02-08 Jason Merrill <jason@redhat.com>
1077
1078 PR c++/90691
1079 * expr.c (fold_for_warn): Call maybe_constant_value.
1080 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
1081 (maybe_constant_value): Add uid_sensitive parm.
1082 (get_fundef_copy): Don't copy if it's true.
1083 (cxx_eval_call_expression): Don't instantiate if it's true.
1084 (cxx_eval_outermost_constant_expr): Likewise.
1085
1086 PR c++/92852
1087 * constexpr.c (maybe_constant_value): Don't unshare if the cached
1088 value is the same as the argument.
1089
1090 * typeck.c (maybe_warn_about_returning_address_of_local): Add
1091 location parameter.
1092
1093 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
1094 if appropriate.
1095
1096 2020-02-08 Jakub Jelinek <jakub@redhat.com>
1097
1098 PR c++/93549
1099 * constexpr.c (find_array_ctor_elt): If last element has no index,
1100 for flag_checking verify all elts have no index. If i is within the
1101 elts, return it directly, if it is right after the last elt, append
1102 if NULL index, otherwise force indexes on all elts.
1103 (cxx_eval_store_expression): Allow cep->index to be NULL.
1104
1105 2020-02-07 Marek Polacek <polacek@redhat.com>
1106
1107 PR c++/92947 - Paren init of aggregates in unevaluated context.
1108 * call.c (build_new_method_call_1): Don't check
1109 cp_unevaluated_operand. Check the return value of digest_init.
1110
1111 2020-02-06 Jason Merrill <jason@redhat.com>
1112
1113 PR c++/92654
1114 * tree.c (cp_walk_subtrees): Walk into type template arguments.
1115 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
1116 instead of TYPE_ALIAS_P.
1117 * pt.c (push_template_decl_real): Likewise.
1118 (find_parameter_packs_r): Likewise. Remove dead code.
1119 * error.c (find_typenames_r): Remove dead code.
1120
1121 2020-02-06 Jason Merrill <jason@redhat.com>
1122
1123 PR c++/92517
1124 * parser.c (cp_parser_constraint_primary_expression): Do the main
1125 parse non-tentatively.
1126
1127 2020-02-06 Marek Polacek <polacek@redhat.com>
1128
1129 PR c++/93597 - ICE with lambda in operator function.
1130 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
1131
1132 2020-02-05 Jason Merrill <jason@redhat.com>
1133
1134 PR c++/93140
1135 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
1136 handling of TREE_CHAIN for empty pack.
1137
1138 2020-02-05 Jakub Jelinek <jakub@redhat.com>
1139
1140 PR c++/93557
1141 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
1142 prior to passing it to c_build_vec_convert.
1143
1144 2020-02-05 Marek Polacek <polacek@redhat.com>
1145
1146 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
1147 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
1148 TREE_SIDE_EFFECTS.
1149
1150 2020-02-05 Jason Merrill <jason@redhat.com>
1151
1152 PR c++/92593
1153 * decl.c (grokdeclarator): Reject field of current class type even
1154 in a template.
1155
1156 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
1157
1158 * coroutines.cc (maybe_promote_captured_temps): Increase the index
1159 number for temporary variables' name.
1160
1161 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
1162
1163 * coroutines.cc (build_co_await): Call convert_from_reference
1164 to wrap co_await_expr with indirect_ref which avoid
1165 reference/non-reference type confusion.
1166
1167 (co_await_expander): Sink to call_expr if await_resume
1168 is wrapped by indirect_ref.
1169
1170 2020-02-04 Jason Merrill <jason@redhat.com>
1171
1172 PR c++/93551
1173 * constraint.cc (satisfy_declaration_constraints): Check return
1174 value of push_tinst_level.
1175
1176 PR c++/90951
1177 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
1178 elements instead of value-initializing them.
1179
1180 PR c++/86917
1181 * init.c (perform_member_init): Simplify.
1182 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
1183 flexarray.
1184 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
1185
1186 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
1187
1188 * coroutines.cc (find_promise_type): Delete unused forward
1189 declaration.
1190 (struct coroutine_info): Add a bool for no promise type error.
1191 (coro_promise_type_found_p): Only emit the error for a missing
1192 promise once in each affected coroutine.
1193
1194 2020-02-03 Jason Merrill <jason@redhat.com>
1195
1196 PR c++/66477
1197 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
1198 defer loading the value of a reference.
1199
1200 2020-02-03 Jason Merrill <jason@redhat.com>
1201
1202 PR c++/91953
1203 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
1204 empty class type.
1205 [COMPONENT_REF]: A member function reference doesn't use the object
1206 as an rvalue.
1207
1208 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
1209
1210 PR c++/93458
1211 * coroutines.cc (struct coroutine_info): Add a bool flag to note
1212 that we emitted an error for a bad function return type.
1213 (get_coroutine_info): Tolerate an unset info table in case of
1214 missing traits.
1215 (find_coro_traits_template_decl): In case of error or if we didn't
1216 find a type template, note we emitted the error and suppress
1217 duplicates.
1218 (find_coro_handle_template_decl): Likewise.
1219 (instantiate_coro_traits): Only check for error_mark_node in the
1220 return from lookup_qualified_name.
1221 (coro_promise_type_found_p): Reorder initialization so that we check
1222 for the traits and their usability before allocation of the info
1223 table. Check for a suitable return type and emit a diagnostic for
1224 here instead of relying on the lookup machinery. This allows the
1225 error to have a better location, and means we can suppress multiple
1226 copies.
1227 (coro_function_valid_p): Re-check for a valid promise (and thus the
1228 traits) before proceeding. Tolerate missing info as a fatal error.
1229
1230 2020-02-03 Jason Merrill <jason@redhat.com>
1231
1232 PR c++/88256
1233 * cp-gimplify.c (predeclare_vla): New.
1234 (cp_genericize_r) [NOP_EXPR]: Call it.
1235
1236 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
1237
1238 * coroutines.cc (transform_await_wrapper): Set actor funcion as
1239 new context of label_decl.
1240 (build_actor_fn): Fill new field of await_xform_data.
1241
1242 2020-02-02 Marek Polacek <polacek@redhat.com>
1243
1244 PR c++/93530 - ICE on invalid alignas in a template.
1245 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
1246 decl_attributes.
1247
1248 2020-01-31 Jason Merrill <jason@redhat.com>
1249
1250 PR c++/86216
1251 * semantics.c (process_outer_var_ref): Capture VLAs even in
1252 unevaluated context.
1253
1254 PR c++/14179
1255 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
1256 non-aggregate elements.
1257 (reshape_init_array): Add first_initializer_p parm.
1258 (reshape_init_r): Change first_initializer_p from bool to tree.
1259 (reshape_init): Pass init to it.
1260
1261 PR c++/14179
1262 * parser.c (cp_parser_initializer_list): Suppress location wrappers
1263 after 256 elements.
1264
1265 2020-01-29 Jason Merrill <jason@redhat.com>
1266
1267 PR c++/82521
1268 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
1269 the expression was dependent before substitution.
1270
1271 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
1272
1273 * coroutines.cc (act_des_fn): New.
1274 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
1275 Access promise via actor function's frame pointer argument.
1276 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
1277
1278 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
1279
1280 * coroutines.cc (co_await_expander): Handle type conversion case.
1281
1282 2020-01-29 Jason Merrill <jason@redhat.com>
1283
1284 PR c++/90333
1285 PR c++/89640
1286 PR c++/60503
1287 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
1288 a trailing return type.
1289 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
1290 parens.
1291
1292 2020-01-29 Marek Polacek <polacek@redhat.com>
1293
1294 PR c++/91754 - Fix template arguments comparison with class NTTP.
1295 * pt.c (class_nttp_const_wrapper_p): New.
1296 (template_args_equal): See through class_nttp_const_wrapper_p
1297 arguments.
1298
1299 2020-01-29 Marek Polacek <polacek@redhat.com>
1300
1301 PR c++/92948 - Fix class NTTP with template arguments.
1302 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
1303 converting a value-dependent expression to a class type.
1304 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
1305 as the result of the tsubst_copy call.
1306
1307 2020-01-29 Jakub Jelinek <jakub@redhat.com>
1308
1309 PR c++/91118
1310 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
1311 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
1312
1313 2020-01-28 Jason Merrill <jason@redhat.com>
1314
1315 PR c++/93442
1316 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
1317
1318 PR c++/93477
1319 PR c++/91476
1320 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
1321
1322 PR c++/90546
1323 * call.c (build_user_type_conversion_1): Allow a template conversion
1324 returning an rvalue reference to bind directly to an lvalue.
1325
1326 PR c++/90731
1327 * decl.c (grokdeclarator): Propagate eh spec from typedef.
1328
1329 2020-01-28 Martin Liska <mliska@suse.cz>
1330
1331 PR c++/92440
1332 * pt.c (redeclare_class_template): Group couple of
1333 errors and inform messages with auto_diagnostic_group.
1334
1335 2020-01-28 Martin Liska <mliska@suse.cz>
1336
1337 PR c++/92440
1338 * pt.c (redeclare_class_template): Use inform
1339 for the second location.
1340
1341 2020-01-27 Jason Merrill <jason@redhat.com>
1342
1343 PR c++/90966
1344 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
1345
1346 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
1347
1348 PR c++/93443
1349 * coroutines.cc (morph_fn_to_coro): Check the ramp return
1350 value when it is constructed from the 'get return object'.
1351
1352 2020-01-27 Nathan Sidwell <nathan@acm.org>
1353
1354 PR c++/91826
1355 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
1356
1357 2020-01-26 Jason Merrill <jason@redhat.com>
1358
1359 PR c++/90992
1360 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
1361 temporarily enable -Wsystem-headers. Change second warning to
1362 conditional inform.
1363
1364 PR c++/90997
1365 * semantics.c (finish_call_expr): Don't call
1366 instantiate_non_dependent_expr before warn_for_memset.
1367
1368 2020-01-25 Marek Polacek <polacek@redhat.com>
1369
1370 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
1371 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
1372 dynamic_cast diagnostic.
1373
1374 2020-01-24 Jason Merrill <jason@redhat.com>
1375
1376 PR c++/93400 - ICE with constrained friend.
1377 * constraint.cc (maybe_substitute_reqs_for): New.
1378 * decl.c (function_requirements_equivalent_p): Call it.
1379 * pt.c (tsubst_friend_function): Only substitute
1380 TEMPLATE_PARMS_CONSTRAINTS.
1381 (tsubst_template_parms): Copy constraints.
1382
1383 2020-01-24 Jason Merrill <jason@redhat.com>
1384
1385 PR c++/93279 - ICE with lambda in member operator.
1386 * name-lookup.c (maybe_save_operator_binding): Don't remember
1387 class-scope bindings.
1388
1389 2020-01-24 Jason Merrill <jason@redhat.com>
1390
1391 PR c++/93377 - ICE with member alias in constraint.
1392 * pt.c (any_template_parm_r): Look at template arguments for all
1393 aliases, not only alias templates.
1394
1395 2020-01-24 Marek Polacek <polacek@redhat.com>
1396
1397 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
1398 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
1399
1400 2020-01-24 Jason Merrill <jason@redhat.com>
1401
1402 PR c++/92852 - ICE with generic lambda and reference var.
1403 * constexpr.c (maybe_constant_value): Likewise.
1404
1405 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
1406
1407 PR c++/92804
1408 * parser.c (cp_parser_nested_name_specifier_opt): Properly
1409 diagnose concept-ids.
1410
1411 2020-01-23 Jason Merrill <jason@redhat.com>
1412
1413 PR c++/93331 - ICE with __builtin_strchr.
1414 * constexpr.c (cxx_eval_builtin_function_call): Use the original
1415 argument if we didn't manage to extract a STRING_CST.
1416
1417 PR c++/93345 - ICE with defaulted dtor and template.
1418 PR c++/33799
1419 * decl.c (cxx_maybe_build_cleanup): Don't try to set
1420 throwing_cleanup in a template.
1421
1422 2020-01-22 Marek Polacek <polacek@redhat.com>
1423
1424 PR c++/92907 - noexcept does not consider "const" in member functions.
1425 * g++.dg/cpp0x/noexcept56.C: New test.
1426
1427 2020-01-22 Marek Polacek <polacek@redhat.com>
1428
1429 PR c++/93324 - ICE with -Wall on constexpr if.
1430 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
1431
1432 2020-01-22 Patrick Palka <ppalka@redhat.com>
1433
1434 * constraint.cc (get_mapped_args): Avoid using auto_vec
1435 as a vector element. Release the vectors inside the lists
1436 vector.
1437 * parser.c (cp_literal_operator_id): Free the buffer.
1438
1439 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
1440
1441 * coroutines.cc (finish_co_await_expr): Add error check on return
1442 value of build_co_await.
1443 (finish_co_yield_expr,): Ditto.
1444
1445 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
1446
1447 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
1448 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
1449 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
1450
1451 2020-01-21 Jason Merrill <jason@redhat.com>
1452
1453 PR c++/60855 - ICE with sizeof VLA capture.
1454 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
1455
1456 PR c++/90732 - ICE with VLA capture and generic lambda.
1457 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
1458
1459 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
1460 Bin Cheng <bin.cheng@linux.alibaba.com>
1461
1462 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
1463 from complete_type_or_else.
1464 (register_param_uses): Likewise.
1465 (build_co_await): Do not try to use complete_type_or_else for void
1466 types, otherwise for incomplete types, check for NULL return from
1467 complete_type_or_else.
1468
1469 2020-01-21 Jason Merrill <jason@redhat.com>
1470
1471 PR c++/91476 - anon-namespace reference temp clash between TUs.
1472 * decl2.c (copy_linkage): Factor out of get_guard.
1473 * call.c (make_temporary_var_for_ref_to_temp): Use it.
1474 * decl.c (cp_finish_decomp): Use it.
1475 (cp_finish_decl): determine_visibility sooner.
1476
1477 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
1478
1479 * coroutines.cc (finish_co_await_expr): Set return value flag.
1480 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
1481
1482 2020-01-19 Jason Merrill <jason@redhat.com>
1483
1484 PR c++/33799 - destroy return value, take 2.
1485 * cp-tree.h (current_retval_sentinel): New macro.
1486 (struct language_function): Add throwing_cleanup bitfield.
1487 * decl.c (cxx_maybe_build_cleanup): Set it.
1488 * except.c (maybe_set_retval_sentinel)
1489 (maybe_splice_retval_cleanup): New functions.
1490 * parser.c (cp_parser_compound_statement): Call
1491 maybe_splice_retval_cleanup.
1492 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
1493
1494 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
1495
1496 2020-01-18 Jakub Jelinek <jakub@redhat.com>
1497
1498 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
1499 but non-NO_DOLLAR_IN_LABEL case build.
1500
1501 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
1502
1503 * Make-lang.in: Add coroutines.o.
1504 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
1505 (DECL_COROUTINE_P): New.
1506 * lex.c (init_reswords): Enable keywords when the coroutine flag
1507 is set,
1508 * operators.def (co_await): New operator.
1509 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
1510 (op_error): Likewise.
1511 (build_new_op_1): Likewise.
1512 (build_new_function_call): Validate coroutine builtin arguments.
1513 * constexpr.c (potential_constant_expression_1): Handle
1514 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
1515 * coroutines.cc: New file.
1516 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
1517 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
1518 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
1519 * cp-tree.h (coro_validate_builtin_call): New.
1520 * decl.c (emit_coro_helper): New.
1521 (finish_function): Handle the case when a function is found to
1522 be a coroutine, perform the outlining and emit the outlined
1523 functions. Set a bit to signal that this is a coroutine component.
1524 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
1525 (cp_parser_unary_expression): Handle co_await.
1526 (cp_parser_assignment_expression): Handle co_yield.
1527 (cp_parser_statement): Handle RID_CO_RETURN.
1528 (cp_parser_jump_statement): Handle co_return.
1529 (cp_parser_operator): Handle co_await operator.
1530 (cp_parser_yield_expression): New.
1531 (cp_parser_required_error): Handle RT_CO_YIELD.
1532 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
1533 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
1534 CO_RETURN_EXPRs.
1535 * tree.c (cp_walk_subtrees): Likewise.
1536
1537 2020-01-17 Jason Merrill <jason@redhat.com>
1538
1539 PR c++/92531 - ICE with noexcept(lambda).
1540 * pt.c (uses_template_parms): Don't try to enumerate all the
1541 expression cases.
1542
1543 2020-01-17 Jakub Jelinek <jakub@redhat.com>
1544
1545 PR c++/93228
1546 * parser.c (cp_parser_template_name): Look up deprecated attribute
1547 in DECL_TEMPLATE_RESULT or its type's attributes.
1548
1549 2020-01-16 Jason Merrill <jason@redhat.com>
1550
1551 PR c++/93286 - ICE with __is_constructible and variadic template.
1552 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
1553 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
1554
1555 PR c++/93280 - ICE with aggregate assignment and DMI.
1556 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
1557 * typeck2.c (digest_nsdmi_init): Not here.
1558
1559 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
1560
1561 PR c++/91073
1562 * cp-tree.h (is_constrained_auto): New.
1563 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
1564 handle concept-check expressions; take a cp_decl_specifier_seq*
1565 instead of a bool.
1566 (cp_parser_condition): Update call.
1567 (cp_parser_simple_declaration): Likewise.
1568 (cp_parser_placeholder_type_specifier): Correctly handle
1569 concept-check expressions.
1570
1571 2020-01-15 Jason Merrill <jason@redhat.com>
1572
1573 Revert
1574 PR c++/33799 - destroy return value if local cleanup throws.
1575 * cp-tree.h (current_retval_sentinel): New macro.
1576 * decl.c (start_preparsed_function): Set up cleanup for retval.
1577 * typeck.c (check_return_expr): Set current_retval_sentinel.
1578
1579 PR c++/93257 - consteval void function.
1580 * constexpr.c (verify_constant): Allow void_node.
1581
1582 PR c++/92871 - bad code with xvalue and GNU ?: extension.
1583 * call.c (prevent_lifetime_extension): New.
1584 (build_conditional_expr_1): Use it.
1585
1586 2020-01-14 Nathan Sidwell <nathan@acm.org>
1587
1588 PR c++/90916
1589 * pt.c (retrieve_specialization): Use get_template_info, not open
1590 coding access.
1591
1592 PR c++/90916
1593 * pt.c (retrieve_specialization): Get the TI from the decl or the
1594 classtype as appropriate.
1595
1596 2020-01-14 David Malcolm <dmalcolm@redhat.com>
1597
1598 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
1599 New static constant.
1600 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
1601 (struct named_label_hash::empty_zero_p): Likewise.
1602 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
1603
1604 2020-01-14 Jason Merrill <jason@redhat.com>
1605
1606 PR c++/92590 - wrong handling of inherited default ctor.
1607 * class.c (add_method): A constrained inherited ctor doesn't hide an
1608 implicit derived ctor.
1609 Revert:
1610 PR c++/92552 - ICE with inherited constrained default ctor.
1611 * pt.c (instantiate_class_template_1): Copy
1612 TYPE_HAS_USER_CONSTRUCTOR.
1613 PR c++/91930 - ICE with constrained inherited default ctor.
1614 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
1615 for inherited constructor.
1616 PR c++/92594 - ICE with inherited trivial default ctor.
1617 * method.c (trivial_fn_p): Treat an inherited default constructor
1618 like a normal default constructor.
1619
1620 PR c++/92594 - ICE with inherited trivial default ctor.
1621 * method.c (trivial_fn_p): Treat an inherited default constructor
1622 like a normal default constructor.
1623
1624 PR c++/92009 - ICE with punning of typeid.
1625 * rtti.c (get_tinfo_desc): Call xref_basetypes.
1626 * constexpr.c (cxx_fold_indirect_ref): Don't strip
1627 REINTERPRET_CAST_P.
1628
1629 2020-01-13 Jason Merrill <jason@redhat.com>
1630
1631 PR c++/92746 - ICE with noexcept of function concept check.
1632 * except.c (check_noexcept_r): Handle concept-check.
1633
1634 PR c++/92582 - ICE with member template as requirement.
1635 * pt.c (struct find_template_parameter_info): Add ctx_parms.
1636 (any_template_parm_r): Handle TEMPLATE_DECL.
1637 (find_template_parameters): Take parms instead of their depth.
1638 * constraint.cc (build_parameter_mapping): Pass them.
1639
1640 PR c++/33799 - destroy return value if local cleanup throws.
1641 * cp-tree.h (current_retval_sentinel): New macro.
1642 * decl.c (start_preparsed_function): Set up cleanup for retval.
1643 * typeck.c (check_return_expr): Set current_retval_sentinel.
1644
1645 PR c++/93238 - short right-shift with enum.
1646 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
1647
1648 2020-01-10 Jason Merrill <jason@redhat.com>
1649
1650 * typeck.c (cp_build_binary_op): Restore short_shift code.
1651
1652 PR c++/93143 - incorrect tree sharing with constexpr.
1653 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
1654 CONSTRUCTORs are already unshared.
1655
1656 PR c++/93173 - incorrect tree sharing.
1657 PR c++/93033
1658 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
1659 copy_if_shared after cp_genericize_tree.
1660 * typeck2.c (split_nonconstant_init): Don't unshare here.
1661
1662 2020-01-08 Jason Merrill <jason@redhat.com>
1663
1664 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
1665 TARGET_EXPR_DIRECT_INIT_P.
1666 * constexpr.c (cxx_eval_constant_expression): Likewise.
1667
1668 2020-01-08 Jason Merrill <jason@redhat.com>
1669
1670 PR c++/91369 - constexpr destructor and member initializer.
1671 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
1672 when not preevaluating.
1673
1674 2020-01-08 Jason Merrill <jason@redhat.com>
1675
1676 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
1677 support.
1678
1679 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
1680
1681 * init.c (build_new): Add location_t parameter and use it throughout.
1682 (build_raw_new_expr): Likewise.
1683 * parser.c (cp_parser_new_expression): Pass the combined_loc.
1684 * pt.c (tsubst_copy_and_build): Adjust call.
1685 * cp-tree.h: Update declarations.
1686
1687 2020-01-07 Jason Merrill <jason@redhat.com>
1688
1689 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
1690 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
1691 explicit class visibility for a template.
1692
1693 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
1694
1695 * mangle.c (mangle_type_attribute_p): New function, split out from...
1696 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
1697 that contain a space.
1698
1699 2020-01-07 Jakub Jelinek <jakub@redhat.com>
1700
1701 PR c++/91369
1702 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
1703 member, initialize it to zero in ctor.
1704 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
1705 a heap object. Don't cache calls to functions which allocate some
1706 heap objects and don't deallocate them or deallocate some heap
1707 objects they didn't allocate.
1708
1709 2020-01-06 Jason Merrill <jason@redhat.com>
1710
1711 PR c++/92552 - ICE with inherited constrained default ctor.
1712 * pt.c (instantiate_class_template_1): Copy
1713 TYPE_HAS_USER_CONSTRUCTOR.
1714 * class.c (one_inherited_ctor): Don't set it here.
1715
1716 2020-01-06 Andrew Sutton <asutton@lock3software.com>
1717
1718 PR c++/92739 - parsing requires clause with attributes.
1719 * parser.c (cp_parser_constraint_requires_parens): Exclude
1720 attributes as postfix expressions.
1721
1722 2020-01-05 Jakub Jelinek <jakub@redhat.com>
1723
1724 PR c++/93138
1725 * parser.c (cp_parser_check_class_key): Disable access checks for the
1726 simple name lookup.
1727 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
1728 !warn_redundant_tags.
1729
1730 2010-01-05 Jakub Jelinek <jakub@redhat.com>
1731
1732 PR c++/93046
1733 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
1734 TARGET_EXPR if it has been gimplified already.
1735
1736 2020-01-03 Jason Merrill <jason@redhat.com>
1737
1738 PR c++/93033 - incorrect tree node sharing with array init.
1739 * typeck2.c (split_nonconstant_init): Unshare non-decl.
1740 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
1741
1742 2020-01-02 Jason Merrill <jason@redhat.com>
1743
1744 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
1745 C++17.
1746
1747 2020-01-02 Jakub Jelinek <jakub@redhat.com>
1748
1749 PR c/90677
1750 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
1751 has not been found, rather than error_mark_node.
1752
1753 2020-01-01 Jakub Jelinek <jakub@redhat.com>
1754
1755 Update copyright years.
1756 \f
1757 Copyright (C) 2020 Free Software Foundation, Inc.
1758
1759 Copying and distribution of this file, with or without modification,
1760 are permitted in any medium without royalty provided the copyright
1761 notice and this notice are preserved.