gep 0, 0 is equivalent to bitcast. LLVM canonicalizes it
to getelementptr because it make SROA can then handle it.
Simple case like
void g(A &a) { z(a); if (glob) a.foo(); } void testG() { A a; g(a); }
was not devirtualized with -fstrict-vtable-pointers because luck of
handling for gep 0 in Memory Dependence Analysis
I think its fine to just use [&] capture on simple factorings like this.