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
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
|
2020-08-04 Marek Polacek <polacek@redhat.com>
PR c++/96082
* parser.c (cp_parser_elaborated_type_specifier): Allow
'template' following ::.
2020-08-04 Nathan Sidwell <nathan@acm.org>
* parser.c (cp_parser_explicit_specialization): Refactor
to avoid leak of num_template_parameter_lists value.
2020-08-04 Patrick Palka <ppalka@redhat.com>
PR c++/94024
* init.c (sort_mem_initializers): Preserve TREE_TYPE of the
member initializer list node.
(emit_mem_initializers): Set input_location when performing each
member initialization.
* parser.c (cp_parser_mem_initializer): Attach the source
location of this initializer to a dummy EMPTY_CLASS_EXPR
within the TREE_TYPE of the list node.
* pt.c (tsubst_initializer_list): Preserve TREE_TYPE of the
member initializer list node.
2020-08-03 Marek Polacek <polacek@redhat.com>
* cp-tree.h (after_nsdmi_defaulted_late_checks): Remove.
2020-08-03 Marek Polacek <polacek@redhat.com>
DR 2032
PR c++/96218
* pt.c (check_default_tmpl_args): Also consider variable
templates.
2020-07-31 Jakub Jelinek <jakub@redhat.com>
PR c++/96182
* decl.c (finish_function): In constexpr functions use for C++14 and
later error instead of warning if no return statement is present and
diagnose it regardless of warn_return_type. Move the warn_return_type
diagnostics earlier in the function.
2020-07-31 Martin Sebor <msebor@redhat.com>
PR c++/96003
* class.c (build_base_path): Set no-warning bit on the synthesized
conditional expression in static_cast.
2020-07-31 Richard Biener <rguenther@suse.de>
PR debug/96383
* cp-objcp-common.h (LANG_HOOKS_FINALIZE_EARLY_DEBUG):
Define to c_common_finalize_early_debug.
2020-07-31 Patrick Palka <ppalka@redhat.com>
PR c++/96197
* constexpr.c (cxx_eval_constant_expression) <case CONST_DECL>:
Pass false to decl_constant_value and decl_really_constant_value
so that they don't unshare their result.
* cp-tree.h (decl_constant_value): New declaration with an added
bool parameter.
(decl_really_constant_value): Add bool parameter defaulting to
true to existing declaration.
* init.c (constant_value_1): Add bool parameter which controls
whether to unshare the initializer before returning. Call
unshare_expr at most once.
(scalar_constant_value): Pass true to constant_value_1's new
bool parameter.
(decl_really_constant_value): Add bool parameter and forward it
to constant_value_1.
(decl_constant_value): Likewise, but instead define a new
overload with an added bool parameter.
2020-07-30 Patrick Palka <ppalka@redhat.com>
PR c++/64194
* pt.c (resolve_overloaded_unification): If the function
template specialization has a placeholder return type,
then instantiate it before attempting unification.
2020-07-30 Patrick Palka <ppalka@redhat.com>
PR c++/95486
* pt.c (alias_ctad_tweaks): Call remove_constraints before
calling set_constraints.
2020-07-30 Patrick Palka <ppalka@redhat.com>
PR c++/96106
* pt.c (reduce_template_parm_level): Propagate DECL_VIRTUAL_P
from the original TEMPLATE_PARM_DECL to the new lowered one.
2020-07-30 Patrick Palka <ppalka@redhat.com>
PR c++/96164
* constraint.cc (constraints_satisfied_p): Return true if
!flags_concepts.
* pt.c (do_type_instantiation): Update a paragraph taken from
[temp.explicit] to reflect the latest specification. Don't
instantiate a member with unsatisfied constraints.
2020-07-29 Jason Merrill <jason@redhat.com>
PR c++/91427
* cp-tree.h (IMPLICIT_RVALUE_P): New.
(enum cp_lvalue_kind_flags): Add clk_implicit_rval.
(implicit_rvalue_p, set_implicit_rvalue_p): New.
* call.c (reference_binding): Check clk_implicit_rval.
(build_over_call): Adjust C++20 implicit move.
* coroutines.cc (finish_co_return_stmt): Simplify implicit move.
* except.c (build_throw): Adjust C++20 implicit move.
* pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Propagate
IMPLICIT_RVALUE_P.
* tree.c (lvalue_kind): Set clk_implicit_rval.
* typeck.c (treat_lvalue_as_rvalue_p): Overhaul.
(maybe_warn_pessimizing_move): Adjust.
(check_return_expr): Adjust C++20 implicit move.
2020-07-29 Jason Merrill <jason@redhat.com>
PR c++/91212
* call.c (build_over_call): Don't call a const ref
overload for implicit move.
2020-07-28 Nathan Sidwell <nathan@acm.org>
* cp-gimplify.c (cp_genericize_r): Set IMPORTED_DECL's context.
* cp-objcp-common.c (cp_pushdecl): Set decl's context.
* decl.c (grokfndecl): Make DECL_CONTEXT setting clearer.
2020-07-28 Nathan Sidwell <nathan@acm.org>
* class.c (fixup_type_variants): Copy TYPE_SIZE and
TYPE_SIZE_UINIT.
(finish_struct): Call it.
2020-07-28 Nathan Sidwell <nathan@acm.org>
* ptree.c (cxx_print_decl): Better indentation.
2020-07-28 Jakub Jelinek <jakub@redhat.com>
Mark Wielaard <mark@klomp.org>
PR c++/96328
* parser.c (cp_lexer_safe_previous_token): Don't call
cp_lexer_previous_token, instead inline it by hand and return NULL
instead of failing assertion if all previous tokens until the first
one are purged.
(cp_parser_error_1): Optimize - only call cp_lexer_safe_previous_token
if token->type is CPP_NAME. Use cp_lexer_safe_previous_token instead
of cp_lexer_previous_token for the missing_token_desc != RT_NONE
case too.
2020-07-27 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (enum cp_tree_index): Add CPTI_AS_BASE_IDENTIFIER.
(as_base_identifier): Define.
* decl.c (initialize_predifined_identifiers): Initialize as_base
identifier.
* class.c (layout_class_type): Name the as-base type. Zap
NSDMI its fields may have.
2020-07-22 Nathan Sidwell <nathan@acm.org>
* class.c (maybe_add_class_template_decl_list): Don't add CONST_DECLs.
2020-07-22 Nathan Sidwell <nathan@acm.org>
* typeck.c (structural_comptypes): [DECLTYPE_TYPE] break
apart complex if.
[UNDERLYING_TYPE]: Use an if.
[TYPEOF_TYPE]: New.
2020-07-22 Nathan Sidwell <nathan@acm.org>
* decl.c (decls_match): Move variables into scopes
they're needed in.
(duplicate_decls): Use STRIP_TEMPLATE.
(build_typename_type): Move var decls to their assignments.
(begin_function_body): Likewise.
* decl2.c (get_guard): Likewise.
(mark_used): Use true for truthiness.
* error.c (dump_aggr_type): Hold the decl in a var called
'decl', not 'name'.
2020-07-22 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (struct tree_lambda_expr): Shrink
default_capture_mode & discriminator.
2020-07-22 Nathan Sidwell <nathan@acm.org>
* mangle.c (decl_is_template_id): Rename to ...
(maybe_template_info): ... here. Return the template info,
rather than use a pointer. Adjust all callers.
(find_substitution): Use template_args_equal, rather than
local check.
2020-07-22 Tobias Burnus <tobias@codesourcery.com>
* parser.c (cp_parser_omp_clause_hint): Require nonnegative hint.
(cp_parser_omp_critical): Permit hint(0) clause without named critical.
* pt.c (tsubst_expr): Re-check the latter for templates.
2020-07-21 Sunil K Pandey <skpgkp2@gmail.com>
PR target/95237
* decl.c (cp_finish_decl): Call target hook
lower_local_decl_alignment to lower local decl alignment.
2020-07-21 Nathan Sidwell <nathan@acm.org>
* parser.c (cp_lexer_consume_token): Drop PRAGMA_EOL assert.
(cp_parser_skip_to_closing_parenthesis_1): Only pass start token
to pragma skipper if recovering.
(cp_parser_skip_to_pragma_eol): Only purge and change pragma
state when recovering.
2020-07-20 Jason Merrill <jason@redhat.com>
* pt.c (type_dependent_expression_p): A pseudo-dtor can be
dependent.
* semantics.c (finish_call_expr): Use build_trivial_dtor_call for
pseudo-destructor.
(finish_pseudo_destructor_expr): Leave type NULL for dependent arg.
2020-07-20 Jason Merrill <jason@redhat.com>
* mangle.c (write_base_ref): New.
(write_expression): Use it for base field COMPONENT_REFs.
* pt.c (invalid_tparm_referent_p): Canonicalize the type
of array offsets. Allow subobjects.
2020-07-20 Jason Merrill <jason@redhat.com>
* pt.c (collect_ctor_idx_types): Add 'const' when deducing from
a string constant.
2020-07-17 Marek Polacek <polacek@redhat.com>
PR c++/79815
* decl.c (grokdeclarator): Detect cv-qual decltype(auto).
* pt.c (do_auto_deduction): Likewise.
2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95591
PR c++/95599
PR c++/95823
PR c++/95824
PR c++/95895
* coroutines.cc (struct coro_ret_data): Delete.
(coro_maybe_expand_co_return): Delete.
(co_return_expander): Delete.
(expand_co_returns): Delete.
(co_await_find_in_subtree): Remove unused name.
(build_actor_fn): Remove unused parm, remove handling
for co_return expansion.
(register_await_info): Demote duplicate info message to a
warning.
(coro_make_frame_entry): Move closer to use site.
(struct susp_frame_data): Add fields for final suspend label
and a flag to indicate await expressions with initializers.
(captures_temporary): Delete.
(register_awaits): Remove unused code, update comments.
(find_any_await): New.
(tmp_target_expr_p): New.
(struct interesting): New.
(find_interesting_subtree): New.
(struct var_nest_node): New.
(flatten_await_stmt): New.
(handle_nested_conditionals): New.
(process_conditional): New.
(replace_statement_captures): Rename to...
(maybe_promote_temps): ... this.
(maybe_promote_captured_temps): Delete.
(analyze_expression_awaits): Check for await expressions with
initializers. Simplify handling for truth-and/or-if.
(expand_one_truth_if): Simplify (map cases that need expansion
to COND_EXPR).
(await_statement_walker): Handle CO_RETURN_EXPR. Simplify the
handling for truth-and/or-if expressions.
(register_local_var_uses): Ensure that we create names in the
implementation namespace.
(morph_fn_to_coro): Add final suspend label to suspend frame
callback data and remove it from the build_actor_fn call.
2020-07-16 Marek Polacek <polacek@redhat.com>
* call.c (convert_like): Remove macro and introduce a new
wrapper instead.
(convert_like_with_context): Likewise.
(convert_like_real): Rename to convert_like.
(convert_like_real_1): Rename to convert_like_internal. Call
convert_like instead of convert_like_real therein.
(perform_direct_initialization_if_possible): Call convert_like
instead of convert_like_real.
2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc: Correct some spelling errors
in comments.
2020-07-15 Nathan Sidwell <nathan@acm.org>
* parser.c (cp_parser_declaration): Avoid copying tokens.
(cp_parser_block_declaration): RAII token pointer.
2020-07-15 Nathan Sidwell <nathan@acm.org>
* parser.c (cp_parser_skip_to_closing_parenthesis_1): Deal with
meeting a deferred pragma.
(cp_parser_skip_to_end_of_statement): Likewise.
(cp_parser_skip_to_end_of_block_or_statement): Likewise.
(cp_parser_skip_to_pragma_eol): We should never meet EOF.
(cp_parser_omp_declare_simd): Likewise.
(cp_parser_omp_declare_reduction, cp_parser_oacc_routine)
(pragma_lex): Likewise.
2020-07-14 Marek Polacek <polacek@redhat.com>
PR c++/95789
PR c++/96104
PR c++/96179
* call.c (convert_like_real_1): Renamed from convert_like_real.
(convert_like_real): New wrapper for convert_like_real_1.
2020-07-14 Nathan Sidwell <nathan@acm.org>
* parser.c (cp_lexer_alloc): Do not deal with PCH here.
(cp_lexer_new_main): Deal with PCH here. Store the tokens directly
into the buffer.
(cp_lexer_new_from_tokens): Assert last token isn't purged either.
(cp_lexer_get_preprocessor_token): Change first arg to flags, adjust.
(cp_parser_new): Pass the lexer in, don't create it here.
(cp_parser_translation_unit): Initialize access checks here.
(cp_parser_initial_pragma): First token is provided by caller,
don't deal with PCH stopping here. Adjust error message.
(c_parse_file): Adjust, change error message to avoid C++20 module
confusion.
2020-07-14 Nathan Sidwell <nathan@acm.org>
* ptree.c (cxx_print_type): Add TYPEOF_TYPE and BASES.
2020-07-14 Nathan Sidwell <nathan@acm.org>
* class.c (build_base_field_1): Cache CLASSTYPE_AS_BASE.
(build_self_reference): Rename value -> decl.
(dump_class_hierarchy_1): Cache CLASSTYPE_AS_BASE.
2020-07-14 Marek Polacek <polacek@redhat.com>
PR c++/95820
* decl.c (grokdeclarator) <case cdk_function>: Check also
pointers/references/... to functions.
2020-07-14 Nathan Sidwell <nathan@acm.org>
* cp-tree.h: Correct some tree lang flag comments,
reformat some structure definitions. Note some structure
sizes. Clarify some comments.
(yyungetc): Delete. Not been a thing for some time.
* class.c (copy_fndecl_with_name): Comment.
(check_bases_and_members): Unnecessary {}.
(layout_class_type): Comment.
* cp-tree.def (UNBOUND_CLASS_TEMPLATE): Adjust comment.
* decl.c: Fix some formatting & whitespace issues.
(function_requirements_equivalent_p): Note why
substitutions are needed.
* decl2.c (no_linkage_error): Note that heroics about
'typedef struct { ... };' are no longer needed.
* method.c: Whitespace.
* name-lookup.c: Whitespace.
(add_decl_to_level): Reformat a line.
(print_binding_stack): Mark as DEBUG_FUNCTION.
(has_using_namespace_std_directive_p): Delete comment.
* pt.c: Whitespace
* ptree.c: Whitespace.
* rtti.c: Whitespace & comment.
* tree.c: Comment.
* typeck.c (structural_comptypes): Add comment.
2020-07-13 Nathan Sidwell <nathan@acm.org>
* Make-lang.in (c++.disclean): Likewise.
2020-07-13 Marek Polacek <polacek@redhat.com>
PR c++/96077
* parser.c (cp_parser_enum_specifier): Commit to tentative parse
after we've seen an opening brace.
2020-07-10 Jason Merrill <jason@redhat.com>
* tree.c (structural_type_p): Allow unions.
* mangle.c (write_expression): Express unions with a designator.
2020-07-10 Jason Merrill <jason@redhat.com>
* pt.c (convert_nontype_argument): Handle REAL_TYPE.
(invalid_nontype_parm_type_p): Allow all structural types.
* tree.c (structural_type_p): Use SCALAR_TYPE_P.
2020-07-10 Jason Merrill <jason@redhat.com>
PR c++/96105
PR c++/96052
PR c++/95976
* class.c (check_field_decls): An array of empty classes is not an
empty data member.
(layout_empty_base_or_field): Handle explicit alignment.
Fix union handling.
2020-07-09 Julian Brown <julian@codesourcery.com>
Thomas Schwinge <thomas@codesourcery.com>
PR middle-end/95270
* semantics.c (finish_omp_clauses): Likewise.
2020-07-09 Patrick Palka <ppalka@redhat.com>
PR c++/96132
* constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
Restore dependent_type_p check that guarded the call to
is_really_empty_class.
2020-07-08 Patrick Palka <ppalka@redhat.com>
PR c++/95497
* constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
When processing_template_decl, check COMPLETE_TYPE_P before
calling is_really_empty_class. Don't check dependent_type_p.
2020-07-08 Marek Polacek <polacek@redhat.com>
PR c++/96103
* parser.c (cp_parser_decltype): Print error about using decltype(auto)
in C++11. Check that the token following "auto" is ")".
2020-07-07 Patrick Palka <ppalka@redhat.com>
PR c++/95303
* cxx-pretty-print.c (pp_cxx_unqualified_id): Check
PRIMARY_TEMPLATE_P before printing the innermost template
arguments.
2020-07-07 Martin Sebor <msebor@redhat.com>
PR c++/96063
* parser.c (class_decl_loc_t::diag_mismatched_tags): Print notes only
if warning_at returns nonzero.
2020-07-06 Martin Sebor <msebor@redhat.com>
PR c++/95984
* call.c (build_over_call): Check calls only when tf_warning is set.
2020-07-06 Nathan Sidwell <nathan@acm.org>
* decl.c (push_library_fn): Return the decl pushdecl_toplevel returns.
* except.c (verify_library_fn): Replace with ...
(declare_library_fn_1): ... this fn. Always push the fn.
(declare_library_fn): Call it.
(build_throw): Call declare_library_fn_1.
2020-07-06 Jonathan Wakely <jwakely@redhat.com>
PR c++/96068
* parser.c (cp_parser_toplevel_declaration): Only do pedwarn for
empty-declaration in C++98.
2020-07-02 Jason Merrill <jason@redhat.com>
Jakub Jelinek <jakub@redhat.com>
* decl.c (grokfndecl): Allow consteval virtual.
* search.c (check_final_overrider): Check consteval mismatch.
* constexpr.c (cxx_eval_thunk_call): New.
(cxx_eval_call_expression): Call it.
* cvt.c (cp_get_fndecl_from_callee): Handle FDESC_EXPR.
* decl2.c (mark_vtable_entries): Track vtables with consteval.
(maybe_emit_vtables): Pass consteval_vtables through.
(clear_consteval_vfns): Replace consteval with nullptr.
(c_parse_final_cleanups): Call it.
2020-07-01 Nathan Sidwell <nathan@acm.org>
* class.c (copy_fndecl_with_name): Add additional predicate args, do
not deduce them locally.
(copy_operator_fn): Adjust copy_fndecl_with_name call.
(build_clone): Add vtt and inherited predicate args. Pass through
to copy_fndecl_with_name call.
(build_cdtor_clones): Likewise, pass through to build_clone as
needed.
(build_cdtor): Determine vtt and inherited here.
* cp-tree.h (DECL_NEEDS_CTT_PARM_P): Delete.
2020-06-30 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (copy_fndecl_with_name): Rename to ...
(copy_operatorn_fn): ... this. Change arg type.
(clone_function_decl): Rename to ...
(clone_cdtor): ... this.
* class.c (copy_fndecl_with_name): Make static.
(copy_operator_fn): New wrapper.
(build_clones): Rename to ...
(build_cdtor_clones): ... this.
(clone_function_decl): Rename to ...
(clone_cdtor): ... this. Adjust build_clones calls.
(clone_constructors_and_destructors): Adjust clone_function_decl
calls.
* method.c (implicitly_declare_fn): Adjust copy_fndecl_with_name
call.
(lazily_declare_fn): Adjust clone_function_decl call.
* pt.c (tsubst_function_decl): Likewise.
(instantiate_template_1): Likewise.
2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (morph_fn_to_coro): Remove trailing
space in a diagnostic.
2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (expand_one_await_expression): Remove
code dealing with initial suspend.
(build_actor_fn): Remove code special-casing initial
and final suspend. Handle the final suspend and marking
of the coroutine as done.
(coro_rewrite_function_body): New.
(bind_expr_find_in_subtree): Remove.
(coro_body_contains_bind_expr_p): Remove.
(morph_fn_to_coro): Split the rewrite of the original
function into coro_rewrite_function_body and call it.
2020-06-29 Marek Polacek <polacek@redhat.com>
PR c++/94553
* decl.c (duplicate_decls): Make sure a concept or a variable
template is unique in its declarative region.
2020-06-29 Marek Polacek <polacek@redhat.com>
PR c++/95568
* pt.c (collect_ctor_idx_types): Use TREE_TYPE.
2020-06-28 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95711
* coroutines.cc (register_local_var_uses): Skip past
namespace decls.
2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95736
* coroutines.cc (get_awaitable_var): New helper.
(build_co_await): Check more carefully before
copying an awaitable.
(expand_one_await_expression): No initializer
is required when the awaitable is not a temp.
(register_awaits): Remove handling that is now
completed when the await expression is built.
2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (morph_fn_to_coro): Diagnose unavailable
get_return_object_on_allocation_failure.
2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95519
* coroutines.cc (struct coroutine_info):Add a field
to hold computed p.return_void expressions.
(coro_build_promise_expression): New.
(get_coroutine_return_void_expr): New.
(finish_co_yield_expr): Build the promise expression
using coro_build_promise_expression.
(finish_co_return_stmt): Likewise.
(build_init_or_final_await): Likewise.
(morph_fn_to_coro): Likewise, for several cases.
2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (morph_fn_to_coro): Handle error
returns in building g-r-o-o-a-f expressions.
2020-06-24 Nicholas Krause <xerofoify@gmail.com>
PR c++/95672
* typeck2.c (cxx_incomplete_type_diagnostic): Add missing
TYPE_EXPANSION_PACK check for diagnosing incomplete types in
cxx_incomplete_type_diagnostic.
2020-06-24 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95518
PR c++/95813
* coroutines.cc (act_des_fn): Copy function
attributes onto the outlined coroutine helpers.
2020-06-24 Jason Merrill <jason@redhat.com>
* call.c (build_over_call): Only call build_base_path once.
2020-06-24 Jason Merrill <jason@redhat.com>
PR c++/95719
* call.c (build_over_call): Look up the overrider in base_binfo.
* class.c (lookup_vfn_in_binfo): Look through BINFO_PRIMARY_P.
2020-06-23 Jason Merrill <jason@redhat.com>
PR c++/93976
Implement C++20 P2082R1, Fixing CTAD for aggregates.
* cp-tree.h (TPARMS_PRIMARY_TEMPLATE): Split out from...
(DECL_PRIMARY_TEMPLATE): ...here.
(builtin_guide_p): Declare.
* decl.c (reshape_init_class): Handle bases of a template.
(reshape_init_r): An array with dependent bound takes a single
initializer.
* pt.c (tsubst_default_argument): Shortcut {}.
(unify_pack_expansion): Allow omitted arguments to trailing pack.
(builtin_guide_p): New.
(collect_ctor_idx_types): Give a trailing pack a {} default
argument. Handle arrays better.
2020-06-23 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95477
* coroutines.cc (morph_fn_to_coro): Apply a cleanup to
the get return object when the DTOR is non-trivial.
2020-06-20 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95505
* coroutines.cc (morph_fn_to_coro): Update handling of
get-return-object-on-allocation-fail and diagnose missing
std::nothrow.
2020-06-20 Jason Merrill <jason@redhat.com>
* call.c (joust): Only compare constraints for non-template
candidates with matching parameters.
* pt.c (tsubst_pack_expansion): Fix getting a type parameter
pack.
(more_specialized_fn): Only compare constraints for candidates with
matching parameters.
2020-06-19 Jason Merrill <jason@redhat.com>
* method.c (early_check_defaulted_comparison): Allow defaulting
comparison outside class. Complain if non-member operator isn't a
friend.
2020-06-18 Jason Merrill <jason@redhat.com>
* method.c (early_check_defaulted_comparison): Check for &&.
(build_comparison_op): Allow empty union. Diagnose non-category
type.
(common_comparison_type): Remove handling for non-category type.
2020-06-18 Marek Polacek <polacek@redhat.com>
PR c++/95735
* pt.c (finish_template_variable): Return if
coerce_innermost_template_parms return error_mark_node.
2020-06-18 Marek Polacek <polacek@redhat.com>
PR c++/95728
* pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
if placement is erroneous.
2020-06-17 Jonathan Wakely <jwakely@redhat.com>
PR c++/66159
* parser.c (cp_parser_elaborated_type_specifier): Do not warn
unless in a declaration.
2020-06-17 Jason Merrill <jason@redhat.com>
* cp-tree.h (copy_fndecl_with_name): Declare.
* class.c (copy_fndecl_with_name): Split out from...
(build_clone): ...here.
(add_implicitly_declared_members): Add op== to TYPE_FIELDS.
* method.c (implicitly_declare_fn): Use copy_fndecl_with_name.
2020-06-17 Jason Merrill <jason@redhat.com>
* call.c (build_new_op_1): Don't look for a CALL_EXPR when
calling a consteval function.
2020-06-17 Jason Merrill <jason@redhat.com>
* decl2.c (grokfield): Pass SD_DEFAULTED and SD_DELETED.
* decl.c (duplicate_decls): Reduce error for delete
after earlier declaration to pedwarn.
2020-06-17 Marek Polacek <polacek@redhat.com>
PR c++/95508
* constexpr.c (maybe_fold_non_dependent_expr): New.
* cp-tree.h (maybe_fold_non_dependent_expr): Declare.
* typeck.c (cp_build_array_ref): Call maybe_fold_non_dependent_expr
instead of maybe_constant_value.
2020-06-16 Marek Polacek <polacek@redhat.com>
PR c++/95369
* call.c (add_list_candidates): Return if a designated initializer
is used with a non-aggregate.
(implicit_conversion_error): Give an error for the case above.
2020-06-16 Marek Polacek <polacek@redhat.com>
PR c++/95560
* name-lookup.c (check_local_shadow): Check if types are
non-null before calling same_type_p.
2020-06-16 Jakub Jelinek <jakub@redhat.com>
* semantics.c (handle_omp_for_class_iterator): Adjust
c_omp_check_loop_iv_exprs caller.
(finish_omp_for): Likewise. Don't call fold_build_cleanup_point_expr
before calling c_finish_omp_for and c_omp_check_loop_iv, move it
after those calls.
* pt.c (tsubst_omp_for_iterator): Handle non-rectangular loops.
2020-06-16 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_omp_clause_schedule): Reject modifier separated
from kind by comma rather than colon.
2020-06-16 Patrick Palka <ppalka@redhat.com>
* pt.c (perform_instantiation_time_access_checks): No need to
tsubst into decl.
* semantics.c (enforce_access): Verify that decl is not
dependent.
2020-06-16 Patrick Palka <ppalka@redhat.com>
PR c++/41437
PR c++/47346
* cp-tree.h (qualified_typedef_usage_s): Delete.
(qualified_typedef_usage_t): Delete.
(deferred_access_check): Move up in file.
(tree_template_info::typedefs_needing_access_checking): Delete.
(tree_template_info::deferred_access_checks): New field.
(TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): Rename to ...
(TI_DEFERRED_ACCESS_CHECKS): ... this, and adjust accordingly.
* pt.c (perform_typedefs_access_check): Rename to ...
(perform_instantiation_time_access_checks): ... this, and adjust
accordingly. Remove unnecessary tree tests.
(instantiate_class_template_1): Adjust accordingly.
(instantiate_decl): Likewise.
* semantics.c (enforce_access): Likewise.
2020-06-16 Patrick Palka <ppalka@redhat.com>
PR c++/41437
PR c++/47346
* call.c (enforce_access): Move to semantics.c.
* cp-tree.h (enforce_access): Delete.
(get_types_needing_access_check): Delete.
(add_typedef_to_current_template_for_access_check): Delete.
* decl.c (make_typename_type): Adjust accordingly. Use
check_accessibility_of_qualified_id instead of directly using
perform_or_defer_access_check.
* parser.c (cp_parser_template_declaration_after_parameters):
Don't push a dk_no_check access state when parsing a template.
* pt.c (get_types_needing_access_check): Delete.
(append_type_to_template_for_access_check_1): Delete.
(perform_typedefs_access_check): Adjust. If type_decl is a
FIELD_DECL, also check its DECL_CONTEXT for dependence. Use
tsubst_copy instead of tsubst to substitute into type_decl so
that we substitute into the DECL_CONTEXT of a FIELD_DECL.
(append_type_to_template_for_access_check): Delete.
* search.c (accessible_p): Remove the processing_template_decl
early exit.
* semantics.c (enforce_access): Moved from call.c. If we're
parsing a template and the access check failed, add the check to
TI_TYPEDEFS_NEEDING_ACCESS_CHECKING.
(perform_or_defer_access_check): Adjust comment.
(add_typedef_to_current_template_for_access_check): Delete.
(check_accessibility_of_qualified_id): Adjust accordingly.
Exit early if the scope is dependent.
2020-06-11 Patrick Palka <ppalka@redhat.com>
PR c++/93467
* constraint.cc (associate_classtype_constraints): If there is a
discrepancy between the current template depth and the template
depth of the original declaration, then adjust the template
parameter depth within the current constraints appropriately.
* pt.c (tsubst_friend_class): Substitute into and set the
constraints on the injected declaration.
2020-06-11 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (instantiate_coro_traits): Pass a reference
to lambda closure objects to traits instantiation.
(morph_fn_to_coro): Likewise for promise parameter
preview and allocator lookup.
2020-06-10 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95440
* call.c (add_candidates): Use vec_safe_length() for
testing the arguments list.
(build_new_method_call_1): Use vec_safe_is_empty() when
checking for an empty args list.
2020-06-10 Marek Polacek <polacek@redhat.com>
PR c++/95562
* parser.c (cp_parser_direct_declarator): Clear
CP_PARSER_FLAGS_DELAY_NOEXCEPT if the declarator kind is not
cdk_id.
2020-06-09 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95137
* coroutines.cc (expand_one_await_expression): Build separate
DTOR trees for the awaitable object on the destroy and resume
paths.
2020-06-09 Jason Merrill <jason@redhat.com>
PR c++/95552
* cp-gimplify.c (predeclare_vla): Only predeclare a VLA if it's
wrapped in a pointer type.
2020-06-05 Marek Polacek <polacek@redhat.com>
PR c++/95369
* call.c (build_converted_constant_expr_internal): Allow
list-initialization.
2020-06-05 Iain Sandoe <iain@sandoe.co.uk>
* cp-tree.def (CO_RETURN_EXPR): Correct the class
to use tcc_statement.
2020-06-05 Jason Merrill <jason@redhat.com>
* error.c (dump_binary_op): Handle negative operand to
POINTER_PLUS_EXPR.
2020-06-04 Jason Merrill <jason@redhat.com>
PR c++/93310
* constexpr.c (cxx_eval_constant_expression) [OBJ_TYPE_REF]:
Evaluate OBJ_TYPE_REF_EXPR.
2020-06-04 Jason Merrill <jason@redhat.com>
PR c++/95158
* class.c (lookup_vfn_in_binfo): New.
* call.c (build_over_call): Use it.
* cp-tree.h (resolves_to_fixed_type_p): Add default argument.
(lookup_vfn_in_binfo): Declare.
2020-06-04 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95346
* coroutines.cc (morph_fn_to_coro): Ensure that the get-
return-object is constructed correctly; When it is not the
final return value, pass it to the CTOR of the return type
as an rvalue, per the standard comment.
2020-06-04 Jakub Jelinek <jakub@redhat.com>
PR c++/82304
PR c++/95307
* constexpr.c (cxx_eval_constant_expression): Diagnose CONVERT_EXPR
conversions from pointer types to arithmetic types here...
(cxx_eval_outermost_constant_expr): ... instead of here.
2020-06-03 Mark Wielaard <mark@klomp.org>
* parser.c (cp_lexer_safe_previous_token): New function.
(cp_parser_error_1): Add name_hint if the previous token is
a string literal and next token is a CPP_NAME and we have a
missing header suggestion for the name.
2020-06-03 Patrick Palka <ppalka@redhat.com>
* pt.c (process_partial_specialization): Pass the full set of
generic template arguments to strictly_subsumes.
2020-06-03 Patrick Palka <ppalka@redhat.com>
PR c++/92103
* pt.c (most_specialized_partial_spec): Reorganize the loop over
DECL_TEMPLATE_SPECIALIZATIONS. Check constraints_satisfied_p on
the original template declaration, not on the tsubsted one.
2020-06-03 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95345
* coroutines.cc (finish_co_await_expr): Revise to allow for
parameter packs.
(finish_co_yield_expr): Likewise.
2020-06-03 Jason Merrill <jason@redhat.com>
PR c++/95232
* cp-tree.h (predeclare_vla): Declare.
* cp-gimplify.c (predeclare_vla): Handle getting a decl.
* pt.c (tsubst_expr) [DECL_EXPR]: Use it.
2020-06-03 Tobias Burnus <tobias@codesourcery.com>
* cp-gimplify.c (cxx_omp_predetermined_mapping): New.
* cp-objcp-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redfine.
* cp-tree.h (cxx_omp_predetermined_mapping): Declare.
2020-06-02 Jason Merrill <jason@redhat.com>
PR c++/95193
* pt.c (tsubst_decl): Relax assert.
2020-06-02 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95050
* coroutines.cc (build_co_await): Wrap the co_await expression
in a TARGET_EXPR, where needed.
(finish_co_yield_expr): Likewise.
2020-06-02 Patrick Palka <ppalka@redhat.com>
PR c++/92633
PR c++/92838
* pt.c (tsubst_function_decl): Don't do set_constraints when
regenerating a lambda.
(tsubst_lambda_expr): Substitute into the lambda's constraints
and do set_constraints here.
2020-06-01 Jason Merrill <jason@redhat.com>
PR c++/95466
PR c++/95311
PR c++/95221
* class.c (build_vfn_ref): Revert 95311 change.
* cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): Build a
COMPOUND_EXPR.
2020-06-01 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95350
* coroutines.cc (struct param_info): Remove rv_ref field.
(build_actor_fn): Remove specifial rvalue ref handling.
(morph_fn_to_coro): Likewise.
2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95087
* coroutines.cc (morph_fn_to_coro): If we see an
early fatal error, drop the erroneous function body.
2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (build_co_await): Remove unused
variable.
(finish_co_await_expr): Likewise.
(finish_co_yield_expr): Likewise; revise comment.
2020-05-30 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (morph_fn_to_coro): Revise initialization
of the frame pointer to avoid an unused value.
2020-05-30 Patrick Palka <ppalka@redhat.com>
PR c++/95386
* constraint.cc (satisfaction_value): Accept INTEGER_CST of any
boolean type.
2020-05-29 Patrick Palka <ppalka@redhat.com>
Jason Merrill <jason@redhat.com>
PR c++/95181
* class.c (add_method): Let special member function templates
coexist if they are not equivalently constrained, or in a class
template.
2020-05-29 Jason Merrill <jason@redhat.com>
PR c++/95371
* pt.c (process_template_parm): Set DECL_TEMPLATE_INFO
on the DECL_TEMPLATE_RESULT.
2020-05-29 Marek Polacek <polacek@redhat.com>
PR c++/95344
* cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set
TREE_THIS_VOLATILE here.
(cp_fold): Set it here along with TREE_NO_WARNING.
2020-05-29 Jason Merrill <jason@redhat.com>
PR c++/95311
PR c++/95221
* class.c (build_vfn_ref): Don't fold the INDIRECT_REF.
2020-05-29 Patrick Palka <ppalka@redhat.com>
PR c++/92652
PR c++/93698
PR c++/94128
* parser.c (cp_parser_requires_clause_expression): Temporarily
increment processing_template_decl only if it is 0.
(cp_parser_constraint_expression): Likewise.
(cp_parser_requires_expression): Likewise.
2020-05-29 Patrick Palka <ppalka@redhat.com>
PR c++/95241
* constexpr.c (get_or_insert_ctor_field): Add limited support
for RANGE_EXPR index lookups.
2020-05-28 Jakub Jelinek <jakub@redhat.com>
PR c++/95328
* decl.c (cp_finish_decomp): Call complete_type before checking
COMPLETE_TYPE_P.
2020-05-28 Jason Merrill <jason@redhat.com>
PR c++/94926
* decl.c (cp_finish_decl): Revert r9-297 change.
(check_static_variable_definition): Likewise.
* constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
* pt.c (instantiate_decl): Return early on type error.
2020-05-27 Jason Merrill <jason@redhat.com>
PR c++/95319
* decl.c (reshape_init_array_1): Don't reuse in overload context.
2020-05-27 Jason Merrill <jason@redhat.com>
PR c++/95242
* call.c (build_new_op_1): Suppress
warn_zero_as_null_pointer_constant across comparison of <=> result
to 0.
2020-05-27 Jason Merrill <jason@redhat.com>
PR c++/95222
* decl.c (grokdeclarator): Don't shift attributes in TYPENAME
context.
2020-05-27 Nathan Sidwell <nathan@acm.org>
PR c++/95263
* pt.c (lookup_template_class_1): Restore alias template mutation.
2020-05-26 Jakub Jelinek <jakub@redhat.com>
PR c++/95197
* cp-gimplify.c: Include omp-general.h.
(cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration
variables in composite distribute parallel for, instantiate copy
ctor of their types.
2020-05-23 Patrick Palka <ppalka@redhat.com>
PR c++/94038
* constexpr.c (cxx_eval_constant_expression)
<case TEMPLATE_ID_EXPR>: Don't evaluate the concept when
constexpr evaluation is uid-sensitive.
2020-05-22 Jason Merrill <jason@redhat.com>
* cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Don't preevaluate
the function address if the call used operator syntax.
2020-05-21 Jason Merrill <jason@redhat.com>
PR c++/95221
* cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): For a virtual
call, instrument the OBJ_TYPE_REF.
* decl.c (compute_array_index_type_loc): Diagnose expressions
in a template that can't be constant.
* parser.c (cp_parser_direct_declarator): Don't check
non-constant array bounds here.
* cp-tree.h (is_rvalue_constant_expression): Declare.
* constexpr.c (is_rvalue_constant_expression): New.
* parser.c (cp_parser_constant_expression): Use it.
* decl.c (cp_finish_decl): Try to treat a constexpr initializer in a
template as constant.
* typeck.c (build_x_modify_expr): Handle error_mark_node arguments.
* decl.c (grokparms): Return NULL_TREE if any parms were erroneous.
2020-05-21 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (finish_co_return_stmt): Revert change to use
finish_expr_stmt.
2020-05-21 Patrick Palka <ppalka@redhat.com>
PR c++/94038
* constexpr.c (constexpr_ctx::uid_sensitive): Remove field.
(uid_sensitive_constexpr_evaluation_value): Define.
(uid_sensitive_constexpr_evaluation_true_counter): Define.
(uid_sensitive_constexpr_evaluation_p): Define.
(uid_sensitive_constexpr_evaluation_sentinel): Define its
constructor.
(uid_sensitive_constexpr_evaluation_checker): Define its
constructor and its evaluation_restricted_p method.
(get_fundef_copy): Remove 'ctx' parameter. Use u_s_c_e_p
instead of constexpr_ctx::uid_sensitive.
(cxx_eval_call_expression): Use u_s_c_e_p instead, and test it
last. Adjust call to get_fundef_copy.
(instantiate_cx_fn_r): Test u_s_c_e_p so that we increment the
counter if necessary.
(cxx_eval_outermost_constant_expr): Remove 'uid_sensitive'
parameter. Adjust function body accordingly.
(maybe_constant_value): Remove 'uid_sensitive' parameter and
adjust function body accordingly. Set up a
uid_sensitive_constexpr_evaluation_checker, and use it to
conditionally update the cv_cache.
* cp-gimplify.c (cp_fold): Set up a
uid_sensitive_constexpr_evaluation_checker, and use it to
conditionally update the fold_cache.
* cp-tree.h (maybe_constant_value): Update declaration.
(struct uid_sensitive_constexpr_evaluation_sentinel): Define.
(struct sensitive_constexpr_evaluation_checker): Define.
* expr.c (fold_for_warn): Set up a
uid_sensitive_constexpr_evaluation_sentinel before calling
the folding subroutines. Drop all but the first argument to
maybe_constant_value.
2020-05-20 Marek Polacek <polacek@redhat.com>
DR 2237
* parser.c (cp_parser_unqualified_id): Reject simple-template-id as
the declarator-id of a destructor.
(cp_parser_constructor_declarator_p): Reject simple-template-id as
the declarator-id of a constructor.
2020-05-20 Marek Polacek <polacek@redhat.com>
DR 2289
PR c++/94553
* cp-tree.h (SD_DECOMPOSITION): New flag.
* decl.c (duplicate_decls): Make sure a structured binding is unique
in its declarative region.
(start_decl): If INITIALIZED is SD_DECOMPOSITION, call
fit_decomposition_lang_decl.
(grokdeclarator): Compare INITIALIZED directly to SD_* flags.
* parser.c (cp_parser_decomposition_declaration): Pass SD_DECOMPOSITION
to start_decl.
2020-05-20 Patrick Palka <ppalka@redhat.com>
PR c++/95223
* typeck.c (structural_comptypes): Don't perform
context-dependent resolution of TYPENAME_TYPEs when
comparing_specializations.
2020-05-19 Nathan Sidwell <nathan@acm.org>
* pt.c (lookup_template_class_1): Do not reinit template_info of an
alias here.
2020-05-18 Martin Sebor <msebor@redhat.com>
PR c++/94923
* call.c ((maybe_warn_class_memaccess): Use is_byte_access_type.
* cp-tree.h (is_dummy_object): Return bool.
(is_byte_access_type): Declare new function.
* tree.c (is_dummy_object): Return bool.
(is_byte_access_type): Define new function.
2020-05-19 Patrick Palka <ppalka@redhat.com>
PR c++/87847
* pt.c (init_template_processing): Enable sanitization for
decl_specializations and type_specializations.
PR c++/66439
* pt.c (fn_type_unification): Pass 'fn' instead of NULL_TREE as
the 'in_decl' parameter to coerce_template_parms.
2020-05-18 Marek Polacek <polacek@redhat.com>
PR c++/94955
* typeck.c (cp_build_binary_op): Use fold_for_warn instead of
cp_fold_rvalue.
2020-05-18 Marek Polacek <polacek@redhat.com>
PR c++/94937
* cvt.c (cp_get_fndecl_from_callee): Return NULL_TREE if the function
type is not INDIRECT_TYPE_P.
* decl.c (omp_declare_variant_finalize_one): Call
cp_get_callee_fndecl_nofold instead of looking for the function decl
manually.
2020-05-18 Marek Polacek <polacek@redhat.com>
PR c++/90915
* parser.c (cp_parser_has_attribute_expression): Sorry on a
type-dependent argument.
2020-05-18 Marek Polacek <polacek@redhat.com>
DR 1512
PR c++/87699
* call.c (add_builtin_candidate) <case EQ_EXPR>: Create candidate
operator functions when type is std::nullptr_t for ==/!=.
* typeck.c (composite_pointer_type_r): Add a bool * parameter. Use it
to maybe add "const" to the pointer type.
(composite_pointer_type): Update the call to composite_pointer_type_r.
(cp_build_binary_op): Turn two warning_at into error_at. Print the
types.
2020-05-18 Jason Merrill <jason@redhat.com>
* call.c (build_over_call): Remove unnecessary
cp_stabilize_reference.
2020-05-18 Marek Polacek <polacek@redhat.com>
* call.c (add_builtin_candidate): Don't create a builtin overload
candidate for ++ when type is bool in C++17.
2020-05-18 Marek Polacek <polacek@redhat.com>
* cfns.h: Regenerated.
2020-05-17 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (morph_fn_to_coro): Initialize the gro variable.
2020-05-16 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (finish_co_return_stmt): Implement rules
from [class.copy.elision] /3.
2020-05-16 Patrick Palka <ppalka@redhat.com>
PR c++/57943
* semantics.c (finish_decltype_type): Call
instantiate_non_dependent_expr_sfinae on the expression.
2020-05-15 Patrick Palka <ppalka@redhat.com>
Revert:
2020-04-07 Patrick Palka <ppalka@redhat.com>
PR c++/90996
* typeck2.c (process_init_constructor_array): Propagate
CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
the array initializer.
2020-05-15 Jason Merrill <jason@redhat.com>
PR c++/93286 - ICE with __is_constructible and variadic template.
* pt.c (tsubst_tree_list): New.
(tsubst, tsubst_copy_and_build): Use it.
* decl2.c (is_late_template_attribute): Handle error_mark_node args.
2020-05-15 Nathan Sidwell <nathan@acm.org>
* pt.c (template_args_equal): Fix thinkos in previous 'cleanup'.
2020-05-14 Jason Merrill <jason@redhat.com>
PR c++/93901
* pt.c (maybe_instantiate_noexcept): Change clone handling.
2020-05-14 Patrick Palka <ppalka@redhat.com>
PR c++/78446
* call.c (build_op_call): Pass complain to lookup_fnfields.
(build_special_member_call): Likewise.
* class.c (type_requires_array_cookie): Pass tf_warning_or_error
to lookup_fnfields.
* cp-tree.h (lookup_fnfields): Add tsubst_flags_t parameter.
* except.c (build_throw): Pass tf_warning_or_error to
lookup_fnfields.
* init.c (build_new_1): Pass complain to lookup_fnfields.
* method.c (locate_fn_flags): Likewise.
* name-lookup.c (lookup_name_real_1): Pass tf_warning_or_error
to lookup_fnfields.
* pt.c (tsubst_baselink): Pass complain to lookup_fnfields.
* search.c (lookup_fnfields): New 'complain' parameter. Pass it
to lookup_member.
2020-05-14 Nathan Sidwell <nathan@acm.org>
* parser.c (cp_parser_diagnose_invalid_typename): Mention
std=c++20 not 2a, reformat dependent binfo inform loops.
* pt.c (tsubst_template_decl): Reorder and commonize some control
paths.
* pt.c (tsubst_friend_function): Simplify control flow.
* pt.c (lookup_template_class_1): Remove unnecessary else by
simply grabbing TYPE_NAME earlier.
* pt.c (push_template_decl_real): Adjust friend pushing logic.
Reinit template type.
* pt.c (build_template_decl): Init DECL_TEMPLATE_RESULT &
TREE_TYPE here ...
(process_partial_specialization): ... not here ...
(push_template_decl_real, add_inherited_template_parms)
(build_deduction_guide): ... or here.
2020-05-14 Jakub Jelinek <jakub@redhat.com>
* cp-gimplify.c (cp_genericize_r): Set cfun->has_omp_target.
2020-05-13 Patrick Palka <ppalka@redhat.com>
PR c++/79706
* init.c (build_vec_delete_1): Just return error_mark_node if
deallocate_expr is error_mark_node.
(build_delete): Just return error_mark_node if do_delete is
error_mark_node.
2020-05-13 Patrick Palka <ppalka@redhat.com>
PR c++/95020
* constraint.cc (tsubst_requires_expr): Produce a new
requires-expression when processing_template_decl, even if
template arguments are not dependent.
2020-05-13 Marek Polacek <polacek@redhat.com>
PR c++/95066
* decl.c (duplicate_decls): Set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
2020-05-13 Nathan Sidwell <nathan@acm.org>
* pt.c (template_args_equal): Reorder category checking for
clarity.
* pt.c (perform_typedefs_access_check): Cache expensively
calculated object references.
(check_auto_in_tmpl_args): Just assert we do not get unexpected
nodes, rather than silently do nothing.
(append_type_to_template_for_access): Likewise, cache expensie
object reference.
* pt.c (canonical_type_parameter): Simplify.
Formatting fixups & some simplifications.
* pt.c (spec_hash_table): New typedef.
(decl_specializations, type_specializations): Use it.
(retrieve_specialization): Likewise.
(register_specialization): Remove unnecessary casts.
(push_template_decl_real): Reformat.
(instantiate_class_template_1): Use more RAII.
(make_argument_pack): Simplify.
(instantiate_template_1): Use gcc_checking_assert for expensive
asserts.
(instantiate_decl): Likewise.
(resolve_typename_type): Reformat comment.
* semantics.c (struct deferred_access): Remove unnecessary GTY on
member.
(begin_class_definition): Fix formatting.
2020-05-13 Jason Merrill <jason@redhat.com>
* call.c, class.c, constexpr.c, constraint.cc, decl.c, init.c,
lambda.c, lex.c, method.c, name-lookup.c, parser.c, pt.c, tree.c,
typeck2.c: Change cxx2a to cxx20.
2020-05-12 Marek Polacek <polacek@redhat.com>
PR c++/95074
* parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: When
looking for a block-scope function declaration, look through the whole
set, not just the first function in the overload set.
2020-05-12 Jakub Jelinek <jakub@redhat.com>
PR c++/95063
* pt.c (tsubst_decl): Deal with DECL_OMP_PRIVATIZED_MEMBER for
a bit-field.
2020-05-11 Jason Merrill <jason@redhat.com>
Resolve C++20 NB comment CA104
* pt.c (determine_specialization): Compare constraints for
specialization of member template of class instantiation.
2020-05-11 Jason Merrill <jason@redhat.com>
PR c++/92583
PR c++/92654
* tree.c (cp_walk_subtrees): Stop at typedefs.
Handle TYPENAME_TYPE here.
* pt.c (find_parameter_packs_r): Not here.
(for_each_template_parm_r): Clear *walk_subtrees.
* decl2.c (min_vis_r): Look through typedefs.
2020-05-11 Jason Merrill <jason@redhat.com>
* call.c (implicit_conversion_error): Split out from...
(perform_implicit_conversion_flags): ...here.
(build_converted_constant_expr_internal): Use it.
2020-05-11 Jason Merrill <jason@redhat.com>
PR c++/90748
* parser.c (inject_parm_decls): Set current_class_ptr here.
(cp_parser_direct_declarator): And here.
(cp_parser_late_return_type_opt): Not here.
(cp_parser_noexcept_specification_opt): Nor here.
(cp_parser_exception_specification_opt)
(cp_parser_late_noexcept_specifier): Remove unneeded parameters.
2020-05-11 Jason Merrill <jason@redhat.com>
* decl.c (cxx_init_decl_processing): Call declare_weak for
__cxa_pure_virtual.
2020-05-11 Jason Merrill <jason@redhat.com>
* pt.c (instantiate_class_template_1): Call tsubst_expr for
STATIC_ASSERT member.
* ptree.c (cxx_print_xnode): Handle STATIC_ASSERT.
2020-05-11 Jason Merrill <jason@redhat.com>
* pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Remove redundant
walking of capture list.
2020-05-11 Jason Merrill <jason@redhat.com>
* cp-tree.h (LOOKUP_EXPLICIT_TMPL_ARGS): Remove.
* call.c (build_new_function_call): Don't set it.
(build_new_method_call_1): Likewise.
(build_over_call): Check cand->explicit_targs instead.
2020-05-11 Jason Merrill <jason@redhat.com>
* decl.c (compute_array_index_type_loc): Stabilize before building
the MINUS_EXPR.
2020-05-11 Jason Merrill <jason@redhat.com>
* decl.c (grokdeclarator): Adjust deprecated_state here.
(start_decl): Not here.
2020-05-08 Iain Sandoe <iain@sandoe.co.uk>
PR c++/95003
* coroutines.cc (build_actor_fn): Ensure that bind scopes
are marked as having side-effects where necessary.
(replace_statement_captures): Likewise.
(morph_fn_to_coro): Likewise.
2020-05-08 Nathan Sidwell <nathan@acm.org>
* NEWS: Delete, it is so stale.
* parser.c (cp_lexer_set_source_position_from_token): EOF has a
location too.
2020-05-07 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94817
PR c++/94829
* coroutines.cc (morph_fn_to_coro): Set unformed outline
functions to error_mark_node. For early error returns suppress
warnings about missing ramp return values. Fix reinstatement
of the function body on pre-existing initial error.
* decl.c (finish_function): Use the normal error path for fails
in the ramp function, do not try to compile the helpers if the
transform fails.
2020-05-07 Marek Polacek <polacek@redhat.com>
PR c++/94590 - Detect long double -> double narrowing.
* typeck2.c (check_narrowing): Detect long double -> double
narrowing even when double and long double have the same
precision. Make it handle conversions to float too.
2020-05-07 Marek Polacek <polacek@redhat.com>
PR c++/94255
* parser.c (cp_parser_class_specifier_1): Check that the scope is
nested inside current scope before pushing it.
2020-05-07 Marek Polacek <polacek@redhat.com>
P1957R2
* typeck2.c (check_narrowing): Consider T* to bool narrowing
in C++11 and up.
2020-05-07 Marek Polacek <polacek@redhat.com>
* decl.c (grok_op_properties): Fix spelling of non-static.
* typeck.c (build_class_member_access_expr): Likewise.
2020-05-07 Richard Biener <rguenther@suse.de>
PR middle-end/94703
* optimize.c (update_cloned_parm): Copy DECL_NOT_GIMPLE_REG_P.
2020-05-06 Marek Polacek <polacek@redhat.com>
PR c++/94938
* pt.c (tsubst_copy_and_build): Call type_dependent_expression_p_push
instead of uses_template_parms. Move the warning_sentinels after the
RECURs.
2020-05-06 Jakub Jelinek <jakub@redhat.com>
PR c++/94951
* typeck.c (cp_strict_aliasing_warning): New function.
(cp_build_indirect_ref_1, build_reinterpret_cast_1): Use
it instead of strict_aliasing_warning.
PR c++/94907
* method.c (defaulted_late_check): Don't call synthesize_method
on constexpr sfk_comparison if it has been called on it already.
2020-05-06 Nathan Sidwell <nathan@acm.org>
PR c++/94946
* decl.c (grokdeclarator): Don't splice template attributes in
parm context -- they can apply to the parm.
2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc: Remove references to n4849 throughout.
2020-05-05 Jason Merrill <jason@redhat.com>
CWG 2235
* pt.c (more_specialized_fn): Do consider parms with no deducible
template parameters.
2020-05-05 Jason Merrill <jason@redhat.com>
PR c++/90212
* constexpr.c (potential_constant_expression_1): In a lambda
function, consider a captured variable directly.
2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (transform_await_wrapper): Check that we have
no unlowered co_yields.
(captures_temporary): Likewise.
(register_awaits): Likewise.
2020-05-05 Nathan Sidwell <nathan@acm.org>
PR c++/94807
* coroutines.cc (morph_fn_to_coro): Just check for
closure_identifier.
* pt.c (tsubst_function_decl): Update lambda fn's this_ptr name.
2020-05-05 Marek Polacek <polacek@redhat.com>
Jason Merrill <jason@redhat.com>
PR c++/94799
* parser.c (cp_parser_postfix_dot_deref_expression): If we have
a type-dependent object of class type, stash it to
parser->context->object_type. If the postfix expression doesn't have
a type, use typeof.
(cp_parser_class_name): Consider object scope too.
(cp_parser_lookup_name): Remove code dealing with the case when
object_type is unknown_type_node.
2020-05-04 Patrick Palka <ppalka@redhat.com>
PR c++/94038
* cp-gimplify.c (cp_fold) <case CALL_EXPR>: Move some variable
declarations closer to their uses. Copy the CALL_EXPR only
when one of its arguments has changed.
<case TREE_VEC>: Instead of first collecting the folded
arguments into a releasing_vec, just make a copy of the TREE_VEC
as soon as folding changes one of its arguments.
2020-05-04 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (morph_fn_to_coro): Mark the coro.gro variable
as artificial and ignored.
2020-05-04 Nathan Sidwell <nathan@acm.org>
pt.c (process_template_parm): Don't walk the template list twice,
remember the final node instead.
(end_template_parm_list): Refactor. Comment on why we do a pop
and a push.
PR c++/94827 -- don't save parms in nested requirement
* constraint.cc (tsubst_nested_requirement): TYPE directly holds
notmalized requirement.
(finish_nested_requirement): Don't stash current tpl parms into
the requirement.
(diagnose_nested_requirement): TYPE directly holds notmalized
requirement.
2020-05-01 Patrick Palka <ppalka@redhat.com>
PR c++/90880
* cp-tree.h (check_accessibility_of_qualified_id): Add
tsubst_flags_t parameter and change return type to bool.
* parser.c (cp_parser_lookup_name): Pass tf_warning_to_error to
check_accessibility_of_qualified_id.
* pt.c (tsubst_qualified_id): Return error_mark_node if
check_accessibility_of_qualified_id returns false.
* semantics.c (check_accessibility_of_qualified_id): Add
complain parameter. Pass complain instead of
tf_warning_or_error to perform_or_defer_access_check. Return
true unless perform_or_defer_access_check returns false.
2020-05-01 Marek Polacek <polacek@redhat.com>
PR c++/94885
* typeck2.c (process_init_constructor_record): Return PICFLAG_ERRONEOUS
if an initializer element was erroneous.
2020-05-01 Jason Merrill <jason@redhat.com>
PR c++/90479
* init.c (get_nsdmi): Don't push_to_top_level for a local class.
2020-05-01 Jason Merrill <jason@redhat.com>
PR c++/91529
* decl.c (cp_finish_decl): Also clear TREE_READONLY if
-fmerge-all-constants.
2020-05-01 Jason Merrill <jason@redhat.com>
PR c++/93822
* pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have
the same type as the variable.
2020-04-30 Jason Merrill <jason@redhat.com>
Nathan Sidwell <nathan@acm.org>
PR c++/94827
* constraint.cc (map_arguments): If ARGS is null, it's a
self-mapping of parms.
(finish_nested_requirement): Do not pass argified
current_template_parms to normalization.
(tsubst_nested_requirement): Don't assert no template parms.
2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94886
* coroutines.cc (transform_local_var_uses): Defer walking
the DECL_INITIALs of BIND_EXPR vars until all the frame
allocations have been made.
2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94883
* coroutines.cc (register_awaits): Update target
expressions for awaitable and suspend handle
initializers.
2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94879
* coroutines.cc (build_co_await): Account for variables
with DECL_VALUE_EXPRs.
(captures_temporary): Likewise.
(register_awaits): Likewise.
2020-04-29 Patrick Palka <ppalka@redhat.com>
PR c++/94830
* pt.c (find_template_parameter_info::parm_list): New field.
(keep_template_parm): Use the new field to build up the
parameter list here instead of ...
(find_template_parameters): ... here. Return ftpi.parm_list.
2020-04-29 Jakub Jelinek <jakub@redhat.com>
PR target/94707
* class.c (build_base_field): Set DECL_FIELD_ABI_IGNORED on C++17 empty
base artificial FIELD_DECLs.
(layout_class_type): Set DECL_FIELD_ABI_IGNORED on empty class
field_poverlapping_p FIELD_DECLs.
2020-04-29 Patrick Palka <ppalka@redhat.com>
PR c++/94819
* constraint.cc (satisfy_declaration_constraints): Use saved_t
instead of t as the key to decl_satisfied_cache.
PR c++/94808
* error.c (print_requires_expression_info): Print the dependent
form of the parameter list with its template parameter mapping,
rather than printing the substituted form.
2020-04-28 Jason Merrill <jason@redhat.com>
PR c++/94583
* decl.c (use_eh_spec_block): Check nothrow type after
DECL_DEFAULTED_FN.
* pt.c (maybe_instantiate_noexcept): Call synthesize_method for
DECL_MAYBE_DELETED fns here.
* decl2.c (mark_used): Not here.
* method.c (get_defaulted_eh_spec): Reject DECL_MAYBE_DELETED here.
2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94760
* coroutines.cc (instantiate_coro_traits): Pass a reference to
object type rather than a pointer type for 'this', for method
coroutines.
(struct param_info): Add a field to hold that the parm is a lambda
closure pointer.
(morph_fn_to_coro): Check for lambda closure pointers in the
args. Use a reference to *this when building the args list for the
promise allocator lookup.
2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94759
* coroutines.cc (coro_promise_type_found_p): Do not
exclude non-classes here (this needs to be handled in the
coroutine header).
(morph_fn_to_coro): Allow for the case where the coroutine
returns void.
2020-04-27 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94701
* coroutines.cc (struct local_var_info): Add fields for static
variables and those with DECL_VALUE_EXPR redirection.
(transform_local_var_uses): Skip past typedefs and static vars
and then account for redirected variables.
(register_local_var_uses): Likewise.
2020-04-27 Jason Merrill <jason@redhat.com>
PR c++/90750
PR c++/79585
* decl.c (grokdeclarator): Move dependent attribute to decl.
* decl2.c (splice_template_attributes): No longer static.
2020-04-27 Patrick Palka <ppalka@redhat.com>
PR c++/94772
* constexpr.c (cxx_eval_call_expression): Don't set new_obj if we're
evaluating the target constructor of a delegating constructor.
(cxx_eval_store_expression): Don't set TREE_READONLY if the LHS of the
INIT_EXPR is '*this'.
2020-04-26 Marek Polacek <polacek@redhat.com>
PR c++/90320
* call.c (struct conversion): Add copy_init_p.
(standard_conversion): Set copy_init_p in ck_base and ck_rvalue
if FLAGS demands LOOKUP_ONLYCONVERTING.
(convert_like_real) <case ck_base>: If copy_init_p is set, or
LOOKUP_ONLYCONVERTING into FLAGS.
2020-04-26 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94752
* coroutines.cc (morph_fn_to_coro): Ensure that
unnamed function params have a usable and distinct
frame field name.
2020-04-24 Jason Merrill <jason@redhat.com>
PR c++/94583
* decl.c (redeclaration_error_message): Reject defaulted comparison
operator that has been previously declared.
2020-04-25 Patrick Palka <ppalka@redhat.com>
* parser.c (cp_parser_diagnose_invalid_type_name): Suggest enabling
concepts if the invalid identifier is 'requires'.
2020-04-25 Jakub Jelinek <jakub@redhat.com>
PR c++/94742
* semantics.c (finish_call_expr): When looking if all overloads
are noreturn, use STRIP_TEMPLATE to look through TEMPLATE_DECLs.
2020-04-24 Martin Liska <mliska@suse.cz>
* coroutines.cc: Fix compilation error for release checking
where we miss declaration of ‘coro_body_contains_bind_expr_p’.
2020-04-23 Patrick Palka <ppalka@redhat.com>
* tree.c (zero_init_expr_p): Use uses_template_parms instead of
dependent_type_p.
PR c++/94645
* pt.c (template_class_depth): Walk into the DECL_FRIEND_CONTEXT of a
friend declaration rather than into its CP_DECL_CONTEXT.
2020-04-23 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94288
* coroutines.cc (await_statement_expander): Simplify cases.
(struct susp_frame_data): Add fields for truth and/or if
cases, rename one field.
(analyze_expression_awaits): New.
(expand_one_truth_if): New.
(add_var_to_bind): New helper.
(coro_build_add_if_not_cond_break): New helper.
(await_statement_walker): Handle conditional expressions,
handle expansion of truth-and/or-if cases.
(bind_expr_find_in_subtree): New, checking-only.
(coro_body_contains_bind_expr_p): New, checking-only.
(morph_fn_to_coro): Ensure that we have a top level bind
expression.
2020-04-22 Jonathan Wakely <jwakely@redhat.com>
PR translation/94698
* class.c (check_field_decls): Change "define" to "declare" in
-Weffc++ diagnostics.
2020-04-22 Patrick Palka <ppalka@redhat.com>
PR c++/94719
PR c++/94549
* constraint.cc (satisfy_declaration_constraints): If the inherited
constructor points to an instantiation of a constructor template,
remember and use its attached template arguments.
2020-04-22 Jonathan Wakely <jwakely@redhat.com>
PR translation/94698
* class.c (check_field_decls): Change "override" to "define" in
-Weffc++ diagnostics.
2020-04-22 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94682
* coroutines.cc (struct param_info): Add a field to note that
the param is 'this'.
(morph_fn_to_coro): Convert this to a reference before using it
in the promise parameter preview.
2020-04-22 Jason Merrill <jason@redhat.com>
PR c++/94546
* pt.c (register_parameter_specializations): If the instantiation is
still a parameter pack, don't wrap it in a NONTYPE_ARGUMENT_PACK.
(tsubst_pack_expansion, tsubst_expr): Adjust.
2020-04-22 Martin Sebor <msebor@redhat.com>
Jason Merrill <jason@redhat.com>
PR c++/94510
* decl.c (reshape_init_array_1): Avoid stripping redundant trailing
zero initializers...
* mangle.c (write_expression): ...and handle them here even for
pointers to members by calling zero_init_expr_p.
* cp-tree.h (zero_init_expr_p): Declare.
* tree.c (zero_init_expr_p): Define.
(type_initializer_zero_p): Remove.
* pt.c (tparm_obj_values): New hash_map.
(get_template_parm_object): Store to it.
(tparm_object_argument): New.
2020-04-22 Patrick Palka <ppalka@redhat.com>
PR c++/67825
* constraint.cc (diagnose_valid_expression): Check convert_to_void here
as well as in tsubst_valid_expression_requirement.
2020-04-21 Patrick Palka <ppalka@redhat.com>
PR c++/94549
* constraint.cc (satisfy_declaration_constraints): Don't strip the
inherited constructor if it already has template information.
PR c++/94597
* pt.c (any_template_parm_r) <case IDENTIFIER_NODE>: New case. If this
is a conversion operator, visit its TREE_TYPE.
2020-04-21 Nathan Sidwell <nathan@acm.org>
* pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
error_mark_node.
2020-04-21 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94661
* coroutines.cc (morph_fn_to_coro): Simplify return
value computation.
2020-04-17 Marek Polacek <polacek@redhat.com>
PR c++/94592
* constexpr.c (cxx_eval_outermost_constant_expr): Return when T is
a BRACE_ENCLOSED_INITIALIZER_P.
(is_nondependent_constant_expression): Don't check
BRACE_ENCLOSED_INITIALIZER_P.
(is_nondependent_static_init_expression): Likewise.
2020-04-20 Patrick Palka <ppalka@redhat.com>
PR c++/94628
* cp-tree.h (lss_policy::lss_nop): New enumerator.
* pt.c (local_specialization_stack::local_specialization_stack): Handle
an lss_nop policy.
(local_specialization_stack::~local_specialization_stack): Likewise.
(tsubst_pack_expansion): Use a local_specialization_stack instead of
manually saving and restoring local_specializations. Conditionally
replace local_specializations sooner, before the handling of the
unsubstituted_packs case.
2020-04-20 Marek Polacek <polacek@redhat.com>
PR c++/94505 - bogus -Wparentheses warning with fold-expression.
* pt.c (fold_expression): Add warning_sentinel for -Wparentheses
before calling build_x_binary_op.
2020-04-20 Marek Polacek <polacek@redhat.com>
* coroutines.cc (captures_temporary): Don't assign the result of
STRIP_NOPS to the same variable.
2020-04-20 Nathan Sidwell <nathan@acm.org>
PR c++/94454 - tpl-tpl-parms are not canonicalizable types
* pt.c (canonical_type_parameter): Assert not a tpl-tpl-parm.
(process_template_parm): tpl-tpl-parms are structural.
(rewrite_template_parm): Propagate structuralness.
PR c++/94454 - Expr pack expansion equality
* tree.c (cp_tree_equal) [TEMPLATE_ID_EXPR, default]: Refactor.
[EXPR_PACK_EXPANSION]: Add.
PR c++/94454 Template Argument Hashing
* pt.c (iterative_hash_template_arg): Strip nodes as
template_args_equal does.
[ARGUMENT_PACK_SELECT, TREE_VEC, CONSTRUCTOR]: Refactor.
[node_class:TEMPLATE_TEMPLATE_PARM]: Hash by level & index.
[node_class:default]: Refactor.
2020-04-18 Patrick Palka <ppalka@redhat.com>
PR c++/94632
* tree.c (cp_tree_equal) <case PARM_DECL>: Ignore
comparing_specializations if the parameters' contexts are identical.
PR c++/92187
* pt.c (splice_late_return_type): Propagate cv-qualifiers and
PLACEHOLDER_TYPE_CONSTRAINTS from the original auto node to the new one.
2020-04-17 Patrick Palka <ppalka@redhat.com>
PR c++/94483
* lambda.c (lambda_capture_field_type): Avoid doing auto deduction if
the explicit initializer has parameter packs.
PR c++/88754
* parser.c (cp_parser_check_template_parameters): Before issuing a hard
error, first try simulating an error instead.
2020-04-17 Jakub Jelinek <jakub@redhat.com>
PR other/94629
* call.c (build_conditional_expr_1): Remove redundant assignment to
arg2.
2020-04-16 Patrick Palka <ppalka@redhat.com>
PR c++/94475
* cvt.c (ocp_convert): If the result of scalar_constant_value is
erroneous, ignore it and use the original expression.
2020-04-16 Jakub Jelinek <jakub@redhat.com>
PR c++/94571
* parser.c (cp_parser_simple_declaration): Fix up a pasto in
diagnostics.
2020-04-15 Jakub Jelinek <jakub@redhat.com>
PR c/94593
* parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
requires directive when not at file or namespace scope.
2020-04-14 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94359
* coroutines.cc (build_actor_fn): Check that the target can
support the resume tailcall before mandating it.
2020-04-14 Patrick Palka <ppalka@redhat.com>
PR c++/85278
* cxx-pretty-print.c (cxx_pretty_printer:simple_type_specifier)
<case DECLTYPE_TYPE>: Handle DECLTYPE_TYPE here instead of ...
(pp_cxx_type_specifier_seq) <case DECLTYPE_TYPE>: ... here.
(cxx_pretty_printer::direct_abstract_declarator) <case DECLTYPE_TYPE>:
New no-op case.
PR c++/94034
* constexpr.c (replace_result_decl_data): New struct.
(replace_result_decl_data_r): New function.
(replace_result_decl): New function.
(cxx_eval_call_expression): Use it.
* tree.c (build_aggr_init_expr): Set the location of the AGGR_INIT_EXPR
to that of its initializer.
2020-04-13 Marek Polacek <polacek@redhat.com>
PR c++/94588
* name-lookup.c (check_local_shadow): Add an inform call.
2020-04-13 Patrick Palka <ppalka@redhat.com>
PR c++/94521
* error.c (dump_scope): Pass TFF_NO_FUNCTION_ARGUMENTS to
dump_function_decl when printing a function template instantiation as a
scope.
PR c++/94470
* constexpr.c (get_or_insert_ctor_field): Set default value of parameter
'pos_hint' to -1.
(cxx_eval_bare_aggregate): Use get_or_insert_ctor_field instead of
assuming the the next index belongs at the end of the new CONSTRUCTOR.
(cxx_eval_store_expression): Revert PR c++/78572 fix.
2020-04-13 Nathan Sidwell <nathan@acm.org>
PR c++/94426 lambdas with internal linkage are different to no-linkage
* decl2.c (determine_visibility): A lambda's visibility is
affected by its extra scope.
* pt.c (instantiate_decl): Determine var's visibility before
instantiating its initializer.
* tree.c (no_linkage_check): Revert code looking at visibility of
lambda's extra scope.
`
2020-04-10 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94528
* coroutines.cc (co_await_expander): Remove.
(expand_one_await_expression): New.
(process_one_statement): New.
(await_statement_expander): New.
(build_actor_fn): Revise to use per-statement expander.
(struct susp_frame_data): Reorder and comment.
(register_awaits): Factor code.
(replace_statement_captures): New, factored from...
(maybe_promote_captured_temps):.. here.
(await_statement_walker): Revise to process per statement.
(morph_fn_to_coro): Use revised susp_frame_data layout.
2020-04-10 Marek Polacek <polacek@redhat.com>
PR c++/94149
* method.c (constructible_expr): In C++20, try using parenthesized
initialization of aggregates to determine the result of
__is_constructible.
2020-04-10 Bin Cheng <bin.cheng@linux.alibaba.com>
* coroutines.cc (co_await_expander): Simplify.
2020-04-09 Jason Merrill <jason@redhat.com>
PR c++/94523
* constexpr.c (cxx_eval_constant_expression) [VAR_DECL]: Look at
ctx->object and ctx->global->values first.
2020-04-09 Marek Polacek <polacek@redhat.com>
PR c++/93790
* call.c (initialize_reference): If the reference binding failed, maybe
try initializing from { }.
* decl.c (grok_reference_init): For T& t(e), set
LOOKUP_AGGREGATE_PAREN_INIT but don't build up a constructor yet.
2020-04-08 Iain Sandoe <iain@sandoe.co.uk>
Jun Ma <JunMa@linux.alibaba.com>
* coroutines.cc (maybe_promote_captured_temps): Add a cleanup
expression, if needed, to any call from which we promoted
temporaries captured by reference.
2020-04-08 Marek Polacek <polacek@redhat.com>
PR c++/94507 - ICE-on-invalid with lambda template.
* pt.c (tsubst_lambda_expr): Cope when tsubst_template_decl or
tsubst_function_decl returns error_mark_node.
2020-04-08 Martin Liska <mliska@suse.cz>
PR c++/94314
* decl.c (duplicate_decls): Duplicate also DECL_IS_REPLACEABLE_OPERATOR.
(cxx_init_decl_processing): Mark replaceable all implicitly defined
operators.
2020-04-08 Patrick Palka <ppalka@redhat.com>
Core issues 1001 and 1322
PR c++/92010
* pt.c (rebuild_function_or_method_type): Split function out from ...
(tsubst_function_type): ... here.
(maybe_rebuild_function_decl_type): New function.
(tsubst_function_decl): Use it.
2020-04-08 Jakub Jelinek <jakub@redhat.com>
PR c++/94325
* decl.c (begin_destructor_body): For CLASSTYPE_VBASECLASSES class
dtors, if CLASSTYPE_PRIMARY_BINFO is non-NULL, but not BINFO_VIRTUAL_P,
look at CLASSTYPE_PRIMARY_BINFO of its BINFO_TYPE if it is not
BINFO_VIRTUAL_P, and so on.
2020-04-08 Marek Polacek <polacek@redhat.com>
PR c++/94478 - ICE with defaulted comparison operator
* method.c (early_check_defaulted_comparison): Give an error when the
context is null.
2020-04-08 Tobias Burnus <tobias@codesourcery.com>
PR middle-end/94120
* paser.c (cp_parser_oacc_declare): Add check that variables
are declared in the same scope as the directive.
2020-04-07 Jason Merrill <jason@redhat.com>
PR c++/94480
* parser.c (cp_parser_requires_expression): Use tentative_firewall.
PR c++/94481
* parser.c (cp_parser_placeholder_type_specifier): Use
matching_parens.
2020-04-07 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (maybe_promote_captured_temps): Ensure that
reference capture placeholder vars are properly declared.
2020-04-07 Patrick Palka <ppalka@redhat.com>
PR c++/90996
* tree.c (replace_placeholders): Look through all handled components,
not just COMPONENT_REFs.
* typeck2.c (process_init_constructor_array): Propagate
CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
the array initializer.
2020-04-07 Jakub Jelinek <jakub@redhat.com>
PR c++/94512
* parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
if cp_parser_omp_master succeeded.
2020-04-06 Jason Merrill <jason@redhat.com>
PR c++/94462
* decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.
2020-04-04 Marek Polacek <polacek@redhat.com>
Jason Merrill <jason@redhat.com>
PR c++/94155 - crash in gimplifier with paren init of aggregates.
* init.c (build_vec_init): Fill in indexes.
2020-04-04 Jason Merrill <jason@redhat.com>
PR c++/91377
* mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR.
2020-04-04 Patrick Palka <ppalka@redhat.com>
PR c++/94205
PR c++/79937
* constexpr.c (struct constexpr_ctx): New field 'parent'.
(cxx_eval_bare_aggregate): Propagate CONSTRUCTOR_PLACEHOLDER_BOUNDARY
flag from the original constructor to the reduced constructor.
(lookup_placeholder): Prefer to return the outermost matching object
by recursively calling lookup_placeholder on the 'parent' context,
but don't cross CONSTRUCTOR_PLACEHOLDER_BOUNDARY constructors.
(cxx_eval_constant_expression): Link the 'ctx' context to the 'new_ctx'
context via 'new_ctx.parent' when being expanded without an explicit
target. Don't call replace_placeholders.
(cxx_eval_outermost_constant_expr): Initialize 'ctx.parent' to NULL.
PR c++/94219
PR c++/94205
* constexpr.c (get_or_insert_ctor_field): Split out (while adding
support for VECTOR_TYPEs, and optimizations for the common case)
from ...
(cxx_eval_store_expression): ... here. Rename local variable
'changed_active_union_member_p' to 'activated_union_member_p'. Record
the sequence of indexes into 'indexes' that yields the subobject we're
assigning to. Record the integer offsets of the constructor indexes
we're assigning through into 'index_pos_hints'. After evaluating the
initializer of the store expression, recompute 'valp' using 'indexes'
and using 'index_pos_hints' as hints.
(cxx_eval_bare_aggregate): Tweak comments. Use get_or_insert_ctor_field
to recompute the constructor_elt pointer we're assigning through after
evaluating each initializer.
2020-04-04 Jason Merrill <jason@redhat.com>
PR c++/67825
* constraint.cc (tsubst_valid_expression_requirement): Call
convert_to_void.
2020-04-04 Jason Merrill <jason@redhat.com>
PR c++/94453
* constexpr.c (maybe_constant_value): Use break_out_target_exprs.
* expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in
NON_LVALUE_EXPR.
2020-04-04 Jakub Jelinek <jakub@redhat.com>
PR debug/94441
* parser.c (cp_parser_omp_for_loop): Use
protected_set_expr_location_if_unset.
* cp-gimplify.c (genericize_if_stmt, genericize_cp_loop): Likewise.
PR c++/94477
* pt.c (tsubst_expr) <case OMP_MASTER>: Clear
omp_parallel_combined_clauses.
2020-04-03 Jason Merrill <jason@redhat.com>
PR c++/91966
* pt.c (complex_pack_expansion_r): New.
(complex_alias_template_p): Use it.
2020-03-31 Jason Merrill <jason@redhat.com>
PR c++/94205
* constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Call
replace_placeholders.
* typeck2.c (store_init_value): Fix arguments to
fold_non_dependent_expr.
2020-03-31 Jason Merrill <jason@redhat.com>
* constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Use
local variables.
2020-03-30 Jason Merrill <jason@redhat.com>
PR c++/90711
* tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
(called_fns_equal): Check DECL_CONTEXT.
2020-03-30 Jakub Jelinek <jakub@redhat.com>
PR c++/94385
* semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with
STATEMENT_CODE_P code.
2020-03-28 Patrick Palka <ppalka@redhat.com>
PR c++/94306
* parser.c (cp_parser_requires_clause_opt): Diagnose and recover from
"requires {" when "requires requires {" was probably intended.
PR c++/94252
* constraint.cc (tsubst_compound_requirement): Always suppress errors
from type_deducible_p and expression_convertible_p, as they're not
substitution errors.
(diagnose_atomic_constraint) <case INTEGER_CST>: Remove this case so
that we diagnose INTEGER_CST expressions of non-bool type via the
default case.
* cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: New case.
* parser.c (cp_parser_requires_expression): Always parse the requirement
body as if we're processing a template, by temporarily incrementing
processing_template_decl. Afterwards, if we're not actually in a
template context, perform semantic processing to diagnose any invalid
types and expressions.
* pt.c (tsubst_copy_and_build) <case REQUIRES_EXPR>: Remove dead code.
* semantics.c (finish_static_assert): Explain an assertion failure
when the condition is a REQUIRES_EXPR like we do when it is a concept
check.
* constraint.cc (diagnose_compound_requirement): When diagnosing a
compound requirement, maybe replay the satisfaction failure, subject to
the current diagnosis depth.
* constraint.cc (finish_constraint_binary_op): Set the location of EXPR
as well as its range, because build_x_binary_op doesn't always do so.
(current_constraint_diagnosis_depth): New.
(concepts_diagnostics_max_depth_exceeded_p): New.
(collect_operands_of_disjunction): New.
(satisfy_disjunction): When diagnosing a satisfaction failure, maybe
replay each branch of the disjunction, subject to the current diagnosis
depth.
(diagnose_valid_expression): When diagnosing a satisfaction failure,
maybe replay the substitution error, subject to the current diagnosis
recursion.
(diagnose_valid_type): Likewise.
(diagnose_nested_requiremnet): Likewise.
(diagnosing_failed_constraint::diagnosing_failed_constraint): Increment
current_constraint_diagnosis_depth when diagnosing.
(diagnosing_failed_constraint::~diagnosing_failed_constraint): Decrement
current_constraint_diagnosis_depth when diagnosing.
(diagnosing_failed_constraint::replay_errors_p): New static member
function.
(diagnose_constraints): Don't diagnose if concepts_diagnostics_max_depth
is 0. Emit a one-off note to increase -fconcepts-diagnostics-depth if
the limit was exceeded.
* cp-tree.h (diagnosing_failed_constraint::replay_errors_p): Declare.
2020-03-27 Nathan Sidwell <nathan@acm.org>
PR c++/84733
* name-lookup.c (do_pushdecl): Look through cleanp levels.
2020-03-27 Martin Sebor <msebor@redhat.com>
PR c++/94078
PR c++/93824
PR c++/93810
* cp-tree.h (most_specialized_partial_spec): Declare.
* parser.c (cp_parser_elaborated_type_specifier): Distinguish alias
from declarations.
(specialization_of): New function.
(cp_parser_check_class_key): Move code...
(class_decl_loc_t::add): ...to here. Add parameters. Avoid issuing
-Wredundant-tags on first-time declarations in other declarators.
Correct handling of template specializations.
(class_decl_loc_t::diag_mismatched_tags): Also expect to be called
when -Wredundant-tags is enabled. Use primary template or partial
specialization as the guide for uses of implicit instantiations.
* pt.c (most_specialized_partial_spec): Declare extern.
2020-03-27 Nathan Sidwell <nathan@acm.org>
PR c++/94257
* name-lookup.c (push_namespace): Triage ambiguous lookups that
contain namespaces.
2020-03-27 Jakub Jelinek <jakub@redhat.com>
PR c++/94326
* call.c (set_flags_from_callee): Don't update
cp_function_chain->can_throw or current_function_returns_abnormally
if cp_unevaluated_operand.
PR c++/94339
* cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
operand and creating a new COMPOUND_EXPR if anything changed.
2020-03-26 Marek Polacek <polacek@redhat.com>
PR c++/94336 - template keyword accepted before destructor names.
* parser.c (cp_parser_unqualified_id): Give an error when 'template'
is followed by a destructor name.
2020-03-27 Patrick Palka <ppalka@redhat.com>
* decl.c (compute_array_index_type_loc): Remove redundant
type_dependent_expression_p check that is subsumed by
value_dependent_expression_p.
* decl2.c (is_late_template_attribute): Likewise.
* pt.c (uses_template_parms): Likewise.
(dependent_template_arg_p): Likewise.
2020-03-26 Marek Polacek <polacek@redhat.com>
DR 1710
PR c++/94057 - template keyword in a typename-specifier.
* parser.c (check_template_keyword_in_nested_name_spec): New.
(cp_parser_nested_name_specifier_opt): Implement DR1710, optional
'template'. Call check_template_keyword_in_nested_name_spec.
(cp_parser_simple_type_specifier): Assume that a <
following a qualified-id in a typename-specifier begins
a template argument list.
2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (coro_init_identifiers): Initialize an identifier
for the cororoutine handle 'address' method name.
(struct coro_aw_data): Add fields to cover the continuations.
(co_await_expander): Determine the kind of await_suspend in use.
If we have the case that returns a continuation handle, then save
this and make the target for 'scope exit without cleanup' be the
continuation resume label.
(expand_co_awaits): Remove.
(struct suspend_point_info): Remove fields that kept the returned
await_suspend handle type.
(transform_await_expr): Remove code tracking continuation handles.
(build_actor_fn): Add the continuation handle as an actor-function
scope var. Build the symmetric transfer continuation point. Call
the tree walk for co_await expansion directly, rather than via a
trivial shim function.
(register_await_info): Remove fields tracking continuation handles.
(get_await_suspend_return_type): Remove.
(register_awaits): Remove code tracking continuation handles.
(morph_fn_to_coro): Remove code tracking continuation handles.
2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (co_await_expander): If we are expanding the
initial await expression, set a boolean flag to show that we
have now reached the initial await_resume() method call.
(expand_co_awaits): Handle the 'initial await resume called' flag.
(build_actor_fn): Insert the initial await expression into the
start of the user-authored function-body. Handle the 'initial await
resume called' flag.
(morph_fn_to_coro): Initialise the 'initial await resume called'
flag. Modify the unhandled exception catch clause to recognise
exceptions that occur before the initial await_resume() and re-
throw them.
2020-03-26 Jakub Jelinek <jakub@redhat.com>
PR c++/81349
* class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
true for all TEMPLATE_DECLs.
PR c++/94272
* cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
2020-03-25 Patrick Palka <ppalka@redhat.com>
PR c++/94265
* parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
current condition chain when the if-statement has a non-empty
init-statement.
2020-03-25 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94319
* coroutines.cc (captures_temporary): Fix a missing dereference.
2020-03-24 Marek Polacek <polacek@redhat.com>
PR c++/94190 - wrong no post-decrement operator error in template.
* call.c (convert_like_real): Use convert_from_reference on the result.
2020-03-24 Jason Merrill <jason@redhat.com>
PR c++/94186
* constraint.cc (constraint_satisfaction_value): Repeat noisily on
error.
(tsubst_nested_requirement): Likewise.
(get_constraint_error_location): Allow missing context.
(diagnose_atomic_constraint): Diagnose non-bool constraint here.
(satisfy_atom): Not here. Only diagnose non-constant when noisy.
2020-03-24 Jason Merrill <jason@redhat.com>
* pt.c (any_template_parm_r): Look into the type of a non-type
template parm.
2020-03-24 Jason Merrill <jason@redhat.com>
* cp-tree.h (cp_expr): When constructing from an expr and a
location, call protected_set_expr_location.
2020-03-23 Patrick Palka <ppalka@redhat.com>
PR c++/93805
* except.c (maybe_noexcept_warning): Add TODO.
* method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
2020-03-23 nathans <nathan@acm.org>
PR c++/94044
* tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
operand.
2020-03-21 Patrick Palka <ppalka@redhat.com>
PR c++/94066
* constexpr.c (reduced_constant_expression_p) [CONSTRUCTOR]: Properly
handle unions without an initializer.
(cxx_eval_component_reference): Emit a different diagnostic when the
constructor element corresponding to a union member is NULL.
(cxx_eval_bare_aggregate): When constructing a union, always set the
active union member before evaluating the initializer. Relax assertion
that verifies the index of the constructor element we're initializing
hasn't been changed.
(cxx_eval_store_expression): Diagnose changing the active union member
while the union is in the process of being initialized. After setting
an active union member, clear CONSTRUCTOR_NO_CLEARING on the underlying
CONSTRUCTOR.
(cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
CONSTRUCTOR returned by lookup_placeholder.
2020-03-20 Patrick Palka <ppalka@redhat.com>
* cxx-pretty-print.c (pp_cxx_parameter_mapping): Make extern. Move
the "[with ]" bits to here from ...
(pp_cxx_atomic_constraint): ... here.
* cxx-pretty-print.h (pp_cxx_parameter_mapping): Declare.
* error.c (rebuild_concept_check): Delete.
(print_concept_check_info): Print the dependent form of the constraint and the
preferably substituted parameter mapping alongside it.
2020-03-19 Jason Merrill <jason@redhat.com>
PR c++/94175
* cp-gimplify.c (simple_empty_class_p): Look through
SIMPLE_TARGET_EXPR_P.
(cp_gimplify_expr) [MODIFY_EXPR]: Likewise.
[RETURN_EXPR]: Avoid producing 'return *retval;'.
* call.c (build_call_a): Strip TARGET_EXPR from empty class arg.
* cp-tree.h (SIMPLE_TARGET_EXPR_P): Check that TARGET_EXPR_INITIAL
is non-null.
2020-03-19 Jakub Jelinek <jakub@redhat.com>
PR c++/93931
* parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
on outer_automatic_var_p decls.
* cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
capture proxy decls.
2020-03-18 Nathan Sidwell <nathan@acm.org>
PR c++/94147 - mangling of lambdas assigned to globals
* parser.c (cp_parser_init_declarator): Namespace-scope variables
provide a lambda scope.
* tree.c (no_linkage_check): Lambdas with a variable for extra
scope have a linkage from the variable.
2020-03-18 Jakub Jelinek <jakub@redhat.com>
* constraint.cc (resolve_function_concept_check, subsumes_constraints,
strictly_subsumes): Fix up duplicated word issue in a comment.
* coroutines.cc (build_init_or_final_await, captures_temporary):
Likewise.
* logic.cc (dnf_size_r, cnf_size_r): Likewise.
* pt.c (append_type_to_template_for_access_check): Likewise.
PR c++/91759
* decl.c (grokfndecl): Restore old diagnostics about deduction
guide declared in different scope if in_namespace is NULL_TREE.
2020-03-17 Jakub Jelinek <jakub@redhat.com>
PR c++/90995
* parser.c (cp_parser_enum_specifier): Use temp_override for
parser->colon_corrects_to_scope_p, replace goto out with return.
If scoped enum or enum with underlying type is not followed by
{ or ;, call cp_parser_commit_to_tentative_parse before calling
cp_parser_error and make sure to return error_mark_node instead of
NULL_TREE. Formatting fixes.
2020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/94197
* method.c (assignable_expr): Use cp_unevaluated.
(is_xible_helper): Push a non-deferred access check for
the stub objects created by assignable_expr and constructible_expr.
2020-03-17 Jakub Jelinek <jakub@redhat.com>
* pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
(lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
in a comment.
* parser.c (cp_parser_statement, cp_parser_linkage_specification,
cp_parser_placeholder_type_specifier,
cp_parser_constraint_requires_parens): Likewise.
* name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
2020-03-15 Iain Sandoe <iain@sandoe.co.uk>
* coroutines.cc (co_await_expander): Fix indentation.
2020-03-14 Jason Merrill <jason@redhat.com>
PR c++/92068
* pt.c (process_partial_specialization): Error rather than crash on
extra pack expansion.
2020-03-14 Jason Merrill <jason@redhat.com>
PR c++/92909
* pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
DECL_ORIGINAL_TYPE of a typedef.
2020-03-14 Jason Merrill <jason@redhat.com>
PR c++/93248
* pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
substituting DECL_ARGUMENTS.
2020-03-14 Jakub Jelinek <jakub@redhat.com>
* logic.cc (formula::formula): Change "a an" to "an" in a comment.
* parser.c (cp_debug_parser): Change "a an" to "an" in a string
literal.
2020-03-13 Patrick Palka <ppalka@redhat.com>
PR c++/67960
* call.c (build_over_call): Use a warning_sentinel to disable
warn_deprecated_decl before calling build_addr_func.
2020-03-12 Jakub Jelinek <jakub@redhat.com>
PR c++/94124
* decl.c (reshape_init_array_1): Don't unshare constructor if there
aren't any trailing zero elts, otherwise only unshare the first
nelts.
2020-03-11 Jason Merrill <jason@redhat.com>
PR c++/93907
* constraint.cc (tsubst_parameter_mapping): Canonicalize type
argument.
2020-03-11 Marek Polacek <polacek@redhat.com>
Jason Merrill <jason@redhat.com>
PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
* constexpr.c (cref_has_const_field): New function.
(modifying_const_object_p): Consider a COMPONENT_REF
const only if any of its fields are const.
(cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
as readonly after its initialization has been done.
2020-03-10 Marek Polacek <polacek@redhat.com>
PR c++/94124 - wrong conversion error with non-viable overload.
* decl.c (reshape_init_array_1): Unshare a constructor if we
stripped trailing zero-initializers.
2020-03-10 Jason Merrill <jason@redhat.com>
PR c++/93901
* pt.c (maybe_instantiate_noexcept): Always update clones.
2020-03-10 Jason Merrill <jason@redhat.com>
PR c++/93596
* pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
2020-03-10 Jason Merrill <jason@redhat.com>
PR c++/93922
PR c++/94041
PR c++/52320
PR c++/66139
* cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
66139: Don't split_nonconstant_init. Remove pre_p parameter.
2020-03-09 Marek Polacek <polacek@redhat.com>
PR c++/92031 - bogus taking address of rvalue error.
PR c++/91465 - ICE with template codes in check_narrowing.
PR c++/93870 - wrong error when converting template non-type arg.
PR c++/94068 - ICE with template codes in check_narrowing.
* call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
in a template when not ck_identity and we're dealing with a class.
(convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
in a template if we need a temporary.
* decl.c (compute_array_index_type_loc): Remove
instantiate_non_dependent_expr_sfinae call. Call
fold_non_dependent_expr instead of maybe_constant_value.
(build_explicit_specifier): Don't instantiate or create a sentinel
before converting the expression.
* except.c (build_noexcept_spec): Likewise.
* pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
build_converted_constant_expr returned.
* typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
of maybe_constant_value.
2020-03-09 Jakub Jelinek <jakub@redhat.com>
PR c++/94067
Revert
2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
* constexpr.c (cxx_eval_constant_expression): Do not handle
RROTATE_EXPR and LROTATE_EXPR.
2020-03-09 Marek Polacek <polacek@redhat.com>
PR c++/94050 - ABI issue with alignas on armv7hl.
* class.c (layout_class_type): Don't replace a class's
CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
2020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
* coroutines.cc (build_actor_fn): Factor out code inserting the
default return_void call to...
(morph_fn_to_coro): ...here, also hoist local var declarations.
2020-03-08 Patrick Palka <ppalka@redhat.com>
PR c++/93729
* call.c (convert_like_real): Check complain before emitting an error
about binding a bit-field to a reference.
* cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
[TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
TYPE_NAME.
2020-03-06 Nathan Sidwell <nathan@acm.org>
PR c++/94027
* mangle.c (find_substitution): Don't call same_type_p on template
args that cannot match.
2020-03-04 Martin Sebor <msebor@redhat.com>
PR c++/90938
* tree.c (type_initializer_zero_p): Fail for structs initialized
with non-structs.
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.
|