Commit 8504e86
committed
Auto-enable file/line/function info on contracts violations + usability improvements
Thanks @MikeShah for your YouTube video here: https://youtu.be/ZslemeHsOjk?si=qPoNdJLxBoSgFh6b . I'm treating the video as a "looking over your shoulder using Cpp2" mini-UX study to make a better experience for folks coming to the syntax the first time...
Diagnose attempt to declare two things at once, e.g., `x,y : int = 5;`
Diagnose attempt to for-loop over two ranges, e.g., `for x,y do ..`
Automatically use <source_location>, including for file/line/function information on contracts checks so when using a capable compiler you get nice bounds/other violation messages out of the box that point directly to the offending source line
Remove the -add-source-info flag as no longer needed, now <source_location> is now reliable and automated (modulo a workaround in cpp2util.h for an MSVC bug where importing source_location via a module doesn't work correctly)1 parent a252d50 commit 8504e86
File tree
26 files changed
+92
-59
lines changed- include
- regression-tests
- test-results
- gcc-14-c++2b
- msvc-2022-c++latest
- source
26 files changed
+92
-59
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
553 | 555 | | |
554 | 556 | | |
555 | 557 | | |
556 | | - | |
557 | | - | |
558 | | - | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
559 | 561 | | |
| 562 | + | |
560 | 563 | | |
561 | 564 | | |
562 | 565 | | |
563 | 566 | | |
564 | 567 | | |
| 568 | + | |
565 | 569 | | |
566 | 570 | | |
567 | 571 | | |
| |||
1520 | 1524 | | |
1521 | 1525 | | |
1522 | 1526 | | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
1523 | 1535 | | |
1524 | | - | |
| 1536 | + | |
1525 | 1537 | | |
1526 | 1538 | | |
1527 | 1539 | | |
| |||
1555 | 1567 | | |
1556 | 1568 | | |
1557 | 1569 | | |
1558 | | - | |
| 1570 | + | |
1559 | 1571 | | |
1560 | 1572 | | |
1561 | 1573 | | |
| |||
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
25 | 33 | | |
26 | 34 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 10 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments