fix Issue 11081: duplicate COMDAT with failed compilation with lambdas

This patch avoids code generation for template instances with erronous parents. This mostly happens for !__traits(compiles) expressions.
At the same time it fixes mangled names for function literals used as alias template parameters.