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
|
2017-06-11 Jason Merrill <jason@redhat.com>
* cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
id_equal.
2017-06-09 Jason Merrill <jason@redhat.com>
Missing bits from N4268, constant evaluation for all non-type args.
* call.c (build_converted_constant_expr): Rename from
build_integral_nontype_arg_conv, handle all types.
* pt.c (convert_nontype_argument): In C++17 call it for all types.
Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
* cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
Overhaul pointer-to-member conversion and template argument handling.
* call.c (standard_conversion): Avoid creating ck_pmem when the
class type is the same.
* cvt.c (can_convert_qual): Split from
perform_qualification_conversions.
* constexpr.c (cxx_eval_constant_expression): Check it.
* typeck.c (convert_ptrmem): Only cplus_expand_constant if
adjustment is necessary.
* pt.c (check_valid_ptrmem_cst_expr): Compare class types.
(convert_nontype_argument): Avoid redundant error.
* call.c (convert_like_real): Remove "inner" parameter.
Don't replace a constant with its value.
* cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
* pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
nullptr_node.
* parser.c (cp_parser_constant_expression): Check
potential_rvalue_constant_expression after decay_conversion.
* pt.c (convert_nontype_argument): Don't require linkage in C++17.
PR c++/80384 - ICE with dependent noexcept-specifier
* pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
noexcept-specifier.
* constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2017-06-09 Jan Hubicka <hubicka@ucw.cz>
* class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
* decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
(excpet.c): Mark terminate as cold.
2017-06-08 Jakub Jelinek <jakub@redhat.com>
PR c/81006
* semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
to sizetype before size_binop.
PR c++/81011
* cp-gimplify.c (cxx_omp_finish_clause): When changing clause
to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
and OMP_CLAUSE_SHARED_READONLY flags.
2017-06-08 Jan Hubicka <hubicka@ucw.cz>
* cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
2017-06-07 Nathan Sidwell <nathan@acm.org>
* class.c (layout_class_type): Restructure overlong-bitfield tpe
search.
2017-06-07 Jonathan Wakely <jwakely@redhat.com>
PR c++/80990
* pt.c (do_class_deduction): Build qualified type.
2017-06-06 Nathan Sidwell <nathan@acm.org>
* name-lookup.c (suggest_alternatives_for): Use qualified lookup
sans using directives. Don't walk into inline namespaces.
PR c++/80979
* name-lookup.c (adl_class_only): Don't add visible friends.
2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
* parser.c (cp_parser_base_specifier): Fix typos in error messages.
2017-06-02 Nathan Sidwell <nathan@acm.org>
Remove lang_type_ptrmem.
* cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
into ...
(lang_type_class): ... this. Reorder bitfields. Rename to ...
(lang_type): ... this. Delete old definition.
(lang_type_ptrmem): Delete.
(LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
(LANG_TYPE_PTRMEM_CHECK): Delete.
(TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
(TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
* decl.c (build_ptrmemfunc_type): Adjust.
* lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
(maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
* class.c (check_bases_and_members): Adjust vec_new_uses_cookie
setting.
Remove cp_binding_level::namespaces
* name-lookup.h (cp_binding_level): Lose namespaces field.
* name-lookup.c (add_decl_to_level): Chain namespaces on the names
list.
(suggest_alternatives_for): Adjust for namespace list. Do
breadth-first search.
* decl2.c (collect_source_refs): Namespaces are on the regulr
list.
(collect_ada_namespace): Likewise.
2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
* typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
warning.
2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/80812
* method.c (constructible_expr): Strip array types before calling
build_value_init.
2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/80896
* cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
for case INDIRECT_REF too in the main switch.
2017-05-31 Jason Merrill <jason@redhat.com>
PR c++/80840 - ICE with constexpr and reference
* pt.c (convert_nontype_argument): Don't test whether a decl is
value-dependent when binding to a reference.
2017-05-31 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (lang_decl_slector): New enum.
(lang_decl_base): Make selector an enum. Drop decomposition_p
field.
(lang_decl): Use enum for discrimination.
(LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
LANG_DECL_DEOMP_CHECK): Use enum.
(DECL_DECOMPOSITION_P): Use selector value.
(SET_DECL_DECOMPOSITION_P): Delete.
(retrofit_lang_decl): Lose SEL parm.
(fit_decomposition_lang_decl): Declare.
* decl.c (cp_finish_decomp, grokdeclarator): Use
fit_decomposition_lang_decl.
* lex.c (maybe_add_lang_decl_raw): New. Broken out of
retrofit_lang_decl.
(set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
(fit_decomposition_lang_decl): Likewise.
(retrofit_lang_decl): Use worker functions.
(cxx_dup_lang_specific_decl): Use selector enum.
(maybe_add_lang_type_raw): New. Broken out of ...
(cxx_make_type_name): ... here. Call it.
2017-05-30 Jason Merrill <jason@redhat.com>
PR c++/80856 - ICE with local extern in template
* semantics.c (finish_call_expr): Replace a local extern overload
set in a template with the IDENTIFIER_NODE.
2017-05-30 David Malcolm <dmalcolm@redhat.com>
* call.c (perform_implicit_conversion_flags): Convert
"from %qT to %qT" to "from %qH to %qI" in diagnostic.
(print_conversion_rejection): Replace pairs of %qT with
%qH and %qI in various places.
(build_user_type_conversion_1): Likewise.
(build_integral_nontype_arg_conv): Likewise.
(build_conditional_expr_1): Likewise.
(convert_like_real): Likewise.
(convert_arg_to_ellipsis): Likewise.
(joust): Likewise.
(initialize_reference): Likewise.
* cvt.c (cp_convert_to_pointer): Likewise.
(cp_convert_to_pointer): Likewise.
(convert_to_reference): Likewise.
(ocp_convert): Likewise.
* error.c (cp_printer): Gain bool and const char ** parameters.
(struct deferred_printed_type): New struct.
(class cxx_format_postprocessor): New class.
(cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
to pp->m_format_postprocessor.
(comparable_template_types_p): New function.
(newline_and_indent): New function.
(arg_to_string): New function.
(print_nonequal_arg): New function.
(print_template_differences): New function.
(type_to_string_with_compare): New function.
(print_template_tree_comparison): New function.
(append_formatted_chunk): New function.
(add_quotes): New function.
(cxx_format_postprocessor::handle): New function.
(defer_phase_2_of_type_diff): New function.
(cp_printer): Add "quoted" and "buffer_ptr" params. Implement
%H and %I.
* typeck.c (cp_build_binary_op): Replace pairs of %qT with
%qH and %qI in various places.
(convert_member_func_to_ptr): Likewise.
(build_reinterpret_cast_1): Likewise.
(convert_for_assignment): Likewise.
* typeck2.c (check_narrowing): Likewise.
2017-05-30 Nathan Sidwell <nathan@acm.org>
Kill IDENTIFIER_NAMESPACE_BINDINGS
* cp-tree.h (lang_identifier): Delete namespace_bindings.
(IDENTIFIER_NAMESPACE_BINDINGS): Delete.
(lang_decl_ns): Add bindings.
(DECL_NAMESPACE_BINDINGS): New.
* lex.c (retrofit_lang_decl): Create namespace hash table.
* name-lookup.c (find_namespace_slot): Change to use hash-map.
* ptree.c (cxx_print_binding): Delete.
(cxx_print_identifier): Remove NAMESPACE_BINDING printing.
* cp-tree.def (OVERLOAD): Fix comment.
* cp-tree.h: Fix comments and whitespace.
* error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
* name-lookup.c (add_decl_to_level): Assert not class.
(check_local_shadow): Use OVL_P.
(pushdecl_with_scope_1): Rename to ...
(do_pushdecl_with_Scope): ... here.
(do_nonmember_using_decl): Use qualified_namespace_lookup return
value.
(push_class_level_binding_1): Use OVL_P.
(pushdecl_namespace_level): Use do_pushdecl_with_scope.
(pushtag_1): Rename to ...
(do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
(pushtag): Adjust.
(store_class_bindings): Do not time here.
* name-lookup.h (pushdecl_outermost_localscope): Reorder.
* pt.c (listify): Declare argvec at point of initialization.
PR c++/80913
* name-lookup.c (add_decl_to_level): Assert not making a circular
chain.
(update_binding): Don't prematurely slide artificial decl.
2017-05-29 Alexandre Oliva <aoliva@redhat.com>
* cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
2017-05-29 Nathan Sidwell <nathan@acm.org>
PR c++/80891 (#1,#5)
* cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
* name-lookup.c (name_lookup): Add deduping field.
(name_lookup::preserve_state, name_lookup::restore_state): Deal
with deduping.
(name_lookup::add_overload): New.
(name_lookup::add_value, name_lookup::add_fns): Call add_overload.
(name_lookup::search_adl): Set deduping. Don't unmark here.
* pt.c (most_specialized_instantiation): Revert previous change,
Assert not given duplicates.
* tree.c (lookup_mark): Just mark the underlying decls.
(lookup_maybe_add): Dedup using marked decls.
PR c++/80891 (#4)
* ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
* tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
Stat hack representation
* name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
(stat_hack): New.
(find_namespace_binding): Replace with ...
(find_namespace_slot): ... this.
(find_namespace_value): New.
(name_lookup::search_namespace_only,
name_lookup::adl_namespace_only): Adjust.
(update_binding): Add SLOT parameter, adjust.
(check_local_shadow): Use find_namespace_value.
(set_local_extern_decl_linkage): Likewise.
(do_pushdecl): Adjust for namespace slot.
(push_local_binding): Assert not a namespace binding.
(check_for_out_of_scope_variable): Use find_namespace_value.
(set_identifier_type_value_with_scope): Likewise.
(get_namespace_binding): Likewise.
(set_namespace_binding): Delete.
(set_global_binding): Directly update the binding.
(finish_namespace_using_decl): Likewise.
(lookup_type_scope_1): Use find_namespace_slot and update.
(do_push_nested_namespace): Use find_namespace_value.
PR c++/80891 (#1)
* pt.c (most_specialized_instantiation): Cope with duplicate
instantiations.
PR c++/80891 (#3)
* cp-tree.h (build_min_nt_call_vec): Declare.
* decl.c (build_offset_ref_call_from_tree): Call it.
* parser.c (cp_parser_postfix_expression): Likewise.
* pt.c (tsubst_copy_and_build): Likewise.
* semantics.c (finish_call_expr): Likewise.
* tree.c (build_min_nt_loc): Keep unresolved lookups.
(build_min): Likewise.
(build_min_non_dep): Likewise.
(build_min_non_dep_call_vec): Likewise.
(build_min_nt_call_vec): New.
PR c++/80891 (#2)
* tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
(ovl_used): New.
(lookup_keep): Call it.
2017-05-26 Nathan Sidwell <nathan@acm.org>
Implement DR2061
* name-lookup.c (push_inline_namespaces): New.
(push_namespace): Look inside inline namespaces.
Inline and using namespace representation change.
* cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
inlinees as vector.
(DECL_NAMESPACE_USING): Adjust.
(DECL_NAMESPACE_INLINEES): New.
* name-lookup.h (struct cp_binding_level): Change usings
representation.
* name-lookup.c (name_lookup::do_queue_usings,
name_lookup::queue_usings): Adjust.
(name_lookup::search_namespace, name_lookup::search_usings,
name_lookup::queue_namespace): Adjust.
(name_lookup::adl_namespace_only): Adjust.
(add_using_namespace, push_namespace): Push onto vector.
(pop_namespace): Add timing logic.
* call.c (build_operator_new_call): Do namelookup and ADL here.
(build_new_op_1): Likewise.
* name-lookup.h (lookup_function_nonclass): Delete declaration.
(do_using_directive): Likewise.
* name-lookup.c (set_namespace_binding, push_local_binding): Don't
declare early.
(struct scope_binding): Delete.
(EMPTY_SCOPE_BINDING): Delete.
(set_decl_namespace): Use OVL_P.
(finish_local_using_decl): Lose unnecesary checks.
(lookup_function_nonclass): Delete.
(cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
* cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
(ovl_iterator): Add allow_inner field. Adjust ctor. Make
unduplicatable.
(ovl_iterator::maybe_push, ovl_iterator::pop): New.
(lkp_iterator): Add outer field. Adjust ctor.
(lkp_iterator::operator++): New.
(lookup_mark, lookup_maybe_add): Declare.
* name-lookup.c (name_lookup): Delete fn_set member.
(name_lookup::preserve_state, name_lookup::restore_state): Unmark
and mark lookup.
(name_lookup::add_value): Use lookup_add directly.
(name_lookup::add_fns: Use lookup_maybe_add.
(name_lookup::search_adl): Mark and unmark fns.
(pushdecl): Adjust.
* pt.c (check_explicit_specialization): Use lookup_add directly.
* ptree.c (cxx_print_xnode): Show complete overload structure.
* tree.c (lookup_mark, lookup_maybe_add): New.
* name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
2017-05-26 Jakub Jelinek <jakub@redhat.com>
* cp-tree.h (struct lang_decl_decomp): New type.
(struct lang_decl): Add u.decomp.
(LANG_DECL_DECOMP_CHECK): Define.
(DECL_DECOMPOSITION_P): Note it is set also on the vars
for user identifiers.
(DECL_DECOMP_BASE): Define.
(retrofit_lang_decl): Add extra int = 0 argument.
* lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
use it to influence the selector choices and for selector
0 to non-zero transition copy old content.
(cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
* decl.c (poplevel): For DECL_DECOMPOSITION_P, check
!DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
wording if decl is a structured binding.
(cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
of individual variables for tuple structured bindings.
(grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
Clear DECL_DECOMP_BASE.
* decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
* pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
is expected.
* expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
DECL_VALUE_EXPR.
2017-05-25 Jason Merrill <jason@redhat.com>
PR c++/80605 - __is_standard_layout and zero-length array
* class.c (check_bases): Use DECL_FIELD_IS_BASE.
2017-05-25 Nathan Sidwell <nathan@acm.org>
Kill OVL_CURRENT, OVL_NEXT.
* cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
* name-lookup.c (set_decl_namespace): Use ovl_iterator.
(consider_binding_level): Use OVL_FIRST.
(cp_emit_debug_info_for_using): Use lkp_iterator.
* pt.c (check_explicit_specialization): Use ovl_iterator.
Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
* cp-tree.h (lang_decl_ns): Remove ns_users field.
(DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
(TREE_INDIRECT_USING): Delete.
* name-lookup.h (is_associated_namespace): Delete.
* name-lookup.c (name_lookup::search_usings,
name_lookup::do_queue_usings): Usings are always direct.
(is_associated_namespace): Delete.
(handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
(namespace_ancestor_1, namespace_ancestor): Delete.
(push_using_directive_1, push_using_directive): Delete.
(add_using_namespace_1): Delete.
(add_using_namespace): Reimplement.
(emit_debug_info_using_namespace): New.
(finish_namespace_using_directive, finish_local_using_directive,
push_namespace): Adjust.
* tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
* semantics.c (finish_handler_parms): Warn about non-reference type
catch handlers.
2017-05-25 Nathan Sidwell <nathan@acm.org>
Reimplement unqualified namespace lookup.
* name-lookup.c (name_lookup::using_pair,
name_lookup::using_queue): New typedefs.
(name_lookup::queue_namespace, name_lookup::do_queue_usings,
name_lookup::queue_usings): New.
(name_lookup::search_unqualified): New.
(merge_functions, same_entity_p, ambiguous_decl,
unqualified_namespace_lookup_1, unqualified_namespace_lookup,
lookup_using_namespace): Delete.
(lookup_name_real_1): Adjust.
Reimplement qualified namespace lookup.
* name-lookup.c (name_lookup::flags): New member. Adjust ctor.
(name_lookup::ambiguous, name_lookup::add_value,
name_lookup::add_type, name_lookup::process_binding): New.
(name_lookup::search_namespace_only,
name_lookup::search_namespace, name_lookup::search_usings): New.
(name_lookup::search_qualified): New.
(do_nonmember_using_decl, suggest_alternatives_for,
lookup_qualified_name): Adjust.
(tree_vec_contains): Delete.
(qualified_lookup_using_namespace): Rename to ...
(qualified_namespace_lookup): ... here. Reimplement.
Reimplement ADL.
* cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
* name-lookup.h (lookup_arg_dependent): Return plain tree.
* name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
arg_assoc_args_vec, arg_assoc_type, add_function,
arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
arg_assoc_class, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent_1): Delete.
(name_lookup): New lookup object.
(name_lookup::preserve_state, name_lookup::restore_state,
name_lookup::mark_seen, name_lookup::find_and_mark,
name_lookup::add_fns, name_lookup::adl_namespace_only,
name_lookup::adl_namespace, name_lookup::adl_class_only,
name_lookup::adl_bases, name_lookup::adl_class,
name_lookup::adl_expr, name_lookup::adl_type,
name_lookup::adl_template_arg, name_lookup::search_adl): New.
(lookup_arg_dependent): Return a plain tree. Adjust.
(is_associated_namespace): Move later.
2017-05-24 Nathan Sidwell <nathan@acm.org>
* friend.c (do_friend): Remove check for existing decl.
* name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
* name-lookup.c (push_local_binding): Directly look for binding.
(lookup_name_innermost_nonclass_level_1): Delete.
(lookup_name_innermost_nonclass_level): Delete.
* Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
* cp-tree.h (cp_free_lang_data): Add extern.
(ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
ATTRIBUTE_PURE.
(type_unknown_p): Return bool, make inline, lose TREE_LIST check.
* typeck.c (type_unknown_p): Delete.
* tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
overload management.
(dependent_name): Likewise.
(decl_anon_ns_mem_p): Simplify.
2017-05-24 Jonathan Wakely <jwakely@redhat.com>
PR c++/80544
* tree.c (reshape_init): Use unqualified type for direct enum init.
* typeck.c (maybe_warn_about_cast_ignoring_quals): New.
(build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
non-class destination types.
(build_const_cast_1): Strip cv-quals from destination types.
(build_static_cast, build_reinterpret_cast, build_const_cast)
(cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
2017-05-24 Martin Sebor <msebor@redhat.com>
PR c/80731
* call.c (fully_fold_internal): Adjust.
2017-05-24 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (ovl_skip_hidden): Declare.
* tree.c (ovl_skip_hidden): New.
* name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
(lookup_arg_dependent_1): Likewise.
(ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
(hidden_name_p, remove_hidden_names): Delete.
(lookup_name_real_1): Do not strip hidden names.
* name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
* cp-tree.h (OVL_HIDDEN_P): New.
(ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
(ovl_iterator::reveal_node): Declare.
* tree.c (ovl_copy): Copy OVL_HIDDEN_P.
(ovl_insert): Order on hiddenness.
(ovl_iterator::reveal_node): New.
* name-lookup.c (anticipated_builtin_p): New.
(supplement_binding_1): Use it.
(set_local_extern_decl_linkage): Use hidden_p.
(do_pushdecl): Deal with unhiding a hidden decl, use
anticipated_builtin_p.
(do_nonmember_using_decl): Use anticipated_decl_p.
(lookup_name_real_1): Use DECL_HIDDEN_P.
2017-05-23 Jason Merrill <jason@redhat.com>
-Wunused and C++17 structured bindings
* decl.c (poplevel): Don't warn about unused structured bindings,
only real variables.
* error.c (dump_simple_decl): Handle structured bindings.
* expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
2017-05-23 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
* name-lookup.c (create_local_binding): New.
(update_binding): New.
(pushdecl_maybe_friend_1): Rename to ...
(do_pushdecl): ... this. Reimplement.
(pushdecl): Adjust.
(push_overloaded_decl_1, push_overloaded_decl): Delete.
2017-05-23 Jason Merrill <jason@redhat.com>
PR c++/80396 - built-in for make_integer_sequence.
* pt.c (builtin_pack_fn_p, builtin_pack_call_p)
(expand_integer_pack, expand_builtin_pack_call): New.
(find_parameter_packs_r): Check builtin_pack_call_p.
(check_for_bare_parameter_packs): Handle it.
(tsubst_pack_expansion): Call expand_builtin_pack_call.
(declare_integer_pack): New.
(init_template_processing): Call it.
* decl2.c (mark_used): Check builtin_pack_fn_p.
2017-05-23 Nathan Sidwell <nathan@acm.org>
* name-lookup.c (find_namespace_binding): New.
(pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
(set_identifier_type_value_with_scope): Use find_namespace_binding.
(find_binding, cp_binding_level_find_binding_for_name,
binding_for_name, namespace_binding_1): Delete.
(push_overloaded_decl_1): Use CP_DECL_CONTEXT.
(get_namespace_binding, set_namespace_binding,
finish_namespace_using_decl, unqualified_namespace_lookup_1,
qualified_lookup_using_namespace, lookup_type_scope_1,
lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
PR c++/80866
* parser.c (cp_parser_template_id): Keep the lookup when stashing
the template_id.
* cp-tree.h (DECL_HIDDEN_P): New.
* name-lookup.c (set_decl_context,
set_local_extern_decl_linkage): New, broken out of ...
(pushdecl_maybe_friend_1): ... here. Call them.
2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
* parser.c (OACC_KERNELS_CLAUSE_MASK): Add
"PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
"VECTOR_LENGTH".
2017-05-23 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (OVL_P): New.
* name-lookup.h (push_local_binding): Delete.
(do_toplevel_using_decl, do_local_using_decl): Rename to ...
(finish_namespace_using_decl, finish_local_using_decl): ... here
* name-lookup.c (add_decl_to_level): Swap args.
(pop_bindings_and_leave_scope): Look inside TREE_LIST.
(diagnose_name_conflict): Check contexts are same for redecl.
(update_local_overload): New.
(compparms_for_decl_and_using): Rename to ...
(matching_fn_p): ... here.
(pushdecl_maybe_friend_1): Adjust add_decl_to_level,
push_local_bindings call.
(push_local_binding): Make static, replace FLAGS arg with
IS_USING.
(validate_nonmember_using_decl): Use OVL_FIRST.
(do_nonmember_using_decl): Use in/out parameters. Use
lkp_iterator and simplify.
(do_toplevel_using_decl, do_local_using_decl): Rename to ...
(finish_namespace_using_decl, finish_local_using_decl): ... here.
Adjust.
(lookup_type_current_level): Delete.
* parser.c (cp_parser_using_declaration): Adjust.
* pt.c (tsubst_expr): Adjust.
2017-05-22 Nathan Sidwell <nathan@acm.org>
* name-lookup.h (parse_using_directive): Replace with ...
(finish_namespace_using_directive): ... this and ...
(finish_local_using_directive): ... this.
* name-lookup.c (add_using_namespace_1): Move later.
(add_using_namespace): Move later, add namespace_p arg, remove
indirect arg.
(push_using_directive_1): Directly recurse.
(do_using_directive, parse_using_directive): Delete, split into ...
(finish_namespace_using_directive): ... this and ...
(finish_local_using_directive): ... this.
(push_namespace): Use add_using_namespace.
* parser.c (cp_parser_using_directive): Call
finish_namespace_using_directive or finish_local_using_directive.
* pt.c (tsubst_expr): Call finish_local_using_directive.
* cp-objcp-common.c (cp_register_dumps): Register raw dumper.
* cp-tree.h (raw_dump_id): Declare.
* decl2.c (raw_dump_id): Define.
(dump_tu): Use raw_dump_id.
* config-lang.in (gtfiles): Sort list, break lines.
* cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
(CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
CPTI_RETHROW_FN): New.
(noexcept_deferred_spec): New.
(terminate_node, call_unexpected_node): Rename to ...
(terminate_fn, call_unexpected_fn): ... here.
(get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
* except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
(init_exception_processing): Adjust.
(declare_library_fn): Create and push the fns here.
(do_get_exception_ptr, do_begin_catch, do_end_catch,
do_allocate_exception_ptr, do_free_exception_ptr): Adjust
declare_library_fn use.
(unevaluated_noexcept_spec): Adjust.
* cp-gimplify.c (genericize_eh_spec_block,
gimplify_most_not_throw_expr): Adjust.
* name-lookup.c (pushdecl_top_level,
pushdecl_top_level_and_finish): Move after namespace pushing and
popping functions.
(push_to_top_level): Rename to ...
(do_push_to_top_level): ... here. Remove timing code.
(pop_from_top_level_1): Rename to ...
(do_pop_from_top_level): ... here.
(do_push_nested_namespace, do_pop_nested_namespace)
(push_to_top_level): New wrapper for do_push_to_top_level.
(pop_from_top_level): Adjust.
(push_nested_namepace, pop_nested_namespace): Wrappers for workers.
2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
* config-lang.in (gtfiles): Add c-family/c-format.c,
except.c, init.c, lambda.c and friend.c.
* class.c (dvirt_fn): Move out of function scope,
add GTY attribute.
* except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
* init.c (fn): Likewise.
* lambda.c (ptr_id, max_id): Likewise.
* friend.c (global_friend): Add GTY attribute.
2017-05-19 Nathan Sidwell <nathan@acm.org>
* call.c (add_list_candidates): Use OVL_FIRST.
(build_new_method_call_1): Likewise.
* cp-tree.h (OVL_SINGLE_P): New.
(TYPE_HIDDEN_P): New.
* decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
* dump.c (cp_tump_tree): Adjust overload dumping.
* error.c (dump_decl): Use OVL_SINGLE_P, simplify context
printing.
* method.c (lazily_declare_fn): Assert we added it.
* parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
OVL_FIRST.
(cp_parser_template_name): Use lkp_iterator.
* pt.c (begin_template_parm_list): Fixup comment.
(instantiate_class_template_1): Use TYPE_HIDDEN_P.
* tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
(ovl_scope): Use lkp_iterator.
2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
* parser.c (cp_parser_omp_clause_default): Handle
"OMP_CLAUSE_DEFAULT_PRESENT".
* parser.c (cp_parser_omp_clause_default): Avoid printing more
than one syntax error message.
2017-05-19 Nathan Sidwell <nathan@acm.org>
* class.c (class_dump_id): Define.
(dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
* cp-objcp-common.c (cp_register_dumps): New.
* cp-objcp-common.h (cp_register_dumps): Declare.
(LANG_HOOKS_REGISTER_DUMPS): Override.
* cp-tree.h (class_dump_id): Declare.
2017-05-18 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (OVL_ARG_DEPENDENT): Delete.
(OVL_USED_P): New.
(lookup_keep): Declare.
* name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
* pt.c (tsubst_copy): Assert lookup is persistent.
* semantics.c (finish_call_expr): Use lkp_iterator, call
lookup_keep.
* tree.c (ovl_copy): New.
(ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
(lookup_keep): New.
* cp-tree.h (OVL_USED): Replace with ...
(OVL_USING_P): ... this.
(ovl_iterator::using_p): Adjust.
* name-lookup.c (push_overloaded_decl_1,
do_nonmember_using_decl): Adjust.
* search.c (lookup_field_r): Adjust.
* tree.c (ovl_insert, ovl_scope): Adjust.
* cp-tree.h (lookup_add): Swap args.
(ovl_cons, build_overload): Delete.
* name-lookup.c (add_function, push_overloaded_decl_1,
do_nonmember_using_decl, merge_functions, remove_hidden_names):
Use lookup_add, ovl_insert.
* pt.c (check_explicit_specialization): Use lookup_add.
(do_class_deduction): Likewise. Refactor if.
* tree.c (lookup_add): Swap args.
(ovl_cons, build_overload): Delete.
* name-lookup.c (find_local_binding): New, broken out of ...
(lookup_name_innermost_nonclass_level_1): ... here. Call it.
(set_namespace_binding): Swap scope & name args.
(namespace_binding_1): Likewise.
(pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
(push_overloaded_decl_1): Likewise.
(set_global_binding): Likewise.
(get_namespace_binding): Adjust namespace_binding_1 call.
2017-05-17 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (default_hash_traits <lang_identifier *>): New
specialization.
* name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
(extern_c_fns): New hash table.
(check_extern_c_conflict): New, broken out of ...
(pushdecl_maybe_friend_1): ... here. Call it.
(c_linkage_bindings): Just look in hash table.
2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/80654
PR c++/80682
Implement new C++ intrinsics __is_assignable and __is_constructible.
* cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
(is_xible): New.
* cxx-pretty-print.c (pp_cxx_trait_expression): Handle
CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
* method.c (constructible_expr): Set cp_unevaluated.
(is_xible_helper): New.
(is_trivially_xible): Adjust.
(is_xible): New.
* parser.c (cp_parser_primary_expression): Handle
RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
(cp_parser_trait_expr): Likewise.
* semantics.c (trait_expr_value): Handle
CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
2017-05-17 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (ovl_iterator::using_p): New predicate.
(ovl_iterator::remove_node): New worker.
(ovl_insert): Declare.
* tree.c (ovl_insert): New.
(ovl_iterator::remove_node): New.
* class.c (add_method): Use ovl_iterator, ovl_insert.
(clone_function_decl): Fix description.
(clone_constructors_and_destructors): Use ovl_iterator.
* class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
(maybe_warn_about_overly_private_class): Use ovl_iterator.
(method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
(resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
(get_base_fndecls): Use ovl_iterator.
(warn_hidden): Use OVL_NAME, ovl_iterator.
(add_implicitly_declared_members): Use ovl_iterator.
* constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
flatten nested if.
(finish_shorthand_constraint): Simplify, use ovl_make.
* pt.c (make_constrained_auto): Simplify. Use ovl_make.
* search.c (shared_member_p): Use ovl_iterator.
(lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
(lookup_conversion_operator): Use OVL_FIRST.
(lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
(look_for_overrides_here): Use ovl_iterator.
(lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
* typeck.c (build_x_unary_op): Use ovl_make.
2017-05-17 Martin Liska <mliska@suse.cz>
* class.c (dump_class_hierarchy): Introduce dump_flags_t type and
use it instead of int type.
(dump_vtable): Likewise.
(dump_vtt): Likewise.
* decl2.c (dump_tu): Likewise.
2017-05-16 David Malcolm <dmalcolm@redhat.com>
* call.c (enforce_access): Add access_failure_info * param and use
it to record access failures.
* cp-tree.h (class access_failure_info): New class.
(enforce_access): Add access_failure_info * param, defaulting to
NULL.
(lookup_member): Likewise.
(locate_field_accessor): New function decl.
(perform_or_defer_access_check): Add access_failure_info * param,
defaulting to NULL.
* search.c (lookup_member): Add access_failure_info * param and
pass it on to call to perform_or_defer_access_check.
(matches_code_and_type_p): New function.
(field_access_p): New function.
(direct_accessor_p): New function.
(reference_accessor_p): New function.
(field_accessor_p): New function.
(struct locate_field_data): New struct.
(dfs_locate_field_accessor_pre): New function.
(locate_field_accessor): New function.
* semantics.c (perform_or_defer_access_check): Add
access_failure_info * param, and pass it on to call to
enforce_access.
* typeck.c (access_failure_info::record_access_failure): New method.
(access_failure_info::maybe_suggest_accessor): New method.
(finish_class_member_access_expr): Pass an access_failure_info
instance to the lookup_member call, and call its
maybe_suggest_accessor method afterwards.
2017-05-16 Marek Polacek <polacek@redhat.com>
PR sanitizer/80536
PR sanitizer/80386
* cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
2017-05-16 Nathan Sidwell <nathan@acm.org>
* name-lookup.c (check_local_shadow): New, broke out of ...
(pushdecl_maybe_friend_1): ... here. Call it.
* cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
(ovl_first): Move inline definition to end of file.
(ovl_make, lookup_add): Declare.
(get_fns, get_first_fn): Make pure.
* tree.c (ovl_cache): New.
(ovl_make, lookup_add): New.
* pt.c (do_class_deduction): Don't add candidates that will be
elided.
* call.c (build_user_type_conversion_1): Use OVL_FIRST.
(print_error_for_call_failure): Use OVL_NAME.
(build_op_call_1): Use ovl_iterator.
(add_candidates): Use OVL_FIRST & lkp_iterator.
(build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
lkp_iterator.
* class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
(type_has_user_nondefault_constructor,
in_class_defaulted_default_constructor,
type_has_user_provided_constructor,
type_has_user_provided_or_explicit_constructor,
type_has_non_user_provided_default_constructor,
vbase_has_user_provided_move_assign,
type_has_move_constructor, type_has_move_assign,
type_has_user_declared_move_constructor,
type_has_user_declared_move_assign,
type_build_ctor_call, type_build_dtor_call,
type_requires_array_cookie, explain_non_literal_class): Likewise.
(finish_struct): Use lkp_iterator.
(resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
(note_name_declared_in_class): Use OVL_NAME.
* cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
(pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
cxx_pretty_printer::expression): Likewise.
* decl2.c (check_classfn): Use ovl_iterator.
* pt.c (retrieve_specialization): Use ovl_iterator.
* tree.c (cp_tree_equal): Use lkp_iterator.
(type_has_nontrivial_copy_init): Use ovl_iterator.
* typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
check is_overloaded_fn.
2017-05-16 Martin Liska <mliska@suse.cz>
* parser.c (cp_lexer_print_token): Add default value for flags
argument of print_gimple_stmt, print_gimple_expr,
print_generic_stmt and print_generic_expr.
2017-05-16 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
iterators.
(MAYBE_BASELINK_FUNCTIONS): New.
* constraint.cc (resolve_constraint_check): Use lkp_iterator.
* decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
* lambda.c (maybe_generic_this_capture): Use lkp_iterator.
* method.c (inherited_ctor_binfo): Use ovl_iterator.
(binfo_inherited_from): Likewise.
* parser.c (lookup_literal_operator): Use lkp_iterator.
* pt.c (iterative_hash_template_arg): Use lkp_iterator.
(print_candidates_1): Likewise.
(determine_specialization): Likewise.
(resolve_overloaded_unification): Likewise.
(resolve_nondeduced_context): Likewise.
(type_dependent_expression_p): Likewise.
(dependent_template_p): Likewise.
* ptree.c (cxx_print_xnode): Likewise.
* semantics.c (omp_reduction_lookup): Use lkp_iterator.
(classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
* typeck.c (check_template_keyword): Use lkp_iterator.
* cp-tree.h (OVL_FIRST, OVL_NAME): New.
(ovl_first): New.
* constexpr.c (function_concept_check): Use OVL_FIRST.
* cvt.c (build_expr_type_conversion): Likewise.
* decl.c (poplevel, grokdeclarator): Use OVL_NAME.
* decl2.c (mark_used): Use OVL_FIRST.
* error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
(dump_expr, location_of): Use OVL_FIRST.
* friend.c (do_friend): Use OVL_NAME.
* init.c (build_offset_ref): Use OVL_FIRST.
* mangle.c (write_member_name): Likewise.
(write_expression): Use OVL_NAME.
* method.c (strip_inheriting_ctors): Use OVL_FIRST.
* name-lookup.c (pushdecl_class_level): Use OVL_NAME.
* pt.c (check_explicit_specialization): Use OVL_FIRST.
(check_template_shadow): Likewise.
(tsubst_template_args): Use OVL_NAME.
(tsubst_baselink): Use OVL_FIRST.
* semantics.c (perform_koenig_lookup): Use OVL_NAME.
* tree.c (get_first_fn): Use OVL_FIRST.
* typeck.c (finish_class_member_access_expr): Use OVL_NAME.
(cp_build_addr_expr_1): Use OVL_FIRST.
* pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
peeking.
* semantics.c (finish_id_expression): Directly init local var.
(finish_omp_reduction_clause): Use really_overloaded_fn.
* tree.c (get_fns): Document. Assert we got an overload.
(get_first_fn) Document.
* typeck.c (cp_build_addr_expr_1): Pass arg directly to
really_overloaded_fn.
* typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
* cp-tree.h (SCOPE_DEPTH): New.
* name-lookup.h (is_nested_namespace): Declare.
* name-lookup.c (is_nested_namespace): New.
(is_ancestor): Use it.
(set_decl_namespace): Likewise.
(push_namespace): Set SCOPE_DEPTH.
* pt.c (check_specialization_namespace): Use is_nested_namespace.
(check_unqualigied_spec_or_inst): Likewise.
2017-05-15 Nathan Sidwell <nathan@acm.org>
PR c++/79369
* cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
* name-lookup.h (push_namespace): Return int, add make_inline arg.
* name-lookup.c (push_namespace): Deal with inline directly.
Return pushed count.
* parser.c (cp_parser_namespace_definition): Adjust for
push_namespace change.
2017-05-11 Nathan Sidwell <nathan@acm.org>
* cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
LANG_HOOKS_PUSHDECL): Move to ...
* cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
* cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
* name-lookup.h (pushdecl): Add default friend parm.
(pushdecl_maybe_friend): Delete.
(pushdecl_top_level): Add default friend parm.
(pushdecl_top_level_maybe_friend): Delete.
* name-lookup.c (pushdecl_maybe_friend): Delete.
(pushdecl): Add is_friend parm.
(pushdecl_top_level): Add is friend_parm.
(pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
(pushdecl_top_level_and_finish): Do pushing and finishing directly.
* friend.c (do_friend): Adjust.
* pt.c (tsubst_friend_class): Adjust.
Revert pushdecl_top_level_and_finish name change.
* name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
* name-lookup.c (pushdecl_top_level_and_finish): Likewise.
* decl.c (cp_make_fname_decl): Adjust.
* decl2.c (get_guard, handle_tls_init): Adjust.
* rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
* name-lookup.c (pushdecl_outermost_localscope): Always
conditionally stop timer.
* decl.c (xref_tag_1): Don't frob ts_lambda scope here.
* name-lookup.c (pushtag_1): Deal with ts_lambda scope.
* cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
pushtag_top_level_maybe_friend,
pushdecl_top_level_and_finish): Move declarations to ...
* name-lookup.h: ... here. Group pushdecl variants.
(pushdecl_top_level_and_finish): Rename to ...
(pushdecl_top_level_with_init): ... here.
* decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
* decl2.c (get_guard, handle_tls_init): Likewise.
* rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
* lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
* method.c (implicitly_declare_fn): Likewise.
* searchc (node_debug_info_needed): Likewise.
* name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
(pushdecl_top_level_with_init): ... here.
(pop_everything): Use namespace_bindings_p.
* name-lookup.h (pop_binding): Rename to pop_local_binding.
(getdecls): Rename to get_local_decls.
* name-lookup.c (pop_binding): Rename to ...
(pop_local_binding): ... here.
(pop_bindings_and_leave_scope): Adjust.
(getdecls): Rename to ...
(get_local_decls): ... here. Assert local scope.
* decl.c (poplevel): Assert not namespace. Adjust and simplify
logic.
(store_parm_decls): Adjust get_local_decls call.
(parser.c (synthesize_implicit_template_parm): Likewise.
2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/80682
* method.c (is_trivially_xible): Reject void types.
2017-05-10 Nathan Sidwell <nathan@acm.org>
* class.c (handle_using_decl): Always use OVL_CURRENT.
(resolve_address_of_overloaded_function): Move iterator decl into
for scope. Don't strip anticipated decls here.
* pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
printing.
(print_candidates): Adjust.
* cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
line breaking.
* call.c (build_new_function_call): Lose koenig_p arg. Remove
koenig_p handling here.
* pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
(tsubst_omp_clauses): Likewise.
(do_class_deduction): Adjust buld_new_function_call calls.
* semantics.c (finish_call_expr): Likewise.
2017-05-10 Jason Merrill <jason@redhat.com>
* pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
(unify_type_mismatch, unify_parameter_pack_mismatch)
(unify_ptrmem_cst_mismatch, unify_expression_unequal)
(unify_parameter_pack_inconsistent, unify_inconsistency)
(unify_vla_arg, unify_method_type_error, unify_arity)
(unify_arg_conversion, unify_no_common_base)
(unify_inconsistent_template_template_parameters)
(unify_template_deduction_failure)
(unify_template_argument_mismatch)
(unify_overload_resolution_failure): Call unify_invalid.
CWG 1847 - Clarifying compatibility during partial ordering
* pt.c (more_specialized_fn): No order between two non-deducible
parameters.
* pt.c (dependent_type_p): Make sure we aren't called with
global_type_node.
PR c++/79549 - C++17 ICE with non-type auto template parameter pack
* pt.c (convert_template_argument): Just return an argument pack.
(coerce_template_parameter_pack, template_parm_to_arg)
(extract_fnparm_pack, make_argument_pack, tsubst_template_args)
(tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
Don't set the type of a NONTYPE_ARGUMENT_PACK.
* parser.c (make_char_string_pack, make_string_pack): Likewise.
2017-05-10 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (add_method, clone_function_decl): Change last arg to
bool.
* class.c (add_method): Change third arg to bool. Adjust.
(one_inheriting_sig, one_inherited_ctor): Adjust.
(clone_function_decl): Change 2nd arg to bool. Adjust.
(clone_constructors_and_destructors): Adjust.
* lambda.c (maybe_add_lambda_conv_op): Adjust.
* method.c (lazily_declare_fn): Adjust.
* pt.c (tsubst_decl, instantiate_template_1): Adjust.
* semantics.c (finish_member_declaration): Adjust.
2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/80145
* decl.c (finish_function): To improve error recovery, change the
logic for calling apply_deduced_return_type.
2017-05-09 Jason Merrill <jason@redhat.com>
PR c++/80605 - __is_standard_layout and empty base
* class.c (check_bases): Ignore empty bases.
PR c++/70979 - literal class and closure types
* class.c (finalize_literal_type_property): Handle closures
specifically.
(explain_non_literal_class): Likewise.
PR c++/66297, DR 1684 - literal class and constexpr member fns
* constexpr.c (is_valid_constexpr_fn): Only complain about
non-literal enclosing class in C++11.
* class.c (finalize_literal_type_property): Likewise.
2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/80186
* pt.c (tsubst_decl): Early return error_mark_node if
grok_ctor_properties returns false.
2017-05-09 Jason Merrill <jason@redhat.com>
PR c++/70167 - array prvalue treated as lvalue
* cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
(enum fcl_t): New.
* semantics.c (finish_compound_literal): Add fcl_context parameter.
Only make a static variable for C99 syntax.
* parser.c (cp_parser_postfix_expression): Pass it.
* pt.c (tsubst_copy_and_build): Likewise.
* call.c (extend_ref_init_temps): Set
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2017-05-09 Nathan Sidwell <nathan@acm.org>
* cp-lang.c (get_global_decls, cxx_pushdecl): New.
(LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
* name-lookup.h (pushdecl_top_level): Declare.
2017-05-08 Jason Merrill <jason@redhat.com>
PR c++/80178 - parameter passing for uncopyable classes
* tree.c (type_has_nontrivial_copy_init): True for classes with only
deleted copy/move ctors.
(remember_deleted_copy, maybe_warn_parm_abi): New.
* decl.c (require_complete_types_for_parms, check_function_type):
Call maybe_warn_parm_abi.
* call.c (convert_for_arg_passing, build_cxx_call): Likewise.
2017-05-08 Nathan Sidwell <nathan@acm.org>
* decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
(start_preparsed_function): Do decl pushing before setting
current_funciton_decl and announcing it.
* name-lookup.h (pushdecl_with_scope): Replace with ...
(pushdecl_outermost_localscope): ... this.
* name-lookup.c (pushdecl_with_scope): Replace with ...
(pushdecl_outermost_localscope): ... this.
(pushdecl_namespace_level): Adjust.
* decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
* lambda.c (insert_capture_proxy): Likewise.
* class.c (build_vtbl_initializer): Don't shadow outer variable
with static var.
Revert _binding -> _value change.
* name-lookup.h (get_namespace_value, set_global_value): Rename to ...
(get_namespace_binding, set_global_binding): ... these.
* name-lookup.c (get_namespace_value, set_global_value): Rename to ...
(get_namespace_binding, set_global_binding): ... these.
(arg_assoc_namespace, pushdecl_maybe_friend_1,
check_for_out_of_scope_variable, push_overloaded_decl_1,
lookup_name_innermost_nonclass_level, push_namespace): Adjust.
* cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
* decl.c (poplevel): Adjust.
* pt.c (make_constrained_auto): Likewise.
2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
PR translation/80280
* call.c (print_z_candidate): Fix quoting.
2017-05-05 David Malcolm <dmalcolm@redhat.com>
* error.c (pedwarn_cxx98): Replace report_diagnostic
with diagnostic_report_diagnostic.
2017-05-05 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
(SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
(IDENTIFIER_NAMESPACE_VALUE): Delete.
* name-lookup.h (namespace_binding, set_namespace_binding): Replace
with ...
(get_namespace_value, set_global_value): ... these.
(get_global_value_if_present, is_typename_at_global_scope): Delete.
* decl.c (poplevel): Use get_namespace_value.
(grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
* class.c (build_vtbl_initializer): Stash library decl in
static var. Use IDENTIFIER_GLOBAL_VALUE.
* except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
do_allocate_exception, do_free_exception, build_throw): Likewise.
* init.c (throw_bad_array_new_length): Likewise.
* rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
* name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
check_for_our_of_scope_variable, push_overloaded_decl_1): Use
get_namespace_value.
(set_namespace_binding_1): Rename to
(set_namespace_binding): ... here.
(set_global_value): New.
(lookup_name_innermost_nonclass_level_1, push_namespace): Use
get_namespace_value.
* pt.c (listify): Use get_namespace_value.
* call.c (make_temporary_var_for_ref_to_temp): Push decl into
current scope.
* lex.c (unqualified_name_lookup_error): Likewise.
* class.c (alter_class): Use retrofit_lang_decl directly.
* decl.c (push_local_name, dupliate_decls): Likewise.
* semantics.c (omp_privatize_field): Likewise.
Kill walk_namespaces.
* cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
* decl.c (walk_namespaces_r, walk_namespaces): Delete.
Kill per-namespace static_decls.
* cp-tree.h (static_decls): Declare.
(wrapup_globals_for_namespace,
diagnose_inline_vars_for_namespace): Replace with ...
(wrapup_namespace_globals): ... this.
* decl.c (static_decls): Define.
(wrapup_globals_for_namespace,
diagnose_inline_vars_for_namespace): Replace with ...
(wrapup_namespace_globals): ... this.
(cxx_init_decl_processing): Initialize static_decls.
* decl2.c (c_parse_final_cleanups): Adjust.
* name-lookup.h (cp_binding_level): Remove static_decls member.
* name-lookup.c (add_decl_to_level): Adjust.
(begin_scope): Adjust.
2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71577
* decl.c (reshape_init): Unconditionally return error_mark_node
upon error about too many initializers.
2017-05-04 Nathan Sidwell <nathan@acm.org>
* constraint.cc (diagnose_check_constraint): Fix %E thinko.
2017-05-04 Martin Sebor <msebor@redhat.com>
PR translation/80280
* call.c (print_z_candidate): Add missing quoting to %D and other
like directives.
(build_op_call_1): Same.
* constraint.cc (diagnose_check_constraint): Same.
* mangle.c (mangle_decl): Same.
* name-lookup.c (cp_binding_level_debug): Same.
(set_decl_namespace): Same.
* parser.c (cp_parser_tx_qualifier_opt): Same.
* pt.c (print_candidates_1): Same.
(check_template_variable): Same.
(tsubst_default_argument): Same.
(most_specialized_partial_spec): Same.
* semantics.c (omp_reduction_lookup): Same.
* tree.c (check_abi_tag_redeclaration): Same.
* typeck.c (comptypes): Same.
* typeck2.c (abstract_virtuals_error_sfinae): Same.
2017-05-04 Nathan Sidwell <nathan@acm.org>
More global trees.
* cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
CPTI_INIT_LIST_IDENTIFIER.
(global_namespace, global_type_node, global_identifier,
anon_identifier, init_list_identifier): New.
* decl.c (global_type_node, global_scope_name): Delete.
(initialize_predefined_identifiers): Add new identifiers.
(cxx_init_decl_processing): Adjust.
* name-lookup.h (global_namespace, global_type_node): Delete.
* name-lookup.c (global_namespace, anonymous_namespace_name,
get_anonymous_namespace_name): Delete.
(namespace_scope_ht_size, begin_scope, pushtag_1,
push_namespace): Adjust,
* call.c (type_has_extended_temps): Use init_list_identifier.
* pt.c (listify): Likewise.
* name-lookup.c: Reorder functions to make merging from modules
branch simpler.
2017-05-03 Jason Merrill <jason@redhat.com>
* constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
2017-05-03 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
along with #defines, to before name-lookup include.
2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
* pt.c (is_auto_or_concept): Remove.
(type_uses_auto_or_concept): Remove, unused.
(find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
* parser.c (tree_type_is_auto_or_concept): Remove, unused.
* cp-tree.h (is_auto_or_concept): Remove.
2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
PR c++/80038
* cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
add pedigree operation and detach call here.
* cp-gimplify.c (cp_gimplify_expr): Remove the calls to
cilk_cp_gimplify_call_params_in_spawned_fn.
(cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
* semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
* parser.c (cp_parser_member_declaration): Add fix-it hints for
stray comma and missing semicolon at end of member declaration.
2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
* parser.c (cp_parser_cast_expression): Add target type of cast to
diagnostic.
* error.c (type_to_string): Add '{enum}' suffix to enumeration types.
2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
return type to bool.
* cp-tree.h (grok_ctor_properties): Update.
2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
* parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
information to diagnostic of invalid colon in nested-name-specifier.
2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
* parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
diagnostic of invalid class/struct keyword after enum.
2017-04-25 David Malcolm <dmalcolm@redhat.com>
* parser.c (cp_parser_member_declaration): Add fix-it hint
for removing stray semicolons.
2017-04-25 David Malcolm <dmalcolm@redhat.com>
* name-lookup.c (get_std_name_hint): New function.
(maybe_suggest_missing_header): New function.
(suggest_alternative_in_explicit_scope): Call
maybe_suggest_missing_header.
2017-04-25 David Malcolm <dmalcolm@redhat.com>
PR c++/80177
* name-lookup.c (suggest_alternative_in_explicit_scope): Convert
candidate type of bm from tree to const char *.
(consider_binding_level): Likewise.
(lookup_name_fuzzy): Likewise, using this to merge the best
result from the preprocessor into bm, rather than immediately
returning, so that better matches from reserved words can "win".
Guard the rejection of keywords that don't start decl-specifiers
so it only happens for FUZZY_LOOKUP_TYPENAME.
2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
* decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
(start_enum): Likewise.
(build_enumerator): Likewise. Use %qE instead of plain %E.
* parser.c (cp_parser_mem_initializer_list): Use %qD instead of
%<%D%> in diagnostics.
(cp_parser_elaborated_type_specifier): Likewise.
* pt.c (make_pack_expansion): Use %qT and %qE instead of
%<%T%> and %<%E%> in diagnostics.
(tsubst_pack_expansion): Likewise.
2017-04-24 David Malcolm <dmalcolm@redhat.com>
PR c++/80016
* parser.c (cp_parser_unary_expression): Generate a location
range for alignof and sizeof expressions.
2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
* parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
error message.
(cp_parser_virt_specifier_seq_opt): Likewise.
(set_and_check_decl_spec_loc): Likewise twice.
2017-04-21 Jason Merrill <jason@redhat.com>
PR c++/80179 - ICE with initialized flexible array member.
* constexpr.c (verify_ctor_sanity): Handle flexible array members.
2017-04-21 Richard Biener <rguenther@suse.de>
* cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
(copy_type): Likewise.
* lex.c (copy_decl): Pass down mem-stat info.
(copy_type): Likewise.
2017-04-20 Jonathan Wakely <jwakely@redhat.com>
PR c++/80473
* init.c (build_new_1): Suppress notes about over-aligned new when
the warning is suppressed.
2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
* parser.c (cp_parser_member_declaration): Add warning with fixit
information for extra semicolon after in-class function definition.
2017-04-20 Jakub Jelinek <jakub@redhat.com>
PR middle-end/80423
* tree.c (build_cplus_array_type): Call build_array_type
with the intended TYPE_TYPELESS_STORAGE flag value, instead
of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
on the shared type.
2017-04-18 Marek Polacek <polacek@redhat.com>
PR c++/80244 - ICE with attribute in template alias.
* tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
PR c++/80241 - ICE with alignas pack expansion.
* error.c (dump_expr): Handle TREE_LIST.
* parser.c (cp_parser_std_attribute_list): Return error_mark if
make_pack_expansion returns an error.
2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/80287
* class.c (fixup_may_alias): Fix all type variants.
2017-04-17 Jason Merrill <jason@redhat.com>
PR c++/80415 - wrong error with default arg and array reference.
* tree.c (lvalue_kind): Return clk_class for an array prvalue.
* pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
2017-04-15 Alexandre Oliva <aoliva@redhat.com>
* decl.c (name_unnamed_type): Split out of...
(grokdeclarator): ... this.
* decl.h (name_unnamed_type): Declare.
2017-04-12 Richard Biener <rguenther@suse.de>
Bernd Edlinger <bernd.edlinger@hotmail.de>
PR middle-end/79671
* tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
for arrays of character or std::byte type.
2017-04-11 Jason Merrill <jason@redhat.com>
PR c++/80294 - ICE with constexpr and inheritance.
* constexpr.c (reduced_constant_expression_p):
A null constructor element is non-constant.
(cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
returning an empty base.
2017-04-11 Jakub Jelinek <jakub@redhat.com>
PR c++/80370
* decl.c (cp_finish_decomp): If processing_template_decl on
non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
processing.
* pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
dependent.
2017-04-11 Jakub Jelinek <jakub@redhat.com>
PR c++/80363
* error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
2017-04-10 Jakub Jelinek <jakub@redhat.com>
PR c++/80176
* tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
operand, if it is a static member function, recurse on the
BASELINK.
2017-04-10 Marek Polacek <polacek@redhat.com>
PR sanitizer/80348
* typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
ORIG_TYPE earlier and not only when shortening.
2017-04-07 Jason Merrill <jason@redhat.com>
PR c++/80356 - ICE with reference to function template argument.
PR c++/79294
* pt.c (convert_nontype_argument_function): Adjust type even with a
value-dependent argument.
PR c++/80267 - ICE with nested capture of reference
PR c++/60992
* pt.c (tsubst_copy): Handle lookup finding a capture proxy.
2017-04-07 Marek Polacek <polacek@redhat.com>
PR sanitizer/80348
* typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
PR c++/80095
* call.c (build_over_call): Don't check cxx_dialect.
* cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
whether SUB is a CONSTRUCTOR.
* init.c (build_new_1): Don't check cxx_dialect.
* tree.c (replace_placeholders): Add a function comment. Return if
not in C++14, or if the object isn't a (member of a) class.
* typeck2.c (store_init_value): Don't check cxx_dialect nor whether
TYPE is CLASS_TYPE_P.
2017-04-05 Jakub Jelinek <jakub@redhat.com>
PR c++/80309
* pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
of a loop doing vec_safe_push of NULL. Formatting fixes.
(rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
to newidx before calling canonical_type_parameter on newtype.
2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
PR c++/80296
* cxx-pretty-print.c (cxx_pretty_printer::expression): Add
UNARY_PLUS_EXPR case.
2017-04-03 Jason Merrill <jason@redhat.com>
* semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
2017-04-03 Jonathan Wakely <jwakely@redhat.com>
* class.c (update_vtable_entry_for_fn): Fix typo in comment.
* decl2.c (one_static_initialization_or_destruction): Likewise.
* name-lookup.c (store_bindings): Likewise.
* parser.c (make_call_declarator): Likewise.
* pt.c (check_explicit_specialization): Likewise.
2017-04-03 Jason Merrill <jason@redhat.com>
PR sanitizer/79993 - ICE with VLA initialization from string
PR c++/69487 - wrong VLA initialization from string
* init.c (finish_length_check): Split out from build_vec_init.
(build_vec_init): Handle STRING_CST.
* typeck2.c (split_nonconstant_init): Handle STRING_CST.
(digest_init_r): Don't give a STRING_CST VLA type.
2017-03-31 Jakub Jelinek <jakub@redhat.com>
PR c++/79572
* cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
for NOP_EXPR to REFERENCE_TYPE.
PR libstdc++/80251
* cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
* cxx-pretty-print.c (pp_cxx_trait_expression): Handle
CPTK_IS_AGGREGATE.
* semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
Remove extraneous parens.
(finish_trait_expr): Handle CPTK_IS_AGGREGATE.
* parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
(cp_parser_trait_expr): Likewise.
2017-03-27 Jakub Jelinek <jakub@redhat.com>
PR middle-end/80162
* cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
* typeck.c (cxx_mark_addressable): Likewise. Look through
VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
to ARRAY_TYPE.
(cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
2017-03-24 Jason Merrill <jason@redhat.com>
PR c++/77339 - ICE with invalid use of alias template.
* pt.c (lookup_template_class_1): Don't try to enter the scope of an
alias template.
2017-03-24 Marek Polacek <polacek@redhat.com>
PR c++/80119
* cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
doesn't have side effects.
2017-03-23 Jason Merrill <jason@redhat.com>
PR c++/80150 - ICE with overloaded variadic deduction.
* pt.c (try_one_overload): Remove asserts.
PR c++/77563 - missing ambiguous conversion error.
* call.c (convert_like_real): Use LOOKUP_IMPLICIT.
2017-03-23 Marek Polacek <polacek@redhat.com>
* cp-tree.h: Remove a C_RID_YYCODE reference.
2017-03-22 Jakub Jelinek <jakub@redhat.com>
PR c++/80141
* semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
processing_template_decl.
2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/77752
* name-lookup.c (pushtag_1): Add check for bogus, non template,
std::initializer_list.
2017-03-21 Jakub Jelinek <jakub@redhat.com>
PR c++/35878
* init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/35878
* init.c (std_placement_new_fn_p): New.
(build_new_1): Call it.
2017-03-20 Jason Merrill <jason@redhat.com>
PR c++/80096 - ICE with C++17 non-type auto.
* pt.c (tsubst): Delay tsubst of type of template non-type
parameter.
PR c++/79519 - ICE with deleted template friend.
* decl.c (grokdeclarator): Complain about misplaced function
definition using =, as well.
PR c++/79640 - infinite recursion with generic lambda.
* pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
before substituting its initializer.
2017-03-20 Marek Polacek <polacek@redhat.com>
Paolo Carlini <paolo.carlini@oracle.com>
PR c++/80059 - ICE with noexcept and __transaction_atomic
* except.c (build_must_not_throw_expr): Call
instantiate_non_dependent_expr.
2017-03-19 Jason Merrill <jason@redhat.com>
PR c++/80084 - wrong C++17 decomposition by reference of parameter.
* decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
reference decomposition.
PR c++/80077 - error with constexpr and -fno-elide-constructors.
* constexpr.c (cxx_eval_call_expression): Set ctx->call while
expanding trivial constructor.
2017-03-17 Jason Merrill <jason@redhat.com>
PR c++/78345 - ICE initializing array from lambda.
* init.c (build_aggr_init): Check array initializer.
(build_vec_init): Check the type of a CONSTRUCTOR.
PR c++/80073 - C++17 ICE with virtual base.
* decl.c (xref_basetypes): Also check for indirect vbases.
2017-03-16 Jason Merrill <jason@redhat.com>
* decl.c (start_enum): std::byte aliases anything.
PR c++/79797
* constexpr.c (lookup_placeholder): Tweak.
2017-03-15 Jason Merrill <jason@redhat.com>
PR c++/80043 - ICE with -fpermissive
* typeck.c (convert_for_assignment): Handle instantiate_type
not giving an error.
2017-03-14 Nathan Sidwell <nathan@acm.org>
PR c++/79393 DR 1658 workaround
* method.c (synthesized_method_base_walk): Inihibit abstract class
virtual base access check here.
(synthesized_method_walk): Not here.
2017-03-13 Nathan Sidwell <nathan@acm.org>
PR c++/79393 DR 1658 workaround
* method.c (synthesized_method_walk): Check vbases of abstract
classes for dtor walk.
2017-03-10 David Malcolm <dmalcolm@redhat.com>
PR translation/79848
* decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
2017-03-10 Jason Merrill <jason@redhat.com>
PR c++/79960 - alias templates and partial ordering
* pt.c (comp_template_args): Add partial_order parm.
(template_args_equal): Likewise.
(comp_template_args_porder): New.
(get_partial_spec_bindings): Use it.
2017-03-10 Marek Polacek <polacek@redhat.com>
PR c++/79967
* decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
2017-03-10 Jakub Jelinek <jakub@redhat.com>
PR c++/79899
* optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
Use XALLOCAVEC macro.
PR c++/79896
* decl.c (finish_enum_value_list): If value is error_mark_node,
don't copy it and change its type.
* init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
of CONST_DECL is error_mark_node.
2017-03-09 Marek Polacek <polacek@redhat.com>
PR c++/79900 - ICE in strip_typedefs
* tree.c (strip_typedefs): Skip the attribute handling if T is
a variant type which hasn't been updated yet.
PR c++/79687 - wrong code with pointer-to-member
* init.c (constant_value_1): Break if the variable has a dynamic
initializer.
2017-03-08 Jason Merrill <jason@redhat.com>
PR c++/79797 - ICE with self-reference in array DMI.
* constexpr.c (lookup_placeholder): Split out...
(cxx_eval_constant_expression): ...from here.
2017-03-07 Jakub Jelinek <jakub@redhat.com>
PR c/79834
* parser.c (cp_parser_omp_cancellation_point,
cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
cp_parser_omp_target_update): Change "may only be used in compound
statements" diagnostics, such that the same translatable string is
used for all pragmas.
(cp_parser_pragma): Likewise. Use error_at instead of
cp_parser_error for that diagnostics.
2017-03-06 Marek Polacek <polacek@redhat.com>
PR c++/79796 - ICE with NSDMI and this pointer
* call.c (build_over_call): Handle NSDMI with a 'this' by calling
replace_placeholders.
2017-03-06 Jakub Jelinek <jakub@redhat.com>
PR c++/79822
* constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
({ (void) 0; }).
2017-03-06 Jason Merrill <jason@redhat.com>
Revert "Allow deduction guides to look into primary template."
* cp-tree.h, parser.c, pt.c, search.c: Revert.
2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/70266
* except.c (build_must_not_throw_expr): Perform the implicit
conversions on the condition.
2017-03-03 Jason Merrill <jason@redhat.com>
* mangle.c (mangle_decl): Check -Wnoexcept-type instead of
-Wc++1z-compat.
Core issues 2273 and 2277
* call.c (joust): Adjust using-declaration tiebreaker to handle
the intermediate base case.
* method.c (strip_inheriting_ctors): Just return the argument if
!flag_new_inheriting_ctors.
2017-03-03 Richard Biener <rguenther@suse.de>
PR c++/79825
* cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
2017-03-03 Marek Polacek <polacek@redhat.com>
PR c++/79791
* typeck.c (string_conv_p): In C++11, always call pedwarn with
OPT_Wwrite_strings.
2017-03-02 Jason Merrill <jason@redhat.com>
Update overload resolution with deduction guides.
* pt.c (do_class_deduction): Always build the copy guide.
(copy_guide_p, template_guide_p): New.
(build_deduction_guide): Remember the original constructor.
* call.c (joust): Prefer the copy guide and non-template guides.
Allow deduction guides to look into primary template.
* cp-tree.h (struct saved_scope): Add deduction_guide_type.
(struct cp_decl_specifier_seq): Add constructor_p.
* parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
(cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
Clear deduction_guide_type. Don't handle deduction guide names.
(cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
(cp_parser_direct_declarator): Likewise. Handle deduction guides.
(cp_parser_member_declaration, cp_parser_cache_defarg)
(cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
* pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
(build_deduction_guide): Set deduction_guide_type.
(dependent_scope_p): Check deduction_guide_type.
* search.c (lookup_member): Likewise.
2017-03-02 Jakub Jelinek <jakub@redhat.com>
PR c++/79782
* init.c (mark_exp_read_r): New function.
(emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
whole arguments instead of plain mark_exp_read on TREE_LIST values.
2017-03-01 Jason Merrill <jason@redhat.com>
Class template argument deduction in new-expression
* init.c (build_new): Handle deduction from no initializer.
* parser.c (cp_parser_new_expression): Don't require a single
expression for class template deduction.
* typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
class template placeholder.
* pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
(tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
(redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
2017-03-01 Jakub Jelinek <jakub@redhat.com>
PR c++/79746
* init.c (emit_mem_initializers): When not constructing vbases of
abstract classes, mark arguments as read for
-Wunused-but-set-parameter.
2017-02-28 Jason Merrill <jason@redhat.com>
Class template argument deduction refinements
* call.c (joust): Move deduction guide tiebreaker down.
* decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
deduction with no initializer.
* pt.c (build_deduction_guide): Handle implicit default/copy ctor.
(do_class_deduction): Use that rather than special case.
(do_auto_deduction): Handle null initializer.
2017-02-28 Jakub Jelinek <jakub@redhat.com>
* decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
instead of just cond ? "..." : "...".
(grokdeclarator): Likewise.
(build_enumerator): Likewise.
* init.c (build_new_1): Likewise.
* call.c (build_new_method_call_1): Likewise.
* parser.c: Include intl.h.
(cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
"enter"/"exit" keyword.
(cp_finalize_oacc_routine): Don't use %s to supply portions of the
message.
2017-02-27 Jason Merrill <jason@redhat.com>
PR c++/71568 - SFINAE forming pointer to member function
* init.c (build_offset_ref): Check the return value of
perform_or_defer_access_check.
2017-02-27 Marek Polacek <polacek@redhat.com>
* decl.c (expand_static_init): Add missing } in a comment.
2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
* init.c: Include intl.h.
(build_new_1): Move message strings into pedwarn to make them
-Wformat-security friendly. Mark string for translation.
* pt.c (tsubst_copy_and_build): Mark string for translation.
Make the pointer const.
* semantics.c (finish_id_expression): Mark strings for translation.
2017-02-25 Jakub Jelinek <jakub@redhat.com>
* call.c (build_op_delete_call): Make msg1 and msg2 const.
2017-02-24 Jakub Jelinek <jakub@redhat.com>
PR c++/79588
* call.c (build_over_call): Call check_function_arguments even for
-Wrestrict, adjust check_function_arguments caller.
* parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
here.
* typeck.c (cp_build_function_call_vec): Adjust
check_function_arguments caller.
2017-02-24 Marek Polacek <polacek@redhat.com>
PR translation/79705
* decl.c (check_redeclaration_exception_specification): Mark a string
for translation. Make the pointer const.
2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/79361
* pt.c (register_specialization): Check duplicate_decls return value
for error_mark_node and pass it back.
2017-02-22 Jason Merrill <jason@redhat.com>
PR c++/79679 - missing destructor for argument
* call.c (build_over_call): Don't pass tf_no_cleanup to argument
conversions.
* pt.c (do_class_deduction): Handle 0 argument case.
2017-02-22 Jakub Jelinek <jakub@redhat.com>
PR c++/79664
* parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
* constexpr.c (potential_constant_expression_1): Handle
OMP_*, OACC_* and CILK_* trees. Use error_at with
EXPR_LOC_OR_LOC (t, input_location) computed early
instead of error, or error_at with location_of (t).
2017-02-22 Marek Polacek <polacek@redhat.com>
PR c++/79653
* parser.c (cp_parser_std_attribute_spec): Don't build the attribute
if the alignas expression is erroneous.
* pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
error_mark_node.
PR c++/79657
* semantics.c (finish_underlying_type): Bail out for incomplete enums.
2017-02-21 Jason Merrill <jason@redhat.com>
PR c++/50308 - wrong deprecated warning with ADL
PR c++/17729 - duplicate deprecated warning
* semantics.c (finish_id_expression): Only call mark_used on a
function if we aren't building a call.
PR c++/41727 - ICE with partial spec of partial instantiation
* pt.c (process_partial_specialization): For now, don't check more
specialized if there is more than one level of args.
2017-02-21 Marek Polacek <polacek@redhat.com>
PR c++/79535
* cp-tree.h (maybe_reject_flexarray_init): Declare.
* init.c (maybe_reject_flexarray_init): No longer static.
Add check for current_function_decl.
* parser.c (cp_parser_late_parse_one_default_arg): Reject
a default mem-initializer for a flexible array.
2017-02-21 Jakub Jelinek <jakub@redhat.com>
Paolo Carlini <paolo.carlini@oracle.com>
PR c++/79654
* decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
on error.
* pt.c (tsubst_decomp_names): Return error_mark_node if the first
decl after the decomposition artificial decl has error_mark_node.
* decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
instead of just == error_mark_node comparison.
2017-02-21 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/79589
* decl.c: Include gimplify.h.
(cp_finish_decomp): Make sure there is no sharing of trees
in between DECL_VALUE_EXPR of decomposition decls.
PR c++/79655
* constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
PR c++/79639
* constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
call cplus_expand_constant on it first.
2017-02-19 Jason Merrill <jason@redhat.com>
PR c++/78139 - destructor needed by new-expression
* call.c (build_special_member_call): Use tf_no_cleanup.
PR c++/78282 - auto template and pack expansion
* pt.c (find_parameter_packs_r): Don't walk into the type of
templates other than template template-parameters.
PR c++/79606 - ICE with this->base_member in NSDMI
* class.c (build_base_path): Check processing_template_decl.
PR c++/79607 - ICE with T{} initializer
* decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
PR c++/79566 - elaborated-type-specifier in range for
* parser.c (cp_parser_simple_declaration): Fix check for type
definition.
PR c++/79400 - confusing suggestion of 'noexcept'
* parser.c (cp_parser_exception_specification_opt): Remove
suggestion for deprecated dynamic exception-specification.
PR c++/79470 - partial ordering with reference parameters
* pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
PR c++/79500 - ICE with non-template deduction guide
* pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
DECL_TEMPLATE_RESULT.
PR c++/79580 - ICE with compound literal
* parser.c (cp_parser_class_head): If we're in the middle of an
expression, use ts_within_enclosing_non_class.
PR c++/79503 - inherited ctor taking base class
* call.c (add_function_candidate): Also check that
DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/79380
* typeck.c (cxx_alignas_expr): Reject a non-integral alignas
argument.
2017-02-19 Eric Fiselier <eric@efcs.ca>
Jonathan Wakely <jwakely@redhat.com>
PR c++/69523
* parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
control warning about literal suffix identifiers without a leading
underscore.
2017-02-17 Jason Merrill <jason@redhat.com>
PR c++/79508 - lookup error with member template
* parser.c (cp_parser_template_name): Clear
parser->context->object_type if we aren't doing lookup.
PR c++/78690 - ICE with using and global type with same name
* pt.c (type_dependent_object_expression_p): True for
IDENTIFIER_NODE.
PR c++/79549 - C++17 ICE with non-type auto template parameter pack
* pt.c (convert_template_argument): Just return an auto arg pack.
(tsubst_template_args): Don't tsubst an auto pack type.
PR c++/79556 - C++17 ICE with non-type auto
* pt.c (do_auto_deduction): Don't try to deduce from null type.
PR c++/79533 - C++17 ICE with temporary cast to reference
* call.c (build_over_call): Conversion to a reference prevents copy
elision.
2017-02-16 Jakub Jelinek <jakub@redhat.com>
Jason Merrill <jason@redhat.com>
PR c++/79502 - lost nodiscard attribute
* pt.c (apply_late_template_attributes): Do apply non-dependent
attributes to types.
2017-02-16 Jason Merrill <jason@redhat.com>
PR c++/78572 - ICE with self-modifying array initializer
* constexpr.c (cxx_eval_store_expression): The object we're
initializing is outside the constant-expression.
(cxx_eval_call_expression): Set ctx->call.
PR c++/79050 - ICE with undeduced auto and LTO
* decl.c (poplevel): Remove undeduced auto decls.
2017-02-16 Jakub Jelinek <jakub@redhat.com>
PR c++/79512
* parser.c (cp_parser_omp_target): For -fopenmp-simd
ignore #pragma omp target even when not followed by identifier.
2017-02-15 Jason Merrill <jason@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR c++/79464 - ICE in IPA with omitted constructor parms
* class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
(adjust_clone_args): Adjust.
(add_method): Remember omitted parms.
* call.c (add_function_candidate): Likewise.
* mangle.c (write_method_parms): Likewise.
* method.c (ctor_omit_inherited_parms): Return false if there are no
parms to omit.
2017-02-15 Martin Sebor <msebor@redhat.com>
PR c++/79363
* init.c (maybe_reject_flexarray_init): New function.
(perform_member_init): Call it.
2017-02-15 Jakub Jelinek <jakub@redhat.com>
PR c++/79301
* parser.c (cp_parser_std_attribute): Don't pedwarn about
[[deprecated]] with -std=c++11 and [[fallthrough]] with
-std=c++11 and -std=c++14.
PR c++/79288
* decl.c (grokdeclarator): For static data members, handle thread_p
only after handling inline.
2017-02-14 Marek Polacek <polacek@redhat.com>
PR c++/79420
PR c++/79463
* parser.c (cp_parser_postfix_dot_deref_expression): Avoid
clobbering if the postfix expression isn't an EXPR_P.
2017-02-13 Jason Merrill <jason@redhat.com>
PR c++/79461 - ICE with lambda in constexpr constructor
* constexpr.c (build_data_member_initialization): Ignore
initialization of a local variable.
2017-02-13 Jakub Jelinek <jakub@redhat.com>
* init.c (warn_placement_new_too_small): Add missing space in
diagnostics.
* parser.c (cp_parser_oacc_declare): Likewise.
* mangle.c (maybe_check_abi_tags): Likewise.
PR c++/79232
* typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
in the rightmost operand.
2017-02-13 Nathan Sidwell <nathan@acm.org>
PR c++/79296 - ICE mangling localized template instantiation
* decl2.c (determine_visibility): Use template fn context for
local class instantiations.
2017-02-11 Jason Merrill <jason@redhat.com>
PR c++/77659 - ICE with new and C++14 aggregate NSDMI
* init.c (build_new): Make backups of any CONSTRUCTORs in init.
(build_new_1): Use replace_placeholders.
* tree.c (replace_placeholders_t): Also track whether we've seen a
placeholder.
(replace_placeholders, replace_placeholders_r): Adjust.
* cp-tree.h: Adjust.
PR c++/77790 - ICE with auto function in C++11 mode
* decl.c (undeduced_auto_decl): Remove C++14 limitation.
(require_deduced_type): Add complain parm, return bool.
* cp-tree.h: Adjust.
* decl2.c (mark_used): Use require_deduced_type.
2017-02-10 Jason Merrill <jason@redhat.com>
PR c++/78908 - template ops and bitfields
* tree.c (build_min_non_dep): Use unlowered_expr_type.
PR c++/78897 - constexpr union
* constexpr.c (cxx_eval_store_expression): A store to a union member
erases a previous store to another member.
PR c++/71285 - member of fold-expression
* semantics.c (finish_unary_fold_expr)
(finish_binary_fold_expr): Use null type for fold-expressions.
PR c++/79401 - protected inherited constructor
* call.c (enforce_access): For inheriting constructor, find a base
binfo in the path we already have.
2017-02-10 Marek Polacek <polacek@redhat.com>
PR c++/79435
* pt.c (type_dependent_expression_p): Check if the expression type
is null.
PR c++/79184
* cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
if warnings shouldn't be given.
2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71737
* pt.c (tsubst_decl): Don't try to preserve a typedef that names
an error_mark_node as type.
2017-02-09 Jakub Jelinek <jakub@redhat.com>
Jason Merrill <jason@redhat.com>
PR c++/79143
* pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
from pattern to type.
2017-02-09 Jason Merrill <jason@redhat.com>
PR c++/79316 - default argument in deduction guide
PR c++/79350 - explicit deduction guide
* parser.c (cp_parser_constructor_declarator_p)
(cp_parser_direct_declarator): Parse deduction guides more like
constructors.
* cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
* tree.c (special_function_p): Return it.
* decl.c (check_special_function_return_type): Handle it.
(grokdeclarator, grokfndecl): Adjust.
(cp_finish_decl): Pass flags to do_auto_deduction.
* error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
* pt.c (dguide_name_p): Take a const_tree.
(do_class_deduction): Handle explicit.
(do_auto_deduction): Pass flags through.
(build_deduction_guide): Copy explicit flag.
2017-02-09 Jakub Jelinek <jakub@redhat.com>
PR c++/79429
* parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
non-pragma_compound context here.
(cp_parser_omp_target): Likewise.
(cp_parser_pragma): Don't call push_omp_privatization_clauses and
parsing for ordered and target omp pragmas in non-pragma_stmt
non-pragma_compound contexts.
PR c/79431
* parser.c (cp_parser_oacc_declare): Formatting fix.
(cp_parser_omp_declare_target): Don't invoke symtab_node::get on
automatic variables.
2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
Chung-Lin Tang <cltang@codesourcery.com>
* parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
parsing. Parse constant expression. Remove semantic checking.
(cp_parser_omp_clause_collapse): Disallow tile.
(cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
error about missing for after already emitting one. Use more
conventional for idiom for unbounded loop.
* pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
* semantics.c (finish_omp_clauses): Correct TILE semantic check.
(finish_omp_for): Deal with tile clause.
2017-02-07 Nathan Sidwell <nathan@acm.org>
* method.c (synthesized_method_base_walk): New. Broken out of ...
(synthesized_method_walk): ... here. Call it. Cleanup
initializations.
2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/79360
* typeck2.c (process_init_constructor_union): Consider only
FIELD_DECLs when looking for an NSDMI.
2017-02-06 Jason Merrill <jason@redhat.com>
PR c++/71193 - incomplete types in templates
* parser.c (cp_parser_postfix_dot_deref_expression): In a template
handle incomplete type by pedwarning and then treating as dependent.
2017-02-06 Jakub Jelinek <jakub@redhat.com>
PR c++/79379
* constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
(potential_constant_expression_1): Likewise.
PR c++/79377
* tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
allow one fewer than expected arguments if flag_permissive.
PR c++/79372
* decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
* pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
with error_mark_node type.
2017-02-03 Jason Merrill <jason@redhat.com>
PR c++/78689 - ICE on constructor with label
* optimize.c (maybe_clone_body): Replace omitted parameters with
null lvalues.
* class.c (build_clone): Fix logic for omitting inherited parms.
PR c++/12245 - excessive memory use
* constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
back in. Don't cache constants.
(maybe_constant_init): Don't cache constants.
PR c++/79294 - ICE with invalid template argument
* pt.c (convert_nontype_argument_function): Check value-dependence.
(convert_nontype_argument): Don't check it here for function ptrs.
2017-02-02 Richard Biener <rguenther@suse.de>
PR cp/14179
* cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
it lazily on the first changed element only and copy it
fully upfront, only storing changed elements.
2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/69637
* decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
to the width.
2017-01-31 Jakub Jelinek <jakub@redhat.com>
PR c++/79304
* error.c (dump_expr) <case COMPONENT_REF>: Don't print .
after ARROW_EXPR.
2017-01-31 David Malcolm <dmalcolm@redhat.com>
PR c++/79298
* name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
any namespace aliases.
2017-01-31 Nathan Sidwell <nathan@acm.org>
PR c++/79290
* typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
PR c++/67273
PR c++/79253
* pt.c: (instantiate_decl): Push to top level when current
function scope doesn't match. Only push lmabda scope stack when
pushing to top.
* cp-tree.h (instantiate_decl): Make defer_ok bool.
* pt.c: Fix instantiate_decl calls to pass true/false not 0/1
(instantiate_decl): Simplify and reorder state saving and restoration.
PR c++/79264
* lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
* semantics.c (finish_member_declaration): Assert class is being
defined.
2017-01-30 Alexandre Oliva <aoliva@redhat.com>
Introduce C++ support in libcc1.
* cp-tree.h (struct lang_identifier): Add oracle_looked_up.
(ansi_opname): Rename to...
(cp_operator_id): ... this. Adjust all callers.
(ansi_assopname): Rename to...
(cp_assignment_operator_id): ... this. Adjust all callers.
(cp_literal_operator_id): Declare.
(set_global_friend): Declare.
(is_global_friend): Declare.
(enum cp_oracle_request): New type.
(cp_binding_oracle_function): New type.
(cp_binding_oracle): Declare.
(cp_finish_injected_record_type): Declare.
* friend.c (global_friend): New var.
(set_global_friend): New fn.
(is_global_friend): New fn.
(is_friend): Call is_global_friend.
* name-lookup.c (cp_binding_oracle): New var.
(query_oracle): New fn.
(qualified_lookup_using_namespace): Call query_oracle.
(lookup_name_real_1): Likewise.
* parser.c (cp_literal_operator_id): Drop static.
* search.c (friend_accessible_p): Call is_global_friend.
* semantics.c (is_this_parameter): Accept a variable if the
binding oracle is enabled.
2017-01-27 Jason Merrill <jason@redhat.com>
PR c++/78771 - ICE with inherited constructor.
* call.c (build_over_call): Call deduce_inheriting_ctor here.
* pt.c (tsubst_decl): Not here.
* class.c (add_method): Or here.
* method.c (deduce_inheriting_ctor): Handle clones.
(implicitly_declare_fn): Don't deduce inheriting ctors yet.
2017-01-27 Adam Butcher <adam@jessamine.co.uk>
PR c++/64382
* cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
New function.
* cp/cp-tree.h: Declare it.
* cp/semantics.c (finish_id_expression): Resolve names within a default
capturing generic lambda defined within a template prior to
instantiation to allow for captures to be added to the closure type.
2017-01-26 Jakub Jelinek <jakub@redhat.com>
PR c++/68727
* cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
* cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
* parser.c (cp_parser_builtin_offsetof): Pass result of
build_static_cast of null_pointer_node to finish_offsetof.
* semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
it for -Winvalid-offsetof pedwarn instead of trying to guess
original offsetof type from EXPR. Save OBJECT_PTR as a new
second operand to OFFSETOF_EXPR.
* pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
as OBJECT_PTR.
2017-01-26 Jason Merrill <jason@redhat.com>
* name-lookup.c (parse_using_directive): Deprecate strong using.
PR c++/79176 - lambda ICE with -flto -Os
* decl2.c (vague_linkage_p): Handle decloned 'tors.
* tree.c (decl_linkage): Likewise.
2017-01-25 Martin Sebor <msebor@redhat.com>
* decl.c (grokdeclarator): Fix a typo in a comment.
2017-01-25 Jakub Jelinek <jakub@redhat.com>
PR c++/78896
* decl.c (cp_finish_decomp): Disallow memberwise decomposition of
lambda expressions.
PR c++/77914
* parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
PR lto/79061
* decl.c (cxx_init_decl_processing): Pass main_input_filename
to build_translation_unit_decl.
2017-01-24 Jakub Jelinek <jakub@redhat.com>
PR c++/79205
* cp-gimplify.c (cp_genericize_r): Add result of
convert_from_reference on invisiref parm to p_set.
2017-01-24 Nathan Sidwell <nathan@acm.org>
PR c++/78469 - defaulted ctor and inaccessible dtor
* cp-tree.h (tsubst_flags): Add tf_no_cleanup.
* init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
* tree.c (build_target_expr): Check tf_no_cleanup.
PR c++/79118 - anon-members and constexpr
* constexpr.c (cx_check_missing_mem_inits): Caller passes type not
ctor decl. Recursively check anonymous members.
(register_constexpr_fundef): Adjust cx_check_missing_mem_inits
call.
(explain_invalid_constexpr_fn): Likewise.
2017-01-23 Nathan Sidwell <nathan@acm.org>
PR c++/71710 - template using directive of field
* pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
check earlier.
PR c++/71406 - ICE with scope-ref'd template id exprs
PR c++/77508
* typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
before breaking up TEMPLATE_ID_EXPR.
2017-01-20 Nathan Sidwell <nathan@acm.org>
PR c++/78495 - wrong code inherited ctor and invisi-ref parm
* cp-gimplify.c (cp_generize_r): Don't skip thunks.
2017-01-20 David Malcolm <dmalcolm@redhat.com>
PR c++/77829
PR c++/78656
* cp-tree.h (suggest_alternatives_for): Add bool param.
(suggest_alternative_in_explicit_scope): New decl.
* error.c (qualified_name_lookup_error): When SCOPE is a namespace
that isn't the global one, call new function
suggest_alternative_in_explicit_scope, only calling
suggest_alternatives_for if it fails, and disabling near match
searches fort that case. When SCOPE is the global namespace,
pass true for new param to suggest_alternatives_for to allow for
fuzzy name lookups.
* lex.c (unqualified_name_lookup_error): Pass true for new param
to suggest_alternatives_for.
* name-lookup.c (consider_binding_level): Add forward decl.
(suggest_alternatives_for): Add "suggest_misspellings" param,
using it to conditionalize the fuzzy name-lookup code.
(suggest_alternative_in_explicit_scope): New function.
* parser.c (cp_parser_primary_expression): When calling
finish_id_expression, pass location of id_expression rather
than that of id_expr_token.
(cp_parser_id_expression): Convert local "unqualified_id" from
tree to cp_expr to avoid implicitly dropping location information.
2017-01-20 Marek Polacek <polacek@redhat.com>
PR c/64279
* call.c (build_conditional_expr_1): Warn about duplicated branches.
* semantics.c (finish_expr_stmt): Build statement using the proper
location.
2017-01-19 Jason Merrill <jason@redhat.com>
US 20 - forwarding references and class template argument deduction
* cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
* pt.c (push_template_decl_real): Set it.
(maybe_adjust_types_for_deduction): Check it.
(rewrite_template_parm): Copy it.
US 19 - deduction guides and constructors
* call.c (joust): Prefer deduction guides to constructors.
* pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
(deduction_guide_p): Check DECL_P.
* decl.c (check_initializer): Always use build_aggr_init for array
decomposition.
PR c++/79130 - decomposition and direct-initialization
* init.c (build_aggr_init): Communicate direct-initialization to
build_vec_init.
(build_vec_init): Check for array copy sooner.
* parser.c (cp_parser_decomposition_declaration): Remove call to
build_x_compound_expr_from_list.
2017-01-18 Jason Merrill <jason@redhat.com>
PR c++/68666 - member variable template-id
* typeck.c (finish_class_member_access_expr): Handle variable
template-id.
* pt.c (lookup_and_finish_template_variable): No longer static.
* cp-tree.h: Declare it.
2017-01-18 Nathan Sidwell <nathan@acm.org>
PR c++/78488
* call.c (build_over_call): When checking ellipsis conversions for
an inherited ctor, make sure there is at least one conversion.
2017-01-18 Jason Merrill <jason@redhat.com>
PR c++/78894 - ICE with class deduction and default arg
* pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
PR c++/77489
* mangle.c (write_discriminator): Reorganize abi warning check.
2017-01-18 Nathan Sidwell <nathan@acm.org>
* cp-tree.h: Clarify exception spec node comment.
* except.c (nothrow_spec_p): Simplify by checking node-equality.
PR c++/79091
* mangle.c (write_exception_spec): Check nothrow explicitly.
(write_encoding): Don't increment processing_template_decl around
encoding.
2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
PR c++/70182
* mangle.c (write_template_args): Add "on" for operator names.
2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
PR c++/77489
* mangle.c (write_discriminator): Handle discriminator >= 10.
2017-01-17 Nathan Sidwell <nathan@acm.org>
PR c++/61636
* cp-tree.h (maybe_generic_this_capture): Declare.
* lambda.c (resolvable_dummy_lambda): New, broken out of ...
(maybe_resolve_dummy): ... here. Call it.
(maybe_generic_this_capture): New.
* parser.c (cp_parser_postfix_expression): Speculatively capture
this in generic lambda in unresolved member function call.
* pt.c (tsubst_copy_and_build): Force hard error from failed
member function lookup in generic lambda.
2017-01-17 Aldy Hernandez <aldyh@redhat.com>
PR c++/70565
* cp-array-notation.c (expand_array_notation_exprs): Handle
OMP_PARALLEL.
2017-01-11 Jason Merrill <jason@redhat.com>
PR c++/78337 - ICE on invalid with generic lambda
* semantics.c (process_outer_var_ref): Check if containing_function
is null. Move inform call under complain test.
2017-01-11 Nathan Sidwell <nathan@acm.org>
PR c++/77812
* name-lookup.c (set_namespace_binding_1): An overload of 1 decl
is a new overload.
2017-01-11 Nathan Sidwell <nathan@acm.org>
* name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2017-01-11 Jakub Jelinek <jakub@redhat.com>
PR c++/78341
* parser.c (cp_parser_std_attribute_spec): Remove over-eager
assertion. Formatting fix.
PR c++/72813
* decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
writing PCH file.
2017-01-10 David Malcolm <dmalcolm@redhat.com>
PR c++/77949
* parser.c (cp_parser_class_specifier_1): Only suggest inserting
a missing semicolon if we have a valid insertion location for
the fix-it hint.
2017-01-10 Jason Merrill <jason@redhat.com>
FI 20, decomposition declaration with parenthesized initializer.
* parser.c (cp_parser_decomposition_declaration): Use
cp_parser_initializer.
2017-01-09 Jason Merrill <jason@redhat.com>
Implement P0195R2, C++17 variadic using.
* parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
* pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
* error.c (dump_decl): Likewise.
2017-01-09 Jakub Jelinek <jakub@redhat.com>
PR translation/79019
PR translation/79020
* semantics.c (finish_omp_clauses): Add missing whitespace to
translatable strings.
* cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
2017-01-07 Jason Merrill <jason@redhat.com>
PR c++/78948 - instantiation from discarded statement
* parser.h (struct cp_parser): Remove in_discarded_stmt field.
* cp-tree.h (in_discarded_stmt): Declare it.
(struct saved_scope): Add discarded_stmt bitfield.
(in_discarded_stmt): New macro.
* decl2.c (mark_used): Check it.
* parser.c (cp_parser_selection_statement): Adjust.
(cp_parser_jump_statement): Adjust.
2017-01-05 Jakub Jelinek <jakub@redhat.com>
PR c++/78931
* decl.c (cp_finish_decomp): Remove probe variable, if tt is
REFERENCE_REF_P, set tt to its operand.
PR c++/78890
* class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
unions even for C++11 and later.
2017-01-05 Nathan Sidwell <nathan@acm.org>
PR c++/78765
* pt.c (convert_nontype_argument): Don't try and see if integral
or enum expressions are constants prematurely.
2017-01-04 Marek Polacek <polacek@redhat.com>
PR c++/64767
* typeck.c (cp_build_binary_op): Warn when a pointer is compared with
a zero character literal.
2017-01-04 Jakub Jelinek <jakub@redhat.com>
PR c++/78949
* typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
vector type.
PR c++/78693
* parser.c (cp_parser_simple_declaration): Only complain about
inconsistent auto deduction if auto_result doesn't use auto.
* parser.c (cp_parser_simple_declaration): Diagnose function
declaration among more than one init-declarators with auto
specifier.
PR c++/71182
* parser.c (cp_lexer_previous_token): Use vec_safe_address in the
assertion, as lexer->buffer may be NULL.
2017-01-04 Marek Polacek <polacek@redhat.com>
PR c++/77545
PR c++/77284
* constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
2017-01-04 Nathan Sidwell <nathan@acm.org>
PR c++/66735
* cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
(lambda_capture_field_type): Update prototype.
* lambda.c (lambda_capture_field_type): Add is_reference parm.
Add referenceness here.
(add_capture): Adjust lambda_capture_field_type call, refactor
error checking.
* pt.c (tsubst): Adjust lambda_capture_field_type call.
2017-01-01 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
Copyright (C) 2017 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.
|