c++: Fix TREE_SIDE_EFFECTS after digest_init.
[gcc.git] / gcc / cp / ChangeLog
1 2020-02-08 Jason Merrill <jason@redhat.com>
2
3 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
4 if appropriate.
5
6 2020-02-08 Jakub Jelinek <jakub@redhat.com>
7
8 PR c++/93549
9 * constexpr.c (find_array_ctor_elt): If last element has no index,
10 for flag_checking verify all elts have no index. If i is within the
11 elts, return it directly, if it is right after the last elt, append
12 if NULL index, otherwise force indexes on all elts.
13 (cxx_eval_store_expression): Allow cep->index to be NULL.
14
15 2020-02-07 Marek Polacek <polacek@redhat.com>
16
17 PR c++/92947 - Paren init of aggregates in unevaluated context.
18 * call.c (build_new_method_call_1): Don't check
19 cp_unevaluated_operand. Check the return value of digest_init.
20
21 2020-02-06 Jason Merrill <jason@redhat.com>
22
23 PR c++/92654
24 * tree.c (cp_walk_subtrees): Walk into type template arguments.
25 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
26 instead of TYPE_ALIAS_P.
27 * pt.c (push_template_decl_real): Likewise.
28 (find_parameter_packs_r): Likewise. Remove dead code.
29 * error.c (find_typenames_r): Remove dead code.
30
31 2020-02-06 Jason Merrill <jason@redhat.com>
32
33 PR c++/92517
34 * parser.c (cp_parser_constraint_primary_expression): Do the main
35 parse non-tentatively.
36
37 2020-02-06 Marek Polacek <polacek@redhat.com>
38
39 PR c++/93597 - ICE with lambda in operator function.
40 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
41
42 2020-02-05 Jason Merrill <jason@redhat.com>
43
44 PR c++/93140
45 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
46 handling of TREE_CHAIN for empty pack.
47
48 2020-02-05 Jakub Jelinek <jakub@redhat.com>
49
50 PR c++/93557
51 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
52 prior to passing it to c_build_vec_convert.
53
54 2020-02-05 Marek Polacek <polacek@redhat.com>
55
56 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
57 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
58 TREE_SIDE_EFFECTS.
59
60 2020-02-05 Jason Merrill <jason@redhat.com>
61
62 PR c++/92593
63 * decl.c (grokdeclarator): Reject field of current class type even
64 in a template.
65
66 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
67
68 * coroutines.cc (maybe_promote_captured_temps): Increase the index
69 number for temporary variables' name.
70
71 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
72
73 * coroutines.cc (build_co_await): Call convert_from_reference
74 to wrap co_await_expr with indirect_ref which avoid
75 reference/non-reference type confusion.
76
77 (co_await_expander): Sink to call_expr if await_resume
78 is wrapped by indirect_ref.
79
80 2020-02-04 Jason Merrill <jason@redhat.com>
81
82 PR c++/93551
83 * constraint.cc (satisfy_declaration_constraints): Check return
84 value of push_tinst_level.
85
86 PR c++/90951
87 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
88 elements instead of value-initializing them.
89
90 PR c++/86917
91 * init.c (perform_member_init): Simplify.
92 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
93 flexarray.
94 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
95
96 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
97
98 * coroutines.cc (find_promise_type): Delete unused forward
99 declaration.
100 (struct coroutine_info): Add a bool for no promise type error.
101 (coro_promise_type_found_p): Only emit the error for a missing
102 promise once in each affected coroutine.
103
104 2020-02-03 Jason Merrill <jason@redhat.com>
105
106 PR c++/66477
107 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
108 defer loading the value of a reference.
109
110 2020-02-03 Jason Merrill <jason@redhat.com>
111
112 PR c++/91953
113 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
114 empty class type.
115 [COMPONENT_REF]: A member function reference doesn't use the object
116 as an rvalue.
117
118 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
119
120 PR c++/93458
121 * coroutines.cc (struct coroutine_info): Add a bool flag to note
122 that we emitted an error for a bad function return type.
123 (get_coroutine_info): Tolerate an unset info table in case of
124 missing traits.
125 (find_coro_traits_template_decl): In case of error or if we didn't
126 find a type template, note we emitted the error and suppress
127 duplicates.
128 (find_coro_handle_template_decl): Likewise.
129 (instantiate_coro_traits): Only check for error_mark_node in the
130 return from lookup_qualified_name.
131 (coro_promise_type_found_p): Reorder initialization so that we check
132 for the traits and their usability before allocation of the info
133 table. Check for a suitable return type and emit a diagnostic for
134 here instead of relying on the lookup machinery. This allows the
135 error to have a better location, and means we can suppress multiple
136 copies.
137 (coro_function_valid_p): Re-check for a valid promise (and thus the
138 traits) before proceeding. Tolerate missing info as a fatal error.
139
140 2020-02-03 Jason Merrill <jason@redhat.com>
141
142 PR c++/88256
143 * cp-gimplify.c (predeclare_vla): New.
144 (cp_genericize_r) [NOP_EXPR]: Call it.
145
146 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
147
148 * coroutines.cc (transform_await_wrapper): Set actor funcion as
149 new context of label_decl.
150 (build_actor_fn): Fill new field of await_xform_data.
151
152 2020-02-02 Marek Polacek <polacek@redhat.com>
153
154 PR c++/93530 - ICE on invalid alignas in a template.
155 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
156 decl_attributes.
157
158 2020-01-31 Jason Merrill <jason@redhat.com>
159
160 PR c++/86216
161 * semantics.c (process_outer_var_ref): Capture VLAs even in
162 unevaluated context.
163
164 PR c++/14179
165 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
166 non-aggregate elements.
167 (reshape_init_array): Add first_initializer_p parm.
168 (reshape_init_r): Change first_initializer_p from bool to tree.
169 (reshape_init): Pass init to it.
170
171 PR c++/14179
172 * parser.c (cp_parser_initializer_list): Suppress location wrappers
173 after 256 elements.
174
175 2020-01-29 Jason Merrill <jason@redhat.com>
176
177 PR c++/82521
178 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
179 the expression was dependent before substitution.
180
181 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
182
183 * coroutines.cc (act_des_fn): New.
184 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
185 Access promise via actor function's frame pointer argument.
186 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
187
188 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
189
190 * coroutines.cc (co_await_expander): Handle type conversion case.
191
192 2020-01-29 Jason Merrill <jason@redhat.com>
193
194 PR c++/90333
195 PR c++/89640
196 PR c++/60503
197 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
198 a trailing return type.
199 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
200 parens.
201
202 2020-01-29 Marek Polacek <polacek@redhat.com>
203
204 PR c++/91754 - Fix template arguments comparison with class NTTP.
205 * pt.c (class_nttp_const_wrapper_p): New.
206 (template_args_equal): See through class_nttp_const_wrapper_p
207 arguments.
208
209 2020-01-29 Marek Polacek <polacek@redhat.com>
210
211 PR c++/92948 - Fix class NTTP with template arguments.
212 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
213 converting a value-dependent expression to a class type.
214 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
215 as the result of the tsubst_copy call.
216
217 2020-01-29 Jakub Jelinek <jakub@redhat.com>
218
219 PR c++/91118
220 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
221 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
222
223 2020-01-28 Jason Merrill <jason@redhat.com>
224
225 PR c++/93442
226 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
227
228 PR c++/93477
229 PR c++/91476
230 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
231
232 PR c++/90546
233 * call.c (build_user_type_conversion_1): Allow a template conversion
234 returning an rvalue reference to bind directly to an lvalue.
235
236 PR c++/90731
237 * decl.c (grokdeclarator): Propagate eh spec from typedef.
238
239 2020-01-28 Martin Liska <mliska@suse.cz>
240
241 PR c++/92440
242 * pt.c (redeclare_class_template): Group couple of
243 errors and inform messages with auto_diagnostic_group.
244
245 2020-01-28 Martin Liska <mliska@suse.cz>
246
247 PR c++/92440
248 * pt.c (redeclare_class_template): Use inform
249 for the second location.
250
251 2020-01-27 Jason Merrill <jason@redhat.com>
252
253 PR c++/90966
254 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
255
256 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
257
258 PR c++/93443
259 * coroutines.cc (morph_fn_to_coro): Check the ramp return
260 value when it is constructed from the 'get return object'.
261
262 2020-01-27 Nathan Sidwell <nathan@acm.org>
263
264 PR c++/91826
265 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
266
267 2020-01-26 Jason Merrill <jason@redhat.com>
268
269 PR c++/90992
270 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
271 temporarily enable -Wsystem-headers. Change second warning to
272 conditional inform.
273
274 PR c++/90997
275 * semantics.c (finish_call_expr): Don't call
276 instantiate_non_dependent_expr before warn_for_memset.
277
278 2020-01-25 Marek Polacek <polacek@redhat.com>
279
280 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
281 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
282 dynamic_cast diagnostic.
283
284 2020-01-24 Jason Merrill <jason@redhat.com>
285
286 PR c++/93400 - ICE with constrained friend.
287 * constraint.cc (maybe_substitute_reqs_for): New.
288 * decl.c (function_requirements_equivalent_p): Call it.
289 * pt.c (tsubst_friend_function): Only substitute
290 TEMPLATE_PARMS_CONSTRAINTS.
291 (tsubst_template_parms): Copy constraints.
292
293 2020-01-24 Jason Merrill <jason@redhat.com>
294
295 PR c++/93279 - ICE with lambda in member operator.
296 * name-lookup.c (maybe_save_operator_binding): Don't remember
297 class-scope bindings.
298
299 2020-01-24 Jason Merrill <jason@redhat.com>
300
301 PR c++/93377 - ICE with member alias in constraint.
302 * pt.c (any_template_parm_r): Look at template arguments for all
303 aliases, not only alias templates.
304
305 2020-01-24 Marek Polacek <polacek@redhat.com>
306
307 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
308 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
309
310 2020-01-24 Jason Merrill <jason@redhat.com>
311
312 PR c++/92852 - ICE with generic lambda and reference var.
313 * constexpr.c (maybe_constant_value): Likewise.
314
315 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
316
317 PR c++/92804
318 * parser.c (cp_parser_nested_name_specifier_opt): Properly
319 diagnose concept-ids.
320
321 2020-01-23 Jason Merrill <jason@redhat.com>
322
323 PR c++/93331 - ICE with __builtin_strchr.
324 * constexpr.c (cxx_eval_builtin_function_call): Use the original
325 argument if we didn't manage to extract a STRING_CST.
326
327 PR c++/93345 - ICE with defaulted dtor and template.
328 PR c++/33799
329 * decl.c (cxx_maybe_build_cleanup): Don't try to set
330 throwing_cleanup in a template.
331
332 2020-01-22 Marek Polacek <polacek@redhat.com>
333
334 PR c++/92907 - noexcept does not consider "const" in member functions.
335 * g++.dg/cpp0x/noexcept56.C: New test.
336
337 2020-01-22 Marek Polacek <polacek@redhat.com>
338
339 PR c++/93324 - ICE with -Wall on constexpr if.
340 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
341
342 2020-01-22 Patrick Palka <ppalka@redhat.com>
343
344 * constraint.cc (get_mapped_args): Avoid using auto_vec
345 as a vector element. Release the vectors inside the lists
346 vector.
347 * parser.c (cp_literal_operator_id): Free the buffer.
348
349 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
350
351 * coroutines.cc (finish_co_await_expr): Add error check on return
352 value of build_co_await.
353 (finish_co_yield_expr,): Ditto.
354
355 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
356
357 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
358 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
359 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
360
361 2020-01-21 Jason Merrill <jason@redhat.com>
362
363 PR c++/60855 - ICE with sizeof VLA capture.
364 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
365
366 PR c++/90732 - ICE with VLA capture and generic lambda.
367 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
368
369 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
370 Bin Cheng <bin.cheng@linux.alibaba.com>
371
372 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
373 from complete_type_or_else.
374 (register_param_uses): Likewise.
375 (build_co_await): Do not try to use complete_type_or_else for void
376 types, otherwise for incomplete types, check for NULL return from
377 complete_type_or_else.
378
379 2020-01-21 Jason Merrill <jason@redhat.com>
380
381 PR c++/91476 - anon-namespace reference temp clash between TUs.
382 * decl2.c (copy_linkage): Factor out of get_guard.
383 * call.c (make_temporary_var_for_ref_to_temp): Use it.
384 * decl.c (cp_finish_decomp): Use it.
385 (cp_finish_decl): determine_visibility sooner.
386
387 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
388
389 * coroutines.cc (finish_co_await_expr): Set return value flag.
390 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
391
392 2020-01-19 Jason Merrill <jason@redhat.com>
393
394 PR c++/33799 - destroy return value, take 2.
395 * cp-tree.h (current_retval_sentinel): New macro.
396 (struct language_function): Add throwing_cleanup bitfield.
397 * decl.c (cxx_maybe_build_cleanup): Set it.
398 * except.c (maybe_set_retval_sentinel)
399 (maybe_splice_retval_cleanup): New functions.
400 * parser.c (cp_parser_compound_statement): Call
401 maybe_splice_retval_cleanup.
402 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
403
404 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
405
406 2020-01-18 Jakub Jelinek <jakub@redhat.com>
407
408 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
409 but non-NO_DOLLAR_IN_LABEL case build.
410
411 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
412
413 * Make-lang.in: Add coroutines.o.
414 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
415 (DECL_COROUTINE_P): New.
416 * lex.c (init_reswords): Enable keywords when the coroutine flag
417 is set,
418 * operators.def (co_await): New operator.
419 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
420 (op_error): Likewise.
421 (build_new_op_1): Likewise.
422 (build_new_function_call): Validate coroutine builtin arguments.
423 * constexpr.c (potential_constant_expression_1): Handle
424 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
425 * coroutines.cc: New file.
426 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
427 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
428 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
429 * cp-tree.h (coro_validate_builtin_call): New.
430 * decl.c (emit_coro_helper): New.
431 (finish_function): Handle the case when a function is found to
432 be a coroutine, perform the outlining and emit the outlined
433 functions. Set a bit to signal that this is a coroutine component.
434 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
435 (cp_parser_unary_expression): Handle co_await.
436 (cp_parser_assignment_expression): Handle co_yield.
437 (cp_parser_statement): Handle RID_CO_RETURN.
438 (cp_parser_jump_statement): Handle co_return.
439 (cp_parser_operator): Handle co_await operator.
440 (cp_parser_yield_expression): New.
441 (cp_parser_required_error): Handle RT_CO_YIELD.
442 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
443 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
444 CO_RETURN_EXPRs.
445 * tree.c (cp_walk_subtrees): Likewise.
446
447 2020-01-17 Jason Merrill <jason@redhat.com>
448
449 PR c++/92531 - ICE with noexcept(lambda).
450 * pt.c (uses_template_parms): Don't try to enumerate all the
451 expression cases.
452
453 2020-01-17 Jakub Jelinek <jakub@redhat.com>
454
455 PR c++/93228
456 * parser.c (cp_parser_template_name): Look up deprecated attribute
457 in DECL_TEMPLATE_RESULT or its type's attributes.
458
459 2020-01-16 Jason Merrill <jason@redhat.com>
460
461 PR c++/93286 - ICE with __is_constructible and variadic template.
462 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
463 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
464
465 PR c++/93280 - ICE with aggregate assignment and DMI.
466 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
467 * typeck2.c (digest_nsdmi_init): Not here.
468
469 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
470
471 PR c++/91073
472 * cp-tree.h (is_constrained_auto): New.
473 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
474 handle concept-check expressions; take a cp_decl_specifier_seq*
475 instead of a bool.
476 (cp_parser_condition): Update call.
477 (cp_parser_simple_declaration): Likewise.
478 (cp_parser_placeholder_type_specifier): Correctly handle
479 concept-check expressions.
480
481 2020-01-15 Jason Merrill <jason@redhat.com>
482
483 Revert
484 PR c++/33799 - destroy return value if local cleanup throws.
485 * cp-tree.h (current_retval_sentinel): New macro.
486 * decl.c (start_preparsed_function): Set up cleanup for retval.
487 * typeck.c (check_return_expr): Set current_retval_sentinel.
488
489 PR c++/93257 - consteval void function.
490 * constexpr.c (verify_constant): Allow void_node.
491
492 PR c++/92871 - bad code with xvalue and GNU ?: extension.
493 * call.c (prevent_lifetime_extension): New.
494 (build_conditional_expr_1): Use it.
495
496 2020-01-14 Nathan Sidwell <nathan@acm.org>
497
498 PR c++/90916
499 * pt.c (retrieve_specialization): Use get_template_info, not open
500 coding access.
501
502 PR c++/90916
503 * pt.c (retrieve_specialization): Get the TI from the decl or the
504 classtype as appropriate.
505
506 2020-01-14 David Malcolm <dmalcolm@redhat.com>
507
508 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
509 New static constant.
510 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
511 (struct named_label_hash::empty_zero_p): Likewise.
512 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
513
514 2020-01-14 Jason Merrill <jason@redhat.com>
515
516 PR c++/92590 - wrong handling of inherited default ctor.
517 * class.c (add_method): A constrained inherited ctor doesn't hide an
518 implicit derived ctor.
519 Revert:
520 PR c++/92552 - ICE with inherited constrained default ctor.
521 * pt.c (instantiate_class_template_1): Copy
522 TYPE_HAS_USER_CONSTRUCTOR.
523 PR c++/91930 - ICE with constrained inherited default ctor.
524 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
525 for inherited constructor.
526 PR c++/92594 - ICE with inherited trivial default ctor.
527 * method.c (trivial_fn_p): Treat an inherited default constructor
528 like a normal default constructor.
529
530 PR c++/92594 - ICE with inherited trivial default ctor.
531 * method.c (trivial_fn_p): Treat an inherited default constructor
532 like a normal default constructor.
533
534 PR c++/92009 - ICE with punning of typeid.
535 * rtti.c (get_tinfo_desc): Call xref_basetypes.
536 * constexpr.c (cxx_fold_indirect_ref): Don't strip
537 REINTERPRET_CAST_P.
538
539 2020-01-13 Jason Merrill <jason@redhat.com>
540
541 PR c++/92746 - ICE with noexcept of function concept check.
542 * except.c (check_noexcept_r): Handle concept-check.
543
544 PR c++/92582 - ICE with member template as requirement.
545 * pt.c (struct find_template_parameter_info): Add ctx_parms.
546 (any_template_parm_r): Handle TEMPLATE_DECL.
547 (find_template_parameters): Take parms instead of their depth.
548 * constraint.cc (build_parameter_mapping): Pass them.
549
550 PR c++/33799 - destroy return value if local cleanup throws.
551 * cp-tree.h (current_retval_sentinel): New macro.
552 * decl.c (start_preparsed_function): Set up cleanup for retval.
553 * typeck.c (check_return_expr): Set current_retval_sentinel.
554
555 PR c++/93238 - short right-shift with enum.
556 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
557
558 2020-01-10 Jason Merrill <jason@redhat.com>
559
560 * typeck.c (cp_build_binary_op): Restore short_shift code.
561
562 PR c++/93143 - incorrect tree sharing with constexpr.
563 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
564 CONSTRUCTORs are already unshared.
565
566 PR c++/93173 - incorrect tree sharing.
567 PR c++/93033
568 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
569 copy_if_shared after cp_genericize_tree.
570 * typeck2.c (split_nonconstant_init): Don't unshare here.
571
572 2020-01-08 Jason Merrill <jason@redhat.com>
573
574 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
575 TARGET_EXPR_DIRECT_INIT_P.
576 * constexpr.c (cxx_eval_constant_expression): Likewise.
577
578 2020-01-08 Jason Merrill <jason@redhat.com>
579
580 PR c++/91369 - constexpr destructor and member initializer.
581 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
582 when not preevaluating.
583
584 2020-01-08 Jason Merrill <jason@redhat.com>
585
586 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
587 support.
588
589 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
590
591 * init.c (build_new): Add location_t parameter and use it throughout.
592 (build_raw_new_expr): Likewise.
593 * parser.c (cp_parser_new_expression): Pass the combined_loc.
594 * pt.c (tsubst_copy_and_build): Adjust call.
595 * cp-tree.h: Update declarations.
596
597 2020-01-07 Jason Merrill <jason@redhat.com>
598
599 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
600 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
601 explicit class visibility for a template.
602
603 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
604
605 * mangle.c (mangle_type_attribute_p): New function, split out from...
606 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
607 that contain a space.
608
609 2020-01-07 Jakub Jelinek <jakub@redhat.com>
610
611 PR c++/91369
612 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
613 member, initialize it to zero in ctor.
614 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
615 a heap object. Don't cache calls to functions which allocate some
616 heap objects and don't deallocate them or deallocate some heap
617 objects they didn't allocate.
618
619 2020-01-06 Jason Merrill <jason@redhat.com>
620
621 PR c++/92552 - ICE with inherited constrained default ctor.
622 * pt.c (instantiate_class_template_1): Copy
623 TYPE_HAS_USER_CONSTRUCTOR.
624 * class.c (one_inherited_ctor): Don't set it here.
625
626 2020-01-06 Andrew Sutton <asutton@lock3software.com>
627
628 PR c++/92739 - parsing requires clause with attributes.
629 * parser.c (cp_parser_constraint_requires_parens): Exclude
630 attributes as postfix expressions.
631
632 2020-01-05 Jakub Jelinek <jakub@redhat.com>
633
634 PR c++/93138
635 * parser.c (cp_parser_check_class_key): Disable access checks for the
636 simple name lookup.
637 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
638 !warn_redundant_tags.
639
640 2010-01-05 Jakub Jelinek <jakub@redhat.com>
641
642 PR c++/93046
643 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
644 TARGET_EXPR if it has been gimplified already.
645
646 2020-01-03 Jason Merrill <jason@redhat.com>
647
648 PR c++/93033 - incorrect tree node sharing with array init.
649 * typeck2.c (split_nonconstant_init): Unshare non-decl.
650 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
651
652 2020-01-02 Jason Merrill <jason@redhat.com>
653
654 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
655 C++17.
656
657 2020-01-02 Jakub Jelinek <jakub@redhat.com>
658
659 PR c/90677
660 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
661 has not been found, rather than error_mark_node.
662
663 2020-01-01 Jakub Jelinek <jakub@redhat.com>
664
665 Update copyright years.
666 \f
667 Copyright (C) 2020 Free Software Foundation, Inc.
668
669 Copying and distribution of this file, with or without modification,
670 are permitted in any medium without royalty provided the copyright
671 notice and this notice are preserved.