Commit 6855b9c
authored
[clang][deps] Properly capture the global module and '\n' for all module directives (#148685)
Previously, the newline after a module directive was not properly
captured and printed by `clang::printDependencyDirectivesAsSource`.
According to P1857R3, each directive must, after skipping horizontal
whitespace, appear at the start of a logical line. Because the newline
after module directives was missing, this invalidated the following
line.
This fixes tests that were previously in violation of P1857R3,
including for Objective-C directives, which should also comply with
P1857R3.
This also ensures that the global module fragment `module;` is captured
by the dependency directives scanner.1 parent 6b371ca commit 6855b9c
File tree
4 files changed
+41
-26
lines changed- clang
- lib
- Lex
- Parse
- unittests/Lex
4 files changed
+41
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
| 563 | + | |
| 564 | + | |
563 | 565 | | |
564 | | - | |
565 | | - | |
| 566 | + | |
566 | 567 | | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
| 568 | + | |
| 569 | + | |
572 | 570 | | |
573 | 571 | | |
574 | 572 | | |
| |||
735 | 733 | | |
736 | 734 | | |
737 | 735 | | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
738 | 743 | | |
739 | 744 | | |
740 | 745 | | |
| |||
905 | 910 | | |
906 | 911 | | |
907 | 912 | | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | 913 | | |
917 | 914 | | |
918 | 915 | | |
| |||
925 | 922 | | |
926 | 923 | | |
927 | 924 | | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
928 | 933 | | |
929 | 934 | | |
930 | 935 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
950 | 950 | | |
951 | 951 | | |
952 | 952 | | |
| 953 | + | |
| 954 | + | |
953 | 955 | | |
954 | 956 | | |
955 | 957 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2519 | 2519 | | |
2520 | 2520 | | |
2521 | 2521 | | |
| 2522 | + | |
2522 | 2523 | | |
2523 | 2524 | | |
2524 | 2525 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
643 | | - | |
| 643 | + | |
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
649 | | - | |
650 | | - | |
| 649 | + | |
| 650 | + | |
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
| |||
1122 | 1122 | | |
1123 | 1123 | | |
1124 | 1124 | | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
1129 | | - | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
1130 | 1136 | | |
1131 | 1137 | | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
1135 | 1142 | | |
1136 | 1143 | | |
1137 | 1144 | | |
| |||
0 commit comments