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