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