could not convert ‘{1, "HelloNewPMPass", "v0.1", <lambda closure object>llvmGetPassPluginInfo()::<lambda(llvm::PassBuilder&)>{arginfo}}’ from ‘<brace-enclosed initializer list>’ to ‘llvm::PassPluginLibraryInfo’
I left the second lambda, because the error is not the not captured variable but that capturing in the outer lambda already breaks the compilation.
Obviously the problem is, that a function pointer is expected but a capturing lambda does not return one? But how to make variables available?
This is a pointer to a function, which is not compatible with a lambda capturing local variables.
Since this is all embedded in function llvmGetPassPluginInfo(), is there a reason that you can’t use a static variable (at file level) or a function returning the value?