# Clang's broken generic lambdas nearly killed my compile-time testing library

Original title: I can't use generic lambdas at compile-time, now what?

> Hacker News story 50153125 · language: en · submitted 2026-10-19
> Web version: https://zeli.app/story/50153125
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 19 · by [ibobev](<https://news.ycombinator.com/user?id=ibobev>) · 💬 3
[original](<https://blog.ganets.ky/ClangGenericLambdas/>) · [HN discussion](<https://news.ycombinator.com/item?id=50153125>)

## Summary

A follow-up to a previous article on breaking MSVC and Clang, this post explains how Clang still fails to evaluate generic lambdas at compile-time, a bug that threatens the author's compile-time unit testing library, k3tchup. The author walks through the minimal repro, why generic lambdas are needed for dispatching between nullary and stateful test packets, and how to work around the limitation in Clang 16 and later using function templates instead of inline lambdas.

## Key quote

> Because I'm writing a unit testing library focused around compile-time testing, the inability to evaluate generic lambdas at compile-time could kill the project, at least with the API I want.

---

## Cite

- Page: https://zeli.app/story/50153125
- Date: 2026-10-19
- Source: blog.ganets.ky (https://blog.ganets.ky/ClangGenericLambdas/)
- Hacker News: https://news.ycombinator.com/item?id=50153125

## Other languages

- zh: https://zeli.app/zh/story/50153125 · markdown: https://zeli.app/zh/story/50153125.md
- ko: https://zeli.app/ko/story/50153125 · markdown: https://zeli.app/ko/story/50153125.md
