The flag: -Wc++17-compat-mangling was not emitting a warning diagnostic in all cases, specifically if a function has parameters that happen to have function pointers that have noexecept parameters. For example:
void fn(void (*)(void (*)() noexcept)){}
That example will produce different symbol names between c++17 and earlier dialects. I believe that clang should be emitting the compatibility warning in this case. This patch modifies the existing logic to recursively check the parameters of a function and warn if they too are noexcept.
This fixes PR39656.
You don't need this lambda.