aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/ChangeLog
blob: 254e5a310966a7ba49c98bde308197c9da48ee84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
2020-03-04  Jason Merrill  <jason@redhat.com>

	PR c++/90432
	* init.c (perform_member_init): Don't do aggregate initialization of
	empty field.
	* constexpr.c (cx_check_missing_mem_inits): Don't enforce
	initialization of empty field.

2020-03-04  Martin Liska  <mliska@suse.cz>

	* method.c: Wrap array in ctor with braces in order
	to silent clang warnings.

2020-03-03  Jason Merrill  <jason@redhat.com>
	    Marek Polacek  <polacek@redhat.com>

	PR c++/90505 - mismatch in template argument deduction.
	* pt.c (tsubst): Don't reduce the template level of template
	parameters when tf_partial.

2020-03-03  Jakub Jelinek  <jakub@redhat.com>

	PR c++/93998
	* constexpr.c (cxx_eval_constant_expression)
	<case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
	*non_constant_p is true.

2020-03-03  Jun Ma  <JunMa@linux.alibaba.com>

	* coroutines.cc (captures_temporary): Strip component_ref
	to its base object.

2020-03-03  Jun Ma <JunMa@linux.alibaba.com>

	* coroutines.cc (finish_co_await_expr): Build co_await_expr
	with unknown_type_node.
	(finish_co_yield_expr): Ditto.
	*pt.c (type_dependent_expression_p): Set co_await/yield_expr
	with unknown type as dependent.

2020-03-02  Iain Sandoe  <iain@sandoe.co.uk>

	* coroutines.cc (struct local_var_info): Adjust to remove the
	reference to the captured var, and just to note that this is a
	lambda capture proxy.
	(transform_local_var_uses): Handle lambda captures specially.
	(struct param_frame_data): Add a visited set.
	(register_param_uses): Also check for param uses in lambda
	capture proxies.
	(struct local_vars_frame_data): Remove captures list.
	(register_local_var_uses): Handle lambda capture proxies by
	noting and bypassing them.
	(morph_fn_to_coro): Update to remove lifetime extension of
	lambda capture-by-copy vars.

2020-03-02  Iain Sandoe  <iain@sandoe.co.uk>

	* coroutines.cc (build_co_await): Do not build frame
	awaitable proxy vars when the co_await expression is
	a function parameter or local var.
	(co_await_expander): Do not initialise a frame var with
	itself.
	(transform_await_expr): Only substitute the awaitable
	frame var if it's needed.
	(register_awaits): Do not make frame copies for param
	or local vars that are awaitables.

2020-02-28  Jason Merrill  <jason@redhat.com>

	Implement P2092R0, Disambiguating Nested-Requirements
	* parser.c (cp_parser_requirement_parameter_list): Pass
	CP_PARSER_FLAGS_TYPENAME_OPTIONAL.

	* call.c (build_user_type_conversion_1): Don't look at the second
	conversion of a non-viable candidate.

2020-02-28  Jakub Jelinek  <jakub@redhat.com>

	P1937R2 - Fixing inconsistencies between const{expr,eval} functions
	* typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
	functions in unevaluated contexts.

2020-02-27  Nathan Sidwell  <nathan@acm.org>

	PR c++/93933
	* pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
	cp_tree_equal.
	* tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
	* typeck.c (comptypes): Assert we don't get any argument packs.

	* class.c (adjust_clone_args): Correct arg-checking assert.
	* typeck.c (comptypes): Assert not nulls.

2020-02-26  Marek Polacek  <polacek@redhat.com>

	PR c++/93789 - ICE with invalid array bounds.
	* decl.c (compute_array_index_type_loc): Don't use the folded
	size when folding cleared TREE_CONSTANT.

2020-02-26  Iain Sandoe  <iain@sandoe.co.uk>

	* class.c (classtype_has_non_deleted_copy_ctor): New.
	* coroutines.cc (struct param_info): Keep track of params
	that are references, and cache the original type and whether
	the DTOR is trivial.
	(build_actor_fn): Handle param copies always, and adjust the
	handling for references.
	(register_param_uses): Only handle uses here.
	(classtype_has_non_deleted_copy_ctor): New.
	(morph_fn_to_coro): Adjust param copy handling to match n4849
	by reordering ahead of the promise CTOR and always making a
	frame copy, even if the param is unused in the coroutine body.
	* cp-tree.h (classtype_has_non_deleted_copy_ctor): New.

