Skip to content

Commit c3edfd7

Browse files
fix: preserve cascade ordering without Clang 18 recursive-lambda compiler crash
1 parent fc3b39f commit c3edfd7

3 files changed

Lines changed: 6 additions & 77 deletions

File tree

‎.automation/native-cascade.patch‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎.github/workflows/land-native-cascade.yml‎

Lines changed: 0 additions & 56 deletions
This file was deleted.

‎src/WebScene.NativeWeb/src/native_web.cpp‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,12 @@ const scene &document::render(float width, float height) {
936936
++order;
937937
}
938938
}
939-
std::ranges::sort(declarations, {}, [](const auto &d) {
940-
return std::tuple(d.important, d.specificity, d.order);
939+
// Explicit iterator comparator avoids a Clang 18 concepts-instantiation
940+
// crash for a projected ranges::sort inside this recursive generic lambda.
941+
// Keep the same importance/specificity/source-order cascade key.
942+
std::sort(declarations.begin(), declarations.end(), [](const candidate &a, const candidate &b) {
943+
return std::tie(a.important, a.specificity, a.order) <
944+
std::tie(b.important, b.specificity, b.order);
941945
});
942946
specified_variables local;
943947
for (const auto &d : declarations)

0 commit comments

Comments
 (0)