While the examples involved requires it seemed pretty ordinary (for a bug) to me because requires very easily gets you IFNDR which is profound level of doom. This area is haunted, no surprise there are (also?) bugs.
The (new?) reduction to not involve requires changes that and seems more concerning. Do you have a link to the Clang/ LLVM bug - I didn't see one in the article but it's entirely possible I missed it.
Yeah, that area of the clang code seems pretty broken.
I've recently fixed a different bug related to consteval lambdas in Clang (https://github.com/llvm/llvm-project/issues/183415 and https://github.com/llvm/llvm-project/issues/169139, bug from 2025) and from what I found out there there is much much more to fix in this area. I think the ways used to propagate consteval-ness and constexpr-ness are pretty brittle and require too many specific checks in many places that are easily forgotten or done wrong.
I actually just looked at this bug because I also ran into it and thought "how hard can it be to fix a clang bug?". It was actually my second ever attempted time to fix something in LLVM.
The Clang codebase is surprisingly easy to hack on! (You should compile clang with clang and lld though, otherwise (with gcc) you get a 150GB build folder and probably OOM during linking)
With clang the build folder is at least a third as small (only ~50GB). It also helps to compile only the host target (e.g. x86_64) and to limit the amount of parallel linking steps to avoid going OOM.
Then, after you have an initial build, a recompile only takes a minute or so.
This area is definitely haunted. Thanks for linking the bug here. I realize I did link the bug in my previous article, but forgot to do it in this one. I'll add the link
I suspect this is intentional and the advantage of this might be that it uses runtime type erasure just like go, unlike cpp/rust templates which usually has enormous compile times. It's casually dufus opinion of mine, i think cppreference covers it or else it begs the question: how all compilers chose to do the same thing?
If I'm understanding you correctly, you're saying that it might be intentional that Clang can't execute generic lambdas at compile-time. I'm pretty sure that this isn't true, since there's nothing in the standard forbidding it, the bug I logged with LLVM was recognized to be a real bug. It works in the other compilers, but writing a compiler is extremely difficult, and edge cases may slip through
3
u/tialaramex Oct 18 '26
While the examples involved
requiresit seemed pretty ordinary (for a bug) to me becauserequiresvery easily gets you IFNDR which is profound level of doom. This area is haunted, no surprise there are (also?) bugs.The (new?) reduction to not involve
requireschanges that and seems more concerning. Do you have a link to the Clang/ LLVM bug - I didn't see one in the article but it's entirely possible I missed it.-1
u/Business-Weather-217 Oct 18 '26
I suspect this is intentional and the advantage of this might be that it uses runtime type erasure just like go, unlike cpp/rust templates which usually has enormous compile times. It's casually dufus opinion of mine, i think cppreference covers it or else it begs the question: how all compilers chose to do the same thing?