2020-02-26  Patrick Palka  <ppalka@redhat.com>

	* constraint.cc (finish_constraint_binary_op): Set expr's location range
	to the range of its operands.
	(satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
	(diagnose_trait_expr): Take the instantiated parameter mapping MAP
	instead of the corresponding template arguments ARGS and adjust body
	accordingly.
	(diagnose_requires_expr): Likewise.
	(diagnose_atomic_constraint): Likewise.  When printing an atomic
	constraint expression, print the instantiated parameter mapping
	alongside it.
	* cxx-pretty-print.cc (cxx_pretty_printer::expression)
	[NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
	(cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.

2020-02-26  Marek Polacek  <polacek@redhat.com>

	PR c++/93676 - value-init crash in template.
	* init.c (build_new_1): Don't call build_vec_init in a template.

2020-02-26  Marek Polacek  <polacek@redhat.com>

	PR c++/93862 - ICE with static_cast when converting from int[].
	* call.c (reference_compatible_p): No longer static.
	* cp-tree.h (reference_compatible_p): Declare.
	* typeck.c (build_static_cast_1): Use reference_compatible_p instead
	of reference_related_p.

2020-02-26  Marek Polacek  <polacek@redhat.com>

	PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
	* constexpr.c (reduced_constant_expression_p): Don't crash on a null
	field.

2020-02-24  Martin Sebor  <msebor@redhat.com>

	PR c++/93804
	* parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
	in shared C/C++ code in headers.
	Remove a duplicate hunk of code.

2020-02-24  Marek Polacek  <polacek@redhat.com>

	PR c++/93869 - ICE with -Wmismatched-tags.
	* parser.c (cp_parser_check_class_key): Check class_key earlier.

2020-02-24  Marek Polacek  <polacek@redhat.com>

	PR c++/93712 - ICE with ill-formed array list-initialization.
	* call.c (next_conversion): Return NULL for ck_aggr.
	(build_aggr_conv): Set u.expr instead of u.next.
	(build_array_conv): Likewise.
	(build_complex_conv): Likewise.
	(conv_get_original_expr): Handle ck_aggr.

2020-02-24  Jakub Jelinek  <jakub@redhat.com>

	P1937R2 - Fixing inconsistencies between const{expr,eval} functions
	* call.c (build_over_call): Don't evaluate immediate functions in
	unevaluated operands.

2020-02-24  Jason Merrill  <jason@redhat.com>

	P0780R2: Resolve lambda init-capture pack grammar.
	* parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
	...&x=y.

2020-02-22  Marek Polacek  <polacek@redhat.com>

	PR c++/93882
	* decl.c (grokdeclarator): Use %qs in a diagnostic message.

2020-02-21  Martin Sebor  <msebor@redhat.com>

	PR gcov-profile/93753
	* class.c (check_flexarrays): Tighten up a test for potential members
	of anonymous structs or unions.

2020-02-20  Martin Sebor  <msebor@redhat.com>

	PR c++/93801
	* parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.

2020-02-20  Martin Liska  <mliska@suse.cz>

	PR translation/93841
	* config/or1k/or1k.opt: Remove superfluous word.
	* doc/invoke.texi: Likewise.

2020-02-20  Martin Liska  <mliska@suse.cz>

	PR translation/93838
	* parser.c (cp_parser_decl_specifier_seq): Remove trailing space.

2020-02-19  Marek Polacek  <polacek@redhat.com>

	PR c++/93169 - wrong-code with a non-constexpr constructor.
	* constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
	on constant CONSTRUCTORs.

2020-02-15  Marek Polacek  <polacek@redhat.com>

	PR c++/93710 - poor diagnostic for array initializer.
	* call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
	for an error call.

2020-02-15  Jason Merrill  <jason@redhat.com>

	PR c++/92556
	* pt.c (any_template_parm_r): Look into lambda body.

	PR c++/92583
	* pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.

2020-02-14  Jakub Jelinek  <jakub@redhat.com>

	PR c++/61414
	* class.c (enum_min_precision): Change prec type from int to int &.

	PR libstdc++/92906
	* cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
	CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
	(fallback_dfloat32_type, fallback_dfloat64_type,
	fallback_dfloat128_type): Define.
	* mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
	dfloat*_type_node.
	* rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
	is disabled for compatibility.

2020-02-13  Jason Merrill  <jason@redhat.com>

	PR c++/93713
	* name-lookup.c (matching_fn_p): A function does not match a
	template.

	PR c++/93643
	PR c++/91476
	* tree.c (decl_linkage): Always lk_none for locals.

2020-02-12  Jason Merrill  <jason@redhat.com>

	PR c++/92583
	PR c++/92654
	* tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
	* pt.c (find_parameter_packs_r): Not here.

2020-02-12 Iain Sandoe <iain@sandoe.co.uk>

	* coroutines.cc (build_actor_fn): Implement deallocation function
	selection per n4849, dcl.fct.def.coroutine bullet 12.
	(morph_fn_to_coro): Implement allocation function selection per
	n4849, dcl.fct.def.coroutine bullets 9 and 10.

2020-02-12  Marek Polacek  <polacek@redhat.com>

	PR c++/93684 - ICE-on-invalid with broken attribute.
	* parser.c (cp_parser_std_attribute): Peek a token first before
	consuming it.

2020-02-11  Jason Merrill  <jason@redhat.com>

	PR c++/93675
	* class.c (add_implicitly_declared_members): Use do_friend.
	* method.c (implicitly_declare_fn): Fix friend handling.
	(decl_remember_implicit_trigger_p): New.
	(synthesize_method): Use it.
	* decl2.c (mark_used): Use it.

2020-02-11  Jason Merrill  <jason@redhat.com>

	PR c++/93650
	PR c++/90691
	* constexpr.c (maybe_constant_value): Correct earlier change.
	(cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
	* method.c (genericize_spaceship): Wrap result in TARGET_EXPR.

2020-02-12  Patrick Palka  <ppalka@redhat.com>

	PR c++/69448
	PR c++/80471
	* type-utils.h (find_type_usage): Refactor to take a tree * and to
	return a tree *, and update documentation accordingly.
	* pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
	decltype(auto) node.
	(make_constrained_decltype_auto): No need to explicitly set
	AUTO_IS_DECLTYPE anymore.
	(splice_late_return_type): Use find_type_usage to find and
	replace a possibly nested auto node instead of using is_auto.
	Check test for is_auto into an assert when deciding whether
	to late_return_type.
	(type_uses_auto): Adjust the call to find_type_usage.
	* parser.c (cp_parser_decltype): No need to explicitly set
	AUTO_IS_DECLTYPE anymore.

	* error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
	(dump_simple_decl): Handle standard concept definitions as well as
	variable concept definitions.

2020-02-10  Jakub Jelinek  <jakub@redhat.com>

	PR other/93641
	* error.c (dump_decl_name): Fix up last argument to strncmp.

2020-02-10  Jason Merrill  <jason@redhat.com>

	PR c++/93618
	* tree.c (array_of_unknown_bound_p): New.
	* init.c (perform_member_init): Do nothing for flexible arrays.

2020-02-09  Jakub Jelinek  <jakub@redhat.com>

	PR c++/93633
	* constexpr.c (cxx_eval_constant_expression): If obj is heap var with
	ARRAY_TYPE, use the element type.  Punt if objtype after that is not
	a class type.

2020-02-08  Jason Merrill  <jason@redhat.com>

	PR c++/90691
	* expr.c (fold_for_warn): Call maybe_constant_value.
	* constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
	(maybe_constant_value): Add uid_sensitive parm.
	(get_fundef_copy): Don't copy if it's true.
	(cxx_eval_call_expression): Don't instantiate if it's true.
	(cxx_eval_outermost_constant_expr): Likewise.

	PR c++/92852
	* constexpr.c (maybe_constant_value): Don't unshare if the cached
	value is the same as the argument.

	* typeck.c (maybe_warn_about_returning_address_of_local): Add
	location parameter.

	* typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
	if appropriate.

2020-02-08  Jakub Jelinek  <jakub@redhat.com>

	PR c++/93549
	* constexpr.c (find_array_ctor_elt): If last element has no index,
	for flag_checking verify all elts have no index.  If i is within the
	elts, return it directly, if it is right after the last elt, append
	if NULL index, otherwise force indexes on all elts.
	(cxx_eval_store_expression): Allow cep->index to be NULL.

2020-02-07  Marek Polacek  <polacek@redhat.com>

	PR c++/92947 - Paren init of aggregates in unevaluated context.
	* call.c (build_new_method_call_1): Don't check
	cp_unevaluated_operand.  Check the return value of digest_init.

2020-02-06  Jason Merrill  <jason@redhat.com>

	PR c++/92654
	* tree.c (cp_walk_subtrees): Walk into type template arguments.
	* cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
	instead of TYPE_ALIAS_P.
	* pt.c (push_template_decl_real): Likewise.
	(find_parameter_packs_r): Likewise.  Remove dead code.
	* error.c (find_typenames_r): Remove dead code.

2020-02-06  Jason Merrill  <jason@redhat.com>

	PR c++/92517
	* parser.c (cp_parser_constraint_primary_expression): Do the main
	parse non-tentatively.

2020-02-06  Marek Polacek  <polacek@redhat.com>

	PR c++/93597 - ICE with lambda in operator function.
	* name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.

2020-02-05  Jason Merrill  <jason@redhat.com>

	PR c++/93140
	* pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
	handling of TREE_CHAIN for empty pack.

2020-02-05  Jakub Jelinek  <jakub@redhat.com>

	PR c++/93557
	* semantics.c (cp_build_vec_convert): Call decay_conversion on arg
	prior to passing it to c_build_vec_convert.

2020-02-05  Marek Polacek  <polacek@redhat.com>

	PR c++/93559 - ICE with CONSTRUCTOR flags verification.
	* decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
	TREE_SIDE_EFFECTS.

2020-02-05  Jason Merrill  <jason@redhat.com>

	PR c++/92593
	* decl.c (grokdeclarator): Reject field of current class type even
	in a template.

2020-02-05  Bin Cheng  <bin.cheng@linux.alibaba.com>

	* coroutines.cc (maybe_promote_captured_temps): Increase the index
	number for temporary variables' name.

2020-02-05  Jun Ma <JunMa@linux.alibaba.com>

	* coroutines.cc (build_co_await): Call convert_from_reference
	to wrap co_await_expr with indirect_ref which avoid
	reference/non-reference type confusion.

	(co_await_expander):  Sink to call_expr if await_resume
	is wrapped by indirect_ref.

2020-02-04  Jason Merrill  <jason@redhat.com>

	PR c++/93551
	* constraint.cc (satisfy_declaration_constraints): Check return
	value of push_tinst_level.

	PR c++/90951
	* constexpr.c (cxx_eval_array_reference): {}-initialize missing
	elements instead of value-initializing them.

	PR c++/86917
	* init.c (perform_member_init): Simplify.
	* constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
	flexarray.
	(cxx_eval_vec_init_1): Handle CONSTRUCTOR.

2020-02-04  Iain Sandoe  <iain@sandoe.co.uk>

	* coroutines.cc (find_promise_type): Delete unused forward
	declaration.
	(struct coroutine_info): Add a bool for no promise type error.
	(coro_promise_type_found_p): Only emit the error for a missing
	promise once in each affected coroutine.

2020-02-03  Jason Merrill  <jason@redhat.com>

	PR c++/66477
	* constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
	defer loading the value of a reference.

2020-02-03  Jason Merrill  <jason@redhat.com>

	PR c++/91953
	* constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
	empty class type.
	[COMPONENT_REF]: A member function reference doesn't use the object
	as an rvalue.

2020-02-03  Iain Sandoe  <iain@sandoe.co.uk>

	PR c++/93458
	* coroutines.cc (struct coroutine_info): Add a bool flag to note
	that we emitted an error for a bad function return type.
	(get_coroutine_info): Tolerate an unset info table in case of
	missing traits.
	(find_coro_traits_template_decl): In case of error or if we didn't
	find a type template, note we emitted the error and suppress
	duplicates.
	(find_coro_handle_template_decl): Likewise.
	(instantiate_coro_traits): Only check for error_mark_node in the
	return from lookup_qualified_name. 
	(coro_promise_type_found_p): Reorder initialization so that we check
	for the traits and their usability before allocation of the info
	table.  Check for a suitable return type and emit a diagnostic for
	here instead of relying on the lookup machinery.  This allows the
	error to have a better location, and means we can suppress multiple
	copies.
	(coro_function_valid_p): Re-check for a valid promise (and thus the
	traits) before proceeding.  Tolerate missing info as a fatal error.

2020-02-03  Jason Merrill  <jason@redhat.com>

	PR c++/88256
	* cp-gimplify.c (predeclare_vla): New.
	(cp_genericize_r) [NOP_EXPR]: Call it.

2020-02-03  Jun Ma <JunMa@linux.alibaba.com>

	* coroutines.cc (transform_await_wrapper): Set actor funcion as
	new context of label_decl.
	(build_actor_fn): Fill new field of await_xform_data.

2020-02-02  Marek Polacek  <polacek@redhat.com>

	PR c++/93530 - ICE on invalid alignas in a template.
	* decl.c (grokdeclarator): Call cplus_decl_attributes instead of
	decl_attributes.

2020-01-31  Jason Merrill  <jason@redhat.com>

	PR c++/86216
	* semantics.c (process_outer_var_ref): Capture VLAs even in
	unevaluated context.

	PR c++/14179
	* decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
	non-aggregate elements.
	(reshape_init_array): Add first_initializer_p parm.
	(reshape_init_r): Change first_initializer_p from bool to tree.
	(reshape_init): Pass init to it.

	PR c++/14179
	* parser.c (cp_parser_initializer_list): Suppress location wrappers
	after 256 elements.

2020-01-29  Jason Merrill  <jason@redhat.com>

	PR c++/82521
	* pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
	the expression was dependent before substitution.

2020-01-30  Bin Cheng  <bin.cheng@linux.alibaba.com>

	* coroutines.cc (act_des_fn): New.
	(morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
	Access promise via actor function's frame pointer argument.
	(build_actor_fn, build_destroy_fn): Use frame pointer argument.

2020-01-30  Bin Cheng  <bin.cheng@linux.alibaba.com>

	* coroutines.cc (co_await_expander): Handle type conversion case.

2020-01-29  Jason Merrill  <jason@redhat.com>

	PR c++/90333
	PR c++/89640
	PR c++/60503
	* parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
	a trailing return type.
	(cp_parser_lambda_declarator_opt): Parse C++11 attributes before
	parens.

2020-01-29  Marek Polacek  <polacek@redhat.com>

	PR c++/91754 - Fix template arguments comparison with class NTTP.
	* pt.c (class_nttp_const_wrapper_p): New.
	(template_args_equal): See through class_nttp_const_wrapper_p
	arguments.

2020-01-29  Marek Polacek  <polacek@redhat.com>

	PR c++/92948 - Fix class NTTP with template arguments.
	* pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
	converting a value-dependent expression to a class type.
	(tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
	as the result of the tsubst_copy call.

2020-01-29  Jakub Jelinek  <jakub@redhat.com>

	PR c++/91118
	* cp-gimplify.c (cxx_omp_predetermined_sharing): Return
	OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.

2020-01-28  Jason Merrill  <jason@redhat.com>

	PR c++/93442
	* parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.

	PR c++/93477
	PR c++/91476
	* decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.

	PR c++/90546
	* call.c (build_user_type_conversion_1): Allow a template conversion
	returning an rvalue reference to bind directly to an lvalue.

	PR c++/90731
	* decl.c (grokdeclarator): Propagate eh spec from typedef.

2020-01-28  Martin Liska  <mliska@suse.cz>

	PR c++/92440
	* pt.c (redeclare_class_template): Group couple of
	errors and inform messages with auto_diagnostic_group.

2020-01-28  Martin Liska  <mliska@suse.cz>

	PR c++/92440
	* pt.c (redeclare_class_template): Use inform
	for the second location.

2020-01-27  Jason Merrill  <jason@redhat.com>

	PR c++/90966
	* pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.

2020-01-27  Iain Sandoe  <iain@sandoe.co.uk>

	PR c++/93443
	* coroutines.cc (morph_fn_to_coro): Check the ramp return
	value when it is constructed from the 'get return object'.

2020-01-27  Nathan Sidwell  <nathan@acm.org>

	PR c++/91826
	* name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.

2020-01-26  Jason Merrill  <jason@redhat.com>

	PR c++/90992
	* except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
	temporarily enable -Wsystem-headers.  Change second warning to
	conditional inform.

	PR c++/90997
	* semantics.c (finish_call_expr): Don't call
	instantiate_non_dependent_expr before warn_for_memset.

2020-01-25  Marek Polacek  <polacek@redhat.com>

	PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
	* constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
	dynamic_cast diagnostic.

2020-01-24  Jason Merrill  <jason@redhat.com>

	PR c++/93400 - ICE with constrained friend.
	* constraint.cc (maybe_substitute_reqs_for): New.
	* decl.c (function_requirements_equivalent_p): Call it.
	* pt.c (tsubst_friend_function): Only substitute
	TEMPLATE_PARMS_CONSTRAINTS.
	(tsubst_template_parms): Copy constraints.

2020-01-24  Jason Merrill  <jason@redhat.com>

	PR c++/93279 - ICE with lambda in member operator.
	* name-lookup.c (maybe_save_operator_binding): Don't remember
	class-scope bindings.

2020-01-24  Jason Merrill  <jason@redhat.com>

	PR c++/93377 - ICE with member alias in constraint.
	* pt.c (any_template_parm_r): Look at template arguments for all
	aliases, not only alias templates.

2020-01-24  Marek Polacek  <polacek@redhat.com>

	PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
	* pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.

2020-01-24  Jason Merrill  <jason@redhat.com>

	PR c++/92852 - ICE with generic lambda and reference var.
	* constexpr.c (maybe_constant_value): Likewise.

2020-01-23  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/92804
	* parser.c (cp_parser_nested_name_specifier_opt): Properly
	diagnose concept-ids.

2020-01-23  Jason Merrill  <jason@redhat.com>

	PR c++/93331 - ICE with __builtin_strchr.
	* constexpr.c (cxx_eval_builtin_function_call): Use the original
	argument if we didn't manage to extract a STRING_CST.

	PR c++/93345 - ICE with defaulted dtor and template.
	PR c++/33799
	* decl.c (cxx_maybe_build_cleanup): Don't try to set
	throwing_cleanup in a template.

2020-01-22  Marek Polacek  <polacek@redhat.com>

	PR c++/92907 - noexcept does not consider "const" in member functions.
	* g++.dg/cpp0x/noexcept56.C: New test.

2020-01-22  Marek Polacek  <polacek@redhat.com>

	PR c++/93324 - ICE with -Wall on constexpr if.
	* semantics.c (is_std_constant_evaluated_p): Check fndecl.

2020-01-22  Patrick Palka  <ppalka@redhat.com>

	* constraint.cc (get_mapped_args): Avoid using auto_vec
	as a vector element.  Release the vectors inside the lists
	vector.
	* parser.c (cp_literal_operator_id): Free the buffer.

2020-01-22  Jun Ma  <JunMa@linux.alibaba.com>

	* coroutines.cc (finish_co_await_expr): Add error check on return
	value of build_co_await.
	(finish_co_yield_expr,): Ditto.

2020-01-22  Jun Ma  <JunMa@linux.alibaba.com>

	* coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
	(lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
	(build_co_await): Use lookup_awaitable_member instead of lookup_member.

2020-01-21  Jason Merrill  <jason@redhat.com>

	PR c++/60855 - ICE with sizeof VLA capture.
	* lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.

	PR c++/90732 - ICE with VLA capture and generic lambda.
	* pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.

2020-01-21  Iain Sandoe  <iain@sandoe.co.uk>
	    Bin Cheng  <bin.cheng@linux.alibaba.com>

	* coroutines.cc (coro_promise_type_found_p): Check for NULL return
	from complete_type_or_else.
	(register_param_uses): Likewise.
	(build_co_await): Do not try to use complete_type_or_else for void
	types, otherwise for incomplete types, check for NULL return from
	complete_type_or_else.

2020-01-21  Jason Merrill  <jason@redhat.com>

	PR c++/91476 - anon-namespace reference temp clash between TUs.
	* decl2.c (copy_linkage): Factor out of get_guard.
	* call.c (make_temporary_var_for_ref_to_temp): Use it.
	* decl.c (cp_finish_decomp): Use it.
	(cp_finish_decl): determine_visibility sooner.

2020-01-21  Bin Cheng  <bin.cheng@linux.alibaba.com>

	* coroutines.cc (finish_co_await_expr): Set return value flag.
	(finish_co_yield_expr, morph_fn_to_coro): Ditto.

2020-01-19  Jason Merrill  <jason@redhat.com>

	PR c++/33799 - destroy return value, take 2.
	* cp-tree.h (current_retval_sentinel): New macro.
	(struct language_function): Add throwing_cleanup bitfield.
	* decl.c (cxx_maybe_build_cleanup): Set it.
	* except.c (maybe_set_retval_sentinel)
	(maybe_splice_retval_cleanup): New functions.
	* parser.c (cp_parser_compound_statement): Call
	maybe_splice_retval_cleanup.
	* typeck.c (check_return_expr): Call maybe_set_retval_sentinel.

	* parser.c (cp_parser_lambda_body): Use cp_parser_function_body.

2020-01-18  Jakub Jelinek  <jakub@redhat.com>

	* coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
	but non-NO_DOLLAR_IN_LABEL case build.

2020-01-18  Iain Sandoe  <iain@sandoe.co.uk>

	* Make-lang.in: Add coroutines.o.
	* cp-tree.h (lang_decl-fn): coroutine_p, new bit.
	(DECL_COROUTINE_P): New.
	* lex.c (init_reswords): Enable keywords when the coroutine flag
	is set,
	* operators.def (co_await): New operator.
	* call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
	(op_error): Likewise.
	(build_new_op_1): Likewise.
	(build_new_function_call): Validate coroutine builtin arguments.
	* constexpr.c (potential_constant_expression_1): Handle
	CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
	* coroutines.cc: New file.
	* cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
	CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
	* cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
	* cp-tree.h (coro_validate_builtin_call): New.
	* decl.c (emit_coro_helper): New.
	(finish_function): Handle the case when a function is found to
	be a coroutine, perform the outlining and emit the outlined
	functions. Set a bit to signal that this is a coroutine component.
	* parser.c (enum required_token): New enumeration RT_CO_YIELD.
	(cp_parser_unary_expression): Handle co_await.
	(cp_parser_assignment_expression): Handle co_yield.
	(cp_parser_statement): Handle RID_CO_RETURN.
	(cp_parser_jump_statement): Handle co_return.
	(cp_parser_operator): Handle co_await operator.
	(cp_parser_yield_expression): New.
	(cp_parser_required_error): Handle RT_CO_YIELD.
	* pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
	(tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
	CO_RETURN_EXPRs.
	* tree.c (cp_walk_subtrees): Likewise.

2020-01-17  Jason Merrill  <jason@redhat.com>

	PR c++/92531 - ICE with noexcept(lambda).
	* pt.c (uses_template_parms): Don't try to enumerate all the
	expression cases.

2020-01-17  Jakub Jelinek  <jakub@redhat.com>

	PR c++/93228
	* parser.c (cp_parser_template_name): Look up deprecated attribute
	in DECL_TEMPLATE_RESULT or its type's attributes.

2020-01-16  Jason Merrill  <jason@redhat.com>

	PR c++/93286 - ICE with __is_constructible and variadic template.
	* pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
	(tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.

	PR c++/93280 - ICE with aggregate assignment and DMI.
	* init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
	* typeck2.c (digest_nsdmi_init): Not here.

2020-01-15  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/91073
	* cp-tree.h (is_constrained_auto): New.
	* parser.c (cp_parser_maybe_commit_to_declaration): Correctly
	handle concept-check expressions; take a cp_decl_specifier_seq*
	instead of a bool.
	(cp_parser_condition): Update call.
	(cp_parser_simple_declaration): Likewise.
	(cp_parser_placeholder_type_specifier): Correctly handle
	concept-check expressions.

2020-01-15  Jason Merrill  <jason@redhat.com>

	Revert
	PR c++/33799 - destroy return value if local cleanup throws.
	* cp-tree.h (current_retval_sentinel): New macro.
	* decl.c (start_preparsed_function): Set up cleanup for retval.
	* typeck.c (check_return_expr): Set current_retval_sentinel.

	PR c++/93257 - consteval void function.
	* constexpr.c (verify_constant): Allow void_node.

	PR c++/92871 - bad code with xvalue and GNU ?: extension.
	* call.c (prevent_lifetime_extension): New.
	(build_conditional_expr_1): Use it.

2020-01-14  Nathan Sidwell  <nathan@acm.org>

	PR c++/90916
	* pt.c (retrieve_specialization): Use get_template_info, not open
	coding access.

	PR c++/90916
	* pt.c (retrieve_specialization): Get the TI from the decl or the
	classtype as appropriate.

2020-01-14  David Malcolm  <dmalcolm@redhat.com>

	* cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
	New static constant.
	* cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
	(struct named_label_hash::empty_zero_p): Likewise.
	* decl2.c (mangled_decl_hash::empty_zero_p): Likewise.

2020-01-14  Jason Merrill  <jason@redhat.com>

	PR c++/92590 - wrong handling of inherited default ctor.
	* class.c (add_method): A constrained inherited ctor doesn't hide an
	implicit derived ctor.
	Revert:
	PR c++/92552 - ICE with inherited constrained default ctor.
	* pt.c (instantiate_class_template_1): Copy
	TYPE_HAS_USER_CONSTRUCTOR.
	PR c++/91930 - ICE with constrained inherited default ctor.
	* name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
	for inherited constructor.
	PR c++/92594 - ICE with inherited trivial default ctor.
	* method.c (trivial_fn_p): Treat an inherited default constructor
	like a normal default constructor.

	PR c++/92594 - ICE with inherited trivial default ctor.
	* method.c (trivial_fn_p): Treat an inherited default constructor
	like a normal default constructor.

	PR c++/92009 - ICE with punning of typeid.
	* rtti.c (get_tinfo_desc): Call xref_basetypes.
	* constexpr.c (cxx_fold_indirect_ref): Don't strip
	REINTERPRET_CAST_P.

2020-01-13  Jason Merrill  <jason@redhat.com>

	PR c++/92746 - ICE with noexcept of function concept check.
	* except.c (check_noexcept_r): Handle concept-check.

	PR c++/92582 - ICE with member template as requirement.
	* pt.c (struct find_template_parameter_info): Add ctx_parms.
	(any_template_parm_r): Handle TEMPLATE_DECL.
	(find_template_parameters): Take parms instead of their depth.
	* constraint.cc (build_parameter_mapping): Pass them.

	PR c++/33799 - destroy return value if local cleanup throws.
	* cp-tree.h (current_retval_sentinel): New macro.
	* decl.c (start_preparsed_function): Set up cleanup for retval.
	* typeck.c (check_return_expr): Set current_retval_sentinel.

	PR c++/93238 - short right-shift with enum.
	* typeck.c (cp_build_binary_op): Use folded op1 for short_shift.

2020-01-10  Jason Merrill  <jason@redhat.com>

	* typeck.c (cp_build_binary_op): Restore short_shift code.

	PR c++/93143 - incorrect tree sharing with constexpr.
	* constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
	CONSTRUCTORs are already unshared.

	PR c++/93173 - incorrect tree sharing.
	PR c++/93033
	* cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
	copy_if_shared after cp_genericize_tree.
	* typeck2.c (split_nonconstant_init): Don't unshare here.

2020-01-08  Jason Merrill  <jason@redhat.com>

	* cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
	TARGET_EXPR_DIRECT_INIT_P.
	* constexpr.c (cxx_eval_constant_expression): Likewise.

2020-01-08  Jason Merrill  <jason@redhat.com>

	PR c++/91369 - constexpr destructor and member initializer.
	* constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
	when not preevaluating.

2020-01-08  Jason Merrill  <jason@redhat.com>

	* constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
	support.

2020-01-07  Paolo Carlini  <paolo.carlini@oracle.com>

	* init.c (build_new): Add location_t parameter and use it throughout.
	(build_raw_new_expr): Likewise.
	* parser.c (cp_parser_new_expression): Pass the combined_loc.
	* pt.c (tsubst_copy_and_build): Adjust call.
	* cp-tree.h: Update declarations.

2020-01-07  Jason Merrill  <jason@redhat.com>

	PR c++/47877 - -fvisibility-inlines-hidden and member templates.
	* decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
	explicit class visibility for a template.

2020-01-07  Richard Sandiford  <richard.sandiford@arm.com>

	* mangle.c (mangle_type_attribute_p): New function, split out from...
	(write_CV_qualifiers_for_type): ...here.  Don't mangle attributes
	that contain a space.

2020-01-07  Jakub Jelinek  <jakub@redhat.com>

	PR c++/91369
	* constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
	member, initialize it to zero in ctor.
	(cxx_eval_call_expression): Bump heap_dealloc_count when deleting
	a heap object.  Don't cache calls to functions which allocate some
	heap objects and don't deallocate them or deallocate some heap
	objects they didn't allocate.

2020-01-06  Jason Merrill  <jason@redhat.com>

	PR c++/92552 - ICE with inherited constrained default ctor.
	* pt.c (instantiate_class_template_1): Copy
	TYPE_HAS_USER_CONSTRUCTOR.
	* class.c (one_inherited_ctor): Don't set it here.

2020-01-06  Andrew Sutton  <asutton@lock3software.com>

	PR c++/92739 - parsing requires clause with attributes.
	* parser.c (cp_parser_constraint_requires_parens): Exclude
	attributes as postfix expressions.

2020-01-05  Jakub Jelinek  <jakub@redhat.com>

	PR c++/93138
	* parser.c (cp_parser_check_class_key): Disable access checks for the
	simple name lookup.
	(cp_parser_maybe_warn_enum_key): Likewise.  Return early if
	!warn_redundant_tags.

2010-01-05  Jakub Jelinek  <jakub@redhat.com>

	PR c++/93046
	* cp-gimplify.c (cp_gimplify_init_expr): Don't look through
	TARGET_EXPR if it has been gimplified already.

2020-01-03  Jason Merrill  <jason@redhat.com>

	PR c++/93033 - incorrect tree node sharing with array init.
	* typeck2.c (split_nonconstant_init): Unshare non-decl.
	* cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.

2020-01-02  Jason Merrill  <jason@redhat.com>

	* pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
	C++17.

2020-01-02  Jakub Jelinek  <jakub@redhat.com>

	PR c/90677
	* cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
	has not been found, rather than error_mark_node.

2020-01-01  Jakub Jelinek  <jakub@redhat.com>

	Update copyright years.

Copyright (C) 2020 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.