In the following code:
int main(){
constexpr int a = 123;
[]() {
int v = (a,123);
};
}
Obviously, this code doesn't require a
to be potentially-evaluated for it's constexpr
, so it's not ODR-used. Thus it should't require capture of any form.
However, only GCC succeeded to compile this snippet.
Is this a bug existing both in MSVC and clang? Or did I miss something? Whose fault is it?