Commit cf55ae7
committed
[Modules] Fix an identifier hiding a function-like macro definition.
We emit a macro definition only in a module defining it. But it means
that if another module has an identifier with the same name as the macro,
the users of such module won't be able to use the macro anymore.
Fix by storing that an identifier has a macro definition that's not in
a current module (`MacroDirectivesOffset == 0`). This way
`IdentifierLookupVisitor` knows not to stop at the first module with
an identifier but to keep checking included modules for the actual macro
definition.
Fixes issue #32040.
rdar://302582781 parent 357e380 commit cf55ae7
File tree
4 files changed
+57
-10
lines changed- clang
- lib/Serialization
- test/Modules
4 files changed
+57
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1131 | 1131 | | |
1132 | 1132 | | |
1133 | 1133 | | |
1134 | | - | |
| 1134 | + | |
1135 | 1135 | | |
1136 | 1136 | | |
1137 | 1137 | | |
| |||
1151 | 1151 | | |
1152 | 1152 | | |
1153 | 1153 | | |
1154 | | - | |
1155 | | - | |
1156 | | - | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
1157 | 1157 | | |
1158 | 1158 | | |
1159 | 1159 | | |
1160 | 1160 | | |
1161 | | - | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
1162 | 1165 | | |
1163 | 1166 | | |
1164 | 1167 | | |
| |||
2419 | 2422 | | |
2420 | 2423 | | |
2421 | 2424 | | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
2422 | 2428 | | |
2423 | 2429 | | |
2424 | 2430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| 289 | + | |
| 290 | + | |
289 | 291 | | |
290 | 292 | | |
291 | 293 | | |
| |||
300 | 302 | | |
301 | 303 | | |
302 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
303 | 309 | | |
304 | 310 | | |
305 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3792 | 3792 | | |
3793 | 3793 | | |
3794 | 3794 | | |
3795 | | - | |
| 3795 | + | |
| 3796 | + | |
| 3797 | + | |
| 3798 | + | |
3796 | 3799 | | |
3797 | 3800 | | |
3798 | 3801 | | |
| |||
3871 | 3874 | | |
3872 | 3875 | | |
3873 | 3876 | | |
3874 | | - | |
| 3877 | + | |
| 3878 | + | |
3875 | 3879 | | |
3876 | 3880 | | |
3877 | 3881 | | |
| |||
3902 | 3906 | | |
3903 | 3907 | | |
3904 | 3908 | | |
3905 | | - | |
3906 | | - | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
3907 | 3913 | | |
3908 | 3914 | | |
3909 | 3915 | | |
3910 | 3916 | | |
3911 | 3917 | | |
3912 | 3918 | | |
3913 | | - | |
| 3919 | + | |
3914 | 3920 | | |
3915 | 3921 | | |
3916 | 3922 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
0 commit comments