When it's not possible to initialize an implicit capture, add a note
pointing to the first use of the captured variable.
Example (the note is new):
lambda-expressions.cpp:81:15: error: no matching constructor for initialization of 'G'
return [=]{ ^
lambda-expressions.cpp:82:24: note: implicitly capturing 'g', first used here
const G* gg = &g; ^
As suggested in https://reviews.llvm.org/D50927.
This early exit leaves your CodeSynthesisContext on the stack. Consider using RAII?