Minimal repro:
#include <iostream>
int main() {
auto foo = [a = false]() mutable {
if (a) std::cout << ',';
a = true;
std::cout << 'A';
};
foo();
foo();
}
https://godbolt.org/z/6nn4z4eqM
Looks like when -fexperimental-new-constant-interpreter is set, if (a) condition is optimized away completely, and -Wunreachable-code warning is emitted.
Didn't find anything similar in "clang:bytecode" open issues, but feel free to close if this is a duplicate.