Any workarounds for cudafe++ mangling host code?

I’m running into an issue where cudaf++ is performing invalid code transforms to host code. It’s stripping parenthesis it mistakenly believes are unnecessary. I came across this issue when a particular header file of mine first made it into a .cu file, and I was bombarded with a flood of compiler errors that made no sense. After carefully analyzing the build using the --keep and --verbose options I finally noticed the unexpected code transformations cudafe++ was applying. In particular a lambda that is written as:

auto f = [](auto&& in) -> decltype(auto) { return (in.val); };

is transformed into

auto f = [](auto&& in) -> decltype(auto) { return in.val; };

This lack of parenthesis around in.val is a critical difference, as it changes the return type from a reference to a value (which in my case then causes the cascading compilation errors).

I’m not sure why cudafe++ needs to do anything with the host code in a .cu file other than slurp it out and drop it elsewhere (as-is, minus a couple decorators like host and device). It looks like it’s parsing the C++ (incorrectly in this case) to an AST and then re-generating it.

Regardless, this is clearly a compiler bug, and I’ve already filed a ticket against it (issue 3019982). The reason I’m here is to ask if maybe someone knows a workaround I’m unaware of. Is there a way to prevent cudafe++ from tweaking host code at all and force it to transplant things as-is? I assume that for now I’ll just have to ensure code like this never makes it into a .cu file, but I figure it doesn’t hurt to ask!