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
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
|
2019-12-19 Jason Merrill <jason@redhat.com>
PR c++/66139 - EH cleanups for partially constructed aggregates.
PR c++/57510
* cp-gimplify.c (cp_gimplify_init_expr): Use split_nonconstant_init.
* typeck2.c (split_nonconstant_init): Handle non-variable dest.
(split_nonconstant_init_1): Clear TREE_SIDE_EFFECTS.
* tree.c (is_local_temp): New.
2019-12-18 Jason Merrill <jason@redhat.com>
PR c++/91165 follow-on tweak
* constexpr.c (cxx_eval_call_expression): Use
unshare_expr_without_location.
2019-12-19 Julian Brown <julian@codesourcery.com>
Maciej W. Rozycki <macro@codesourcery.com>
Tobias Burnus <tobias@codesourcery.com>
Thomas Schwinge <thomas@codesourcery.com>
* parser.c (cp_parser_omp_clause_name): Support no_create.
(cp_parser_oacc_data_clause): Likewise.
(cp_parser_oacc_all_clauses): Likewise.
(OACC_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
(OACC_PARALLEL_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_NO_CREATE.
* semantics.c (handle_omp_array_sections): Support no_create.
2019-12-18 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (cxx_sizeof_or_alignof_type): Add location_t parameter
and use it throughout.
(cxx_sizeof_expr): Likewise.
(cxx_alignof_expr): Likewise.
(cxx_sizeof_or_alignof_expr): Likewise.
(cxx_alignas_expr): Update call.
* decl.c (fold_sizeof_expr): Likewise.
* pt.c (tsubst_copy): Likewise.
(tsubst_copy_and_build): Likewise.
* except.c (build_throw): Add location_t parameter and use it.
(expand_end_catch_block): Update call.
* parser.c (cp_parser_unary_expression): Update
cxx_sizeof_or_alignof_type and cxx_sizeof_or_alignof_expr calls,
pass the compound location.
(cp_parser_throw_expression): Likewise pass the combined location
to build_throw.
* cp-tree.h: Update declarations.
* semantics.c (finish_handler_parms): Use DECL_SOURCE_LOCATION.
* decl2.c (check_classfn): Likewise.
* except.c (is_admissible_throw_operand_or_catch_parameter):
Exploit cp_expr_loc_or_input_loc in one place.
* except.c (create_try_catch_expr): Remove, unused.
2019-12-17 Jason Merrill <jason@redhat.com>
PR c++/12333 - X::~X() with implicit this->.
* parser.c (cp_parser_lookup_name): Use lookup_destructor.
* typeck.c (lookup_destructor): No longer static.
2019-12-17 Martin Sebor <msebor@redhat.com>
PR c++/61339
* parser.c (cp_parser_maybe_warn_enum_key): New function.
(class_decl_loc_t): New class.
(cp_parser_elaborated_type_specifier): Call
cp_parser_maybe_warn_enum_key.
(cp_parser_class_head): Call cp_parser_check_class_key.
(cp_parser_check_class_key): Add arguments. Call class_decl_loc_t::add.
(c_parse_file): Call class_decl_loc_t::diag_mismatched_tags.
2019-12-17 Jason Merrill <jason@redhat.com>
PR c++/79592 - missing explanation of invalid constexpr.
* constexpr.c (register_constexpr_fundef): Do store the body of a
template instantiation that is not potentially constant.
(explain_invalid_constexpr_fn): Look it up.
(cxx_eval_call_expression): Check fundef->result.
2019-12-17 Jason Merrill <jason@redhat.com>
PR c++/92576 - redeclaration of variable template.
* decl.c (redeclaration_error_message): Recurse for variable
templates.
2019-12-17 Jason Merrill <jason@redhat.com>
* name-lookup.c (get_std_name_hint): Add std::byte.
2019-12-17 Jakub Jelinek <jakub@redhat.com>
PR c++/59655
* pt.c (push_tinst_level_loc): If limit_bad_template_recursion,
set TREE_NO_WARNING on tldcl.
* decl2.c (no_linkage_error): Treat templates with TREE_NO_WARNING
as defined during error recovery.
2019-12-13 Jason Merrill <jason@redhat.com>
PR c++/91165 - verify_gimple ICE with cached constexpr.
* constexpr.c (cxx_bind_parameters_in_call): Don't unshare.
(cxx_eval_call_expression): Unshare all args if we're caching.
2019-12-12 Jason Merrill <jason@redhat.com>
PR c++/92496 - ICE with <=> and no #include <compare>.
* typeck.c (cp_build_binary_op): Handle error from spaceship_type.
2019-12-11 David Malcolm <dmalcolm@redhat.com>
* cxx-pretty-print.c (cxx_pretty_printer::clone): New vfunc
implementation.
* cxx-pretty-print.h (cxx_pretty_printer::clone): New vfunc decl.
* error.c (cxx_format_postprocessor::clone): New vfunc.
2019-12-11 Jakub Jelinek <jakub@redhat.com>
PR c++/92869
* class.c (finish_struct): For C++17 and earlier, check
type_has_user_provided_or_explicit_constructor rather than
TYPE_HAS_USER_CONSTRUCTOR whether to set CLASSTYPE_NON_AGGREGATE.
2019-12-11 Marek Polacek <polacek@redhat.com>
PR c++/92878 - Parenthesized init of aggregates in new-expression.
* init.c (build_new_1): Handle parenthesized initialization of
aggregates in new-expression.
2019-12-11 Jason Merrill <jason@redhat.com>
PR c++/92105 - decltype(decltype) error cascade.
* parser.c (cp_parser_decltype_expr): Don't tentative_firewall here.
(cp_parser_decltype): Do it here. Remember a non-tentative error.
PR c++/57082 - new X{} and private destructor.
* init.c (build_new_1): Also pass tf_no_cleanup to
build_special_member_call.
PR c++/92774 - ICE with implicitly deleted operator<=>.
* method.c (comp_info::~comp_info): Factor out of...
(build_comparison_op): Here. Handle error return from build_new_op.
PR c++/92859 - ADL and bit-field.
* name-lookup.c: Use unlowered_expr_type.
PR c++/92446 - deduction of class NTTP.
* pt.c (deducible_expression): Look through VIEW_CONVERT_EXPR.
2019-12-10 Jason Merrill <jason@redhat.com>
PR c++/92847 - C++20 comparison ambiguity with class template.
* call.c (cand_parms_match): Handle all templated functions.
Fix C++20 structural type vs. private base.
* class.c (build_base_field_1): Take access parameter.
(build_base_field): Likewise.
(build_base_fields, layout_virtual_bases): Pass it.
* tree.c (structural_type_p): Improve private base diagnostic.
PR c++/92560 - ICE with decltype and rewritten operator.
* call.c (build_new_op_1): Clear tf_decltype on inner call.
2019-12-09 David Malcolm <dmalcolm@redhat.com>
* error.c (range_label_for_type_mismatch::get_text): Replace
label_text ctor calls with label_text::borrow.
2019-12-09 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (check_for_casting_away_constness): Add location_t
parameter and use it.
(maybe_warn_about_useless_cast): Likewise.
(maybe_warn_about_cast_ignoring_quals): Likewise.
(build_static_cast_1): Likewise.
(build_static_cast): Likewise; sets the location of the returned tree.
(build_reinterpret_cast_1): Likewise.
(build_reinterpret_cast): Likewise; sets the location of the returned
tree.
(build_const_cast_1): Likewise.
(build_const_cast): Likewise; sets the location of the returned tree.
(cp_build_c_cast): Likewise.
(build_c_cast): Adjust.
(build_ptrmemfunc): Adjust calls.
(cp_build_unary_op): Pass the location to invert_truthvalue_loc.
* rtti.c (build_dynamic_cast_1): Add location_t parameter and
use it.
(build_dynamic_cast): Likewise.
* cp-tree.h: Adjust declarations.
* parser.c (cp_parser_postfix_expression): Pass cp_cast_loc to
the various build_*_cast functions.
(get_cast_suggestion): Adjust calls.
(cp_parser_builtin_offsetof): Likewise.
* decl.c (reshape_init): Adjust call.
* method.c (forward_parm): Likewise.
(build_comparison_op): Likewise.
* pt.c (tsubst_copy_and_build): Likewise.
* semantics.c (finish_omp_reduction_clause): Likewise.
(cp_omp_finish_iterators): Likewise.
* tree.c (cp_stabilize_reference): Likewise.
(move): Likewise.
* typeck2.c (build_functional_cast): Likewise.
* typeck2.c (build_functional_cast_1): New.
(build_functional_cast_1): Calls the latter and sets the location
of the returned tree.
2019-12-08 Jakub Jelinek <jakub@redhat.com>
* cvt.c (maybe_warn_nodiscard): Add workaround for GCC 3.4-4.4 - cast
msg to (const char *) in conditional expressions. Formatting fixes.
2019-12-07 Jason Merrill <jason@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR c++/92831
* call.c (build_conditional_expr_1): For ?: with omitted middle
operand use cp_stabilize_reference if arg1 is glvalue_p rather than
just if it is lvalue_p.
2019-12-06 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_diagnose_invalid_type_name): Mention
that concept is also available with -std=c++2a.
PR c++/92831 - CWG 1299, not extending temporary lifetime for ?:
* cp-tree.h (extend_ref_init_temps): Add a new argument with NULL
default arg.
* call.c (set_up_extended_ref_temp): Add COND_GUARD argument, pass it
down to extend_ref_init_temps. Before pushing cleanup, if COND_GUARD
is non-NULL, create a bool temporary if needed, initialize to false
and guard the cleanup with the temporary being true.
(extend_ref_init_temps_1): Add COND_GUARD argument, pass it down
to recursive calls and set_up_extended_ref_temp. Handle COND_EXPR.
(extend_ref_init_temps): Add COND_GUARD argument, pass it down to
recursive calls and to extend_ref_init_temps_1.
2019-12-06 Richard Sandiford <richard.sandiford@arm.com>
* decl.c (start_decl_1): Use verify_type_context to check whether
the target allows variables of a particular type to have static
or thread-local storage duration.
(check_array_initializer): Use verify_type_context to check whether
the target allows a particular type to be used as an array element.
(create_array_type_for_decl): Likewise.
(cp_finish_decl): Use verify_type_context to check whether
the target allows static member variables of a particular type.
(grokdeclarator): Likewise. Also use verify_type_context to check
whether the target allows non-static member variables of a particular
type.
* except.c: Include target.h.
(is_admissible_throw_operand_or_catch_parameter): Use
verify_type_context to check whether the target allows particular
types to be thrown and caught.
* typeck2.c (add_exception_specifier): Likewise.
* init.c (build_new_1): Use verify_type_context to check whether
the target allows particular types to be dynamically allocated.
(build_vec_delete_1, build_delete): Use verify_type_context to check
whether the target allows particular types to be deleted.
* lambda.c (add_capture): Use verify_type_context to check
whether the target allows particular types to be captured by copy.
* pt.c: Include target.h.
(instantiate_class_template_1): Use verify_type_context to check
whether the target allows non-static member variables of a particular
type.
* typeck.c (cxx_alignof_expr): Use verify_type_context to check
whether the target allows the alignment of a particular type
to be measured.
(pointer_diff, cp_build_unary_op): Use verify_type_context to check
whether the target allows arithmetic involving pointers to particular
types.
2019-12-05 Marek Polacek <polacek@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts.
* class.c (trivial_default_constructor_is_constexpr): Return true in
C++20.
* constexpr.c (cx_check_missing_mem_inits): Allow missing field
initializers in C++20.
(cxx_eval_call_expression): Don't clear CONSTRUCTOR_NO_CLEARING for
constexpr constructors in C++20.
(reduced_constant_expression_p): Don't set FIELD for union and array
types. Skip empty class fields without initializers.
* decl.c (check_for_uninitialized_const_var): Permit trivial default
initialization in constexpr.
(next_initializable_field): Don't skip vptr fields.
* method.c (walk_field_subobs): Still consider a constructor that
doesn't initialize all the members constexpr.
2019-12-05 Marek Polacek <polacek@redhat.com>
PR c++/92271 - make __is_same alias for __is_same_as.
* cxx-pretty-print.c (pp_cxx_trait_expression) <case CPTK_IS_SAME_AS>:
Print "__is_same".
2019-12-05 David Edelsohn <dje.gcc@gmail.com>
* cp-gimplify.c: Include memmodel.h.
2019-12-05 Paolo Carlini <paolo.carlini@oracle.com>
* typeck2.c (build_functional_cast): Add location_t parameter
and use it.
* cp-tree.h: Update declaration.
* parser.c (cp_parser_functional_cast): Adjust call.
* call.c (build_op_delete_call): Likewise.
(build_new_method_call_1): Likewise.
* decl.c (check_initializer): Likewise.
* pt.c (tsubst_copy_and_build): Likewise.
* semantics.c (finish_compound_literal): Likewise.
2019-12-04 David Edelsohn <dje.gcc@gmail.com>
* cp-gimplify.c: Include tm_p.h.
2019-12-04 Marek Polacek <polacek@redhat.com>
* parser.c (enum primary_constraint_error): Remove stray comma.
2019-12-04 Richard Sandiford <richard.sandiford@arm.com>
* cp-tree.h (CP_AGGREGATE_TYPE_P): Check for gnu_vector_type_p
instead of VECTOR_TYPE.
* call.c (build_conditional_expr_1): Restrict vector handling
to vectors that satisfy gnu_vector_type_p.
* cvt.c (ocp_convert): Only allow vectors to be converted
to bool if they satisfy gnu_vector_type_p.
(build_expr_type_conversion): Only allow conversions from
vectors if they satisfy gnu_vector_type_p.
* typeck.c (cp_build_binary_op): Only allow binary operators to be
applied to vectors if they satisfy gnu_vector_type_p.
(cp_build_unary_op): Likewise unary operators.
(build_reinterpret_cast_1):
2019-12-03 Jakub Jelinek <jakub@redhat.com>
* cp-tree.h (enum cp_tree_index): Add CPTI_SOURCE_LOCATION_IMPL.
(source_location_impl): Define.
(enum cp_built_in_function): Add CP_BUILT_IN_SOURCE_LOCATION.
(fold_builtin_source_location): Declare.
* cp-gimplify.c: Include output.h, file-prefix-map.h and cgraph.h.
(cp_gimplify_expr, cp_fold): Handle CP_BUILT_IN_SOURCE_LOCATION.
Formatting fix.
(get_source_location_impl_type): New function.
(struct source_location_table_entry,
struct source_location_table_entry_hash): New types.
(source_location_table, source_location_id): New variables.
(fold_builtin_source_location): New function.
* constexpr.c (cxx_eval_builtin_function_call): Handle
CP_BUILT_IN_SOURCE_LOCATION.
* tree.c (builtin_valid_in_constant_expr_p): Likewise. Formatting
fix.
* decl.c (cxx_init_decl_processing): Register
__builtin_source_location.
* name-lookup.c (get_std_name_hint): Add source_location entry.
2019-12-03 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (cp_build_addr_expr_1): Use the cp_expr_loc_or_input_loc
location in a few additional diagnostics; tidy.
(check_return_expr): Likewise.
* typeck.c (cp_build_addr_expr_1): Use tree_strip_any_location_wrapper
for the address of main pedwarn.
2019-12-03 Jakub Jelinek <jakub@redhat.com>
PR c++/91369
* constexpr.c (struct constexpr_global_ctx): Add cleanups member,
initialize it in the ctor.
(cxx_eval_constant_expression) <case TARGET_EXPR>: If TARGET_EXPR_SLOT
is already in the values hash_map, don't evaluate it again. Put
TARGET_EXPR_SLOT into hash_map even if not lval, and push it into
save_exprs too. If there is TARGET_EXPR_CLEANUP and not
CLEANUP_EH_ONLY, push the cleanup to cleanups vector.
<case CLEANUP_POINT_EXPR>: Save outer cleanups, set cleanups to
local auto_vec, after evaluating the body evaluate cleanups and
restore previous cleanups.
<case TRY_CATCH_EXPR>: Don't crash if the first operand is NULL_TREE.
(cxx_eval_outermost_constant_expr): Set cleanups to local auto_vec,
after evaluating the expression evaluate cleanups.
2019-12-03 Marek Polacek <polacek@redhat.com>
PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
* call.c (build_new_method_call_1): Handle parenthesized initialization
of aggregates by building up a CONSTRUCTOR.
(extend_ref_init_temps): Do nothing for CONSTRUCTOR_IS_PAREN_INIT.
* cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT, LOOKUP_AGGREGATE_PAREN_INIT):
Define.
* decl.c (grok_reference_init): Handle aggregate initialization from
a parenthesized list of values.
(reshape_init): Do nothing for CONSTRUCTOR_IS_PAREN_INIT.
(check_initializer): Handle initialization of an array from a
parenthesized list of values. Use NULL_TREE instead of NULL.
* tree.c (build_cplus_new): Handle BRACE_ENCLOSED_INITIALIZER_P.
* typeck2.c (digest_init_r): Set LOOKUP_AGGREGATE_PAREN_INIT if it
receives a CONSTRUCTOR with CONSTRUCTOR_IS_PAREN_INIT set. Allow
narrowing when LOOKUP_AGGREGATE_PAREN_INIT.
(massage_init_elt): Don't lose LOOKUP_AGGREGATE_PAREN_INIT when passing
flags to digest_init_r.
2019-12-03 Jakub Jelinek <jakub@redhat.com>
PR c++/92732
* typeck2.c (digest_nsdmi_init): For bitfields, use
DECL_BIT_FIELD_TYPE instead of TREE_TYPE.
2019-12-03 Jason Merrill <jason@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR c++/92705
* call.c (strip_standard_conversion): New function.
(build_new_op_1): Use it for user_conv_p.
(compare_ics): Likewise.
(source_type): Likewise.
2019-12-03 Jakub Jelinek <jakub@redhat.com>
PR c++/92695
* constexpr.c (cxx_bind_parameters_in_call): For virtual calls,
adjust the first argument to point to the derived object rather
than its base.
2019-12-02 Jakub Jelinek <jakub@redhat.com>
PR c++/92695
* constexpr.c (cxx_eval_constant_expression) <case OBJ_TYPE_REF>: Use
STRIP_NOPS before checking for ADDR_EXPR.
2019-11-29 Jakub Jelinek <jakub@redhat.com>
PR c++/60228
* parser.c (cp_parser_omp_declare_reduction_exprs): If
processing_template_decl, wrap the combiner or initializer
into EXPR_STMT.
* decl.c (start_preparsed_function): Don't start a lambda scope
for DECL_OMP_DECLARE_REDUCTION_P functions.
(finish_function): Don't finish a lambda scope for
DECL_OMP_DECLARE_REDUCTION_P functions, nor cp_fold_function
them nor cp_genericize them.
* mangle.c (decl_mangling_context): Look through
DECL_OMP_DECLARE_REDUCTION_P functions.
* semantics.c (expand_or_defer_fn_1): For DECL_OMP_DECLARE_REDUCTION_P
functions, use tentative linkage, don't keep their bodies with
-fkeep-inline-functions and return false at the end.
2019-11-28 Jakub Jelinek <jakub@redhat.com>
PR c++/92695
* decl2.c (mark_used): Don't call note_vague_linkage_fn for pure
virtual functions, even if they are declared inline.
2019-11-16 Jason Merrill <jason@redhat.com>
Implement P1814R0, CTAD for alias templates.
* pt.c (rewrite_tparm_list): Factor out of build_deduction_guide.
(maybe_aggr_guide): Check for copy-init here.
(alias_ctad_tweaks, deduction_guides_for): New.
(ctor_deduction_guides_for): Factor out of do_class_deduction.
(ctad_template_p): New.
* parser.c (cp_parser_simple_type_specifier): Use it.
* constraint.cc (append_constraint): New.
2019-11-16 Jason Merrill <jason@redhat.com>
* cxx-pretty-print.c (pp_cxx_unqualified_id): Handle alias
template-id.
* pt.c (complex_alias_template_p): True if constraints.
(get_underlying_template, tsubst): Check alias constraints.
(push_template_decl_real): Set alias constraints here.
* parser.c (cp_parser_alias_declaration): Not here.
* constraint.cc (get_constraints): Take const_tree.
2019-11-12 Jason Merrill <jason@redhat.com>
PR c++/92206 - ICE with typedef to dependent alias.
* pt.c (dependent_alias_template_spec_p)
(alias_template_specialization_p): Add transparent_typedefs
parameter.
(iterative_hash_template_arg, any_template_parm_r)
(primary_template_specialization_p, tsubst, dependent_type_p_r):
Adjust.
* decl.c (check_elaborated_type_specifier): Adjust.
* error.c (dump_template_bindings, dump_aggr_type): Adjust.
2019-11-27 Andrew Sutton <asutton@lock3software.com>
PR c++/92236
Defer evaluation of concept checks so that static assertions can
emit more detailed diagnostics.
* constexpr.c (cxx_eval_call_expression): Handle concept checks.
(cxx_eval_constant_expression): Diagnose misuse of function concepts
as template-id expressions. Follow the usual return path for results.
(cxx_eval_outermost_constant_expr): Avoid calling
cp_get_callee_fndecl_nofold for function concepts.
* constraint.cc (build_function_check): Fully type the concept check
so that we don't ICE in conversions.
* cp-gimplify.c (cp_genericize_r) [CALL_EXPR]: Handle concept checks.
[TEMPLATE_ID_EXPR] Likewise.
* cvt.c (convert_to_void): Always evaluate concept checks so we don't
accidentally ignore them. Substitution during satisfaction can make
a program ill-formed (example in g++.dg/cpp2a/concepts6.C).
* pt.c (tsubst_copy_and_build): [CALL_EXPR]: Don't evaluate concepts.
[TEMPLATE_ID_EXPR]: Likewise.
* semantics.c (finish_call_expr): Don't evaluate concepts.
(finish_id_expression_1): Likewise.
(finish_static_assert): Preserve the original condition so we can
diagnose concept errors when a check returns false.
2019-11-27 Andrew Sutton <asutton@lock3software.com>
PR c++/92439
Improve quality of diagnostics for subexpressions that need parens.
* parser.c (cp_parser_requires_clause_opt): Add a flag to indicate
when parsing a requires-clause before lambda parameters, and...
(cp_parser_lambda_declarator_opt): ... use that here ...
(cp_parser_type_parameter): ... and here ...
(cp_parser_late_return_type_opt): ... and here ...
(cp_parser_explicit_template_declaration): ... and here.
(cp_parser_diagnose_ungrouped_constraint_plain): Adjust the message
because this can apply to subexpressions that are not immediately
after a requires-clause.
(cp_parser_diagnose_ungrouped_constraint_rich): Likewise.
(primary_constraint_error): New.
(cp_parser_constraint_requires_parens): New.
(cp_parser_unary_constraint_requires_parens): New.
(cp_parser_constraint_primary_expression): Check for unary expressions
before parsing the primary expression. Also check for binary and
postfix operators after a successful parse of the primary expression.
Force a re-parse if the result would form a lower-precedence string.
(cp_parser_constraint_logical_and_expression): Propagate lambda flag;
move checks for ill-formed constraints into the constraint primary
expression.
(cp_parser_constraint_logical_or_expression): Likewise.
(cp_parser_requires_clause_expression): Propagate lambda flag.
2019-11-27 Andrew Sutton <asutton@lock3software.com>
PR c++/88395
* constraint.cc (satisfy_declaration_constraints): Push tinst levels
around satisfaction.
2019-11-27 Andrew Sutton <asutton@lock3software.com>
Diagnose certain constraint errors as hard errors, but otherwise treat
them the same as normal SFINAE-type errors. Also, generally clean up
the satisfaction functions.
* constexpr.c (cxx_eval_constant_expression): Use
evaluate_concept_check.
* constraint.cc (normalize_concept_definition): Accept a diagnostic
flag and only cache when not diagnosing errors.
(decl_satisfied_cache): Map to trees instead of bools.
(satisfy_atom): Guarantee a location for the errors, propagate complain
flags to force_rvalue, and emit errors for non-boolean constraints.
(get_normalized_constraints_and_args): New overloads. Factored out of
satisfy_constraint_expression and satisfy_declaration_constraints.
(satisfy_constraint_expression): Propagate diagnostic info to
normalization.
(satisfy_declaration_constraints): New. Factored out of
constraints_satisfied_p.
(constraint_satisfaction_value): New. Calls
satisfy_constraint_expression or satisfy_declaration_constraints.
(constraints_satisfied_p): Call constraint_satisfaction_value.
(evaluate_concept_check): Don't take tsubst_falgs_t. Replay
satisfaction if an error is encountered.
(current_failed_constraint): Moved from pt.c.
(diagnose_constraints): Call constraint_satisfaction_value.
* cp-tree.h: Update declarations.
* pt.c (current_failed_constraint): Moved to constraint.cc.
* semantics.c (finish_id_expression_1): Remove a duplicate case.
2019-11-27 Jakub Jelinek <jakub@redhat.com>
PR c++/92524
* tree.c (replace_placeholders_r): Don't walk constructor elts with
RANGE_EXPR indexes.
2019-11-26 Jason Merrill <jason@redhat.com>
* pt.c (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Remember the
location of a variable template-id.
* constexpr.c (cxx_eval_constant_expression): Get expr location
before stripping location wrappers.
(non_const_var_error): Take location argument.
2019-11-26 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (cp_build_unary_op): Consistently use the accurate
location in seven additional diagnostic messages.
(cp_build_compound_expr): Use cp_expr_loc_or_input_loc in one place.
2019-11-26 Jakub Jelinek <jakub@redhat.com>
PR c++/92648
* parser.c (cp_parser_std_attribute): For unknown attributes,
skip balanced token seq instead of trying to parse
attribute-argument-clause as expression list. Formatting fix.
PR c++/61414
* class.c (enum_to_min_precision): New hash_map.
(enum_min_precision): New function.
(check_bitfield_decl): Use it.
2019-11-25 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (cp_build_indirect_ref_1): Add location_t parameter
and use it in error messages.
(build_x_indirect_ref): Adjust call.
(build_indirect_ref): Likewise.
(cp_build_fold_indirect_ref): Likewise.
(cp_build_array_ref): Likewise.
* call.c (build_new_op_1): Likewise.
* semantics.c (finish_omp_clauses): Likewise.
(finish_omp_depobj): Likewise.
* typeck2.c (build_x_arrow): Likewise.
* cp-tree.h (cp_build_indirect_ref): Update declaration.
* call.c (build_new_op_1): Use location argument in warning_at.
* typeck.c (cp_build_modify_expr): Consistently use the
location_t argument.
2019-11-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/92365
* name-lookup.c (check_local_shadow): Use can_convert_arg
instead of can_convert.
2019-11-22 Marek Polacek <polacek@redhat.com>
PR c++/88337 - P1327R1: Allow polymorphic typeid in constexpr.
* constexpr.c (potential_constant_expression_1): Allow a typeid
expression whose operand is of polymorphic type in constexpr in
C++20.
* rtti.c (build_typeid): Remove obsolete FIXME comment.
2019-11-22 Jakub Jelinek <jakub@redhat.com>
PR c/90677
* cp-objcp-common.c (identifier_global_tag): Define.
PR c++/92458
* init.c (nsdmi_inst): Change type to
decl_tree_cache_map * from tree_cache_map *.
* constraint.cc (decl_constraints): Likewise.
* decl.c (get_tuple_decomp_init): Likewise.
* pt.c (defarg_inst, explicit_specifier_map): Likewise.
(tsubst_default_argument, store_explicit_specifier): Use
decl_tree_cache_map::create_ggc rather than
tree_cache_map::create_ggc.
* cp-objcp-common.c (debug_type_map): Change type to
type_tree_cache_map * from tree_cache_map *.
2019-11-21 Marek Polacek <polacek@redhat.com>
PR c++/92450 - ICE with invalid nested name specifier.
* parser.c (cp_parser_member_declaration): Don't attempt to print
erroneous bit-field diagnostic if grokdeclarator returns
error_mark_node.
2019-11-21 Jakub Jelinek <jakub@redhat.com>
Jason Merrill <jason@redhat.com>
PR c++/90842
* parser.c (cp_parser_decl_specifier_seq): For concept or typedef
break early if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
For type specifiers, set CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS
if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR is set.
2019-11-20 Paolo Carlini <paolo.carlini@oracle.com>
* typeck2.c (build_x_arrow): Early return if decay_conversion
returns error_mark_node.
2019-11-20 Jakub Jelinek <jakub@redhat.com>
PR c++/90767
* call.c (complain_about_no_candidates_for_method_call): If
conv->from is not a type, pass to complain_about_bad_argument
lvalue_type of conv->from.
2019-11-20 Paolo Carlini <paolo.carlini@oracle.com>
* cvt.c (ocp_convert): Use additional warning sentinel.
2019-11-19 Jakub Jelinek <jakub@redhat.com>
PR c++/92414
* constexpr.c (cxx_eval_outermost_constant_expr): If DECL_INITIAL
on object is erroneous, return t without trying to evaluate
a constexpr dtor.
2019-11-12 Jason Merrill <jason@redhat.com>
* call.c (same_fn_or_template): Change to cand_parms_match.
(joust): Adjust.
(print_z_candidate): Mark rewritten/reversed candidates.
(build_new_op_1): Warn about recursive call with reversed arguments.
2019-11-15 Andrew Sutton <asutton@lock3software.com>
PR c++/89913
* pt.c (get_underlying_template): Exit loop if the original type
of the alias is null.
2019-11-19 Andrew Sutton <asutton@lock3software.com>
PR c++/92078
* pt.c (maybe_new_partial_specialization): Apply access to newly
created partial specializations. Update comment style.
2019-11-19 Andrew Sutton <asutton@lock3software.com>
PR c++/92078
* pt.c (maybe_new_partial_specialization): Apply access to newly
created partial specializations. Update comment style.
2019-11-19 Andrew Sutton <asutton@lock3software.com>
PR c++/92403
Suppress diagnostics substituting into a requires-expression.
* pt.c (tsubst_copy_and_build): Perform the first substitution without
diagnostics and a second only if tsubst_requries_expr returns an error.
2019-11-19 Jakub Jelinek <jakub@redhat.com>
PR c++/92504
* semantics.c (handle_omp_for_class_iterator): Don't call
cp_fully_fold on cond.
2019-11-18 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (cp_build_addr_expr_1): Use cp_expr_loc_or_input_loc
in three places.
(cxx_sizeof_expr): Use it in one additional place.
(cxx_alignof_expr): Likewise.
(lvalue_or_else): Likewise.
2019-11-18 Marek Polacek <polacek@redhat.com>
PR c++/91962 - ICE with reference binding and qualification conversion.
* call.c (convert_like_real) <case ck_ref_bind>: Check need_temporary_p.
2019-11-17 Jakub Jelinek <jakub@redhat.com>
* method.c (lookup_comparison_result): Use %qD instead of %<%T::%D%>
to print the decl.
(lookup_comparison_category): Use %qD instead of %<std::%D%> to print
the decl.
2019-11-15 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (cp_truthvalue_conversion): Add tsubst_flags_t parameter
and use it in calls; also pass the location_t of the expression to
cp_build_binary_op and c_common_truthvalue_conversion.
* rtti.c (build_dynamic_cast_1): Adjust call.
* cvt.c (ocp_convert): Likewise.
* cp-gimplify.c (cp_fold): Likewise.
* cp-tree.h (cp_truthvalue_conversion): Update declaration.
2019-11-14 Jason Merrill <jason@redhat.com>
Implement P1816R0, class template argument deduction for aggregates.
* pt.c (maybe_aggr_guide, collect_ctor_idx_types): New.
(is_spec_or_derived): Split out from do_class_deduction.
(build_deduction_guide): Handle aggregate guide.
* class.c (finish_struct): Set CLASSTYPE_NON_AGGREGATE in a
template.
* cp-tree.h (CP_AGGREGATE_TYPE_P): An incomplete class is not an
aggregate.
2019-11-14 Richard Sandiford <richard.sandiford@arm.com>
* call.c (build_conditional_expr_1): Use truth_type_for instead
of build_same_sized_truth_vector_type.
* typeck.c (build_vec_cmp): Likewise.
2019-11-14 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_omp_context_selector): Don't require score
argument to fit into shwi, just to be INTEGER_CST. Diagnose
negative score.
* pt.c (tsubst_attribute): Likewise.
* parser.c (cp_parser_omp_context_selector): Rename
CTX_PROPERTY_IDLIST to CTX_PROPERTY_NAME_LIST, add CTX_PROPERTY_ID.
Use CTX_PROPERTY_ID for atomic_default_mem_order, only allow a single
identifier in that. For CTX_PROPERTY_NAME_LIST, allow identifiers
and string literals.
* pt.c (tsubst_attribute): Fix up STRING_CST handling if allow_string.
2019-11-13 Marek Polacek <polacek@redhat.com>
PR c++/89070 - bogus [[nodiscard]] warning in SFINAE.
* cvt.c (convert_to_void): Guard maybe_warn_nodiscard calls with
tf_warning.
2019-11-13 Richard Sandiford <richard.sandiford@arm.com>
PR c++/92206
* cp-tree.h (STF_STRIP_DEPENDENT): New constant.
* tree.c (strip_typedefs): Add STF_STRIP_DEPENDENT to the flags
when calling strip_typedefs recursively on a DECL_ORIGINAL_TYPE.
Don't apply the fix for DR1558 in that case; allow aliases with
dependent template parameters to be stripped instead.
2019-11-12 Nathan Sidwell <nathan@acm.org>
* name-lookup.c (lookup_using_decl): New function, merged from ...
(do_class_using_decl): ... here. Call it. And ...
(finish_nonmember_using_decl): ... here. Call it.
2019-11-12 Martin Liska <mliska@suse.cz>
* name-lookup.c: Do not include params.h.
* typeck.c: Likewise.
2019-11-12 Martin Liska <mliska@suse.cz>
* name-lookup.c (namespace_hints::namespace_hints): Replace old
parameter syntax with the new one, include opts.h if needed. Use
SET_OPTION_IF_UNSET macro.
* typeck.c (comptypes): Likewise.
2019-11-12 Maciej W. Rozycki <macro@codesourcery.com>
Frederik Harwath <frederik@codesourcery.com>
gcc/cp/
* constexpr.c (potential_constant_expression_1): Handle
OACC_SERIAL.
* parser.c (OACC_SERIAL_CLAUSE_MASK): New macro.
(cp_parser_oacc_kernels_parallel): Rename function to...
(cp_parser_oacc_compute): ... this. Handle PRAGMA_OACC_SERIAL.
(cp_parser_omp_construct): Update accordingly.
(cp_parser_pragma): Handle PRAGMA_OACC_SERIAL. Fix alphabetic
order.
* pt.c (tsubst_expr): Handle OACC_SERIAL.
2019-11-11 Jason Merrill <jason@redhat.com>
Implement P1946R0, Allow defaulting comparisons by value.
* method.c (early_check_defaulted_comparison): Accept by-value,
reject mixed by-value and by-reference parms.
* decl.c (grokdeclarator): Set funcdef_flag for defaulted friend.
* decl2.c (grokfield): Don't SET_DECL_FRIEND_CONTEXT.
* typeck.c (cp_build_binary_op): Sorry about <=> on VECTOR_TYPE.
2019-11-11 Jakub Jelinek <jakub@redhat.com>
PR c++/92447
* decl.c (finish_function): Move ctype initialization before
DECL_DELETED_FN handling.
* semantics.c (finish_translation_unit): Diagnose declare target
without corresponding end declare target.
2019-11-10 Jason Merrill <jason@redhat.com>
Implement D1957R0, T* to bool should be considered narrowing.
* typeck2.c (check_narrowing): Treat pointer->bool as a narrowing
conversion with -std=c++2a.
2019-11-08 Marek Polacek <polacek@redhat.com>
PR c++/92215 - flawed diagnostic for bit-field with non-integral type.
* parser.c (cp_parser_member_declaration): Add a diagnostic for
bit-fields with non-integral types.
2019-11-08 Jakub Jelinek <jakub@redhat.com>
* init.c (build_vec_delete_1): Fix a comment typo - mist -> must.
2019-11-07 Jason Merrill <jason@redhat.com>
Implement D1959R0, remove weak_equality and strong_equality.
* method.c (enum comp_cat_tag, comp_cat_info): Remove *_equality.
(genericize_spaceship, common_comparison_type): Likewise.
* typeck.c (cp_build_binary_op): Move SPACESHIP_EXPR to be with the
relational operators, exclude other types no longer supported.
2019-11-06 Jason Merrill <jason@redhat.com>
Implement D1907R1 "structural type".
* tree.c (structural_type_p): New.
* pt.c (invalid_nontype_parm_type_p): Use it.
* class.c (build_base_field_1): Take binfo. Copy TREE_PRIVATE.
(build_base_field): Pass binfo.
PR c++/92150 - partial specialization with class NTTP.
* pt.c (unify): Handle VIEW_CONVERT_EXPR.
* pt.c (use_pack_expansion_extra_args_p): Still do substitution if
all packs are simple pack expansions.
(add_extra_args): Check that the extra args aren't dependent.
2019-11-06 Andrew Sutton <asutton@lock3software.com>
Use satisfaction with nested requirements.
* constraint.cc (build_parameter_mapping): Use
current_template_parms when the declaration is not available.
(norm_info::norm_info) Make explicit.
(normalize_constraint_expression): Factor into a separate overload
that takes arguments, and use that in the original function.
(tsubst_nested_requirement): Use satisfy_constraint instead of
trying to evaluate this as a constant expression.
(finish_nested_requirement): Keep the normalized constraint and the
original normalization arguments with the requirement.
(diagnose_nested_requirement): Use satisfy_constraint. Tentatively
implement more comprehensive diagnostics, but do not enable.
* parser.c (cp_parser_requires_expression): Relax requirement that
requires-expressions can live only inside templates.
* pt.c (any_template_parm_r): Look into type of PARM_DECL.
2019-11-06 Jason Merrill <jason@redhat.com>
C++20 NB CA378 - Remove constrained non-template functions.
* decl.c (grokfndecl): Reject constraints on non-templated function.
2019-11-06 Matthias Kretz <m.kretz@gsi.de>
* parser.c (cp_parser_operator): Parse operator?: as an
attempt to overload the conditional operator.
2019-11-05 Jason Merrill <jason@redhat.com>
Implement C++20 operator<=>.
* cp-tree.h (struct lang_decl_fn): Add maybe_deleted bitfield.
(DECL_MAYBE_DELETED): New.
(enum special_function_kind): Add sfk_comparison.
(LOOKUP_REWRITTEN, LOOKUP_REVERSED): New.
* call.c (struct z_candidate): Add rewritten and reversed methods.
(add_builtin_candidate): Handle SPACESHIP_EXPR.
(add_builtin_candidates): Likewise.
(add_candidates): Don't add a reversed candidate if the parms are
the same.
(add_operator_candidates): Split out from build_new_op_1. Handle
rewritten and reversed candidates.
(add_candidate): Swap conversions of reversed candidate.
(build_new_op_1): Swap them back. Build a second operation for
rewritten candidates.
(extract_call_expr): Handle rewritten calls.
(same_fn_or_template): New.
(joust): Handle rewritten and reversed candidates.
* class.c (add_implicitly_declared_members): Add implicit op==.
(classtype_has_op, classtype_has_defaulted_op): New.
* constexpr.c (cxx_eval_binary_expression): Handle SPACESHIP_EXPR.
(cxx_eval_constant_expression, potential_constant_expression_1):
Likewise.
* cp-gimplify.c (genericize_spaceship): New.
(cp_genericize_r): Use it.
* cp-objcp-common.c (cp_common_init_ts): Handle SPACESHIP_EXPR.
* decl.c (finish_function): Handle deleted function.
* decl2.c (grokfield): SET_DECL_FRIEND_CONTEXT on defaulted friend.
(mark_used): Check DECL_MAYBE_DELETED. Remove assumption that
defaulted functions are non-static members.
* error.c (dump_expr): Handle SPACESHIP_EXPR.
* method.c (type_has_trivial_fn): False for sfk_comparison.
(enum comp_cat_tag, struct comp_cat_info_t): New types.
(comp_cat_cache): New array variable.
(lookup_comparison_result, lookup_comparison_category)
(is_cat, cat_tag_for, spaceship_comp_cat)
(spaceship_type, genericize_spaceship)
(common_comparison_type, early_check_defaulted_comparison)
(comp_info, build_comparison_op): New.
(synthesize_method): Handle sfk_comparison. Handle deleted.
(get_defaulted_eh_spec, maybe_explain_implicit_delete)
(explain_implicit_non_constexpr, implicitly_declare_fn)
(defaulted_late_check, defaultable_fn_check): Handle sfk_comparison.
* name-lookup.c (get_std_name_hint): Add comparison categories.
* tree.c (special_function_p): Add sfk_comparison.
* typeck.c (cp_build_binary_op): Handle SPACESHIP_EXPR.
2019-11-05 Tim van Deurzen <tim@kompiler.org>
Add new tree code for the spaceship operator.
* cp-tree.def: Add new tree code.
* operators.def: New binary operator.
* parser.c: Add new token and tree code.
2019-09-15 Jason Merrill <jason@redhat.com>
* call.c (build_new_op_1): Don't apply any standard conversions to
the operands of a built-in operator. Don't suppress conversions in
cp_build_unary_op.
* typeck.c (cp_build_unary_op): Do integral promotions for enums.
2019-11-04 Jason Merrill <jason@redhat.com>
Use vec instead of raw array for built-in candidates.
* call.c (build_builtin_candidate): Take args in a vec.
(add_builtin_candidate, add_builtin_candidates): Likewise.
(build_conditional_expr_1, build_new_op_1): Adjust.
2019-11-04 Jason Merrill <jason@redhat.com>
* constexpr.c (explain_invalid_constexpr_fn): Show location of fn.
* pt.c (maybe_instantiate_noexcept): Only update clones if we
instantiated.
* typeck.c (contextual_conv_bool): New.
* name-lookup.c (lookup_qualified_name): Add wrapper overload taking
C string rather than identifier.
* parser.c (cp_parser_userdef_numeric_literal): Use it.
* rtti.c (emit_support_tinfos): Use it.
* cp-tree.h (ovl_op_identifier): Change to inline functions.
(build_x_binary_op): Add wrapper with fewer parms.
2019-11-05 Jason Merrill <jason@redhat.com>
* decl2.c (mark_used): Diagnose use of a function with unsatisfied
constraints here.
* typeck.c (cp_build_function_call_vec): Not here.
2019-11-05 Nathan Sidwell <nathan@acm.org>
PR c++/92370
* parser.c (cp_parser_error_1): Check EOF and UNKNOWN_LOCATION
when skipping over version control marker.
2019-11-05 Jakub Jelinek <jakub@redhat.com>
PR c++/92343
* constexpr.c (potential_constant_expression_1): Return true rather
than false for PREDICT_EXPR.
* decl.c (omp_declare_variant_finalize_one): Call
declare_simd_adjust_this not just on the context, but also on the
variant-id expression for methods. Don't call
cp_get_callee_fndecl_nofold, call cp_get_callee and only if it is
safe cp_get_fndecl_from_callee. Don't try to print as %qD
NULL in diagnostics.
* pt.c (tsubst_attribute): Handle "omp declare variant base"
attribute.
(tsubst_function_decl): Call omp_declare_variant_finalize
if there are any "omp declare variant base" attributes left.
2019-11-04 Kamlesh Kumar <kamleshbhalui@gmail.com>
PR c++/91979 - mangling nullptr expression
* mangle.c (write_template_arg_literal): Handle nullptr
mangling.
2019-11-04 Jason Merrill <jason@redhat.com>
* typeck.c (check_return_expr): Avoid redundant error.
2019-11-02 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (composite_pointer_type): Add a const op_location_t&
parameter and use it in diagnostics.
(composite_pointer_error): Likewise.
(composite_pointer_type_r): Add a const op_location_t&
parameter and forward it.
(cp_build_binary_op): Adjust calls.
(common_pointer_type): Likewise.
* call.c (add_builtin_candidate): Likewise.
(build_conditional_expr_1): Likewise.
* cp-tree.h (composite_pointer_type): Update declaration.
* typeck.c (cxx_sizeof_expr): Use cp_expr_loc_or_input_loc
in permerror.
(cxx_alignof_expr): Likewise.
(lvalue_or_else): Likewise.
2019-11-02 Jakub Jelinek <jakub@redhat.com>
* decl.c (omp_declare_variant_finalize_one): Use
omp_get_context_selector instead of c_omp_get_context_selector.
PR c++/89640
* parser.c (cp_parser_decl_specifier_seq): Don't parse attributes
if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
PR c++/88335 - Implement P1073R3: Immediate functions
* cp-tree.h (struct lang_decl_fn): Add immediate_fn_p bit.
(DECL_IMMEDIATE_FUNCTION_P, SET_DECL_IMMEDIATE_FUNCTION_P): Define.
(enum cp_decl_spec): Add ds_consteval.
(fold_non_dependent_expr): Add another tree argument defaulted to
NULL_TREE.
* name-lookup.h (struct cp_binding_level): Add immediate_fn_ctx_p
member.
* parser.c (cp_keyword_starts_decl_specifier_p): Adjust comments
for C++11 and C++20 specifiers. Handle RID_CONSTEVAL.
(CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR): Adjust comment.
(CP_PARSER_FLAGS_CONSTEVAL): New.
(cp_parser_skip_balanced_tokens): New forward declaration.
(cp_parser_lambda_declarator_opt): Handle ds_consteval. Set
current_binding_level->immediate_fn_ctx_p before parsing parameter
list if decl-specifier-seq contains consteval specifier.
(cp_parser_decl_specifier_seq): Handle RID_CONSTEVAL.
(cp_parser_explicit_instantiation): Diagnose explicit instantiation
with consteval specifier.
(cp_parser_init_declarator): For consteval or into flags
CP_PARSER_FLAGS_CONSTEVAL.
(cp_parser_direct_declarator): If CP_PARSER_FLAGS_CONSTEVAL, set
current_binding_level->immediate_fn_ctx_p in the sk_function_parms
scope.
(set_and_check_decl_spec_loc): Add consteval entry, formatting fix.
* call.c (build_addr_func): For direct calls to immediate functions
use build_address rather than decay_conversion.
(build_over_call): Evaluate immediate function invocations.
* error.c (dump_function_decl): Handle DECL_IMMEDIATE_FUNCTION_P.
* semantics.c (expand_or_defer_fn_1): Use tentative linkage and don't
call mark_needed for immediate functions.
* typeck.c (cxx_sizeof_or_alignof_expr): Likewise. Formatting fix.
(cp_build_addr_expr_1): Reject taking address of immediate function
outside of immediate function.
* decl.c (validate_constexpr_redeclaration): Diagnose consteval
vs. non-consteval or vice versa redeclaration. Use
SET_DECL_IMMEDIATE_FUNCTION_P if new_decl is immediate function.
(check_tag_decl): Use %qs with keyword string to simplify translation.
Handle ds_consteval.
(start_decl): Adjust diagnostics for static or thread_local variables
in immediate functions.
(grokfndecl): Call sorry_at on virtual consteval. Use %qs with keyword
to string to simplify translation. Diagnose consteval main. Use
SET_DECL_IMMEDIATE_FUNCTION_P for consteval.
(grokdeclarator): Handle consteval. Use %qs with keyword strings to
simplify translation. Use separate ifs instead of chained else if
for invalid specifiers. For constinit clear constinit_p rather than
constexpr_p.
* constexpr.c (find_immediate_fndecl): New function.
(cxx_eval_outermost_constant_expr): Allow consteval calls returning
void. Diagnose returning address of immediate function from consteval
evaluation.
(fold_non_dependent_expr_template): Add OBJECT argument, pass it
through to cxx_eval_outermost_constant_expr.
(fold_non_dependent_expr): Add OBJECT argument, pass it through to
fold_non_dependent_expr_template.
(fold_non_dependent_init): Adjust fold_non_dependent_expr_template
caller.
* method.c (defaulted_late_check): Adjust diagnostics for consteval.
* lambda.c (maybe_add_lambda_conv_op): Copy over
DECL_DECLARED_CONSTEXPR_P and DECL_IMMEDIATE_FUNCTION_P bits from
callop to both artificial functions.
* init.c (build_value_init): Don't do further processing if
build_special_member_call returned a TREE_CONSTANT. Formatting fix.
PR c++/91369 - Implement P0784R7: constexpr new
* cp-tree.h (CALL_FROM_NEW_OR_DELETE_P): Define.
* init.c (build_new_1, build_vec_delete_1, build_delete): Set
CALL_FROM_NEW_OR_DELETE_P on the CALL_EXPR to allocator functions.
* constexpr.c (is_std_allocator_allocate): Only allow
global replaceable allocator functions if CALL_FROM_NEW_OR_DELETE_P
or in std::allocate<T>::{,de}allocate.
(potential_constant_expression_1): Likewise.
2019-11-01 Nathan Sidwell <nathan@acm.org>
* class.c (check_field_decls): Refactor.
2019-10-31 Jakub Jelinek <jakub@redhat.com>
PR c++/90947
* cp-tree.h (type_initializer_zero_p): Declare.
* decl.c (reshape_init_array_1): Formatting fix.
* tree.c (type_initializer_zero_p): New function. Moved from
../tree.c, use next_initializable_field, formatting fix. Return
false for TYPE_NON_AGGREGATE_CLASS types.
2019-10-30 Jason Merrill <jason@redhat.com>
PR c++/92268 - hard error satisfying return-type-requirement
* constraint.cc (type_deducible_p): Check for substitution failure.
(diagnose_compound_requirement): Adjust diagnostic.
* pt.c (do_auto_deduction): Don't pass cargs to
constraints_satisfied_p.
2019-10-30 Jakub Jelinek <jakub@redhat.com>
PR c++/91369 - Implement P0784R7: constexpr new
* constexpr.c (cxx_replaceable_global_alloc_fn): Don't return true
for placement new.
(cxx_placement_new_fn, is_std_construct_at): New functions.
(cxx_eval_call_expression): Allow placement new in std::construct_at.
(potential_constant_expression_1): Likewise.
* typeck.c (decl_in_std_namespace_p): Return true also for decls
in inline namespaces inside of std namespace.
2019-10-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/92024
* name-lookup.c (check_local_shadow): Shadowing TYPE_DECLs
is always a -Wshadow=compatible-local warning, unless
-Wshadow is used.
2019-10-30 Jason Merrill <jason@redhat.com>
* cxx-pretty-print.c (get_fold_operator): Use OVL_OP_INFO.
2019-10-30 Marek Polacek <polacek@redhat.com>
PR c++/92134 - constinit malfunction in static data member.
* decl2.c (grokfield): Set LOOKUP_CONSTINIT.
2019-10-30 Jakub Jelinek <jakub@redhat.com>
* cp-tree.h (omp_declare_variant_finalize, build_local_temp): Declare.
* decl.c: Include omp-general.h.
(declare_simd_adjust_this): Add forward declaration.
(omp_declare_variant_finalize_one, omp_declare_variant_finalize): New
function.
(cp_finish_decl, finish_function): Call omp_declare_variant_finalize.
* parser.c (cp_finish_omp_declare_variant): Adjust parsing of the
variant id-expression and propagate enough information to
omp_declare_variant_finalize_one in the attribute so that it can
finalize it.
* class.c (finish_struct): Call omp_declare_variant_finalize.
* tree.c (build_local_temp): No longer static, remove forward
declaration.
2019-10-30 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (cp_build_modify_expr): Prefer error + inform to
error + error in one place.
(get_delta_difference_1): Likewise.
(get_delta_difference): Likewise, in two places.
2019-10-29 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (build_x_unary_op): Use the location_t argument in
three error_at.
2019-10-29 Marek Polacek <polacek@redhat.com>
PR c++/90998 - ICE with copy elision in init by ctor and -Wconversion.
* call.c (joust): Don't attempt to warn if ->second_conv is null.
2019-10-29 Jakub Jelinek <jakub@redhat.com>
PR c++/92201
* cp-gimplify.c (cp_gimplify_expr): If gimplify_to_rvalue changes the
function pointer type, re-add cast to the original one.
2019-10-29 Marek Polacek <polacek@redhat.com>
PR c++/91548 - fix detecting modifying const objects for ARRAY_REF.
* constexpr.c (cxx_eval_store_expression): Don't call
modifying_const_object_p for ARRAY_REF.
2019-10-29 Richard Sandiford <richard.sandiford@arm.com>
* cp-objcp-common.h (cxx_simulate_enum_decl): Declare.
(LANG_HOOKS_SIMULATE_ENUM_DECL): Define to the above.
* decl.c (cxx_simulate_enum_decl): New function.
2019-10-29 Richard Sandiford <richard.sandiford@arm.com>
* cp-tree.h (cxx_simulate_builtin_function_decl): Declare.
* decl.c (cxx_simulate_builtin_function_decl): New function.
* cp-objcp-common.h (LANG_HOOKS_SIMULATE_BUILTIN_FUNCTION_DECL):
Define to the above.
2019-10-28 Martin Sebor <msebor@redhat.com>
PR c/66970
* cp-objcp-common.c (names_builtin_p): Define new function.
2019-10-28 Nathan Sidwell <nathan@acm.org>
* parser.h (struct cp_token): Drop {ENUM,BOOL}_BITFIELD C-ism.
Add tree_check_p flag, use as nested union discriminator.
(struct cp_lexer): Add saved_type & saved_keyword fields.
* parser.c (eof_token): Delete.
(cp_lexer_new_main): Always init last_token to last token of
buffer.
(cp_lexer_new_from_tokens): Overlay EOF token at end of range.
(cp_lexer_destroy): Restore token under the EOF.
(cp_lexer_previous_token_position): No check for eof_token here.
(cp_lexer_get_preprocessor_token): Clear tree_check_p.
(cp_lexer_peek_nth_token): Check CPP_EOF not eof_token.
(cp_lexer_consume_token): Assert not CPP_EOF, no check for
eof_token.
(cp_lexer_purge_token): Likewise.
(cp_lexer_purge_tokens_after): No check for EOF token.
(cp_parser_nested_name_specifier, cp_parser_decltype)
(cp_parser_template_id): Set tree_check_p.
2019-10-24 Jakub Jelinek <jakub@redhat.com>
* decl2.c (cplus_decl_attributes): Add "omp declare target block"
attribute in between declare target and end declare target
pragmas.
* call.c (convert_arg_to_ellipsis): Add missing space in string
literal.
2019-10-24 Marek Polacek <polacek@redhat.com>
* decl.c (reshape_init_r): Add missing space.
2019-10-24 Nathan Sidwell <nathan@acm.org>
* pt.c (reduce_template_parm_level): Attach the new TPI to the new
DECL.
(convert_generic_types_to_packs): Pass the copied type to
reduce_templatE_parm_level.
2019-10-23 Nathan Sidwell <nathan@acm.org>
* cp-tree.c (CPTI_STD_IDENTIFIER): Delete.
(std_identifier): Delete.
(DECL_NAME_SPACE_STD_P): Compare against std_node.
* decl.c (initialize_predefined_identifiers): 'std' is not needed.
(cxx_init_decl_processing): Adjust creation of ::std. Use
{push,pop}_nested_namespace.
(cxx_builtin_function): Use {push,pop}_nested_namespace.
* except.c (init_exception_processing): Likewise.
* rtti.c (init_rtti_processing): Likewise.
2019-10-23 Jason Merrill <jason@redhat.com>
Implement P1286R2, Contra CWG1778
* method.c (defaulted_late_check): Don't check explicit
exception-specification on defaulted function.
(after_nsdmi_defaulted_late_checks): Remove.
* parser.h (struct cp_unparsed_functions_entry): Remove classes.
* parser.c (unparsed_classes): Remove.
(push_unparsed_function_queues, cp_parser_class_specifier_1):
Adjust.
2019-10-23 Jakub Jelinek <jakub@redhat.com>
* constexpr.c (cxx_eval_constant_expression) <case CLEANUP_STMT>:
Temporarily change input_location to CLEANUP_STMT location.
2019-10-22 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/85887
* decl.c (expand_static_init): Drop ECF_LEAF from __cxa_guard_acquire
and __cxa_guard_release.
2019-10-22 Marc Glisse <marc.glisse@inria.fr>
PR c++/85746
* constexpr.c (cxx_eval_builtin_function_call): Only set
force_folding_builtin_constant_p if manifestly_const_eval.
2019-10-22 Richard Sandiford <richard.sandiford@arm.com>
* cp-tree.h (STF_USER_VISIBLE): New constant.
(strip_typedefs, strip_typedefs_expr): Take a flags argument.
* tree.c (strip_typedefs, strip_typedefs_expr): Likewise,
updating mutual calls accordingly. When STF_USER_VISIBLE is true,
only look through typedefs if user_facing_original_type_p.
* error.c (dump_template_bindings, type_to_string): Pass
STF_USER_VISIBLE to strip_typedefs.
(dump_type): Likewise, unless pp_c_flag_gnu_v3 is set.
2019-10-21 Kamlesh Kumar <kamleshbhalui@gmail.com>
Jason Merrill <jason@redhat.com>
PR c++/83534 - typeinfo of noexcept function
* rtti.c (get_tinfo_decl_dynamic): Do not call
TYPE_MAIN_VARIANT for function.
(get_typeid): Likewise.
2019-10-21 Paolo Carlini <paolo.carlini@oracle.com>
* parser.c (cp_parser_class_head): Improve error recovery upon
extra qualification error.
2019-10-21 Jakub Jelinek <jakub@redhat.com>
PR c++/92015
* constexpr.c (cxx_eval_component_reference, cxx_eval_bit_field_ref):
Use STRIP_ANY_LOCATION_WRAPPER on CONSTRUCTOR elts.
2019-10-21 Marek Polacek <polacek@redhat.com>
PR c++/92062 - ODR-use ignored for static member of class template.
* pt.c (has_value_dependent_address): Strip location wrappers.
2019-10-21 Marek Polacek <polacek@redhat.com>
PR c++/92106 - ICE with structured bindings and -Wreturn-local-addr.
* typeck.c (maybe_warn_about_returning_address_of_local): Avoid
recursing on null initializer and return false instead.
2019-10-17 JeanHeyd Meneide <phdofthehouse@gmail.com>
Implement p1301 [[nodiscard("should have a reason")]] + p1771 DR
* tree.c (handle_nodiscard_attribute): Handle C++2a nodiscard
string message.
(std_attribute_table) Increase nodiscard argument handling
max_length from 0 to 1.
* parser.c (cp_parser_check_std_attribute): Add requirement
that nodiscard only be seen once in attribute-list.
(cp_parser_std_attribute): Check that empty parenthesis lists are
not specified for attributes that have max_length > 0 (e.g.
[[attr()]]).
* cvt.c (maybe_warn_nodiscard): Add nodiscard message to
output, if applicable.
(convert_to_void): Allow constructors to be nodiscard-able (P1771).
2019-10-18 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (struct lang_type): Remove was_anonymous.
(TYPE_WAS_UNNAMED): Implement by checking TYPE_DECL &
TYPE_STUB_DECL.
* decl.c (name_unnamed_type): Don't set TYPE_WAS_UNNAMED.
2019-10-17 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokfndecl): Remove redundant use of in_system_header_at.
(compute_array_index_type_loc): Likewise.
(grokdeclarator): Likewise.
* error.c (cp_printer): Likewise.
* lambda.c (add_default_capture): Likewise.
* parser.c (cp_parser_primary_expression): Likewise.
(cp_parser_selection_statement): Likewise.
(cp_parser_toplevel_declaration): Likewise.
(cp_parser_enumerator_list): Likewise.
(cp_parser_using_declaration): Likewise.
(cp_parser_member_declaration): Likewise.
(cp_parser_exception_specification_opt): Likewise.
(cp_parser_std_attribute_spec): Likewise.
* pt.c (do_decl_instantiation): Likewise.
(do_type_instantiation): Likewise.
* typeck.c (cp_build_unary_op): Likewise.
* decl.c (check_tag_decl): Pass to in_system_header_at the same
location used for the permerror.
(grokdeclarator): Likewise.
* decl.c (check_tag_decl): Use locations[ds_typedef] in error_at.
2019-10-17 Jason Merrill <jason@redhat.com>
* cp-gimplify.c (cp_gimplify_expr): Use get_initialized_tmp_var.
(gimplify_to_rvalue): Remove default NULL argument.
2019-10-17 Nathan Sidwell <nathan@acm.org>
* decl.c (builtin_function_1): Merge into ...
(cxx_builtin_function): ... here. Nadger the decl before maybe
copying it. Set the context.
(cxx_builtin_function_ext_scope): Push to top level, then call
cxx_builtin_function.
2019-10-16 Luis Machado <luis.machado@linaro.org>
* cp-gimplify.c: Fix reference to non-existing tree-gimple.c file.
2019-10-16 Jakub Jelinek <jakub@redhat.com>
* decl.c (cxx_maybe_build_cleanup): When clearing location of cleanup,
if cleanup is a nop, clear location of its operand too.
2019-10-15 Andrew Sutton <asutton@lock3software.com>
Finish moving constraint and logic functionality of out pt.c.
Reimplement and re-enable subsumption caching.
* config-lang.in (gtfiles): Add logic.cc.
* constraint.cc (atomic_constraints_identical_p): Add assertions.
(hash_atomic_constraint): Likewise.
(constraints_equivalent_p): New.
(inchash::add_constraint): New.
(iterative_hash_constraint): New.
(decl_constraints): Moved from pt.c.
(get_constraints): Likewise.
(set_constraints): Likewise.
(remove_constraints): Likewise.
* cp-tree.h (CONSTR_P): New.
(init_constraint_processing): Remove.
(constraints_equivalent_p, iterative_hash_constraint): Declare.
* decl.c (cxx_init_decl_processing): Don't initialize constraints.
* logic.cc (subsumption_entry): Moved from pt.c.
(subsumption_hasher): Likewise.
(subsumption_cache): Likewise.
(lookup_subsumption): Likewise.
(save_subsumption): Likewise.
(subsumes_constraints_nonnull): Use subsumption cache.
* pt.c: Move aforementioned declarations out of this file.
(init_constraint_processing): Remove.
2019-10-15 Andrew Sutton <asutton@lock3software.com>
* parser.c (cp_parser_constructor_declarator_p): Pass an empty
decl-specifier-seq to make sure we parse type constraints as part
of a type-specifier.
2019-10-15 Nathan Sidwell <nathan@acm.org>
* class.c (build_clones): Break out of clone_function_decl. Just
build the clones.
(clone_function_decl): Call build_clones, then maybe add them to
the method vector.
* class.c (build_clone): Refactor to clarify recursiveness.
2019-10-14 Jason Merrill <jason@redhat.com>
PR c++/91930 - ICE with constrained inherited default ctor.
* name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
for inherited constructor.
2019-10-14 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (check_tag_decl): Use DECL_SOURCE_LOCATION.
2019-10-14 Jakub Jelinek <jakub@redhat.com>
PR c++/92084
* semantics.c (handle_omp_array_sections_1): Temporarily disable
-fstrong-eval-order also for in_reduction and task_reduction clauses.
* parser.c (cp_parser_omp_all_clauses): Change bool NESTED_P argument
into int NESTED, if it is 2, diagnose missing commas in between
clauses.
(cp_parser_omp_context_selector): Pass 2 as last argument to
cp_parser_omp_all_clauses.
2019-10-12 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_omp_context_selector): Improve error recovery.
For simd properties, put them directly into TREE_VALUE.
(cp_finish_omp_declare_variant): Add "omp declare variant base"
attribute rather than "omp declare variant".
2019-10-11 Marek Polacek <polacek@redhat.com>
PR c++/92049 - extra error with -fchecking=2.
* pt.c (build_non_dependent_expr): Call fold_non_dependent_expr
with tf_none.
2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (cp_build_binary_op): Do not handle RROTATE_EXPR and
LROTATE_EXPR.
* constexpr.c (cxx_eval_constant_expression): Likewise.
(potential_constant_expression_1): Likewise.
* pt.c (tsubst_copy): Likewise.
2019-10-11 Jason Merrill <jason@redhat.com>
* decl2.c (mark_used): Don't clobber DECL_SOURCE_LOCATION on
explicitly defaulted functions.
* method.c (synthesize_method): Likewise.
2019-10-11 Jakub Jelinek <jakub@redhat.com>
PR c++/91987
* decl2.c (grok_array_decl): For -fstrong-eval-order, when array ref
operands have been swapped and at least one operand has side-effects,
revert the swapping before calling build_array_ref.
* typeck.c (cp_build_array_ref): For non-ARRAY_TYPE array ref with
side-effects on the index operand, if -fstrong-eval-order use
save_expr around the array operand.
(cp_build_binary_op): For shifts with side-effects in the second
operand, wrap first operand into SAVE_EXPR and evaluate it before
the shift.
* semantics.c (handle_omp_array_sections_1): Temporarily disable
flag_strong_eval_order during OMP_CLAUSE_REDUCTION array section
processing.
* cp-gimplify.c (gimplify_to_rvalue): New function.
(cp_gimplify_expr): Use it.
2019-10-10 Marek Polacek <polacek@redhat.com>
* typeck.c (comp_ptr_ttypes_real): Change the return type to bool.
Use false instead of 0.
2019-10-10 Jakub Jelinek <jakub@redhat.com>
* parser.h (struct cp_omp_declare_simd_data): Add variant_p member.
* parser.c (cp_ensure_no_omp_declare_simd): Handle both declare simd
and declare variant.
(cp_parser_oacc_all_clauses): Formatting fix.
(cp_parser_omp_all_clauses): Add NESTED_P argument, if true, terminate
processing on closing paren and don't skip to end of pragma line.
(cp_parser_omp_declare_simd): Add VARIANT_P argument. Handle also
declare variant.
(omp_construct_selectors, omp_device_selectors,
omp_implementation_selectors, omp_user_selectors): New variables.
(cp_parser_omp_context_selector,
cp_parser_omp_context_selector_specification,
cp_finish_omp_declare_variant): New functions.
(cp_parser_late_parsing_omp_declare_simd): Handle also declare variant.
(cp_parser_omp_declare): Handle declare variant.
2019-10-09 Jason Merrill <jason@redhat.com>
* cp-tree.h (template_info_decl_check): Check ENABLE_TREE_CHECKING.
2019-10-09 Marek Polacek <polacek@redhat.com>
PR c++/91364 - P0388R4: Permit conversions to arrays of unknown bound.
PR c++/69531 - DR 1307: Differently bounded array parameters.
PR c++/88128 - DR 330: Qual convs and pointers to arrays of pointers.
* call.c (build_array_conv): Build ck_identity at the beginning
of the conversion.
(standard_conversion): Pass bounds_none to comp_ptr_ttypes_const.
(maybe_warn_array_conv): New.
(convert_like_real): Call it. Add an error message about converting
from arrays of unknown bounds.
(conv_get_original_expr): New.
(nelts_initialized_by_list_init): New.
(conv_binds_to_array_of_unknown_bound): New.
(compare_ics): Implement list-initialization ranking based on
array sizes, as specified in DR 1307 and P0388R.
* cp-tree.h (comp_ptr_ttypes_const): Adjust declaration.
(compare_bounds_t): New enum.
* typeck.c (comp_array_types): New bool and compare_bounds_t
parameters. Use them.
(structural_comptypes): Adjust the call to comp_array_types.
(similar_type_p): Handle ARRAY_TYPE.
(build_const_cast_1): Pass bounds_none to comp_ptr_ttypes_const.
(comp_ptr_ttypes_real): Don't check cv-quals of ARRAY_TYPEs. Use
comp_array_types to compare array types. Look through arrays as per
DR 330.
(comp_ptr_ttypes_const): Use comp_array_types to compare array types.
Look through arrays as per DR 330.
2019-10-09 Marek Polacek <polacek@redhat.com>
PR c++/92032 - DR 1601: Promotion of enum with fixed underlying type.
* call.c (standard_conversion): When converting an enumeration with
a fixed underlying type to the underlying type, give it the cr_promotion
rank.
(compare_ics): Implement a tiebreaker as per CWG 1601.
2019-10-08 Andrew Sutton <asutton@lock3software.com>
Jason Merrill <jason@redhat.com>
Update the concepts implementation to conform to the C++20
specification, improve compile times, and generally clean up
the implementation.
* call.c (build_new_function_call): Don't evaluate concepts here.
(constraint_failure): Don't record the template.
(print_z_candidate): Don't extract the template.
* class.c (add_method): When overloading, hide ineligible special
member fns.
(check_methods): Set TYPE_HAS_COMPLEX_* here.
* constexpr.c (cxx_eval_constant_expression): Evaluate concepts.
(maybe_initialize_fundef_copies_table): Remove.
(get_fundef_copy): Use hash_map_safe_get_or_insert.
(clear_cv_and_fold_caches): Clear the satisfaction cache.
* constraint.cc (known_non_bool_p): New.
(parsing_constraint_expression_sentinel): Renamed from
expanding_constraint_sentinel.
(check_constraint_operands): New.
(check_constraint_atom): New.
(finish_constraint_binary_op): New.
(finish_constraint_or_expr): Likewise.
(finish_constraint_and_expr): Likewise.
(finish_constraint_primary_expr): Likewise.
(combine_constraint_expressions): New.
(finish_requires_expr): Add location parm.
(get_concept_definition): Return the initializer of concept definitions.
(get_template_head_requirements): New.
(get_trailing_function_requirements): New.
(deduce_constrained_parameter): Check if the identifier or template-id
is a concept definition.
(resolve_concept_definition_check): Removed.
(resolve_variable_concept_check): Removed.
(resolve_concept_check): New.
(resolve_constraint_check): Handle concept definitions.
converting arguments.
(function_concept_check_p): Removed.
(variable_concept_check_p): Removed.
(unpack_concept_check): New.
(get_concept_check_template): New.
(build_call_check): Moved and renamed to build_function_check.
(build_concept_check_arguments): make static.
(build_function_check): Always do overload resolution
in order to force conversion of template arguments (i.e., actually
check that the use of a concept is valid).
(build_standard_check): Renamed from build_real_concept_check.
(build_real_concept_check): Build checks for C++2a concepts by
(build_wildcard_concept_check): New.
(build_concept_check): Use build_real_concept_check. New overload.
(build_constraints): Save expressions, not normalized constraints.
(build_concept_id): New. Pass tf_warning_or_error.
(build_type_constraint): New.
(finish_type_constraints): New.
(associate_classtype_constraints): Also add constraints to union
types. Note the original declaration in errors. Don't return
error_mark_node in order to avoid an assertion later.
(push_down_pack_expansion): Remove.
(finish_shorthand_constraint): Make fold expressions, not naked
parameter packs. Always apply the constraint to each template argument.
(check_introduction_list): New. Fail if not enough
names are introduced.
(finish_template_introduction): Don't normalize constraints. Pass
tsubst flags. Check for insufficient introductions.
(placeholder_extract_concept_and_args): Handle the template-id case.
Unpack function concept checks correctly.
(tsubst_simple_requirement): Return errors if they occur. Don't
process as a template.
(tsubst_type_requirement): Likewise.
(type_deducible_p): New. Wrap the input expression in parens for the
purpose of deduction.
(expression_convertible_t): New.
(tsubst_compound_requirement): Use new deduction, conversion predicates.
(tsubst_nested_requirement): Return errors if they occur. Don't
process as a template. Instantiate and evaluate the nested requirement.
(tsubst_valid_expression_requirement): New.
(tsubst_simple_requirement): Use tsubst_valid_expression_requirement.
(tsubst_compound_requirement): Use tsubst_valid_expression_requirement.
(check_constaint_variables): New.
(tsubst_constraint_variables): Check that type substitutions are valid.
(tsubst_requires_expr): Likewise. Produce new requires-exprs during
template substitution. Copy the previous local specialization stack,
so references to non-local parameters can be found. Use cp_unevaluated.
(tsubst_constraint): New. Don't evaluate concept checks.
(subst_info): New.
(norm_info): New. Used to build a normalization tree for concept check
diagnostics.
(debug_parameter_mapping): New.
(debug_argument_list): New.
(expand_concept): Removed.
(normalize_logical_operation): Pass subst_info through call.
(normalize_pack_expansion): Remove.
(normalize_simple_requirement): Removed
(normalize_type_requirement): Removed
(normalize_compound_requirement): Removed
(normalize_nested_requirement): Removed
(normalize_requirement): Removed
(normalize_requirements): Removed
(normalize_requires_expression): Removed
(normalize_variable_concept_check): Removed.
(normalize_function_concept_check): Removed.
(normalize_concept_check): Merged all normalize_*_check here.
Substitute through written template arguments before normalizing the
definition. Only substitute the innermost template arguments.
(check_for_logical_overloads): Delete.
(map_arguments): New. Associate template parameters with arguments.
(build_parameter_mapping): New. Extract used parameters.
(normalize_expression): Rewrite.
(normalize_conjunction): Removed
(normalize_disjunction): Removed
(normalize_predicate_constraint): Removed
(normalize_parameterized_constraint): Removed
(normalized_map): New variable.
(get_normalized_constraints): New entry point for normalization.
Establishes a timer.
(get_normalized_constraints_from_info): New.
(get_normalized_constraints_from_decl): New. Turn on template processing
prior to normalization. Handle inheriting ctors. Build the
normalization arguments from the full set of template parameters of the
most general template. This guarantees that we have no concrete arguments
in the parameter mapping (e.g., from template members of class
templates). Cache normalizations.
(normalize_concept_definition): New. Cache normalizations.
(normalize_template_requirements): New.
(normalize_nontemplate_requirements): New.
(normalize_constraint_expression): New.
(tsubst_parameter_mapping): New.
(get_mapped_args): New.
(parameter_mapping_equivalent_p): New. Use template_args_equal.
(atomic_constraints_identical_p): New.
(hash_atomic_constraint): New.
(satisfying_constraint_p): New. Guard against recursive evaluation of
constraints during satisfaction.
(satisfy_conjunction): New.
(satisfy_disjunction): New.
(sat_entry): New class for hashing satisfaction results.
(sat_hasher): New hash traits.
(sat_cache): New.
(get_satisfaction): New. Returns cached satisfaction result.
(save_satisfaction): New. Caches a satisfaction result.
(clear_satisfaction_cache): New.
(satisfaction_cache): New. Helps manage satisfaction cache requests.
(decl_satisfied_cache): New.
(satisfy_atom): New.
(satisfy_constraint_r): New.
(satisfy_constraint): Use new satisfaction algorithm.
(evaluate_concept_check): New.
(evaluate_concept): Removed.
(evaluate_function_concept): Removed.
(evaluate_variable_concept): Removed.
(satisfy_constraint_expression): New.
(constraint_expression_satisfied_p): New.
(constraints_satisfied_p): Use strip_inheriting_ctors. Use
push_/pop_access_scope.
(more_constrained): Normalize before calling out to subsumption. Allow
classes as arguments.
(strictly_subsumes): Allow non-templates as arguments. Accept a new
template argument.
(weakly_subsumes): New.
(at_least_as_constrained): Removed.
(diagnose_other_expression): Removed.
(diagnose_predicate_constraint): Removed.
(diagnose_pack_expansion): Removed.
(diagnose_check_constraint): Removed.
(diagnose_logical_constraint): Removed.
(diagnose_expression_constraint): Removed.
(diagnose_type_constraint): Removed.
(diagnose_implicit_conversion_constraint): Removed.
(diagnose_argument_deduction_constraint): Removed.
(diagnose_exception_constraint): Removed.
(diagnose_parameterized_constraint): Removed.
(diagnose_argument_deduction_constraint): Removed.
(diagnose_argument_deduction_constraint): Removed.
(diagnose_argument_deduction_constraint): Removed.
(diagnose_trait_expr): New.
(diagnose_requires_expr): New.
(diagnose_atomic_constraint): New.
(diagnose_valid_expression) Stop wrongly diagnosing valid expressions.
Don't substitute as if in template decls. This causes substitution
to generate expressions that aren't suitable for use with the noexcept
routines.
(diagnose_valid_type) Likewise.
(diagnose_compound_requirement) Actually emit diagnostics for
the causes of errors.Call force_paren_expr_uneval.
(diagnose_declaration_constraints): Turn on template processing to
suppress certain analyses.
* cp-objcp-common.c (cp_common_init_ts): Make concepts typed.
(cp_get_debug_type): Use hash_map_safe_*.
* cp-tree.h: New function declarations for semantic actions, other
facilities. Remove declaration no longer used or needed. Remove
unused _CONSTR macros.
(LANG_DECL_HAS_MIN): Add CONCEPT_DECL.
(template_info_decl_check): Factor macro check into an inline function.
(DECL_TEMPLATE_INFO): Use new check facility.
(finish_concept_definition): New. Don't invalid concept declarations
with invalid initializers.
(find_template_parameters): New.
(concept_definition_p): New.
(concept_check_p): New.
(variable_concept_check_p): New.
(force_paren_expr_uneval): New.
(ovl_iterator::using_p): A USING_DECL by itself was also
introduced by a using-declaration.
(struct tree_template_info): Use tree_base instead of
tree_common. Add tmpl and args fields.
(TI_TEMPLATE, TI_ARGS): Adjust.
(DECLTYPE_FOR_INIT_CAPTURE): Remove.
(CONSTR_CHECK, CONSTR_INFO, CONSTR_EXPR, CONSTR_CONTEXT): New.
(ATOMIC_CONSTR_MAP, TRAIT_EXPR_LOCATION): New.
(struct tree_trait_expr): Add locus field.
(enum tsubst_flags): Add tf_norm as a hint to generate normalization
context when diagnosing constraint failure.
* cp-tree.def: Remove unused _CONSTR nodes and rename PRED_CONSTR
to ATOMIC_CONSTR.
(CONCEPT_DECL): New.
* cxx-pretty-print.c: Remove constraint printing code.
(pp_cxx_concept_definition): New.
(pp_cxx_template_declaration): Print concept definitions.
(pp_cxx_check_constraint): Update printing for concept definitions.
(pp_cxx_nested_name_specifier): Fix a weird
case where we're printing '::::' for concepts.
(simple_type_specifier): Print requirements for placeholder types.
(pp_cxx_constrained_type_spec): Print the associated requirements of
a placeholder type.
(pp_cxx_compound_requirement): Add space before the '->'.
(pp_cxx_parameter_mapping): Print the parameter mapping.
(pp_cxx_atomic_constraint): Use the function above.
* decl.c (redeclaration_error_message): New error for concepts.
(grokdeclarator): Check for and disallow decltype(auto) in parameter
declarations.
(grokfndecl): Don't normalize constraints. Add check for constraints
on declaration.
(grokvardecl): Don't normalize constraints.
(grok_special_member_properties): Don't set TYPE_HAS_COMPLEX_*.
(function_requirements_equivalent_p): New. Compare trailing
requires clauses. Compare combined constraints in pre-C++20 mode.
(decls_match): Compare trailing requires clauses. Compare template
heads for function templates. Remove old constraint comparison.
Simplify comparison of functions, function templates.
(duplicate_function_template_decls): New. Refactor a nasty if
condition into a single predicate.
(require_deduced_type): Don't complain if we already complained about
deduction failure.
(finish_function): Perform auto deduction to ensure that constraints
are checked even when functions contain no return statements. Only do
auto deduction if we haven't previously seen any return statements.
This prevents multiple diagnostics of the same error.
(store_decomp_type): Remove.
(cp_finish_decomp): Use hash_map_safe_put.
* error.c: Remove constraint printing code.
(dump_decl): Dump concept definitions. Handle wildcard declarations.
(dump_template_decl): Likewise.
(dump_type): Print associated requirements for placeholder
types.
(rebuild_concept_check): New.
(maybe_print_single_constraint_context): New.
(maybe_print_constraint_context): Recursively print nested contexts.
* init.c (get_nsdmi): Use hash_map_safe_*.
* lambda.c (maybe_add_lambda_conv_op): Bail if deduction failed.
(add_capture): Copy parameter packs from init.
(lambda_capture_field_type): Always use auto for init-capture.
* logic.cc: Completely rewrite.
(constraint_hash): New.
(clause/ctor): Save atoms in the hash table.
(replace): Save atoms during replacement.
(insert): Save atoms during insertion.
(contains): Only search the hash table for containment.
(clause): Keep a hash of atomic constraints.
(clause::clause): Explicitly copy the hash table when copying.
(disjunction_p, conjunction_p, atomic_p, dnf_size, cnf_size): New.
(diagnose_constraint_size): New.
(subsumes_constraints_nonnull): Compare the sizes of normalized formula
to determine the cheapest decomposition.
* name-lookup.c (diagnose_name_conflict): Diagnose name issues with
concepts.
(matching_fn_p): Check constraints.
(push_class_level_binding_1): Move overloaded functions case down,
accept FUNCTION_DECL as target_decl.
* parser.c (enum required_token): New required token for auto.
(make_location): Add overload taking lexer as last parm.
(cp_parser_required_error): Diagnose missing auto.
(cp_parser_diagnose_ungrouped_constraint_plain): New.
(cp_parser_diagnose_ungrouped_constraint_plain): New.
(cp_parser_constraint_primary_expression): New. Tentatively parse the
primary expression. If that fails tentatively parse a lower
precedence expression in order to diagnose the error.
(cp_parser_check_non_logical_constraint): New. Performs a trial
parse of the right-hand-side of non-logical operators in order to
generate good diagnostics.
(cp_parser_constraint_logical_and_expression): New.
(cp_parser_constraint_logical_or_expression): New.
(cp_parser_requires_clause_expression): New.
(cp_parser_requires_clause): Renamed to cp_parser_constraint_expression.
(cp_parser_requires_clause_opt): Parse the requires-clause differently
in -fconcepts and -std=c++2a modes.
(cp_parser_requirement_list): Rename to cp_parser_requirement_seq.
Rewrite so that semicolons are parsed
along with requirements, not the sequence.
(cp_parser_simple_requirement): Expect a semicolon at end.
(cp_parser_compound_requirement): Expect a semicolon at end. Only
allow trailing-return-type with -fconcepts-ts.
(cp_parser_nested_requirement): Expect a semicolon at end. Parse
constraint-expressions.
(cp_parser_concept_definition): New. Don't fail parsing the concept
definition if the initializer is ill-formed. Don't declare the concept
before parsing the initializer.
(cp_parser_constraint_expression): Declare earlier.
(cp_parser_type_requirement): Current scope is not valid.
(cp_parser_requires_expression): Commit to the tentative parse.
(cp_parser_decl_specifier_seq): Warn when concept appears to be used
as a decl-specifier.
(cp_parser_template_declaration_after_parameters): Parse concept
definitions.
(cp_parser_template_id): Don't try to resolve a concept template-id yet.
(cp_parser_template_id_expr): Resolve it as a concept check.
(cp_parser_decl_specifier_seq): Warn on 'concept bool'.
(cp_parser_type_parameter): Combine expressions not
constraints.
(cp_parser_explicit_template_declaration): Combine expressions not
constraints.
(cp_parser_maybe_concept_name): Removed.
(cp_parser_simple_type_specifier): Handle an error condition of
a bad constrained type specifier. Expect auto or decltype after
a concept name. Also handle the case where we have a template-id
as a concept check.
(cp_parser_template_introduction): Diagnose errors on invalid
introductions. Give up if it doesn't start with a concept name.
Pedwarn if not -fconcepts-ts.
(synthesize_implicit_template_parm): Don't do consistent binding.
Use a new flag for constrained parameters. Combine expressions,
not constraints. Fail if we get a placeholder in block scope.
Placeholders that do not constrain types are not allowed in parameter
declarations, so don't handle them.
(cp_parser_placeholder_type_specifier): New. Implement parsing of
placeholder type specifiers following a concept name or partial
concept check. Disallow decltype(auto) parameters.
(cp_parser_nested_name_specifier_opt): If the token is already
CPP_NESTED_NAME_SPECIFIER, leave it alone.
(cp_parser_id_expression, cp_parser_unqualified_id): Call
cp_parser_template_id_expr.
(cp_parser_placeholder_type_specifier): Add tentative parm. Don't
expect a WILDCARD_DECL.
(cp_parser_trait_expr): Pass trait_loc down.
(cp_parser_postfix_expression): Do set location of dependent member
call.
* pt.c (finish_concept_definition): New.
(push_template_decl_real): Handle concept definitions.
(start_concept_definition): Let push_template_decl_real handle the
creation of the template.
(get_constraints): Return null if the table hasn't been initialized.
(tsubst_copy_and_build): Build template-id expressions for concept
checks.
[TRAIT_EXPR]: Pass trait_loc down.
(lookup_template_class_1): Add the template name to the constraint
failure diagnostic.
(lookup_and_finish_template_variable): Build concept checks
with the correct arguments.
(tsubst_function_decl): Don't substitute through constraints.
Always associate constraints with functions.
(template_parm_level_and_index): Make non-static.
(for_each_template_parm_r): Handle requires expressions.
(keep_template_parm): New.
(find_template_parameters): New.
(more_specialized_fn): Change how winners and losers are chosen.
(make_constrained_auto): Don't normalize constraints.
(template_parameters_equivalent_p): New. Compare template
parameters. Add a comparison for implicitly vs. explicitly declared
parameters.
(template_parameter_lists_equivalent_p): New. Compare template
parameter lists.
(template_requirements_equivalent_p): New.
(template_heads_equivalent_p): New. Compare template heads.
(template_parameter_constraints_equivalent_p): New.
(is_compatible_template_arg): Use weakly_subsumes.
(maybe_new_partial_specialization): Use new constraint comparison
for finding specializations.
(process_partial_specialization): Pass main template as argument.
(more_specialized_partial_spec): Don't immediately return when
detecting a winner.
(make_constrained_auto): Handle concept definitions.
(do_auto_deduction): Update auto deduction for new concept model.
Extract the function concept correctly; rename constr to check to
reflect the kind of node.
(tsubst): Adjust wildcard argument during substitution.
[DECLTYPE_TYPE]: Remove init-capture handling.
(tsubst_copy_and_build): Build concept checks, not template ids.
Defer checks of function concepts. Handle concepts before variable
templates. Handle calls to function concepts explicitly.
(coerce_template_parms): Use concept_definition_p. Handle a deduction
error where a potentially empty pack can be supplied after the last
parameter of a concept.
(finish_template_variable): Don't process concepts here.
(instantiation_dependent_r): Use concept_check_p.
(tsubst_template_args): Make non-static.
(make_constrained_placeholder_type): New. Refactored from
make_constrained_auto.
(make_constrained_auto) Use make_constrained_placeholder_type.
(make_constrained_decltype_auto) New.
(tsubst_function_parms): New.
(value_dependent_expression_p) [TEMPLATE_ID_EXPR]: Use
concept_definition_p.
(push_access_scope, pop_access_scope): No longer static.
(tsubst_template_parm): Substitute TEMPLATE_PARM_CONSTRAINTS.
(tsubst_friend_function): Use tsubst_constraint. Use generic_targs_for.
(get_underlying_template) Use generic_targs_for.
(uses_parameter_packs): Return tree.
(gen_elem_of_pack_expansion_instantiation): Don't push
local_specialization_stack.
(prepend_one_capture): New.
(tsubst_lambda_expr): Use prepend_one_capture. Don't touch
local_specializations.
(template_parms_level_to_args): No longer static.
(add_outermost_template_args): Likewise.
(find_template_parameter_info): New. Provide context for finding
template parameters.
(keep_template_parm): Don't keep parameters declared at depth levels
greater than those of the template parameters of the source declaration.
Don't propagate cv-qualified types. Return 0, so we find all template
parameters, not the just first.
(any_template_parm_r): New. Handle cases that are mishandled by
for_each_template_parm_r.
(generic_targs_for): Factor out of coerce_template_args_for_ttp.
(tsubst_argument_pack): Factor out of tsubst_template_args.
(constraint_sat_entry): Removed.
(constraint_sat_hasher): Removed.
(concept_spec_entry): Removed.
(concept_spec_hasher): Removed.
(constraint_memos): Removed.
(concept_memos): Removed.
(lookup_constraint_satisfaction): Removed.
(memoize_constraint_satisfaction): Removed.
(lookup_concept_satisfaction): Removed.
(memoize_concept_satisfaction): Removed.
(concept_expansions): Removed.
(get_concept_expansion): Removed.
(save_concept_expansion): Removed.
(init_constraint_processing): Remove initialization of non-existing
resources.
(find_template_requirement): New. Search for the sub-requirement
within the associated constraints.
(convert_generic_types_to_packs): Also transform the associated
constraint and update the current template requirements.
(store_defaulted_ttp, lookup_defaulted_ttp): Remove.
(add_defaults_to_ttp): Use hash_map_safe_*.
* semantics.c (finish_call_expr): Diagnose calls to concepts.
Handle concept checks explicitly.
(finish_id_expression): Evaluate variable concepts as part of
id-expression processing. Don't treat variable concepts as variables,
and don't process function concepts as plain id-expressions.
(force_paren_expr): Add even_uneval parm.
(finish_trait_expr): Add location parm.
* tree.c (special_memfn_p): New.
(cp_expr_location): Handle TRAIT_EXPR.
* typeck.c (check_return_expr): Actually use the diagnostic kind
when performing return-type deduction.
* typeck2.c (build_functional_cast): Don't rely on the location of
'auto'.
2019-10-09 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grok_ctor_properties): Use DECL_SOURCE_LOCATION.
* typeck.c (cp_build_binary_op): Use the op_location_t argument
in many error messages.
2019-10-08 Martin Sebor <msebor@redhat.com>
PR c++/92001
* call.c (maybe_warn_class_memaccess): Handle arrays.
2019-10-07 Paolo Carlini <paolo.carlini@oracle.com>
* call.c (resolve_args): Use cp_expr_loc_or_input_loc in one place.
* decl.c (grokdeclarator): Use id_loc in one place.
* decl2.c (build_anon_union_vars): Use DECL_SOURCE_LOCATION.
* parser.c (cp_parser_delete_expression): Fix the location of the
returned expression.
(cp_parser_throw_expression): Likewise.
* pt.c (determine_specialization): Use DECL_SOURCE_LOCATION.
2019-10-05 Jakub Jelinek <jakub@redhat.com>
PR c++/91369 - Implement P0784R7: constexpr new
* cp-tree.h (enum cp_tree_index): Add CPTI_HEAP_UNINIT_IDENTIFIER,
CPTI_HEAP_IDENTIFIER and CPTI_HEAP_DELETED_IDENTIFIER.
(heap_uninit_identifier, heap_identifier, heap_deleted_identifier):
Define.
(type_has_constexpr_destructor, build_new_constexpr_heap_type,
cxx_constant_dtor): Declare.
* class.c (type_maybe_constexpr_default_constructor): Make static.
(type_maybe_constexpr_destructor, type_has_constexpr_destructor): New
functions.
(finalize_literal_type_property): For c++2a, don't clear
CLASSTYPE_LITERAL_P for types without trivial destructors unless they
have non-constexpr destructors.
(explain_non_literal_class): For c++2a, complain about non-constexpr
destructors rather than about non-trivial destructors.
* constexpr.c: Include stor-layout.h.
(struct constexpr_global_ctx): New type.
(struct constexpr_ctx): Add global field, remove values and
constexpr_ops_count.
(cxx_replaceable_global_alloc_fn): New inline function.
(cxx_eval_call_expression): For c++2a allow calls to replaceable
global allocation functions, for new return address of a heap uninit
var, for delete record its deletion. Change ctx->values->{get,put} to
ctx->global->values.{get,put}.
(non_const_var_error): Add auto_diagnostic_group sentinel. Emit
special diagnostics for heap variables.
(cxx_eval_store_expression): Change ctx->values->{get,put} to
ctx->global->values.{get,put}.
(cxx_eval_loop_expr): Initialize jump_target if NULL. Change
new_ctx.values->remove to ctx->global->values.remove.
(cxx_eval_constant_expression): Change *ctx->constexpr_ops_count
to ctx->global->constexpr_ops_count. Change ctx->values->{get,put} to
ctx->global->values.{get,put}.
<case NOP_EXPR>: Formatting fix. On cast of replaceable global
allocation function to some pointer type, adjust the type of
the heap variable and change name from heap_uninit_identifier
to heap_identifier.
(find_heap_var_refs): New function.
(cxx_eval_outermost_constant_expr): Add constexpr_dtor argument,
handle evaluation of constexpr dtors and add tracking of heap
variables. Use tf_no_cleanup for get_target_expr_with_sfinae.
(cxx_constant_value): Adjust cxx_eval_outermost_constant_expr caller.
(cxx_constant_dtor): New function.
(maybe_constant_value, fold_non_dependent_expr_template,
maybe_constant_init_1): Adjust cxx_eval_outermost_constant_expr
callers.
(potential_constant_expression_1): Ignore clobbers. Allow
COND_EXPR_IS_VEC_DELETE for c++2a.
* decl.c (initialize_predefined_identifiers): Add heap identifiers.
(decl_maybe_constant_destruction): New function.
(cp_finish_decl): Don't clear TREE_READONLY for constexpr variables
with non-trivial, but constexpr destructors.
(register_dtor_fn): For constexpr variables with constexpr non-trivial
destructors call cxx_maybe_build_cleanup instead of adding destructor
calls at runtime.
(expand_static_init): For constexpr variables with constexpr
non-trivial destructors call cxx_maybe_build_cleanup.
(grokdeclarator): Allow constexpr destructors for c++2a. Formatting
fix.
(cxx_maybe_build_cleanup): For constexpr variables with constexpr
non-trivial destructors call cxx_constant_dtor instead of adding
destructor calls at runtime.
* init.c: Include stor-layout.h.
(build_new_constexpr_heap_type, maybe_wrap_new_for_constexpr): New
functions.
(build_new_1): For c++2a and new[], add cast around the alloc call
to help constexpr evaluation figure out the type of the heap storage.
(build_vec_delete_1): Set DECL_INITIAL of tbase and emit a DECL_EXPR
for it instead of initializing an uninitialized variable.
* method.c: Include intl.h.
(SFK_CTOR_P, SFK_DTOR_P, SFK_ASSIGN_P, SFK_COPY_P, SFK_MOVE_P): Move
definitions earlier.
(process_subob_fn): Add sfk argument, adjust non-constexpr call
diagnostics based on it.
(walk_field_subobs): Formatting fixes. Adjust process_subob_fn caller.
(synthesized_method_base_walk): Likewise.
(synthesized_method_walk): Set *constexpr_p to true for dtors in c++2a.
Fix up DR number in comment.
(implicitly_declare_fn): Formatting fix.
* typeck2.c (store_init_value): Don't call cp_fully_fold_init on
initializers of automatic non-constexpr variables in constexpr
functions.
2019-10-04 Jakub Jelinek <jakub@redhat.com>
PR c++/71504
* constexpr.c (cxx_fold_indirect_ref_1): New function.
(cxx_fold_indirect_ref): Use it.
PR c++/91974
* cp-gimplify.c (cp_gimplify_expr) <case CALL_EXPR>: For
-fstrong-eval-order ensure CALL_EXPR_FN side-effects are evaluated
before any arguments. Additionally, ensure CALL_EXPR_FN that isn't
invariant nor OBJ_TYPE_REF nor SSA_NAME is forced into a temporary.
2019-10-03 Paolo Carlini <paolo.carlini@oracle.com>
* init.c (build_new): Use cp_expr_loc_or_input_loc in two places.
* name-lookup.c (do_pushdecl): Use DECL_SOURCE_LOCATION.
(push_class_level_binding_1): Likewise.
(set_decl_namespace): Likewise.
2019-10-03 Jakub Jelinek <jakub@redhat.com>
* constexpr.c (cxx_eval_constant_expression) <case CLEANUP_STMT>: If
not skipping upon entry to body, run cleanup with the same *jump_target
as it started to run the cleanup even if the body returns, breaks or
continues.
(potential_constant_expression_1): Allow CLEANUP_STMT.
* constexpr.c (cxx_eval_store_expression): Formatting fix. Handle
const_object_being_modified with array type.
2019-10-02 Jason Merrill <jason@redhat.com>
* typeck2.c (store_init_value): Only clear_cv_and_fold_caches if the
value is constant.
2019-09-30 Jason Merrill <jason@redhat.com>
Use hash_map_safe_* functions.
* constexpr.c (maybe_initialize_fundef_copies_table): Remove.
(get_fundef_copy): Use hash_map_safe_get_or_insert.
* cp-objcp-common.c (cp_get_debug_type): Use hash_map_safe_*.
* decl.c (store_decomp_type): Remove.
(cp_finish_decomp): Use hash_map_safe_put.
* init.c (get_nsdmi): Use hash_map_safe_*.
* pt.c (store_defaulted_ttp, lookup_defaulted_ttp): Remove.
(add_defaults_to_ttp): Use hash_map_safe_*.
2019-10-02 Richard Biener <rguenther@suse.de>
PR c++/91606
* decl.c (build_ptrmemfunc_type): Mark pointer-to-member
fat pointer structure members as DECL_NONADDRESSABLE_P.
2019-09-28 Marek Polacek <polacek@redhat.com>
PR c++/91889 - follow-up fix for DR 2352.
* call.c (involves_qualification_conversion_p): New function.
(direct_reference_binding): Build a ck_qual if the conversion
would involve a qualification conversion.
(convert_like_real): Strip the conversion created by the ck_qual
in direct_reference_binding.
PR c++/91921 - stray warning with -Woverloaded-virtual.
* class.c (warn_hidden): Only emit the second part of
-Woverloaded-virtual if the first part was issued. Use inform instead
warning_at.
PR c++/91923 - failure-to-SFINAE with class type NTTP in C++17.
* pt.c (invalid_nontype_parm_type_p): Only emit errors when
tf_error.
2019-09-27 Jakub Jelinek <jakub@redhat.com>
PR c++/88203
* parser.c (cp_parser_omp_var_list_no_open): Parse predefined
variables.
* semantics.c (finish_omp_clauses): Allow predefined variables in
shared and firstprivate clauses, even when they are predetermined
shared.
* cp-gimplify.c (cxx_omp_predetermined_sharing_1): Return
OMP_CLAUSE_DEFAULT_SHARED for predefined variables.
2019-09-27 Jason Merrill <jason@redhat.com>
* constexpr.c (cxx_fold_indirect_ref): Use similar_type_p.
(cxx_eval_indirect_ref): Likewise. Improve error location.
* cp-tree.h (class iloc_sentinel): New.
* decl.c (grokdeclarator, finish_enum_value_list): Use it.
* mangle.c (mangle_decl_string): Use it.
* pt.c (perform_typedefs_access_check): Use it.
2019-09-27 Richard Sandiford <richard.sandiford@arm.com>
* cp-tree.h (build_cxx_call): Take the original function decl
as an optional final parameter.
(cp_build_function_call_vec): Likewise.
* call.c (build_cxx_call): Likewise. Pass all built-in calls to
check_builtin_function_arguments.
* typeck.c (build_function_call_vec): Take the original function
decl as an optional final parameter and pass it to
cp_build_function_call_vec.
(cp_build_function_call_vec): Take the original function
decl as an optional final parameter and pass it to build_cxx_call.
2019-09-25 Marek Polacek <polacek@redhat.com>
PR c++/91877 - ICE with converting member of packed struct.
* call.c (convert_like_real): Use similar_type_p in an assert.
2019-09-25 Paolo Carlini <paolo.carlini@oracle.com>
* name-lookup.c (check_extern_c_conflict): Use DECL_SOURCE_LOCATION.
(check_local_shadow): Use it in three additional places.
2019-09-24 Jason Merrill <jason@redhat.com>
* parser.c (cp_parser_postfix_expression): Do set location of
dependent member call.
2019-09-24 Marek Polacek <polacek@redhat.com>
PR c++/91868 - improve -Wshadow location.
* name-lookup.c (check_local_shadow): Use DECL_SOURCE_LOCATION
instead of input_location.
PR c++/91845 - ICE with invalid pointer-to-member.
* expr.c (mark_use): Use error_operand_p.
* typeck2.c (build_m_component_ref): Check error_operand_p after
calling mark_[lr]value_use.
2019-09-23 Paolo Carlini <paolo.carlini@oracle.com>
* pt.c (check_explicit_specialization): Use cp_expr_loc_or_input_loc.
(process_partial_specialization): Likewise.
(convert_nontype_argument_function): Likewise.
(invalid_tparm_referent_p): Likewise.
(convert_template_argument): Likewise.
(check_valid_ptrmem_cst_expr): Tidy.
2019-09-23 Jason Merrill <jason@redhat.com>
PR c++/91809 - bit-field and ellipsis.
* call.c (convert_arg_to_ellipsis): Don't call decay_conversion for
arithmetic arguments.
2019-09-23 Marek Polacek <polacek@redhat.com>
PR c++/91844 - Implement CWG 2352, Similar types and reference binding.
* call.c (reference_related_p): Use similar_type_p instead of
same_type_p.
(reference_compatible_p): Update implementation to match CWG 2352.
* cp-tree.h (similar_type_p): Declare.
* typeck.c (similar_type_p): New.
2019-09-22 Marek Polacek <polacek@redhat.com>
PR c++/91819 - ICE with operator++ and enum.
* call.c (build_new_op_1): Set arg2_type.
2019-09-17 Jason Merrill <jason@redhat.com>
* parser.c (cp_parser_statement): Handle [[likely]] on
compound-statement.
2019-09-19 Jason Merrill <jason@redhat.com>
Revert:
* call.c (build_new_op_1): Don't apply any standard conversions to
the operands of a built-in operator. Don't suppress conversions in
cp_build_unary_op.
* typeck.c (cp_build_unary_op): Do integral promotions for enums.
2019-09-16 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Use declspecs->locations and
declarator->id_loc in a few error messages.
* pt.c (finish_member_template_decl): Use DECL_SOURCE_LOCATION.
(push_template_decl_real): Likewise.
2019-09-15 Jason Merrill <jason@redhat.com>
PR c++/30277 - int-width bit-field promotion.
PR c++/33819 - long bit-field promotion.
* typeck.c (cp_perform_integral_promotions): Handle large bit-fields
properly. Handle 32-bit non-int bit-fields properly.
(is_bitfield_expr_with_lowered_type): Don't look through NOP_EXPR.
PR c++/82165 - enum bitfields and operator overloading.
* call.c (build_new_op_1): Use unlowered_expr_type.
* call.c (build_new_op_1): Don't apply any standard conversions to
the operands of a built-in operator. Don't suppress conversions in
cp_build_unary_op.
* typeck.c (cp_build_unary_op): Do integral promotions for enums.
2019-09-15 Marek Polacek <polacek@redhat.com>
PR c++/91740 - ICE with constexpr call and ?: in ARRAY_REF.
* pt.c (build_non_dependent_expr): Call build_non_dependent_expr for
the first operand.
2019-09-15 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (DECL_CLONED_FUNCTION_P): Reimplement using
IDENTIFIER_CDTOR_P, correct documentation.
(DECL_CLONED_FUNCTION): Directly access field.
(decl_cloned_function_p): Delete.
* class.c (decl_cloned_function_p): Delete.
* pt.c (instantiate_template_1): Check DECL_CHAIN is a decl.
2019-09-11 Nathan Sidwell <nathan@acm.org>
* c-objcp-common.c (cp-objcp-common.c): Alphababetize and
correctly mark all C++ nodes.
* decl.c (cp_tree_node_structure): Alphabetize.
2019-09-10 Marek Polacek <polacek@redhat.com>
PR c++/91673 - ICE with noexcept in alias-declaration.
* parser.c (CP_PARSER_FLAGS_DELAY_NOEXCEPT): New parser flag.
(cp_parser_lambda_declarator_opt): Pass CP_PARSER_FLAGS_NONE to
cp_parser_exception_specification_opt.
(cp_parser_direct_declarator): Adjust a call to
cp_parser_exception_specification_opt.
(cp_parser_member_declaration): Pass CP_PARSER_FLAGS_DELAY_NOEXCEPT
to cp_parser_declarator if not processing a friend or typedef
declaration.
(cp_parser_late_noexcept_specifier): Adjust a call to
cp_parser_noexcept_specification_opt.
(cp_parser_noexcept_specification_opt): New parameter for parser flags,
drop the FRIEND_P parameter. Use the new parameter.
(cp_parser_exception_specification_opt): Likewise.
(cp_parser_transaction): Adjust a call to
cp_parser_noexcept_specification_opt.
(cp_parser_transaction_expression): Likewise.
2019-09-10 Marek Polacek <polacek@redhat.com>
PR c++/91705 - constexpr evaluation rejects ++/-- on floats.
* constexpr.c (cxx_eval_increment_expression): Call fold_simple on
the offset.
2019-09-10 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (has_designator_problem): Use cp_expr_loc_or_input_loc
in error_at.
(build_enumerator): Likewise.
(cp_finish_decl): Use DECL_SOURCE_LOCATION.
(grokdeclarator): Use id_loc in two error_at; change errror
message about constinit together constexpr to use two ranges.
2019-09-09 Marek Polacek <polacek@redhat.com>
PR c++/84374 - diagnose invalid uses of decltype(auto).
* decl.c (grokdeclarator): Diagnose wrong usage of decltype(auto) in
a function declaration.
2019-09-06 Nathan Sidwell <nathan@acm.org>
PR c++/91125
* cp-tree.h (IDENTIFIER_REPO_CHOSEN, DECL_REPO_AVAILABLE_P): Delete.
(struct lang_decl_base): Remove repo_available_p.
* decl.c (duplicate_decls): Don't copy DECL_REPO_AVAILABLE_P.
(Reserve TREE_LANG_FLAG_3 for modules.
* cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): Delete.
(DECL_NON_TRIVIALLY_INITIALIZED_P): Move to TREE_LANG_FLAG_6.
* class.c (build_ctor_vtbl_group): Don't set
DECL_CONSTRUCTION_VTABLE_P.
* decl2.c (determine_visibility_from_class): Don't check
DECL_CONSTRUCTION_VTABLE_P anymore.
2019-09-06 Martin Liska <mliska@suse.cz>
PR c++/91125
* Make-lang.in: Remove repo.o.
* config-lang.in: Likewise.
* cp-tree.h (init_repo): Remove declarations
of repo-related functions.
(repo_emit_p): Likewise.
(repo_export_class_p): Likewise.
(finish_repo): Likewise.
* decl2.c (import_export_class): Always
set -1 value/
(mark_needed): Remove -frepo from comment.
(import_export_decl): Similarly here.
(c_parse_final_cleanups): Remove call of finish_repo.
* lex.c (cxx_init): Remove call to init_repo.
* optimize.c (can_alias_cdtor): Remove dead condition.
* pt.c (push_template_decl_real): Update comment.
(instantiate_decl): Remove dead code used for -frepo.
* repo.c: Remove.
2019-09-05 Marek Polacek <polacek@redhat.com>
PR c++/91644 - ICE with constinit in function template.
* decl.c (start_decl): Call retrofit_lang_decl for constinit variables.
* pt.c (tsubst_expr): Pass LOOKUP_CONSTINIT down to cp_finish_decl for
constinit variables.
2019-09-05 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (DECL_VTABLE_OR_VTT_P): Forward to DECL_VIRTUAL_P.
2019-09-04 Marek Polacek <polacek@redhat.com>
* call.c (build_over_call): Remove -fdeduce-init-list implementation.
* pt.c (unify): Likewise.
2019-09-01 Marek Polacek <polacek@redhat.com>
PR c++/91129 - wrong error with binary op in template argument.
* typeck.c (warn_for_null_address): Use fold_for_warn instead of
fold_non_dependent_expr.
(cp_build_binary_op): Likewise.
2019-08-30 Jason Merrill <jason@redhat.com>
Add source location to TRAIT_EXPR.
* cp-tree.h (TRAIT_EXPR_LOCATION): New.
(struct tree_trait_expr): Add locus field.
* parser.c (cp_parser_trait_expr): Pass trait_loc down.
* pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Likewise.
* semantics.c (finish_trait_expr): Add location parm.
* tree.c (cp_expr_location): Handle TRAIT_EXPR.
2019-08-29 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (check_var_type): Add location_t parameter and use it.
(grokdeclarator): Adjust call.
* pt.c (tsubst_decl): Likewise.
* cp-tree.h: Adjust declaration.
2019-08-28 Marek Polacek <polacek@redhat.com>
Implement P1152R4: Deprecating some uses of volatile.
PR c++/91361
* cp-gimplify.c (cp_fold): Set TREE_THIS_VOLATILE.
* decl.c (grokdeclarator): Warn about a volatile-qualified structured
binding and return type.
(grokparms): Warn about a volatile-qualified function parameter.
* expr.c (mark_use) <case MODIFY_EXPR>: Emit a -Wvolatile warning.
* typeck.c (cp_build_unary_op): Emit a -Wvolatile warning for pre and
post ++/-- on a volatile operand.
(genericize_compound_lvalue): Use a better location. Don't lose
TREE_THIS_VOLATILE.
(cp_build_modify_expr): Emit a -Wvolatile warning for a compound
assignment whose LHS is volatile-qualified. Build the assignment with
a more precise location.
2019-08-28 Marek Polacek <polacek@redhat.com>
PR c++/91360 - Implement C++20 P1143R2: constinit.
* cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Define.
(LOOKUP_CONSTINIT): Define.
(enum cp_decl_spec): Add ds_constinit.
* decl.c (check_tag_decl): Give an error for constinit in type
declarations.
(check_initializer): Also check LOOKUP_CONSTINIT.
(cp_finish_decl): Add checking for a constinit declaration. Set
TINFO_VAR_DECLARED_CONSTINIT.
(grokdeclarator): Add checking for a declaration with the constinit
specifier.
* lex.c (init_reswords): Handle D_CXX20.
* parser.c (cp_lexer_get_preprocessor_token): Pass a better location
to warning_at. Warn about C++20 keywords.
(cp_keyword_starts_decl_specifier_p): Handle RID_CONSTINIT.
(cp_parser_diagnose_invalid_type_name): Add an inform about constinit.
(cp_parser_decomposition_declaration): Maybe pass LOOKUP_CONSTINIT to
cp_finish_decl.
(cp_parser_decl_specifier_seq): Handle RID_CONSTINIT.
(cp_parser_init_declarator): Maybe pass LOOKUP_CONSTINIT to
cp_finish_decl.
(set_and_check_decl_spec_loc): Add "constinit".
* pt.c (tsubst_decl): Set TINFO_VAR_DECLARED_CONSTINIT.
(instantiate_decl): Maybe pass LOOKUP_CONSTINIT to cp_finish_decl.
* typeck2.c (store_init_value): If a constinit variable wasn't
initialized using a constant initializer, give an error.
2019-08-28 Nathan Sidwell <nathan@acm.org>
PR c++/90613
* name-lookup.c (cp_emit_debug_info): Check for builtins during
overload iteration.
2019-08-27 Marek Polacek <polacek@redhat.com>
PR c++/81676 - bogus -Wunused warnings in constexpr if.
* semantics.c (maybe_mark_exp_read_r): New function.
(finish_if_stmt): Call it on THEN_CLAUSE and ELSE_CLAUSE.
PR c++/91428 - warn about std::is_constant_evaluated in if constexpr.
* cp-tree.h (decl_in_std_namespace_p): Declare.
* semantics.c (is_std_constant_evaluated_p): New.
(finish_if_stmt_cond): Warn about "std::is_constant_evaluated ()" in
an if-constexpr.
* typeck.c (decl_in_std_namespace_p): No longer static.
2019-08-26 Jason Merrill <jason@redhat.com>
* decl.c (duplicate_decls): Always merge DECL_DECLARED_CONSTEXPR_P.
2019-08-26 Marek Polacek <polacek@redhat.com>
PR c++/91545 - ICE in constexpr store evaluation.
* constexpr.c (cxx_eval_store_expression): Check FIELD_DECL instead
of DECL_P.
2019-08-24 Nathan Sidwell <nathan@acm.org>
* class.c (check_for_overrides): Conversion operators need
checking too.
2019-08-24 Paolo Carlini <paolo.carlini@oracle.com>
* semantics.c (finish_switch_cond): Improve error message location.
2019-08-23 Jason Merrill <jason@redhat.com>
* decl2.c (decl_dependent_p): New.
(mark_used): Check it instead of just processing_template_decl.
2019-08-23 Jason Merrill <jason@redhat.com>
* parser.c (cp_parser_nested_name_specifier_opt): Avoid redundant
error.
2019-08-23 Marek Polacek <polacek@redhat.com>
PR c++/91521 - wrong error with operator->.
* decl.c (grokdeclarator): Return error_mark_node for an invalid
trailing return type.
PR c++/79817 - attribute deprecated on namespace.
* cp-tree.h (cp_warn_deprecated_use_scopes): Declare.
* decl.c (grokdeclarator): Call cp_warn_deprecated_use_scopes.
(type_is_deprecated): Likewise.
* decl2.c (cp_warn_deprecated_use_scopes): New function.
* name-lookup.c (handle_namespace_attrs): Handle attribute deprecated.
* parser.c (cp_parser_namespace_alias_definition): Call
cp_warn_deprecated_use_scopes.
(cp_parser_using_declaration): Likewise.
(cp_parser_using_directive): Likewise.
* semantics.c (finish_id_expression_1): Likewise.
2019-08-23 Nathan Sidwell <nathan@acm.org>
* class.c (check_for_override): Checking IDENTIFIER_VIRTUAL_P is
sufficient, reorder DECL_OVERRIDE_P check.
2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
PR pch/61250
* parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch ()
after determining that the first token is not
PRAGMA_GCC_PCH_PREPROCESS.
2019-08-22 Marek Polacek <polacek@redhat.com>
PR c++/91304 - prefix attributes ignored in condition.
* parser.c (cp_parser_condition): Handle prefix attributes.
2019-08-21 Richard Sandiford <richard.sandiford@arm.com>
PR c++/91505
* decl.c (duplicate_decls): Call copy_attributes_to_builtin inside
the BUILT_IN_NORMAL block rather than afterward.
2019-08-19 Marek Polacek <polacek@redhat.com>
PR c++/91264 - detect modifying const objects in constexpr.
* constexpr.c (modifying_const_object_error): New function.
(cxx_eval_call_expression): Set TREE_READONLY on a CONSTRUCTOR of
a const-qualified object after it's been fully constructed.
(modifying_const_object_p): New function.
(cxx_eval_store_expression): Detect modifying a const object
during constant expression evaluation.
(cxx_eval_increment_expression): Use a better location when building
up the store.
(cxx_eval_constant_expression) <case DECL_EXPR>: Mark a constant
object's constructor TREE_READONLY.
2019-08-15 Jason Merrill <jason@redhat.com>
PR c++/90393 - ICE with thow in ?:
PR c++/64372, DR 1560 - Gratuitous lvalue-to-rvalue conversion in ?:
* tree.c (lvalue_kind): Handle throw in one arm.
* typeck.c (rationalize_conditional_expr): Likewise.
(cp_build_modify_expr): Likewise.
2019-08-14 Jason Merrill <jason@redhat.com>
Implement P0848R3, Conditionally Trivial Special Member Functions.
* tree.c (special_memfn_p): New.
* class.c (add_method): When overloading, hide ineligible special
member fns.
(check_methods): Set TYPE_HAS_COMPLEX_* here.
* decl.c (grok_special_member_properties): Not here.
* name-lookup.c (push_class_level_binding_1): Move overloaded
functions case down, accept FUNCTION_DECL as target_decl.
2019-08-14 Jonathan Wakely <jwakely@redhat.com>
PR c++/91436
* name-lookup.c (get_std_name_hint): Fix min_dialect field for
complex_literals and make_unique entries.
2019-08-14 Jakub Jelinek <jakub@redhat.com>
Marek Polacek <polacek@redhat.com>
PR c++/91391 - bogus -Wcomma-subscript warning.
* parser.c (cp_parser_postfix_open_square_expression): Don't warn about
a deprecated comma here. Pass warn_comma_subscript down to
cp_parser_expression.
(cp_parser_expression): New bool parameter. Warn about uses of a comma
operator within a subscripting expression.
(cp_parser_skip_to_closing_square_bracket): Revert to pre-r274121 state.
(cp_parser_skip_to_closing_square_bracket_1): Remove.
2019-08-14 Jonathan Wakely <jwakely@redhat.com>
* name-lookup.c (get_std_name_hint): Add more entries.
2019-08-14 Paolo Carlini <paolo.carlini@oracle.com>
* decl2.c (grok_array_decl): Use the location of the open square
bracket in error message about invalid types.
2019-08-14 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Check here for typedef a function
definition or a member function definition.
(start_function): Adjust.
(grokmethod): Likewise.
2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
PR middle-end/91421
* decl.c (duplicate_decls): Use copy_decl_built_in_function.
* pt.c (declare_integer_pack): Use set_decl_built_in_function.
2019-08-13 Marek Polacek <polacek@redhat.com>
PR c++/90473 - wrong code with nullptr in default argument.
* call.c (null_ptr_cst_p): Update quote from the standard.
* decl.c (check_default_argument): Don't return nullptr when the arg
has side-effects.
2019-08-13 Marek Polacek <polacek@redhat.com>
* cp-tree.h (DECL_MUTABLE_P): Use FIELD_DECL_CHECK.
2019-08-10 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_omp_clause_name): Parse device_type.
(cp_parser_omp_clause_device_type): New function.
(cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
(OMP_DECLARE_TARGET_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
(cp_parser_omp_declare_target): Handle device_type clauses. Remove
diagnostics for declare target with clauses nested in clause-less
declare target declaration-definition-seq.
* semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DEVICE_TYPE.
2019-08-09 Jakub Jelinek <jakub@redhat.com>
* parser.c (check_no_duplicate_clause): Simplify using
omp_find_clause.
(cp_parser_omp_clause_if): Fix up printing of target {enter,exit} data
directive name modifiers.
PR c/91401
* parser.c (cp_parser_omp_clause_dist_schedule): Comment out the
check_no_duplicate_clause call, instead emit a warning for duplicate
dist_schedule clauses.
2019-08-08 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Use id_loc and EXPR_LOCATION in
a few error messages.
2019-08-08 Marek Polacek <polacek@redhat.com>
PR c++/87519 - bogus warning with -Wsign-conversion.
* typeck.c (cp_build_binary_op): Use same_type_p instead of comparing
the types directly.
* constexpr.c (inline_asm_in_constexpr_error): New.
(cxx_eval_constant_expression) <case ASM_EXPR>: Call it.
(potential_constant_expression_1) <case ASM_EXPR>: Likewise.
2019-08-08 Jakub Jelinek <jakub@redhat.com>
* semantics.c (finish_omp_clauses): For C_ORT_OMP
OMP_CLAUSE_USE_DEVICE_* clauses use oacc_reduction_head bitmap
instead of generic_head to track duplicates.
2019-08-07 Marek Polacek <polacek@redhat.com>
PR c++/81429 - wrong parsing of constructor with C++11 attribute.
* parser.c (cp_parser_constructor_declarator_p): Handle the scenario
when a parameter declaration begins with [[attribute]].
2019-08-07 Marek Polacek <polacek@redhat.com>
PR c++/91346 - Implement P1668R1, allow unevaluated asm in constexpr.
* constexpr.c (cxx_eval_constant_expression): Handle ASM_EXPR.
(potential_constant_expression_1) <case ASM_EXPR>: Allow.
* cp-tree.h (finish_asm_stmt): Adjust.
* parser.c (cp_parser_asm_definition): Grab the locaion of "asm" and
use it. Change an error to a pedwarn. Allow asm in C++2a, warn
otherwise.
* pt.c (tsubst_expr): Pass a location down to finish_asm_stmt.
* semantics.c (finish_asm_stmt): New location_t parameter. Use it.
2019-08-07 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_omp_clause_name): Parse use_device_addr clause.
(cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
(OMP_TARGET_DATA_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
(cp_parser_omp_target_data): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR
like PRAGMA_OMP_CLAUSE_USE_DEVICE_PTR, adjust diagnostics about no
map or use_device_* clauses.
* semantics.c (finish_omp_clauses): For OMP_CLAUSE_USE_DEVICE_PTR
in OpenMP, require pointer or reference to pointer type rather than
pointer or array or reference to pointer or array type. Handle
OMP_CLAUSE_USE_DEVICE_ADDR.
* pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_USE_DEVICE_ADDR.
2019-08-06 Jason Merrill <jason@redhat.com>
PR c++/91378 - ICE with noexcept and auto return type.
* pt.c (maybe_instantiate_noexcept): push_to_top_level.
2019-08-06 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (check_array_designated_initializer): Use
cp_expr_loc_or_input_loc in one place.
2019-08-06 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_omp_for_loop): For OMP_LOOP, ignore parallel
clauses and predetermine iterator as lastprivate.
* semantics.c (handle_omp_for_class_iterator): Use
OMP_CLAUSE_LASTPRIVATE_LOOP_IV instead of
OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV, set it for lastprivate also
on OMP_LOOP construct. If a clause is missing for class iterator
on OMP_LOOP, add firstprivate clause, and if there is private
clause, turn it into firstprivate too.
(finish_omp_for): Formatting fix. For OMP_LOOP, adjust
OMP_CLAUSE_LASTPRIVATE_LOOP_IV clause CP_CLAUSE_INFO, so that it
uses copy ctor instead of default ctor.
* cp-gimplify.c (cp_gimplify_expr): Handle OMP_LOOP like
OMP_DISTRIBUTE etc.
(cp_fold_r): Likewise.
(cp_genericize_r): Likewise.
(cxx_omp_finish_clause): Also finish lastprivate clause with
OMP_CLAUSE_LASTPRIVATE_LOOP_IV flag.
* pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_BIND.
(tsubst_omp_for_iterator): For OMP_LOOP, ignore parallel
clauses and predetermine iterator as lastprivate.
* constexpr.c (potential_constant_expression_1): Handle OMP_LOOP
like OMP_DISTRIBUTE etc.
2019-08-05 Marek Polacek <polacek@redhat.com>
DR 2413 - typename in conversion-function-ids.
* parser.c (cp_parser_conversion_type_id): Call
cp_parser_type_specifier_seq with CP_PARSER_FLAGS_TYPENAME_OPTIONAL
instead of CP_PARSER_FLAGS_NONE.
2019-08-05 Paolo Carlini <paolo.carlini@oracle.com>
* cp-tree.h (cp_expr_loc_or_input_loc): New.
(cxx_incomplete_type_diagnostic): Use it.
* call.c (build_converted_constant_expr_internal, convert_like_real,
convert_arg_to_ellipsis, convert_for_arg_passing, build_over_call,
build_cxx_call, perform_implicit_conversion_flags,
initialize_reference): Likewise.
* constexpr.c (cxx_eval_internal_function, cxx_eval_call_expression,
eval_and_check_array_index, cxx_eval_store_expression,
cxx_eval_statement_list, cxx_eval_loop_expr,
cxx_eval_constant_expression, potential_constant_expression_1):
Likewise.
* constraint.cc (check_for_logical_overloads,
satisfy_predicate_constraint): Likewise.
* cp-gimplify.c (cp_gimplify_expr): Likewise.
* cvt.c (cp_convert_to_pointer, convert_to_reference,
cp_convert_and_check, ocp_convert, maybe_warn_nodiscard): Likewise.
* decl.c (pop_switch): Likewise.
* decl2.c (delete_sanity): Likewise.
* error.c (location_of): Likewise.
* init.c (maybe_warn_list_ctor, build_aggr_init,
warn_placement_new_too_small, build_new_1, build_vec_init): Likewise.
* lex.c (unqualified_name_lookup_error): Likewise.
* parser.c (cp_parser_initializer_list, cp_parser_omp_for_cond):
Likewise.
* pt.c (check_for_bare_parameter_packs, check_valid_ptrmem_cst_expr,
unify_arg_conversion, convert_nontype_argument,
tsubst_copy_and_build, resolve_typename_type): Likewise.
* semantics.c (maybe_convert_cond, finish_call_expr,
cp_build_vec_convert): Likewise.
* typeck.c (decay_conversion, rationalize_conditional_expr,
cp_build_unary_op, build_x_compound_expr_from_list,
maybe_warn_about_returning_address_of_local,
maybe_warn_pessimizing_move): Likewise.
* typeck2.c (check_narrowing, digest_init_r,
process_init_constructor_array): Likewise.
2019-08-05 Tom Honermann <tom@honermann.net>
* parser.c (cp_parser_template_declaration_after_parameters): Enable
class template argument deduction for non-type template parameters
in literal operator templates.
2019-08-05 Marek Polacek <polacek@redhat.com>
PR c++/91338 - Implement P1161R3: Deprecate a[b,c].
* parser.c (cp_parser_postfix_open_square_expression): Warn about uses
of a comma operator within a subscripting expression.
(cp_parser_skip_to_closing_square_bracket_1): New function, made out
of...
(cp_parser_skip_to_closing_square_bracket): ...this.
2019-08-05 Jason Merrill <jason@redhat.com>
* semantics.c (force_paren_expr): Preserve location.
2019-08-02 Marek Polacek <polacek@redhat.com>
PR c++/91230 - wrong error with __PRETTY_FUNCTION__ and generic lambda.
* pt.c (value_dependent_expression_p): Consider __PRETTY_FUNCTION__
inside a template function value-dependent.
2019-08-02 Paolo Carlini <paolo.carlini@oracle.com>
* tree.c (handle_nodiscard_attribute): Do not warn about nodiscard
applied to a constructor.
2019-08-02 Martin Liska <mliska@suse.cz>
* decl.c (grok_op_properties):
Mark DECL_SET_IS_OPERATOR_DELETE for user-provided delete operators.
2019-08-01 Martin Sebor <msebor@redhat.com>
PR c++/90947
* decl.c (reshape_init_array_1): Avoid truncating initializer
lists containing string literals.
2019-08-01 Marek Polacek <polacek@redhat.com>
PR c++/90805 - detect narrowing in case values.
* decl.c (case_conversion): Detect narrowing in case values.
2019-07-31 Paolo Carlini <paolo.carlini@oracle.com>
* decl2.c (delete_sanity): Improve diagnostic locations, use
cp_expr_loc_or_loc in four places.
2019-07-31 Jason Merrill <jason@redhat.com>
PR c++/90538 - multiple expansions of capture packs
* cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): Remove.
* lambda.c (add_capture): Copy parameter packs from init.
(lambda_capture_field_type): Always use auto for init-capture.
* pt.c (uses_parameter_packs): Return tree.
(tsubst) [DECLTYPE_TYPE]: Remove init-capture handling.
(gen_elem_of_pack_expansion_instantiation): Don't push
local_specialization_stack.
(prepend_one_capture): New.
(tsubst_lambda_expr): Use it. Don't touch local_specializations.
(do_auto_deduction): Avoid redundant error.
Fix copy_node of TEMPLATE_INFO.
* cp-tree.h (struct tree_template_info): Use tree_base instead of
tree_common. Add tmpl and args fields.
(TI_TEMPLATE, TI_ARGS): Adjust.
2019-07-30 Martin Liska <mliska@suse.cz>
PR tree-optimization/91270
* tree-ssa-dce.c (propagate_necessity): Mark 2nd argument
of delete operator as needed.
2019-07-25 Martin Liska <mliska@suse.cz>
Dominik Infuhr <dominik.infuehr@theobroma-systems.com>
PR c++/23383
* decl.c (cxx_init_decl_processing): Mark delete operators
with DECL_SET_IS_OPERATOR_DELETE.
2019-07-25 Martin Liska <mliska@suse.cz>
* decl.c (duplicate_decls): Use new macros
(e.g. DECL_SET_LAMBDA_FUNCTION and DECL_LAMBDA_FUNCTION_P).
(cxx_init_decl_processing): Likewise.
(grok_op_properties): Likewise.
* parser.c (cp_parser_lambda_declarator_opt): Likewise.
2019-07-24 Martin Sebor <msebor@redhat.com>
PR driver/80545
* decl.c (finish_function): Use lang_mask.
2019-07-20 Jason Merrill <jason@redhat.com>
* cp-tree.h (ovl_iterator::using_p): A USING_DECL by itself was also
introduced by a using-declaration.
2019-07-20 Jason Merrill <jason@redhat.com>
Reduce memory consumption for push/pop_access_scope.
* name-lookup.c (leave_scope): Do add class levels other than
previous_class_level to free_binding_level.
(invalidate_class_lookup_cache): Move from class.c, add to
free_binding_level.
* pt.c (saved_access_scope): Change from list to vec.
2019-07-20 Jakub Jelinek <jakub@redhat.com>
* cp-tree.h (OMP_FOR_GIMPLIFYING_P): Use OMP_LOOPING_CHECK
instead of OMP_LOOP_CHECK.
* parser.c (cp_parser_omp_clause_name): Handle bind clause.
(cp_parser_omp_clause_bind): New function.
(cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_BIND.
(OMP_LOOP_CLAUSE_MASK): Define.
(cp_parser_omp_loop): New function.
(cp_parser_omp_parallel, cp_parser_omp_teams): Handle parsing of
loop combined with parallel or teams.
(cp_parser_omp_construct): Handle PRAGMA_OMP_LOOP.
(cp_parser_pragma): Likewise.
* pt.c (tsubst_expr): Handle OMP_LOOP.
* semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_BIND.
2019-07-19 Jason Merrill <jason@redhat.com>
PR c++/90101 - dependent class non-type parameter.
* pt.c (invalid_nontype_parm_type_p): Check for dependent class type.
2019-07-18 Jason Merrill <jason@redhat.com>
PR c++/90098 - partial specialization and class non-type parms.
PR c++/90099
PR c++/90101
* call.c (build_converted_constant_expr_internal): Don't copy.
* pt.c (process_partial_specialization): Allow VIEW_CONVERT_EXPR
around class non-type parameter.
(unify) [TEMPLATE_PARM_INDEX]: Ignore cv-quals.
2019-07-16 Jason Merrill <jason@redhat.com>
* parser.c (make_location): Add overload taking cp_lexer* as last
parameter.
* parser.c (cp_parser_simple_type_specifier): Separate tentative
parses for optional type-spec and CTAD.
* parser.c (cp_parser_nested_name_specifier_opt): If the token is
already CPP_NESTED_NAME_SPECIFIER, leave it alone.
2019-07-12 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_omp_clause_name): Handle order clause.
(cp_parser_omp_clause_order): New function.
(cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ORDER.
(OMP_SIMD_CLAUSE_MASK, OMP_FOR_CLAUSE_MASK): Add
PRAGMA_OMP_CLAUSE_ORDER.
* semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_ORDER.
* pt.c (tsubst_omp_clauses): Likewise.
2019-07-10 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (get_type_quals,
smallest_type_location (const cp_decl_specifier_seq*)): New.
(check_tag_decl): Use smallest_type_location in error_at about
multiple types in one declaration.
(grokdeclarator): Use locations[ds_complex] in error_at about
complex invalid; use locations[ds_storage_class] in error_at
about static cdtor; use id_loc in error_at about flexible
array member in union; use get_type_quals.
2019-07-09 Martin Sebor <msebor@redhat.com>
PR c++/61339
* cp-tree.h: Change class-key of PODs to struct and others to class.
* search.c: Same.
* semantics.c (finalize_nrv_r): Same.
2019-07-09 Martin Sebor <msebor@redhat.com>
PR c++/61339
* constexpr.c (cxx_eval_call_expression): Change class-key from class
to struct and vice versa to match convention and avoid -Wclass-is-pod
and -Wstruct-no-pod.
* constraint.cc (get_concept_definition): Same.
* cp-tree.h: Same.
* cxx-pretty-print.h: Same.
* error.c: Same.
* logic.cc (term_list::replace): Same.
* name-lookup.c (find_local_binding): Same.
* pt.c (tsubst_binary_right_fold): Same.
* search.c (field_accessor_p): Same.
* semantics.c (expand_or_defer_fn): Same.
2019-07-08 Jakub Jelinek <jakub@redhat.com>
PR c++/91110
* decl2.c (cp_omp_mappable_type_1): Don't emit any note for
error_mark_node type.
2019-07-05 Jakub Jelinek <jakub@redhat.com>
PR c++/67184
PR c++/69445
* call.c (build_new_method_call_1): Remove set but not used variable
binfo.
2019-07-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/67184 (again)
PR c++/69445
* call.c (build_over_call): Devirtualize user-defined operators
coming from a base too.
(build_new_method_call_1): Do not devirtualize here.
2019-07-04 Marek Polacek <polacek@redhat.com>
DR 1813
PR c++/83374 - __is_standard_layout wrong for a class with repeated
bases.
* class.c (check_bases): Set CLASSTYPE_NON_STD_LAYOUT for a class if
CLASSTYPE_REPEATED_BASE_P is true.
2019-07-04 Andrew Stubbs <ams@codesourcery.com>
* cp-tree.h (cp_omp_emit_unmappable_type_notes): New prototype.
* decl.c (cp_finish_decl): Call cp_omp_emit_unmappable_type_notes.
* decl2.c (cp_omp_mappable_type): Move contents to ...
(cp_omp_mappable_type_1): ... here and add note output.
(cp_omp_emit_unmappable_type_notes): New function.
* semantics.c (finish_omp_clauses): Call
cp_omp_emit_unmappable_type_notes in four places.
2019-07-03 Martin Liska <mliska@suse.cz>
* call.c (build_new_op_1): Remove dead assignemts.
* typeck.c (cp_build_binary_op): Likewise.
2019-06-27 Jason Merrill <jason@redhat.com>
PR c++/55442 - memory-hog with highly recursive constexpr.
* constexpr.c (push_cx_call_context): Return depth.
(cxx_eval_call_expression): Don't cache past constexpr_cache_depth.
2019-06-27 Jan Hubicka <jh@suse.cz>
* class.c (layout_class_type): Set TYPE_CXX_ODR_P for as-base
type copy.
2019-06-27 Martin Liska <mliska@suse.cz>
* class.c (adjust_clone_args): Remove obviously
dead assignments.
(dump_class_hierarchy_r): Likewise.
* decl.c (check_initializer): Likewise.
* parser.c (cp_parser_lambda_expression): Likewise.
* pt.c (unify_bound_ttp_args): Likewise.
(convert_template_argument): Likewise.
* rtti.c (build_headof): Likewise.
* typeck.c (convert_for_initialization): Likewise.
2019-06-25 Jason Merrill <jason@redhat.com>
PR c++/70462 - unnecessary base ctor variant with final.
* optimize.c (populate_clone_array): Skip base variant if
CLASSTYPE_FINAL.
(maybe_clone_body): We don't need an alias if we are only defining
one clone.
* class.c (resolves_to_fixed_type_p): Check CLASSTYPE_FINAL.
2019-06-25 Jakub Jelinek <jakub@redhat.com>
PR c++/90969
* constexpr.c (cxx_eval_array_reference): Don't look through VCE from
vector type if lval.
2019-06-25 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* lex.c (init_reswords): Create keyword for "__intN__" type.
* cp-tree.h (cp_decl_specifier_seq): New bitfield "int_n_alt".
* decl.c (grokdeclarator): Don't pedwarn about "__intN" ISO
C incompatibility if alternate "__intN__" form is used.
* parser.c (cp_parser_simple_type_specifier): Set
decl_specs->int_n_alt if "__intN__" form is used.
2019-06-24 Jan Hubicka <jh@suse.cz>
* lex.c (cxx_make_type): Set TYPE_CXX_ODR_P.
2019-06-24 Jason Merrill <jason@redhat.com>
* class.c (layout_class_type): Don't use a separate
CLASSTYPE_AS_BASE if it's the same size.
2019-06-23 Marek Polacek <polacek@redhat.com>
* call.c (convert_default_arg): Use DEFERRED_PARSE instead of
DEFAULT_ARG.
* cp-objcp-common.c (cp_tree_size): Likewise. Use tree_deferred_parse
instead of tree_default_arg.
* cp-tree.def: Rename DEFAULT_ARG to DEFERRED_PARSE.
* cp-tree.h: Rename DEFARG_TOKENS to DEFPARSE_TOKENS. Rename
DEFARG_INSTANTIATIONS to DEFPARSE_INSTANTIATIONS. Rename
tree_default_arg to tree_deferred_parse.
(UNPARSED_NOEXCEPT_SPEC_P): Use DEFERRED_PARSE instead of DEFAULT_ARG.
(cp_tree_node_structure_enum): Rename TS_CP_DEFAULT_ARG to
TS_CP_DEFERRED_PARSE.
(lang_tree_node): Rename tree_default_arg to tree_deferred_parse.
Rename default_arg to deferred_parse. Use TS_CP_DEFERRED_PARSE instead
of TS_CP_DEFAULT_ARG.
(defarg_location): Remove declaration.
(defparse_location): Add declaration.
* decl.c (grokfndecl): Use DEFERRED_PARSE instead of DEFAULT_ARG.
Call defparse_location instead of defarg_location.
(check_default_argument): Use DEFERRED_PARSE instead of DEFAULT_ARG.
(cp_tree_node_structure): Likewise. Use TS_CP_DEFERRED_PARSE instead
of TS_CP_DEFAULT_ARG.
* decl2.c (grokfield): Use DEFERRED_PARSE instead of DEFAULT_ARG.
* error.c (dump_expr): Likewise.
(location_of): Likewise.
* init.c (get_nsdmi): Likewise.
* parser.c (cp_parser_save_noexcept): Likewise. Use DEFPARSE_TOKENS
instead of DEFARG_TOKENS.
(cp_parser_late_noexcept_specifier): Likewise.
(cp_parser_late_parse_one_default_arg): Use DEFPARSE_TOKENS instead
of DEFARG_TOKENS.
(cp_parser_late_parsing_default_args): Use DEFERRED_PARSE instead of
DEFAULT_ARG. Use DEFPARSE_INSTANTIATIONS instead of
DEFARG_INSTANTIATIONS.
(cp_parser_cache_defarg): Use DEFERRED_PARSE instead of DEFAULT_ARG.
Use DEFPARSE_TOKENS instead of DEFARG_TOKENS. Use
DEFPARSE_INSTANTIATIONS instead of DEFARG_INSTANTIATIONS.
(defparse_location): Renamed from defarg_location.
* pt.c (tsubst_default_argument): Use DEFERRED_PARSE instead of
DEFAULT_ARG.
(tsubst_arg_types): Likewise.
(dependent_type_p_r): Likewise.
* tree.c (cp_tree_equal): Likewise.
(cp_walk_subtrees): Likewise.
* typeck.c (convert_arguments): Likewise.
2019-06-22 Marek Polacek <polacek@redhat.com>
PR c++/86476 - noexcept-specifier is a complete-class context.
PR c++/52869
* cp-tree.def (DEFAULT_ARG): Update commentary.
* cp-tree.h (UNPARSED_NOEXCEPT_SPEC_P): New macro.
(tree_default_arg): Use tree_base instead of tree_common.
(do_push_parm_decls, maybe_check_overriding_exception_spec): Declare.
* decl.c (do_push_parm_decls): New function, broken out of...
(store_parm_decls): ...here. Call it.
* except.c (nothrow_spec_p): Accept DEFAULT_ARG in the assert.
* parser.c (cp_parser_noexcept_specification_opt,
cp_parser_late_noexcept_specifier, noexcept_override_late_checks):
Forward-declare.
(unparsed_noexcepts): New macro.
(push_unparsed_function_queues): Update initializer.
(cp_parser_direct_declarator): Pass FRIEND_P to
cp_parser_exception_specification_opt.
(inject_parm_decls): New.
(pop_injected_parms): New.
(cp_parser_class_specifier_1): Implement delayed parsing of
noexcept-specifiers.
(cp_parser_save_noexcept): New.
(cp_parser_late_noexcept_specifier): New.
(noexcept_override_late_checks): New.
(cp_parser_noexcept_specification_opt): Add FRIEND_P parameter. Call
cp_parser_save_noexcept instead of the normal processing if needed.
(cp_parser_exception_specification_opt): Add FRIEND_P parameter and
pass it to cp_parser_noexcept_specification_opt.
(cp_parser_save_member_function_body): Fix comment.
(cp_parser_save_default_args): Maybe save the noexcept-specifier to
post process.
(cp_parser_transaction): Update call to
cp_parser_noexcept_specification_opt.
(cp_parser_transaction_expression): Likewise.
* parser.h (cp_unparsed_functions_entry): Add new field to carry
a noexcept-specifier.
* pt.c (dependent_type_p_r): Handle unparsed noexcept expression.
* search.c (maybe_check_overriding_exception_spec): New function, broken
out of...
(check_final_overrider): ...here. Call
maybe_check_overriding_exception_spec.
* tree.c (canonical_eh_spec): Handle UNPARSED_NOEXCEPT_SPEC_P.
(cp_tree_equal): Handle DEFAULT_ARG.
PR c++/90881 - bogus -Wunused-value in unevaluated context.
* cvt.c (convert_to_void): Don't emit unused warnings in
an unevaluated context.
2019-06-22 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Use id_loc, typespec_loc, and
locations[ds_storage_class] in a few additional places.
2019-06-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/90909
Revert:
2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/67184
PR c++/69445
* call.c (build_over_call): Devirtualize when the final overrider
comes from the base.
2019-06-21 Marek Polacek <polacek@redhat.com>
PR c++/61490 - qualified-id in friend function definition.
* decl.c (grokdeclarator): Diagnose qualified-id in friend function
definition. Improve location for diagnostics of friend functions.
PR c++/60223 - ICE with T{} in non-deduced context.
* pt.c (unify): Allow COMPOUND_LITERAL_P in a non-deduced context.
PR c++/64235 - missing syntax error with invalid alignas.
* parser.c (cp_parser_std_attribute_spec): Commit to tentative parse
if there's a missing close paren.
PR c++/90490 - fix decltype issues in noexcept-specifier.
* except.c (build_noexcept_spec): Call
instantiate_non_dependent_expr_sfinae before
build_converted_constant_expr instead of calling
instantiate_non_dependent_expr after it. Add
processing_template_decl_sentinel.
2019-06-21 Jakub Jelinek <jakub@redhat.com>
PR c++/90950
* semantics.c (finish_omp_clauses): Don't reject references to
incomplete types if processing_template_decl.
2019-06-19 Marek Polacek <polacek@redhat.com>
PR c++/60364 - noreturn after first decl not diagnosed.
* decl.c (duplicate_decls): Give an error when a function is
declared [[noreturn]] after its first declaration.
* parser.c (cp_parser_std_attribute): Don't treat C++11 noreturn
attribute as equivalent to GNU's.
* tree.c (std_attribute_table): Add noreturn.
2019-06-19 Jakub Jelinek <jakub@redhat.com>
* cp-gimplify.c (cp_genericize_r): Handle OMP_CLAUSE_{IN,EX}CLUSIVE
like OMP_CLAUSE_SHARED.
2019-06-18 Jason Merrill <jason@redhat.com>
* constexpr.c (cxx_eval_store_expression): Delay target evaluation.
2019-06-18 Jason Merrill <jason@redhat.com>
* constexpr.c (eval_and_check_array_index): Split out from...
(cxx_eval_array_reference): ...here.
(cxx_eval_store_expression): Use it here, too.
(diag_array_subscript): Take location. Strip location wrapper.
2019-06-18 Jason Merrill <jason@redhat.com>
* constexpr.c (cxx_eval_constant_expression): Handle conversion from
and then to the same type.
2019-06-18 Jason Merrill <jason@redhat.com>
* constexpr.c (unshare_constructor): Add MEM_STAT_DECL.
2019-06-17 Jakub Jelinek <jakub@redhat.com>
* semantics.c (finish_omp_clauses): For OMP_CLAUSE_REDUCTION_INSCAN
set need_copy_assignment.
2019-06-17 Marek Polacek <polacek@redhat.com>
PR c++/83820 - excessive attribute arguments not detected.
* parser.c (cp_parser_std_attribute): Detect excessive arguments.
2019-06-17 Nathan Sidwell <nathan@acm.org>
PR c++/90754
* name-lookup.c (lookup_type_scope_1): Calll qualify_lookup before
checking context.
2019-06-14 Marek Polacek <polacek@redhat.com>
PR c++/90884 - stray note with -Wctor-dtor-privacy.
* class.c (maybe_warn_about_overly_private_class): Guard the call to
inform.
2019-06-12 Jason Merrill <jason@redhat.com>
PR c++/85552 - wrong instantiation of dtor for DMI.
* typeck2.c (digest_nsdmi_init): Set tf_no_cleanup for direct-init.
2019-06-13 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Use id_loc in five additional places
in the last part of the function.
2019-06-13 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Move further up the declaration of
id_loc, use it immediately, update its value after the loop
over declarator, use it again in the final part of function;
improve locations of error messages about multiple data types
and conflicting specifiers.
2019-06-13 Richard Biener <rguenther@suse.de>
PR c++/90801
* typeck2.c (split_nonconstant_init_1): Properly count
num_split_elts, optimize single constructor elt removal.
2019-06-12 Marek Polacek <polacek@redhat.com>
PR c++/66999 - 'this' captured by reference.
* parser.c (cp_parser_lambda_introducer): Reject `&this'. Use
cp_lexer_nth_token_is instead of cp_lexer_peek_nth_token.
PR c++/90825 - endless recursion when evaluating sizeof.
PR c++/90832 - endless recursion when evaluating sizeof.
* constexpr.c (cxx_eval_constant_expression): Don't recurse on the
result of fold_sizeof_expr if is returns a SIZEOF_EXPR.
* typeck.c (cxx_sizeof_expr): Only return a SIZEOF_EXPR if the operand
is instantiation-dependent.
PR c++/90736 - bogus error with alignof.
* constexpr.c (adjust_temp_type): Use cv_unqualified type.
2019-06-11 Matthew Beliveau <mbelivea@redhat.com>
PR c++/90449 - add -Winaccessible-base option.
* class.c (warn_about_ambiguous_bases): Changed name to:
maybe_warn_about_inaccessible_bases.
(maybe_warn_about_inaccessible_bases): Implemented new
Winaccessible-base warning option for both direct and virtual
base warnings.
(layout_class_type): Call to warn_about_ambiguous_bases changed to fit
new name.
2019-06-11 Richard Biener <rguenther@suse.de>
PR c++/90801
* typeck2.c (split_nonconstant_init_1): Avoid ordered remove
from CONSTRUCTOR by marking to remove elements and doing all
of them in a O(n) scan.
2019-06-11 Jakub Jelinek <jakub@redhat.com>
PR c++/90810
* init.c (constant_value_1): Handle VECTOR_CST DECL_INITIAL for
!DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P decls like CONSTRUCTOR.
2019-06-11 Martin Liska <mliska@suse.cz>
PR c++/87847
* pt.c (init_template_processing): Disable hash table
sanitization for decl_specializations and type_specializations.
2019-06-10 Jason Merrill <jason@redhat.com>
* constexpr.c (free_constructor): New.
(cxx_eval_call_expression): Free parameter value CONSTRUCTORs.
* constexpr.c (unshare_constructor): Only unshare if T is itself a
CONSTRUCTOR.
(cxx_eval_call_expression): Don't call it on the result here.
Reduce constexpr_call memory consumption.
* constexpr.c (cxx_bind_parameters_in_call): Use TREE_VEC rather
than TREE_LIST.
(constexpr_call_hasher::equal, cxx_bind_parameters_in_call)
(cxx_eval_call_expression): Adjust.
2019-06-10 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_omp_clause_reduction): Don't sorry_at on inscan
reductions.
(cp_parser_omp_scan_loop_body): New function.
(cp_parser_omp_for_loop): Call cp_parser_omp_scan_loop_body if there
are inscan reduction clauses.
(cp_parser_pragma): Reject PRAGMA_OMP_SCAN.
* semantics.c (finish_omp_clauses): Reject mixing inscan with
non-inscan reductions on the same construct, or inscan reductions with
ordered or schedule clauses, or inscan array reductions.
* pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_{IN,EX}CLUSIVE.
(tsubst_expr): Handle OMP_SCAN.
2019-06-07 Jason Merrill <jason@redhat.com>
* constexpr.c (cxx_eval_constant_expression): Call
STRIP_ANY_LOCATION_WRAPPER early.
[CONVERT_EXPR]: Don't build anything for conversion to void.
[ADDR_EXPR]: ggc_free unused ADDR_EXPR.
2019-06-05 Martin Sebor <msebor@redhat.com>
PR c/90737
* typeck.c (maybe_warn_about_returning_address_of_local): Only
consider functions returning pointers as candidates for
-Wreturn-local-addr.
2019-06-05 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (smallest_type_location): New.
(check_special_function_return_type): Use it.
(grokdeclarator): Lkewise.
2019-06-05 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Use locations[ds_friend]
in one place.
2019-06-05 Martin Sebor <msebor@redhat.com>
* call.c (build_conditional_expr_1): Adjust quoting and hyphenation.
(convert_like_real): Same.
(convert_arg_to_ellipsis): Same.
* constexpr.c (diag_array_subscript): Same.
* constraint.cc (diagnose_trait_expression): Same.
* cvt.c (ocp_convert): Same.
* decl.c (start_decl): Same.
(check_for_uninitialized_const_var): Same.
(grokfndecl): Same.
(check_special_function_return_type): Same.
(finish_enum_value_list): Same.
(start_preparsed_function): Same.
* parser.c (cp_parser_decl_specifier_seq): Same.
* typeck.c (cp_build_binary_op): Same.
(build_static_cast_1): Same.
2019-06-04 Nina Dinka Ranns <dinka.ranns@gmail.com>
PR c++/63149 - Wrong auto deduction from braced-init-list.
* pt.c (listify_autos): use non cv qualified auto_node in
std::initializer_list<auto>.
2019-06-04 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Use declarator->id_loc in two
additional places.
2019-06-04 Nathan Sidwell <nathan@acm.org>
* name-lookup.c (lookup_type_scope_1): Reimplement, handle local
and namespace scopes separately.
2019-06-04 Harald van Dijk <harald@gigawatt.nl>
PR c++/60531 - Wrong error about unresolved overloaded function
* typeck.c (cp_build_binary_op): See if overload can be resolved.
(cp_build_unary_op): Ditto.
2019-06-04 Jason Merrill <jason@redhat.com>
Reduce accumulated garbage in constexpr evaluation.
* constexpr.c (cxx_eval_call_expression): ggc_free any bindings we
don't save.
(cxx_eval_increment_expression): ggc_free the MODIFY_EXPR after
evaluating it.
2019-06-04 Jakub Jelinek <jakub@redhat.com>
* cp-tree.h (CP_OMP_CLAUSE_INFO): Allow for any clauses up to _condvar_
instead of only up to linear.
2019-06-03 Paolo Carlini <paolo.carlini@oracle.com>
* parser.c (cp_parser_unqualified_id): Use build_min_nt_loc in
five places.
2019-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/85254
* class.c (fixup_type_variants): Handle CLASSTYPE_FINAL.
2019-05-31 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (IDENTIFIER_LAMBDA_P): New.
(TYPE_ANON_P): New.
(LAMBDA_TYPE_P, TYPE_UNNAMED_P): Likewise.
(LAMBDANAME_PREFIX, LAMBDANAME_FORMAT): Delete.
(make_lambda_name): Don't declare.
* error.c (dump_aggr_type): Check for lambdas before other
anonymous names.
* lambda.c (begin_lambda_type): Use make_anon_name.
* cp-lang.c (cxx_dwarf_name): Lambda names smell anonymous.
* mangle.c (write_local_name): Likewise.
* name-lookup.c (lambda_cnt, make_lambda_name): Delete.
2019-05-30 Marek Polacek <polacek@redhat.com>
* cp-tree.h (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Fix a typo.
2019-05-31 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Use declarator->id_loc in five
error_at calls.
2019-05-29 Jakub Jelinek <jakub@redhat.com>
PR c++/90598
* tree.c (lvalue_kind): Return clk_none for expressions with
with VOID_TYPE_P.
2019-05-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/89875
* parser.c (cp_parser_sizeof_operand): When the type-id production
did not work out commit to the tentative parse.
2019-05-29 Jakub Jelinek <jakub@redhat.com>
P1091R3 - Extending structured bindings to be more like var decls
P1381R1 - Reference capture of structured bindings
* decl.c (cp_maybe_mangle_decomp): Handle TREE_STATIC decls even at
function scope.
(cp_finish_decomp): Copy over various decl properties from decl to
v[i] in the tuple case.
(grokdeclarator): Allow static, thread_local and __thread for C++2a
and use pedwarn instead of error for older standard revisions.
Make other structured binding diagnostic messages more i18n friendly.
2019-05-28 Nathan Sidwell <nathan@acm.org>
* decl.c (duplicate_decls): Assert a template newdecl has no
specializations.
2019-05-28 Marek Polacek <polacek@redhat.com>
PR c++/90548 - ICE with generic lambda and empty pack.
* pt.c (tsubst_copy_and_build): Handle pack expansion properly.
2019-05-28 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (make_anon_name): Drop declaration.
(TYPE_UNNAMED_P): Use IDENTIFIER_ANON_P.
* cp-lang.c (cxx_dwarf_name): Likewise.
* class.c (find_flexarrays): Likewise.
* decl.c (name_unnamed_type, xref_tag_1): Likewise.
* error.c (dump_aggr_type): Likewise.
* pt.c (push_template_decl_real): Likewise.
* name-lookup.c (consider_binding_level): Likewise.
(anon_cnt, make_anon_name): Delete.
2019-05-25 Marek Polacek <polacek@redhat.com>
PR c++/90572 - wrong disambiguation in friend declaration.
* parser.c (cp_parser_constructor_declarator_p): Don't allow missing
typename for friend declarations.
2019-05-23 Jonathan Wakely <jwakely@redhat.com>
* cp-tree.h (CP_AGGREGATE_TYPE_P): Fix whitespace.
* init.c (std_placement_new_fn_p): Remove outdated TODO comment that
was resolved by r254694.
2019-05-22 Jason Merrill <jason@redhat.com>
PR c++/20408 - unnecessary code for empty struct.
* call.c (build_call_a): Use simple_empty_class_p.
PR c++/86485 - -Wmaybe-unused with empty class ?:
* cp-gimplify.c (simple_empty_class_p): Also true for MODIFY_EXPR.
2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
* parser.c (cp_parser_template_declaration_after_parameters): Use
DECL_SOURCE_LOCATION in literal operator template errors.
2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/67184
PR c++/69445
* call.c (build_over_call): Devirtualize when the final overrider
comes from the base.
2019-05-21 Nathan Sidwell <nathan@acm.org>
* name-lookup.c (do_nonmember_using_decl): Drop INSERT_P
parameter. Document.
(finish_nonmember_using_decl): Adjust do_nonmember_using_decl
calls. Remove stray FIXME comment.
* name-lookup.h (struct cp_binding_level): Drop usings field.
(finish_namespace_using_decl, finish_local_using_decl): Replace with ...
(finish_nonmember_using_decl): ... this.
* name-lookup.c (push_using_decl_1, push_using_decl):
(do_nonmember_using_decl): ... here. Add INSERT_P arg. Reimplement.
(validate_nonmember_using_decl, finish_namespace_using_decl)
(finish_local_using_decl): Replace with ...
(finish_nonmember_using_decl): ... this. Drop DECL parm.
* parser.c (cp_parser_using_declaration): Don't do lookup here.
* pt.c (tsubst_expr): Do not do using decl lookup here.
2019-05-21 Eric Botcazou <ebotcazou@adacore.com>
* decl2.c (cpp_check) <IS_ASSIGNMENT_OPERATOR>: New case.
2019-05-20 Marek Polacek <polacek@redhat.com>
CWG 2094 - volatile scalars are trivially copyable.
PR c++/85679
* tree.c (trivially_copyable_p): Don't check CP_TYPE_VOLATILE_P for
scalar types.
2019-05-20 Marek Polacek <polacek@redhat.com>
* pt.c (convert_template_argument): Add a diagnostic for the
[temp.arg]/2 ambiguity case.
* name-lookup.c (finish_using_directive): Don't issue inform() if the
warning didn't trigger. Add quoting. Tweak the inform message.
2019-05-20 Paolo Carlini <paolo.carlini@oracle.com>
* cp-tree.h: Remove remnants of CONV_NONCONVERTING.
2019-05-20 Nathan Sidwell <nathan@acm.org>
* name-lookup.c (finish_namespace_using_directive)
(finish_local_using_directive): Merge to ...
(finish_using_directive): ... here. Handle both contexts.
* name-lookup.h (finish_namespace_using_directive)
(finish_local_using_directive): Replace with ...
(finish_using_directive): ... this.
* parser.c (cp_parser_using_directive): Adjust.
* pt.c (tsubst_expr): Likewise.
* cp-tree.h (struct lang_decl_ns): Remove usings field.
(DECL_NAMESPACE_USING): Delete.
* name-lookup.c (name_lookup::search_usings): Use namespace's
binding scope.
(name_lookup::queue_namespae): Likewise.
(finish_namespace_using_directive, push_namespace): Likewise.
(has_using_namespace_std_directive): Just search the entire
binding stack.
2019-05-20 Jonathan Wakely <jwakely@redhat.com>
PR c++/90532 Ensure __is_constructible(T[]) is false
* method.c (is_xible_helper): Return error_mark_node for construction
of an array of unknown bound.
2019-05-17 Thomas Schwinge <thomas@codesourcery.com>
PR c++/89433
* parser.c (cp_finalize_oacc_routine): Rework checking if already
marked with an OpenACC 'routine' directive.
PR c++/89433
* parser.c (cp_parser_oacc_routine)
(cp_parser_late_parsing_oacc_routine): Normalize order of clauses.
(cp_finalize_oacc_routine): Call oacc_verify_routine_clauses.
PR c++/89433
* parser.c (cp_finalize_oacc_routine): Refer to OpenACC 'routine'
clauses from "omp declare target" attribute.
2019-05-16 Martin Sebor <msebor@redhat.com>
* call.c (print_z_candidate): Wrap diagnostic text in a gettext
macro. Adjust.
(print_z_candidates): Same.
(build_conditional_expr_1): Quote keywords, operators, and types
in diagnostics.
(build_op_delete_call): Same.
(maybe_print_user_conv_context): Wrap diagnostic text in a gettext
macro.
(convert_like_real): Same.
(convert_arg_to_ellipsis): Quote keywords, operators, and types
in diagnostics.
(build_over_call): Same.
(joust): Break up an overlong line. Wrap diagnostic text in a gettext
macro.
* constexpr.c (cxx_eval_check_shift_p): Spell out >= in English.
(cxx_eval_constant_expression): Quote keywords, operators, and types
in diagnostics.
(potential_constant_expression_1): Same.
* cp-gimplify.c (cp_genericize_r): Same.
* cvt.c (maybe_warn_nodiscard): Quote keywords, operators, and types
in diagnostics.
(type_promotes_to): Same.
* decl.c (check_previous_goto_1): Same.
(check_goto): Same.
(start_decl): Same.
(cp_finish_decl): Avoid parenthesizing a sentence for consistency.
(grok_op_properties): Quote keywords, operators, and types
in diagnostics.
* decl2.c (grokfield): Same.
(coerce_delete_type): Same.
* except.c (is_admissible_throw_operand_or_catch_parameter): Same.
* friend.c (do_friend): Quote C++ tokens.
* init.c (build_new_1): Quote keywords, operators, and types
in diagnostics.
(build_vec_delete_1): Same.
(build_delete): Same.
* lex.c (parse_strconst_pragma): Same.
(handle_pragma_implementation): Same.
(unqualified_fn_lookup_error): Same.
* mangle.c (write_type): Same.
* method.c (defaulted_late_check): Avoid two consecutive punctuators.
* name-lookup.c (cp_binding_level_debug): Remove a trailing newline.
(pop_everything): Same.
* parser.c (cp_lexer_start_debugging): Quote a macro name.
in a diagnostic
(cp_lexer_stop_debugging): Same.
(cp_parser_userdef_numeric_literal): Quote a C++ header name
in a diagnostic.
(cp_parser_nested_name_specifier_opt): Quote keywords, operators,
and types in diagnostics.
(cp_parser_question_colon_clause): Same.
(cp_parser_asm_definition): Same.
(cp_parser_init_declarator): Same.
(cp_parser_template_declaration_after_parameters): Avoid capitalizing
a sentence in a diagnostic.
(cp_parser_omp_declare_reduction): Quote keywords, operators, and types
in diagnostics.
(cp_parser_transaction): Same.
* pt.c (maybe_process_partial_specialization): Replace second call
to permerror with inform for consistency with other uses.
(expand_integer_pack): Quote keywords, operators, and types
in diagnostics.
* rtti.c (get_typeid): Quote keywords, operators, and types
in diagnostics.
(build_dynamic_cast_1): Same.
* semantics.c (finish_asm_stmt): Same.
(finish_label_decl): Same.
(finish_bases): Same.
(finish_offsetof): Same.
(cp_check_omp_declare_reduction): Same.
(finish_decltype_type): Same.
* tree.c (handle_init_priority_attribute): Same. Add detail
to diagnostics.
(maybe_warn_zero_as_null_pointer_constant): Same.
* typeck.c (cp_build_binary_op): Quote keywords, operators, and types
in diagnostics.
(cp_build_unary_op): Same.
(check_for_casting_away_constness): Same.
(build_static_cast): Same.
(build_const_cast_1): Same.
(maybe_warn_about_returning_address_of_local): Same.
(check_return_expr): Same.
* typeck2.c (abstract_virtuals_error_sfinae): Same.
(digest_init_r): Replace a tab with spaces in a diagnostic.
(build_functional_cast): Quote keywords, operators, and types
in diagnostics.
2019-05-15 Jakub Jelinek <jakub@redhat.com>
PR debug/90197
* cp-gimplify.c (genericize_cp_loop): Emit a DEBUG_BEGIN_STMT
before the condition (or if missing or constant non-zero at the end
of the loop. Emit a DEBUG_BEGIN_STMT before the increment expression
if any. Don't call protected_set_expr_location on incr if it already
has a location.
2019-05-15 Marek Polacek <polacek@redhat.com>
CWG 2096 - constraints on literal unions.
* class.c (check_field_decls): Initialize booleans directly. A union
is literal if at least one of its non-static data members is of
non-volatile literal type.
2019-05-15 Paolo Carlini <paolo.carlini@oracle.com>
* cp-tree.h (REFERENCE_VLA_OK): Remove.
* lambda.c (build_capture_proxy): Remove use of the above.
2019-05-15 Paolo Carlini <paolo.carlini@oracle.com>
* call.c (perform_overload_resolution, build_new_method_call_1):
Use OVL_P; remove redundant TEMPLATE_DECL checks.
* decl.c (grokfndecl): Likewise.
* mangle.c (write_expression): Likewise.
* parser.c (cp_parser_template_id): Likewise.
* pt.c (resolve_overloaded_unification, type_dependent_expression_p):
Likewise.
* search.c (build_baselink): Likewise.
* tree.c (is_overloaded_fn, dependent_name, maybe_get_fns): Likewise.
2019-05-14 Paolo Carlini <paolo.carlini@oracle.com>
PR preprocessor/90382
* decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
min_location.
2019-05-13 Jason Merrill <jason@redhat.com>
Use releasing_vec more broadly.
* cp-tree.h (struct releasing_vec): Replace get_ref method with
operator&.
(vec_safe_push, vec_safe_reserve, vec_safe_length, vec_safe_splice):
Forwarding functions for releasing_vec.
(release_tree_vector): Declare but don't define.
* call.c (build_op_delete_call, build_temp, call_copy_ctor)
(perform_direct_initialization_if_possible): Use releasing_vec.
* constexpr.c (cxx_eval_vec_init_1, cxx_eval_store_expression):
Likewise.
* cp-gimplify.c (cp_fold): Likewise.
* cvt.c (force_rvalue, ocp_convert): Likewise.
* decl.c (get_tuple_decomp_init): Likewise.
* except.c (build_throw): Likewise.
* init.c (perform_member_init, expand_default_init): Likewise.
* method.c (do_build_copy_assign, locate_fn_flags): Likewise.
* parser.c (cp_parser_userdef_char_literal)
(cp_parser_userdef_numeric_literal)
(cp_parser_userdef_string_literal)
(cp_parser_perform_range_for_lookup)
(cp_parser_range_for_member_function, cp_parser_omp_for_loop)
(cp_parser_omp_for_loop_init): Likewise.
* pt.c (tsubst_copy_and_build, do_class_deduction): Likewise.
* semantics.c (calculate_direct_bases, calculate_bases)
(finish_omp_barrier, finish_omp_flush, finish_omp_taskwait)
(finish_omp_taskyield, finish_omp_cancel)
(finish_omp_cancellation_point): Likewise.
* tree.c (build_vec_init_elt, strip_typedefs, strip_typedefs_expr)
(build_min_non_dep_op_overload): Likewise.
* typeck.c (build_function_call_vec, cp_build_function_call_nary)
(cp_build_modify_expr): Likewise.
* typeck2.c (build_functional_cast): Likewise.
2019-05-11 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (cp_build_function_call_vec): When mark_used fails
unconditionally return error_mark_node.
2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokvardecl): Use an accurate location in error message
about main as a global variable.
2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
* call.c (build_call_a): Use FUNC_OR_METHOD_TYPE_P.
* cp-gimplify.c (cp_fold): Likewise.
* cp-objcp-common.c (cp_type_dwarf_attribute): Likewise.
* cp-tree.h (TYPE_OBJ_P, TYPE_PTROBV_P): Likewise.
* cvt.c (perform_qualification_conversions): Likewise.
* decl.c (grokdeclarator): Likewise.
* decl2.c (build_memfn_type): Likewise.
* mangle.c (canonicalize_for_substitution, write_type): Likewise.
* parser.c (cp_parser_omp_declare_reduction): Likewise.
* pt.c (check_explicit_specialization, uses_deducible_template_parms,
check_cv_quals_for_unify, dependent_type_p_r): Likewise.
* rtti.c (ptr_initializer): Likewise.
* semantics.c (finish_asm_stmt, finish_offsetof,
cp_check_omp_declare_reduction): Likewise.
* tree.c (cp_build_qualified_type_real,
cp_build_type_attribute_variant, cxx_type_hash_eq,
cxx_copy_lang_qualifiers, cp_free_lang_data): Likewise.
* typeck.c (structural_comptypes, convert_arguments,
cp_build_addr_expr_1, unary_complex_lvalue, cp_build_c_cast,
cp_build_modify_expr, comp_ptr_ttypes_real, type_memfn_rqual):
Likewise.
2019-05-10 Marek Polacek <polacek@redhat.com>
PR c++/78010 - bogus -Wsuggest-override warning on final function.
* class.c (check_for_override): Don't warn for final functions.
2019-05-10 Jakub Jelinek <jakub@redhat.com>
PR pch/90326
* config-lang.in (gtfiles): Remove c-family/c-lex.c, add
c-family/c-cppbuiltin.c.
2019-05-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/90382
Revert:
2018-04-26 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
min_location.
2019-05-08 Nathan Sidwell <nathan@acm.org>
Kill DECL_SAVED_FUNCTION_DATA .
* cp-tree.h (language_function): Remove x_auto_return_pattern.
(current_function_auto_return_pattern): Delete.
(lang_decl_fn): Replace saved_language_function with
saved_auto_return type.
(DECL_SAVED_FUNCTION_DATA): Delete.
(DECL_SAVED_AUTO_RETURN_TYPE): New.
(FNDECL_USED_AUTO): Correct documentation.
* decl.c (duplicate_decls): Adjust AUTO return handling.
(start_preparsed_function): Replace
current_function_auto_return_pattern with
DECL_SAVED_AUTO_RETURN_TYPE. Remove DECL_SAVED_FUNCTION_DATA
zapping.
(finish_function): Likewise.
(save_function_data): Delete.
(fndecl_declared_return_type): Reimplement.
* mangle.c (write_unqualified_name): Use DECL_SAVED_AUTO_RETURN_TYPE.
* method.c (make_thunk, make_alias_for): Likewise.
* parser.c (cp_parser_jump_statement): Likewise.
* pt.c (do_auto_deduction): Likewise.
* typeck.c (check_return_expr): Likewise.
2019-05-06 Jason Merrill <jason@redhat.com>
PR c++/90171 - reorganize usual_deallocation_fn_p
* call.c (struct dealloc_info): New.
(usual_deallocation_fn_p): Take a dealloc_info*.
(aligned_deallocation_fn_p, sized_deallocation_fn_p): Remove.
(build_op_delete_call): Adjust.
2019-05-07 Jason Merrill <jason@redhat.com>
PR c++/86485 - -Wmaybe-unused with empty class ?:
* typeck.c (build_static_cast_1): Use cp_build_addr_expr.
* pt.c (type_dependent_expression_p): A non-type template parm with
a placeholder type is type-dependent.
2019-05-06 Marek Polacek <polacek@redhat.com>
PR c++/90265 - ICE with generic lambda.
* pt.c (tsubst_copy_and_build): Use a dedicated variable for the last
element in the vector.
2019-05-03 Martin Liska <mliska@suse.cz>
* call.c (build_aggr_conv): Use is_empty instead of
elements () == 0 (and similar usages).
* parser.c (cp_parser_lambda_introducer): Likewise.
2019-05-02 Nathan Sidwell <nathan@acm.org>
* semantics.c (finish_id_expression_1): Remove unreachable code.
2019-05-01 Nathan Sidwell <nathan@acm.org>
* name-lookup.h (get_class_binding_direct): Change final arg to
bool.
(get_class_binding): Likewise.
* name-lookup.c (get_class_binding_direct): Replace TYPE_OR_FNS
arg with WANT_TYPE bool. Simplify.
(get_class_binding): Adjust final arg.
* decl.c (reshape_init_class): Adjust get_class_binding calls.
2019-04-30 Nathan Sidwell <nathan@acm.org>
* cp-objcp-common.c (cp_common_init_ts): Use MARK_TS_EXP for _EXPR
nodes. Call c_common_init_ts.
2019-04-29 Nathan Sidwell <nathan@acm.org>
* decl.c (duplicate_decls): Add whitespace, move comments into
conditional blocks.
* method.c (explain_implicit_non_constexpr): Refactor.
* pt.c (check_explicit_specialization): Fix indentation.
* semantics.c (process_outer_var_ref): Reformat.
(finish_id_expression_1): Use STRIP_TEMPLATE.
2019-04-26 Jonathan Wakely <jwakely@redhat.com>
PR c++/90243 - orphaned note in uninstantiated constexpr function
* decl.c (check_for_uninitialized_const_var): Suppress notes if no
error was shown.
2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/90173
* decl.c (grokdeclarator): Set type to error_mark_node
upon error about template placeholder type non followed
by a simple declarator-id.
2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
min_location.
2019-04-24 Jason Merrill <jason@redhat.com>
PR c++/90227 - error with template parameter packs.
* pt.c (coerce_template_parms): Do add empty pack when
require_all_args.
2019-04-24 Richard Biener <rguenther@suse.de>
* call.c (null_ptr_cst_p): Order checks according to expensiveness.
(conversion_null_warnings): Likewise.
* typeck.c (same_type_ignoring_top_level_qualifiers_p): Return
early if type1 == type2.
2019-04-22 Jason Merrill <jason@redhat.com>
PR c++/87366 - wrong error with alias template.
* typeck.c (structural_comptypes): When comparing_specializations,
aliases are unequal.
(comptypes): When comparing_specializations, do structural
comparison.
2019-04-19 Jason Merrill <jason@redhat.com>
PR c++/90190 - CTAD with list-constructor.
* pt.c (do_class_deduction): Don't try the single element deduction
if the single element is also a braced list.
PR c++/90171 - ICE with destroying delete with size_t parm.
* call.c (sized_deallocation_fn_p): New. Use it instead of
second_parm_is_size_t in most cases.
(second_parm_is_size_t): Don't check for aligned.
2019-04-19 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/89900
* pt.c (fn_type_unification): When handling null explicit
arguments do not special case non-parameter packs.
2019-04-19 Jakub Jelinek <jakub@redhat.com>
PR c++/90138
* pt.c (process_template_parm): Set decl to pushdecl result. If
!is_non_type, also set parm to that.
PR c/89888
* decl.c (struct cp_switch): Remove outside_range_p member.
(push_switch): Don't clear it.
(pop_switch): Adjust c_do_switch_warnings caller.
(finish_case_label): Adjust c_add_case_label caller.
PR c++/90108
* decl.c (duplicate_decls): If remove is main variant and
DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
variant that has newdecl as TYPE_NAME if any.
2019-04-18 Jason Merrill <jason@redhat.com>
PR c++/87554 - ICE with extern template and reference member.
* decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars.
2019-04-17 Jason Merrill <jason@redhat.com>
PR c++/90047 - ICE with enable_if alias template.
* pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the
hash table when we're in SFINAE context.
2019-04-17 Marek Polacek <polacek@redhat.com>
PR c++/90124 - bogus error with incomplete type in decltype.
* typeck.c (build_class_member_access_expr): Check
cp_unevaluated_operand.
2019-04-12 Jakub Jelinek <jakub@redhat.com>
PR c/89933
* decl.c (duplicate_decls): When newdecl's type is its main variant,
don't try to remove it from the variant list, but instead assert
it has no variants.
2019-04-12 Martin Sebor <msebor@redhat.com>
PR c/88383
PR c/89288
* parser.c (cp_parser_has_attribute_expression): Handle assignment
expressions.
2019-04-12 Jason Merrill <jason@redhat.com>
* call.c (null_member_pointer_value_p): Handle an empty CONSTRUCTOR
of PMF type.
2019-04-12 Marek Polacek <polacek@redhat.com>
* except.c (build_noexcept_spec): Use build_converted_constant_bool_expr
instead of perform_implicit_conversion_flags.
PR c++/87603 - constexpr functions are no longer noexcept.
* constexpr.c (is_sub_constant_expr): Remove unused function.
* cp-tree.h (is_sub_constant_expr): Remove declaration.
* except.c (check_noexcept_r): Don't consider a call to a constexpr
function noexcept.
2019-04-11 Jakub Jelinek <jakub@redhat.com>
PR translation/90035
* parser.h (struct cp_parser): Add
type_definition_forbidden_message_arg member.
* parser.c (cp_debug_parser): Print it.
(cp_parser_check_type_definition): Pass
parser->type_definition_forbidden_message_arg as second argument to
error.
(cp_parser_has_attribute_expression, cp_parser_sizeof_operand): Set
parser->type_definition_forbidden_message_arg and use G_() with
%qs for parser->type_definition_forbidden_message instead of
building untranslatable message using concat.
2019-04-09 Jakub Jelinek <jakub@redhat.com>
PR translation/90011
* typeck2.c (check_narrowing): Remove trailing space from diagnostics.
2019-04-08 Marek Polacek <polacek@redhat.com>
* typeck2.c (digest_init_r): Don't condition the object slicing warning
on flag_checking.
2019-04-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/89914
* semantics.c (trait_expr_value): Don't use TYPE_NOTHROW_P
when maybe_instantiate_noexcept fails.
(classtype_has_nothrow_assign_or_copy_p): Likewise.
* method.c (implicitly_declare_fn): Avoid passing error_mark_node
to build_exception_variant.
2019-04-05 Marek Polacek <polacek@redhat.com>
PR c++/87145 - bogus error converting class type in template arg list.
* pt.c (convert_nontype_argument): Don't call
build_converted_constant_expr if it could involve calling a conversion
function with a instantiation-dependent constructor as its argument.
2019-04-05 Martin Sebor <msebor@redhat.com>
PR bootstrap/89980
* decl.c (reshape_init_array_1): Avoid treating empty strings
as zeros in array initializers.
Use trivial_type_p () instead of TYPE_HAS_TRIVIAL_DFLT().
2019-04-04 Jason Merrill <jason@redhat.com>
PR c++/89948 - ICE with break in statement-expr.
* constexpr.c (cxx_eval_statement_list): Jumping out of a
statement-expr is non-constant.
2019-04-04 Jason Merrill <jason@redhat.com>
PR c++/89966 - error with non-type auto tparm.
* pt.c (do_auto_deduction): Clear tf_partial.
2019-04-04 Jason Merrill <jason@redhat.com>
PR c++/86986 - ICE with TTP with parameter pack.
* pt.c (coerce_template_parameter_pack): Only look at the type of a
non-type parameter pack.
(fixed_parameter_pack_p_1): Don't recurse into the type of a
non-type parameter pack.
(coerce_template_template_parms): Call add_outermost_template_args.
2019-04-04 Martin Sebor <msebor@redhat.com>
PR c++/89974
PR c++/89878
PR c++/89833
PR c++/47488
* decl.c (reshape_init_array_1): Strip trailing zero-initializers
from arrays of trivial type and known size.
* mangle.c (write_expression): Convert braced initializer lists
to STRING_CSTs.
(write_expression): Trim trailing zero-initializers from arrays
of trivial type.
(write_template_arg_literal): Mangle strings the same as braced
initializer lists.
2019-04-03 Jason Merrill <jason@redhat.com>
PR c++/81866 - ICE with member template and default targ.
* pt.c (tsubst_template_decl): Handle getting a type from
retrieve_specialization.
PR c++/86586 - -fcompare-debug=-Wsign-compare.
* typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare.
PR c++/89331 - ICE with offsetof in incomplete class.
* semantics.c (finish_offsetof): Handle error_mark_node.
* typeck.c (build_class_member_access_expr): Call
complete_type_or_maybe_complain before converting to base.
PR c++/89917 - ICE with lambda in variadic mem-init.
* pt.c (make_pack_expansion): Change type_pack_expansion_p to false.
2019-04-01 Jason Merrill <jason@redhat.com>
PR c++/86946 - ICE with function call in template argument.
DR 1321
* pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use
dependent_name.
2019-04-01 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/62207
* pt.c (tsubst_copy): Deal with lookup_name not returing a variable.
2019-03-31 Marek Polacek <polacek@redhat.com>
PR c++/89852 - ICE with C++11 functional cast with { }.
* constexpr.c (fold_non_dependent_expr_template): New static function
broken out of...
(fold_non_dependent_expr): ...here.
(fold_non_dependent_init): New function.
* cp-tree.h (fold_non_dependent_init): Declare.
* typeck2.c (massage_init_elt): Call fold_non_dependent_init instead
of fold_non_dependent_expr. Don't call maybe_constant_init.
2019-03-30 Jason Merrill <jason@redhat.com>
PR c++/89744 - ICE with specialization of member class template.
* pt.c (lookup_template_class_1): If the partial instantiation is
explicitly specialized, adjust.
(maybe_process_partial_specialization): Also adjust
CLASSTYPE_TI_ARGS.
2019-03-29 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/89869
* typeck.c: Include gimplify.h.
(cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
for second time. Formatting fixes.
2019-03-29 Marek Polacek <polacek@redhat.com>
PR c++/89876 - ICE with deprecated conversion.
* call.c (convert_like_real): Only give warnings with tf_warning.
2019-03-28 Marek Polacek <polacek@redhat.com>
PR c++/89612 - ICE with member friend template with noexcept.
* pt.c (maybe_instantiate_noexcept): For function templates, use their
template result (function decl). Don't set up local specializations.
Temporarily turn on processing_template_decl. Update the template type
too.
PR c++/89836 - bool constant expression and explicit conversions.
* call.c (build_converted_constant_expr_internal): New function,
renamed from...
(build_converted_constant_expr): ...this. New.
(build_converted_constant_bool_expr): New.
* cp-tree.h (build_converted_constant_bool_expr): Declare.
* decl.c (build_explicit_specifier): Call
build_converted_constant_bool_expr.
2019-03-28 Jakub Jelinek <jakub@redhat.com>
PR c++/89785
* constexpr.c (struct check_for_return_continue_data): New type.
(check_for_return_continue): New function.
(potential_constant_expression_1) <case SWITCH_STMT>: Walk
SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested
in loop bodies and set *jump_target to that if found.
2019-03-27 Jason Merrill <jason@redhat.com>
PR c++/89831 - error with qualified-id in const member function.
* semantics.c (finish_non_static_data_member): Use object cv-quals
in scoped case, too.
PR c++/89421 - ICE with lambda in template parameter list.
* parser.c (cp_parser_lambda_expression): Also reject a lambda in a
template parameter list before C++20.
* pt.c (type_dependent_expression_p): True for LAMBDA_EXPR.
* semantics.c (begin_class_definition): Restore error about defining
non-lambda class in template parm list.
2019-03-26 Jason Merrill <jason@redhat.com>
PR c++/86932 - missed SFINAE with empty pack.
* pt.c (coerce_template_parms): Don't add an empty pack if
tf_partial.
(fn_type_unification): Pass tf_partial to coerce_template_parms.
PR c++/86429 - constexpr variable in lambda.
PR c++/82643
PR c++/87327
* constexpr.c (cxx_eval_constant_expression): In a lambda function,
try evaluating the captured variable directly.
2019-03-26 Jakub Jelinek <jakub@redhat.com>
PR c++/89796
* semantics.c (finish_omp_atomic): Add warning_sentinel for
-Wunused-value around finish_expr_stmt call.
2019-03-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84661
PR c++/85013
* parser.c (cp_parser_binary_expression): Don't call cp_fully_fold
to undo the disabling of warnings.
2019-03-25 Jason Merrill <jason@redhat.com>
PR c++/87748 - substitution failure error with decltype.
* pt.c (most_specialized_partial_spec): Clear
processing_template_decl.
2019-03-25 Marek Polacek <polacek@redhat.com>
PR c++/89214 - ICE when initializing aggregates with bases.
* typeck2.c (digest_init_r): Warn about object slicing instead of
crashing.
PR c++/89705 - ICE with reference binding with conversion function.
* call.c (reference_binding): If the result of the conversion function
is a prvalue of non-class type, use the cv-unqualified type.
2019-03-25 Nathan Sidwell <nathan@acm.org>
* lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group.
2019-03-22 Jakub Jelinek <jakub@redhat.com>
PR c++/60702
* cp-tree.h (get_tls_wrapper_fn): Remove declaration.
(maybe_get_tls_wrapper_call): Declare.
* decl2.c (get_tls_wrapper_fn): Make static.
(maybe_get_tls_wrapper_call): New function.
* typeck.c (build_class_member_access_expr): Handle accesses to TLS
variables.
* semantics.c (finish_qualified_id_expr): Likewise.
(finish_id_expression_1): Use maybe_get_tls_wrapper_call.
* pt.c (tsubst_copy_and_build): Likewise.
PR c++/87481
* constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member.
(cxx_eval_constant_expression): When not skipping, not constant class
or location wrapper, increment *ctx->constexpr_ops_count and if it is
above constexpr_loop_nest_limit, diagnose failure.
(cxx_eval_outermost_constant_expr): Add constexpr_ops_count and
initialize ctx.constexpr_ops_count to its address.
(is_sub_constant_expr): Likewise.
2019-03-21 Jakub Jelinek <jakub@redhat.com>
PR c++/71446
* call.c (filed_in_pset): Change pset from hash_set<tree> * to
hash_set<tree, true> &, adjust uses accordingly.
(build_aggr_conv): Change pset from hash_set<tree> *
to hash_set<tree, true>. Replace goto fail; with return NULL;,
adjust pset uses.
PR c++/89767
* parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
variables, check for duplicates in this function.
* lambda.c (add_capture): Don't check for duplicates nor use
IDENTIFIER_MARKED.
(register_capture_members): Don't clear IDENTIFIER_MARKED here.
2019-03-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/89571
* method.c (after_nsdmi_defaulted_late_checks): Avoid passing
error_mark_node to comp_except_specs.
2019-03-20 Jason Merrill <jason@redhat.com>
PR c++/87480 - decltype of member access in default template arg
* pt.c (type_unification_real): Accept a dependent result in
template context.
2019-03-19 Martin Sebor <msebor@redhat.com>
PR tree-optimization/89688
* typeck2.c (store_init_value): Call braced_lists_to_string for more
kinds of initializers.
2019-03-18 Jason Merrill <jason@redhat.com>
PR c++/89630 - ICE with dependent using-decl as template arg.
* tree.c (cp_tree_equal): Always return false for USING_DECL.
PR c++/89761 - ICE with sizeof... in pack expansion.
* pt.c (argument_pack_element_is_expansion_p): Handle
ARGUMENT_PACK_SELECT.
PR c++/89640 - GNU attributes on lambda.
* parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes.
PR c++/89682 - wrong access error in default argument.
* pt.c (tsubst_default_argument): Don't defer access checks.
2019-03-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/85014
* semantics.c (finish_non_static_data_member): Check return value
of context_for_name_lookup and immediately return error_mark_node
if isn't a type.
2019-03-17 Jason Merrill <jason@redhat.com>
PR c++/89571 - ICE with ill-formed noexcept on constructor.
* pt.c (maybe_instantiate_noexcept): Only return false if defaulted.
(regenerate_decl_from_template): Use it for noexcept-specs.
2019-03-14 Jason Merrill <jason@redhat.com>
* parser.c (cp_parser_decl_specifier_seq): Support C++20
concept-definition syntax without 'bool'.
2019-03-14 Jakub Jelinek <jakub@redhat.com>
PR c++/89512
* semantics.c (finish_qualified_id_expr): Reject variable templates.
PR c++/89652
* constexpr.c (struct constexpr_ctx): Change save_exprs type from
hash_set<tree> to vec<tree>.
(cxx_eval_call_expression): Adjust for save_exprs being a vec instead
of hash_set.
(cxx_eval_loop_expr): Likewise. Truncate the vector after each
removal of SAVE_EXPRs from values.
(cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
method on save_exprs instead of add.
2019-03-13 Jason Merrill <jason@redhat.com>
PR c++/86521 - C++17 copy elision in initialization by constructor.
* call.c (joust_maybe_elide_copy): New.
(joust): Call it.
2019-03-13 Marek Polacek <polacek@redhat.com>
PR c++/88979 - further P0634 fix for constructors.
* parser.c (cp_parser_decl_specifier_seq): Pass flags to
cp_parser_constructor_declarator_p.
(cp_parser_direct_declarator): Allow missing typename for constructor
parameters.
(cp_parser_constructor_declarator_p): Add FLAGS parameter. Pass it to
cp_parser_type_specifier.
PR c++/89686 - mixing init-capture and simple-capture in lambda.
* parser.c (cp_parser_lambda_introducer): Give error when combining
init-capture and simple-capture.
PR c++/89660 - bogus error with -Wredundant-move.
* typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg
as the std::move's argument. Don't call convert_for_initialization
when warn_redundant_move isn't on.
2019-03-11 Jason Merrill <jason@redhat.com>
PR c++/86521 - wrong overload resolution with ref-qualifiers.
* call.c (build_user_type_conversion_1): Don't use a conversion to a
reference of the wrong rvalueness for direct binding.
2019-03-11 Martin Liska <mliska@suse.cz>
* cvt.c (build_expr_type_conversion): Wrap apostrophes
in gcc internal format with %'.
* decl.c (check_no_redeclaration_friend_default_args): Likewise.
(grokfndecl): Likewise.
* name-lookup.c (do_pushtag): Likewise.
* pt.c (unify_parameter_deduction_failure): Likewise.
(unify_template_deduction_failure): Likewise.
2019-03-11 Martin Liska <mliska@suse.cz>
* call.c (convert_arg_to_ellipsis): Wrap an option name
in a string format message and fix GNU coding style.
(build_over_call): Likewise.
* class.c (check_field_decl): Likewise.
(layout_nonempty_base_or_field): Likewise.
* constexpr.c (cxx_eval_loop_expr): Likewise.
* cvt.c (type_promotes_to): Likewise.
* decl.c (cxx_init_decl_processing): Likewise.
(mark_inline_variable): Likewise.
(grokdeclarator): Likewise.
* decl2.c (record_mangling): Likewise.
* error.c (maybe_warn_cpp0x): Likewise.
* except.c (doing_eh): Likewise.
* mangle.c (maybe_check_abi_tags): Likewise.
* parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
(cp_parser_userdef_numeric_literal): Likewise.
(cp_parser_primary_expression): Likewise.
(cp_parser_unqualified_id): Likewise.
(cp_parser_pseudo_destructor_name): Likewise.
(cp_parser_builtin_offsetof): Likewise.
(cp_parser_lambda_expression): Likewise.
(cp_parser_lambda_introducer): Likewise.
(cp_parser_lambda_declarator_opt): Likewise.
(cp_parser_selection_statement): Likewise.
(cp_parser_init_statement): Likewise.
(cp_parser_decomposition_declaration): Likewise.
(cp_parser_function_specifier_opt): Likewise.
(cp_parser_static_assert): Likewise.
(cp_parser_simple_type_specifier): Likewise.
(cp_parser_namespace_definition): Likewise.
(cp_parser_using_declaration): Likewise.
(cp_parser_ctor_initializer_opt_and_function_body): Likewise.
(cp_parser_initializer_list): Likewise.
(cp_parser_type_parameter_key): Likewise.
(cp_parser_member_declaration): Likewise.
(cp_parser_try_block): Likewise.
(cp_parser_std_attribute_spec): Likewise.
(cp_parser_requires_clause_opt): Likewise.
* pt.c (check_template_variable): Likewise.
(check_default_tmpl_args): Likewise.
(push_tinst_level_loc): Likewise.
(instantiate_pending_templates): Likewise.
(invalid_nontype_parm_type_p): Likewise.
* repo.c (get_base_filename): Likewise.
* rtti.c (typeid_ok_p): Likewise.
(build_dynamic_cast_1): Likewise.
* tree.c (maybe_warn_parm_abi): Likewise.
2019-03-08 Jakub Jelinek <jakub@redhat.com>
PR other/80058
* parser.c (cp_parser_template_declaration_after_parameters): Avoid
one space before " at the end of line and another after " on another
line in a string literal.
PR tree-optimization/89550
* semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if
warning_at returned true.
* decl2.c (c_parse_final_cleanups): Likewise.
* typeck.c (convert_for_assignment): Likewise.
* decl.c (finish_function): Likewise.
PR c++/89585
* parser.c (cp_parser_asm_definition): Just warn instead of error
on volatile qualifier outside of function body.
PR c++/89599
* constexpr.c (potential_constant_expression_1): Reject
REINTERPRET_CAST_P NOP_EXPRs.
PR c++/89622
* call.c (joust): Call print_z_candidate only if pedwarn returned
true.
2019-03-07 Jason Merrill <jason@redhat.com>
PR c++/88123 - lambda and using-directive.
* name-lookup.c (op_unqualified_lookup)
(maybe_save_operator_binding, discard_operator_bindings)
(push_operator_bindings): New.
* typeck.c (build_x_binary_op, build_x_unary_op): Call
maybe_save_operator_binding.
* decl.c (start_preparsed_function): Call push_operator_bindings.
* tree.c (cp_free_lang_data): Call discard_operator_bindings.
PR c++/88820 - ICE with CTAD and member template used in DMI.
* pt.c (do_class_deduction): Handle parm used as its own arg.
2019-03-07 Jakub Jelinek <jakub@redhat.com>
PR c++/89585
* parser.c (cp_parser_asm_definition): Parse asm qualifiers even
at toplevel, but diagnose them.
2019-03-06 Jason Merrill <jason@redhat.com>
PR c++/89381 - implicit copy and using-declaration.
* class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider
op= brought in by a using-declaration.
2019-03-06 Jakub Jelinek <jakub@redhat.com>
PR c++/87148
* init.c (build_value_init_noctor): Ignore flexible array members.
2019-03-06 Jason Merrill <jason@redhat.com>
PR c++/89576 - if constexpr of lambda capture.
* semantics.c (maybe_convert_cond): Do convert a non-dependent
condition in a template.
* typeck.c (condition_conversion): Handle being called in a
template.
2019-03-06 Marek Polacek <polacek@redhat.com>
PR c++/87378 - bogus -Wredundant-move warning.
* typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue
overload resolution would actually succeed.
2019-03-05 Jason Merrill <jason@redhat.com>
* class.c (is_really_empty_class): Add ignore_vptr parm.
(trivial_default_constructor_is_constexpr): Pass it.
* call.c (build_over_call): Pass it.
* constexpr.c (cxx_eval_constant_expression): Pass it instead of
checking TYPE_POLYMORPHIC_P.
(cxx_eval_component_reference, potential_constant_expression_1):
Pass it.
* cp-gimplify.c (simple_empty_class_p): Pass it.
* init.c (expand_aggr_init_1): Pass it.
2019-03-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84605
* parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too.
2019-03-04 Jakub Jelinek <jakub@redhat.com>
PR c++/71446
* call.c (field_in_pset): New function.
(build_aggr_conv): Handle CONSTRUCTOR_IS_DESIGNATED_INIT correctly.
2019-03-02 Jakub Jelinek <jakub@redhat.com>
PR c++/71446
* cp-tree.h (CONSTRUCTOR_IS_DESIGNATED_INIT): Define.
* parser.c (cp_parser_braced_list): Adjust cp_parser_initializer_list
caller, set CONSTRUCTOR_IS_DESIGNATED_INIT.
(cp_parser_initializer_list): Add designated parameter, set *designated
to a bool whether any designators were parsed.
* decl.c (reshape_init): Copy over CONSTRUCTOR_IS_DESIGNATED_INIT if
needed.
* pt.c (tsubst_copy_and_build): Likewise.
* call.c (implicit_conversion): If CONSTRUCTOR_IS_DESIGNATED_INIT,
don't call build_list_conv, nor build_complex_conv, nor attempt to
convert a single element initializer to scalar.
2019-03-01 Marek Polacek <polacek@redhat.com>
PR c++/89537 - missing location for error with non-static member fn.
* call.c (resolve_args): Use EXPR_LOCATION.
* typeck.c (build_class_member_access_expr): Use input_location.
PR c++/89532 - ICE with incomplete type in decltype.
* semantics.c (finish_compound_literal): Return error_mark_node
if digest_init_flags returns error_mark_node.
2019-03-01 Jakub Jelinek <jakub@redhat.com>
Implement P1002R1, Try-catch blocks in constexpr functions
PR c++/89513
* parser.c (cp_parser_ctor_initializer_opt_and_function_body):
Diagnose constexpr ctor or function with function-try-block with
pedwarn for c++17 and earlier. Formatting fix.
(cp_parser_try_block): Use pedwarn instead of error and only for
c++17 and earlier when try block appears in constexpr function.
* constexpr.c (build_constexpr_constructor_member_initializers):
Handle TRY_BLOCK here instead of erroring on it.
2019-02-28 Jason Merrill <jason@redhat.com>
PR c++/88183 - ICE with .* fold-expression.
* pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling.
PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
* class.c, lambda.c, pt.c: Revert earlier change.
* lambda.c (add_capture): Don't special-case capture of dependent
VLA.
* name-lookup.c (print_binding_level): Print this_entity.
2019-02-27 Marek Polacek <polacek@redhat.com>
PR c++/88857 - ICE with value-initialization of argument in template.
* call.c (convert_like_real): Don't call build_value_init in template.
2019-02-27 Jason Merrill <jason@redhat.com>
PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
* semantics.c (process_outer_var_ref): Do capture dependent vars.
* class.c (finish_struct): Only add TAG_DEFN if T is in
current_function_decl.
* lambda.c (vla_capture_type): Force the capture type out into the
lambda's enclosing function.
(add_capture): Pass in the lambda.
* pt.c (tsubst_lambda_expr): complete_type a VLA capture type.
2019-02-27 Marek Polacek <polacek@redhat.com>
PR c++/89511 - ICE with using-declaration and unscoped enumerator.
* parser.c (cp_parser_using_declaration): For an unscoped enum
only use its context if it's not a function declaration.
2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/89488
* method.c (process_subob_fn): When maybe_instantiate_noexcept
returns false don't call merge_exception_specifiers.
2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/88987
* parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE
for a non-constant parsed expression.
2019-02-26 Jakub Jelinek <jakub@redhat.com>
PR c++/89481
* constexpr.c (cxx_eval_store_expression): When changing active union
member, set no_zero_init.
2019-02-23 Marek Polacek <polacek@redhat.com>
PR c++/88294 - ICE with non-constant noexcept-specifier.
* pt.c (maybe_instantiate_noexcept): Set up the list of local
specializations. Set current_class_{ptr,ref}.
2019-02-22 David Malcolm <dmalcolm@redhat.com>
PR c++/89390
* parser.c (cp_parser_unqualified_id): Capture and use locations
for destructors.
2019-02-22 Marek Polacek <polacek@redhat.com>
PR c++/89420 - ICE with CAST_EXPR in explicit-specifier.
* decl.c (build_explicit_specifier): Don't check
processing_template_decl. Call instantiation_dependent_expression_p
instead of value_dependent_expression_p. Call
instantiate_non_dependent_expr_sfinae before
build_converted_constant_expr instead of calling
instantiate_non_dependent_expr after it. Add
processing_template_decl_sentinel.
2019-02-22 Thomas Schwinge <thomas@codesourcery.com>
* parser.c (cp_parser_oacc_simple_clause): Remove parser formal
parameter, move loc formal parameter to the front. Adjust all
users.
(cp_parser_oacc_shape_clause): Add loc formal parameter. Adjust
all users.
2019-02-21 Jason Merrill <jason@redhat.com>
PR c++/87685 - generic lambda 'this' capture error.
* lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
(maybe_generic_this_capture): Pass -1.
PR c++/88394 - ICE with VLA init-capture.
* lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.
PR c++/88869 - C++17 ICE with CTAD and explicit specialization.
* pt.c (do_class_deduction): Don't include explicit specialization
args in outer_args.
PR c++/89422 - ICE with -g and lambda in default arg in template.
* pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.
2019-02-21 Jason Merrill <jason@redhat.com>
PR c++/88419 - C++17 ICE with class template arg deduction.
* pt.c (make_template_placeholder): Set TYPE_CANONICAL after
CLASS_PLACEHOLDER_TEMPLATE.
2019-02-21 Jakub Jelinek <jakub@redhat.com>
PR c++/89285
* constexpr.c (struct constexpr_fundef): Add parms and result members.
(retrieve_constexpr_fundef): Adjust for the above change.
(register_constexpr_fundef): Save constexpr body with copy_fn,
temporarily set DECL_CONTEXT on DECL_RESULT before that.
(get_fundef_copy): Change FUN argument to FUNDEF with
constexpr_fundef * type, grab body and parms/result out of
constexpr_fundef struct and temporarily change it for copy_fn calls
too.
(cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily
adjust current_function_decl from ctx->call context. Test
!potential_constant_expression instead of !is_constant_expression.
(cxx_bind_parameters_in_call): Grab parameters from new_call. Undo
convert_for_arg_passing changes for TREE_ADDRESSABLE type passing.
(cxx_eval_call_expression): Adjust get_fundef_copy caller.
(cxx_eval_conditional_expression): For IF_STMT, allow then or else
operands to be NULL.
(label_matches): Handle BREAK_STMT and CONTINUE_STMT.
(cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT.
(cxx_eval_switch_expr): Add support for SWITCH_STMT.
(cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT,
DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT.
For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr. Ignore
DECL_EXPR with USING_DECL operand.
* lambda.c (maybe_add_lambda_conv_op): Build thisarg using
build_int_cst to make it a valid constant expression.
2019-02-20 Jason Merrill <jason@redhat.com>
PR c++/88690 - C++17 ICE with empty base in aggregate.
* typeck2.c (process_init_constructor_record): Skip trivial
initialization of an empty base.
2019-02-21 Richard Biener <rguenther@suse.de>
PR middle-end/89392
* vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
make symtab process new functions here.
2019-02-20 Jason Merrill <jason@redhat.com>
PR c++/87921 - wrong error with inline static data member.
* decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P
for a non-template inline variable. Do nothing for an
already-instantiated variable.
(c_parse_final_cleanups): Check DECL_IN_AGGR_P without
DECL_INLINE_VAR_P.
* decl.c (check_initializer): Likewise.
(make_rtl_for_nonlocal_decl): Likewise.
* pt.c (instantiate_decl): Likewise.
* typeck2.c (store_init_value): Likewise.
2019-02-20 Jakub Jelinek <jakub@redhat.com>
PR c++/89403
* decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
for flag_syntax_only from here...
* semantics.c (expand_or_defer_fn_1): ... here.
PR c++/89405
* decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
DECL_COMMON, set DECL_INTERFACE_KNOWN.
PR c++/89336
* constexpr.c (cxx_eval_store_expression): Diagnose changing of active
union member for -std=c++17 and earlier.
2019-02-19 Jason Merrill <jason@redhat.com>
PR c++/87513 - 'sorry' mangling PMF template-id.
* mangle.c (write_expression): Handle SCOPE_REF to BASELINK.
2019-02-19 Jason Merrill <jason@redhat.com>
PR c++/88380 - wrong-code with flexible array and NSDMI.
* typeck2.c (process_init_constructor_record): Skip flexarrays.
2019-02-20 will wray <wjwray@gmail.com>
PR c++/88572 - wrong handling of braces on scalar init.
* decl.c (reshape_init_r): Allow braces around scalar initializer
within aggregate init. Reject double braced-init of scalar
variable.
2019-02-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84536
* pt.c (tsubst_init): Diagnose an initializer expanding to an
empty list of expressions; tweak wrt dependent types.
(regenerate_decl_from_template): For VAR_DECLs call tsubst_init
instead of tsubst_expr.
2019-02-19 Jason Merrill <jason@redhat.com>
PR c++/88368 - wrong 'use of deleted function'
* method.c (walk_field_subobs): Remember errors from get_nsdmi.
(get_defaulted_eh_spec): Call push_tinst_level.
* pt.c (maybe_instantiate_noexcept): Keep error_mark_node.
* typeck2.c (merge_exception_specifiers): Handle error_mark_node.
2019-02-19 Chung-Lin Tang <cltang@codesourcery.com>
PR c/87924
* parser.c (cp_parser_oacc_clause_wait): Add representation of wait
clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
2019-02-19 Jakub Jelinek <jakub@redhat.com>
PR c++/89387
* lambda.c (maybe_generic_this_capture): Don't check
DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs.
PR c++/89391
* typeck.c (build_reinterpret_cast_1): Don't handle void to
&& conversion go through build_target_expr_with_type.
PR c++/89390
* error.c (qualified_name_lookup_error): Only call
suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE.
2019-02-19 Tom Honermann <tom@honermann.net>
* name-lookup.c (get_std_name_hint): Added u8string as a name hint.
2019-02-18 Jason Merrill <jason@redhat.com>
PR c++/89336 - multiple stores in constexpr stmt.
* constexpr.c (cxx_eval_store_expression): Preevaluate scalar or
assigned value.
* pt.c (check_explicit_specialization): If the declarator is a
template-id, only check whether the arguments are dependent.
Improve duplicate [[likely]] diagnostic.
* parser.c (cp_parser_statement): Make attrs_loc a range. Pass it
to process_stmt_hotness_attribute.
* cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc.
(genericize_if_stmt): Use likely/unlikely instead of predictor_name.
2019-02-17 Marek Polacek <polacek@redhat.com>
PR c++/89217 - ICE with list-initialization in range-based for loop.
* constexpr.c (unshare_constructor): No longer static.
* cp-tree.h (unshare_constructor): Declare.
* semantics.c (finish_compound_literal): When dealing with a
non-dependent expression in a template, return the original
expression. Pass LOOKUP_NO_NARROWING to digest_init_flags.
2019-02-13 Marek Polacek <polacek@redhat.com>
PR c++/89297 - ICE with OVERLOAD in template.
* semantics.c (finish_compound_literal): Call
instantiate_non_dependent_expr_sfinae.
2019-02-13 Alexandre Oliva <aoliva@redhat.com>
PR c++/86379
* cp-tree.h (USING_DECL_SCOPE): Use result rather than type.
* name-lookup.c (strip_using_decl): Use USING_DECL_SCOPE.
* search.c (protected_accessible_p): Follow USING_DECL_DECLS.
(shared_member_p): Likewise.
(lookup_member): Likewise.
* decl.c (grok_special_member_properties): Skip USING_DECLs.
* semantics.c (finish_omp_declare_simd_methods): Likewise.
(finish_qualified_id_expr): Do not call shared_member_p with
a dependent expr.
PR c++/87322
* pt.c (tsubst_lambda_expr): Avoid duplicate tsubsting.
Move cp_evaluated resetting before signature tsubsting.
(gen_elem_of_pack_expansion_instantiation): Separate local
specializations per index.
2019-02-13 David Malcolm <dmalcolm@redhat.com>
PR c++/89036
* class.c (add_method): Drop destructor assertion.
2019-02-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/88986
* decl.c (make_typename_type): Allow for TYPE_PACK_EXPANSION as
context (the first argument).
* pt.c (tsubst, case TYPENAME_TYPE): Handle TYPE_PACK_EXPANSION
as context.
2019-02-12 Jason Merrill <jason@redhat.com>
PR c++/89144 - link error with constexpr initializer_list.
* call.c (convert_like_real) [ck_list]: Don't allocate a temporary
array for an empty list.
* typeck2.c (store_init_value): Don't use cxx_constant_init in a
template.
2019-02-11 Jason Merrill <jason@redhat.com>
PR c++/89241 - ICE with __func__ in lambda in template.
* pt.c (enclosing_instantiation_of): Also check
instantiated_lambda_fn_p for the template context.
2019-02-11 Marek Polacek <polacek@redhat.com>
PR c++/89212 - ICE converting nullptr to pointer-to-member-function.
* pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for
null member pointer value.
2019-02-11 Jakub Jelinek <jakub@redhat.com>
PR c++/88977
* pt.c (convert_nontype_argument): Pass true as manifestly_const_eval
to maybe_constant_value calls.
2019-02-11 Marek Polacek <polacek@redhat.com>
* typeck2.c (digest_init_r): Remove commented code.
2019-02-11 Martin Sebor <msebor@redhat.com>
PR c++/87996
* decl.c (compute_array_index_type_loc): Preserve signed sizes
for diagnostics. Call valid_array_size_p instead of error.
* init.c (build_new_1): Compute size for diagnostic. Call
invalid_array_size_error
(build_new): Call valid_array_size_p instead of error.
2019-02-07 Alexandre Oliva <aoliva@redhat.com>
PR c++/86218
* call.c (compare_ics): Deal with ck_aggr in either cs.
2019-02-06 David Malcolm <dmalcolm@redhat.com>
PR c++/71302
* call.c (get_location_for_expr_unwinding_for_system_header): New
function.
(conversion_null_warnings): Use it when getting locations for
EXPR, effectively adding a call to
get_location_for_expr_unwinding_for_system_header for
-Wconversion-null and making use of EXPR_LOCATION for
-Wzero-as-null-pointer-constant.
2019-02-05 Jakub Jelinek <jakub@redhat.com>
PR c++/89187
* optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
PARM_DECLs of the thunk.
* lambda.c (maybe_add_lambda_conv_op): Likewise.
2019-02-05 Marek Polacek <polacek@redhat.com>
PR c++/89158 - by-value capture of constexpr variable broken.
* call.c (convert_like_real) <case ck_user>: Call mark_exp_read
instead of mark_rvalue_use.
2019-02-05 Alexandre Oliva <aoliva@redhat.com>
PR c++/87770
* pt.c (instantiates_primary_template_p): New.
(type_dependent_expression_p): Use it.
2019-02-01 Jason Merrill <jason@redhat.com>
PR c++/88761 - ICE with reference capture of constant.
* lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for
non-proxy decls.
2019-02-01 Marek Polacek <polacek@redhat.com>
PR c++/88325 - ICE with invalid out-of-line template member definition.
* parser.c (cp_parser_class_name): Don't call make_typename_type
for overloads.
2019-02-01 Jakub Jelinek <jakub@redhat.com>
PR c++/87175
* parser.c (cp_parser_gnu_attributes_opt): Set ok to false
if require_open failed.
2019-01-31 Marek Polacek <polacek@redhat.com>
PR c++/89083, c++/80864 - ICE with list initialization in template.
* constexpr.c (adjust_temp_type): Use copy_node and change the type
instead of using build_constructor.
* decl.c (reshape_init_r): Don't reshape a digested initializer.
Return the initializer for COMPOUND_LITERAL_P.
PR c++/88983 - ICE with switch in constexpr function.
* constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY.
(cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the
label in the else branch if we found it in the then branch.
2019-01-30 Jason Merrill <jason@redhat.com>
PR c++/88752 - ICE with lambda and constexpr if.
* cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New.
* pt.c (tsubst_lambda_expr): Set it.
(instantiated_lambda_fn_p): Check it.
(enclosing_instantiation_of): Use it.
2019-01-31 Jakub Jelinek <jakub@redhat.com>
PR libstdc++/88170
* cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as
a C cast in pp_c_flag_gnu_v3 mode.
2019-01-30 Jakub Jelinek <jakub@redhat.com>
PR c++/88988
* lambda.c (is_capture_proxy): Don't return true for
DECL_OMP_PRIVATIZED_MEMBER artificial vars.
2019-01-30 Marek Polacek <polacek@redhat.com>
PR c++/89119 - ICE with value-initialization in template.
* pt.c (tsubst_copy_and_build): Handle RANGE_EXPR.
2019-01-29 Jason Merrill <jason@redhat.com>
PR c++/86943 - wrong code converting lambda to function pointer.
* lambda.c (maybe_add_lambda_conv_op): Use a template-id in the
call. Only forward parms for decltype.
* pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P
specially.
* typeck.c (check_return_expr): Don't mess with a thunk call.
2019-01-28 Jason Merrill <jason@redhat.com>
PR c++/89089 - ICE with [[no_unique_address]].
PR c++/88865 - wrong layout with [[no_unique_address]].
* class.c (check_field_decls): A potentially-overlapping field makes
the class non-layout-POD, but not non-empty.
(end_of_class): Always consider empty data members.
(layout_class_type): Set DECL_SIZE for empty fields.
2019-01-28 Marek Polacek <polacek@redhat.com>
PR c++/88358 - name wrongly treated as type.
* parser.c (cp_parser_direct_declarator): Don't assume a qualified-id
in parameter-list is a type if the function's declarator-id is not
qualified.
2019-01-27 Marek Polacek <polacek@redhat.com>
PR c++/88815 - narrowing conversion lost in decltype.
PR c++/78244 - narrowing conversion in template not detected.
* cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
* pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
* semantics.c (finish_compound_literal): When the compound literal
isn't instantiation-dependent and the type isn't type-dependent,
fall back to the normal processing. Set CONSTRUCTOR_IS_DEPENDENT.
PR c++/89024 - ICE with incomplete enum type.
* call.c (standard_conversion): When converting an
ARITHMETIC_TYPE_P to an incomplete type, return NULL.
2019-01-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/88969
* call.c (build_op_delete_call): Implement 7.6.2.5/(10.1).
* decl2.c (coerce_delete_type): Use build_pointer_type instead
of TYPE_POINTER_TO.
2019-01-24 Jason Merrill <jason@redhat.com>
PR c++/89001 - mangling of reference temporaries
* cp-tree.h (struct saved_scope): Add ref_temp_count.
(current_ref_temp_count): New macro.
* mangle.c (mangle_ref_init_variable): Use it.
* typeck2.c (store_init_value): Clear it.
* call.c (make_temporary_var_for_ref_to_temp): Copy public and
comdat.
2019-01-24 Jakub Jelinek <jakub@redhat.com>
PR c++/88976
* semantics.c (finish_omp_cancel): Diagnose more than one if
on #pragma omp cancel with different modifiers. Use
maybe_convert_cond when not in template or build_x_binary_op
otherwise.
2019-01-23 Marek Polacek <polacek@redhat.com>
PR c++/88757 - qualified name treated wrongly as type.
* parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
in parameter-list as types if name lookup for declarator-id didn't
find one or more function templates.
2019-01-23 Jakub Jelinek <jakub@redhat.com>
PR c/44715
* cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
after genericizing cond and incr expressions.
PR c++/88984
* cp-gimplify.c (genericize_switch_stmt): Move cond genericization
before the begin_bc_block call.
2019-01-21 Jason Merrill <jason@redhat.com>
PR c++/87893 - constexpr ctor ICE on ARM.
PR c++/88293 - ICE with comma expression.
* constexpr.c (initialized_type): Don't shortcut non-void type.
Handle COMPOUND_EXPR.
(cxx_eval_outermost_constant_expr): Return early for void type.
2019-01-21 Jakub Jelinek <jakub@redhat.com>
PR c++/88949
* optimize.c (cxx_copy_decl): New function.
(clone_body): Use it instead of copy_decl_no_change.
PR sanitizer/88901
* typeck.c (cp_build_binary_op): Don't instrument
SANITIZE_POINTER_COMPARE if processing_template_decl.
(pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
2019-01-18 Jason Merrill <jason@redhat.com>
PR c++/88875 - error with explicit list constructor.
* call.c (reference_binding): Don't modify EXPR. Set
need_temporary_p on the ck_user conversion for a temporary.
(convert_like_real): Check it.
2019-01-18 H.J. Lu <hongjiu.lu@intel.com>
PR c/51628
PR c/88664
* call.c (convert_for_arg_passing): Upate the
warn_for_address_or_pointer_of_packed_member call.
* typeck.c (convert_for_assignment): Likewise.
2019-01-17 Jason Merrill <jason@redhat.com>
PR c++/86205 - ICE with ?: of throw and template-id.
* pt.c (resolve_nondeduced_context_or_error): Split out from...
* typeck.c (decay_conversion): ...here.
* call.c (build_conditional_expr_1): Use it.
PR c++/86740, ICE with constexpr if and nested generic lambdas.
* tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
2019-01-17 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Use typespec_loc in error messages
about 'auto' and trailing return type.
2019-01-17 David Malcolm <dmalcolm@redhat.com>
PR c++/88699
* class.c (add_method): Don't use DECL_DESTRUCTOR_P on
USING_DECLs.
2019-01-17 Nathan Sidwell <nathan@acm.org>
PR c++/86610
* semantics.c (process_outer_var_ref): Only skip dependent types
in templates.
2019-01-17 Alexandre Oliva <aoliva@redhat.com>
PR c++/87768
* cp-tree.h (saved_scope): Add suppress_location_wrappers.
* name-lookup.c (do_push_to_top_level): Save and reset it.
(do_pop_from_top_level): Restore it.
PR c++/86648
* pt.c (make_template_placeholder): Use auto_identifier.
(is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
* error.c (dump_type): Handle template placeholders.
* cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
PR c++/88146
* cvt.c (convert_to_void): Handle all cdtor calls as if
returning void.
2019-01-16 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Use locations[ds_storage_class] in
error messages about ill-formed uses of mutable.
2019-01-16 Marek Polacek <polacek@redhat.com>
PR c++/78244 - narrowing conversion in template not detected.
* call.c (perform_implicit_conversion_flags): Set
IMPLICIT_CONV_EXPR_BRACED_INIT.
* cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
* pt.c (tsubst_copy_and_build): Use it.
2019-01-15 David Malcolm <dmalcolm@redhat.com>
PR c++/88795
* pt.c (build_deduction_guide): Bail out if tsubst_arg_types
fails.
2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (start_decl): Improve error location.
* decl2.c (grokfield): Likewise.
2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Move further up the location_t loc
declaration and use the location when building a TYPE_DECL for
a typedef name.
* decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
about an ill-formed bit-field as typedef.
2019-01-14 Marek Polacek <polacek@redhat.com>
PR c++/88830 - ICE with abstract class.
* decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
Fix formatting.
PR c++/88825 - ICE with bogus function return type deduction.
* typeck.c (can_do_nrvo_p): Check error_mark_node.
2019-01-14 Tom Honermann <tom@honermann.net>
Implement P0482R5, char8_t: A type for UTF-8 characters and strings
* cvt.c (type_promotes_to): Handle char8_t promotion.
* decl.c (grokdeclarator): Handle invalid type specifier
combinations involving char8_t.
* lex.c (init_reswords): Add char8_t as a reserved word.
* mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
* parser.c (cp_keyword_starts_decl_specifier_p)
(cp_parser_simple_type_specifier): Recognize char8_t as a simple
type specifier.
(cp_parser_string_literal): Use char8_array_type_node for the type
of CPP_UTF8STRING.
(cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
headers.
* rtti.c (emit_support_tinfos): type_info support for char8_t.
* tree.c (char_type_p): Recognize char8_t as a character type.
* typeck.c (string_conv_p): Handle conversions of u8 string
literals of char8_t type.
(check_literal_operator_args): Handle UDLs with u8 string literals
of char8_t type.
* typeck2.c (ordinary_char_type_p): New.
(digest_init_r): Disallow initializing a char array with a u8 string
literal.
2019-01-14 Martin Liska <mliska@suse.cz>
PR gcov-profile/88263
* decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
as location of the TLS wrapper.
2019-01-12 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (cp_finish_decl): Improve error location.
* decl2.c (grokfield): Likewise, improve two locations.
2019-01-11 Marek Polacek <polacek@redhat.com>
PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
* typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
ADDR_EXPR.
2019-01-11 Jason Merrill <jason@redhat.com>
PR c++/88312 - pack expansion of decltype.
* pt.c (instantiation_dependent_r): A template non-type parameter
pack is instantiation-dependent.
2019-01-11 Jason Merrill <jason@redhat.com>
PR c++/88613 - ICE with use of const var in lambda.
* expr.c (mark_use): Fix location wrapper handling.
* cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
2019-01-11 Tobias Burnus <burnus@net-b.de>
PR C++/88114
* decl2.c (maybe_emit_vtables): If needed, generate code for
the destructor of an abstract class.
(mark_used): Update comment for older function-name change.
2019-01-11 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (start_decl): Improve error location.
(grokdeclarator): Likewise, improve two locations.
2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
PR other/16615
* cp-tree.h: Mechanically replace "can not" with "cannot".
* parser.c: Likewise.
* pt.c: Likewise.
2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grok_reference_init): Improve error location.
(grokdeclarator): Likewise, improve two locations.
2019-01-08 Marek Polacek <polacek@redhat.com>
PR c++/88538 - braced-init-list in template-argument-list.
* parser.c (cp_parser_template_argument): Handle braced-init-list when
in C++20.
PR c++/88548 - this accepted in static member functions.
* parser.c (cp_debug_parser): Adjust printing of
local_variables_forbidden_p.
(cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
(cp_parser_primary_expression): When checking
local_variables_forbidden_p, use THIS_FORBIDDEN or
LOCAL_VARS_FORBIDDEN.
(cp_parser_lambda_body): Update the type of
local_variables_forbidden_p. Set it to 0 rather than false.
(cp_parser_condition): Adjust call to cp_parser_declarator.
(cp_parser_explicit_instantiation): Likewise.
(cp_parser_init_declarator): Likewise.
(cp_parser_declarator): New parameter. Use it.
(cp_parser_direct_declarator): New parameter. Use it to set
local_variables_forbidden_p. Adjust call to cp_parser_declarator.
(cp_parser_type_id_1): Adjust call to cp_parser_declarator.
(cp_parser_parameter_declaration): Likewise.
(cp_parser_default_argument): Update the type of
local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
rather than true.
(cp_parser_member_declaration): Tell cp_parser_declarator if we saw
'static' or 'friend'.
(cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
(cp_parser_late_parsing_default_args): Update the type of
local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
rather than true.
(cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
(cp_parser_objc_class_ivars): Likewise.
(cp_parser_objc_struct_declaration): Likewise.
(cp_parser_omp_for_loop_init): Likewise.
* parser.h (cp_parser): Change the type of local_variables_forbidden_p
to unsigned char.
(LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
Define.
2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (start_decl): Improve permerror location.
2019-01-08 Jonathan Wakely <jwakely@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR c++/88554
* decl.c (finish_function): For -Wreturn-type don't add a return *this;
fixit hint if current_class_ref is NULL. Use a single if instead of
two nested ones.
2019-01-07 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (start_decl): Improve two error_at locations.
(expand_static_init): Likewise.
2019-01-07 Marek Polacek <polacek@redhat.com>
PR c++/88741 - wrong error with initializer-string.
* decl.c (cp_complete_array_type): Strip any location wrappers.
2019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/88261
PR c++/69338
PR c++/69696
PR c++/69697
* cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
* typeck2.c (digest_init_r): Raise an error for non-static
initialization of a flexible array member.
(process_init_constructor, massage_init_elt,
process_init_constructor_array, process_init_constructor_record,
process_init_constructor_union, process_init_constructor): Add the
flags parameter and pass it thru.
(store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
digest_init_flags for static decls.
2019-01-07 Jakub Jelinek <jakub@redhat.com>
PR c++/85052
* cp-tree.h (cp_build_vec_convert): Declare.
* parser.c (cp_parser_postfix_expression): Parse
__builtin_convertvector.
* constexpr.c: Include fold-const-call.h.
(cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
(potential_constant_expression_1): Likewise.
* semantics.c (cp_build_vec_convert): New function.
* pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
IFN_VEC_CONVERT.
2019-01-03 Jakub Jelinek <jakub@redhat.com>
PR c++/88636
* decl.c (builtin_function_1): Return result of pushdecl_top_level
or pushdecl rather than decl.
2019-01-03 Paolo Carlini <paolo.carlini@oracle.com>
* tree.c (handle_nodiscard_attribute): Improve warning location.
2019-01-02 Marek Polacek <polacek@redhat.com>
PR c++/88612 - ICE with -Waddress-of-packed-member.
* call.c (convert_for_arg_passing): Only give warnings with tf_warning.
* typeck.c (convert_for_assignment): Likewise.
PR c++/88631 - CTAD failing for value-initialization.
* typeck2.c (build_functional_cast): Try deducing the template
arguments even if there are no arguments to deduce from.
2019-01-01 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
Copyright (C) 2019 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.
|