Commit 77f2ccb
authored
[STLExtras] Add out-of-line definition of friend operator== for C++20 (llvm#72348)
The last attempt at llvm#72220 was
reverted by
llvm@94d6699
because it breaks C++20 build in clang-17 and before.
This is a workaround of
llvm#70210 and unblocks
llvm#72213 which rectifies
rewriting template operator and thus introduces new breakages.
Moving the function definition out of the class makes clang find a
matching `operator!=` for the `operator==`. This makes clang not rewrite
the `operator==` with reversed args. Hence, the ambiguity is resolved.
The final plan, when llvm#70210
is fixed, is to move these back to inline definition or even convert to
a member template operator. This should not be urgent and could even
wait for a major clang release including
llvm#722131 parent 75d820d commit 77f2ccb
2 files changed
+19
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1290 | 1290 | | |
1291 | 1291 | | |
1292 | 1292 | | |
1293 | | - | |
1294 | | - | |
1295 | | - | |
1296 | | - | |
1297 | | - | |
1298 | | - | |
1299 | | - | |
1300 | | - | |
1301 | | - | |
1302 | | - | |
1303 | | - | |
1304 | | - | |
1305 | 1293 | | |
1306 | 1294 | | |
1307 | 1295 | | |
| |||
1364 | 1352 | | |
1365 | 1353 | | |
1366 | 1354 | | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
1367 | 1372 | | |
1368 | 1373 | | |
1369 | 1374 | | |
| |||
0 commit comments