https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96311
--- Comment #2 from Tillmann Karras <tilkax at gmail dot com> --- (In reply to Martin Liška from comment #1) > Confirmed, but it seems the code is rejected with clang: > [...] > Is it a valid test-case? I think so. There is a bug report for Clang: https://bugs.llvm.org/show_bug.cgi?id=25627 And MSVC used to have the same problem: https://developercommunity.visualstudio.com/content/problem/367326/problems-with-capturing-constexpr-in-lambda.html