3 ms·
That’s a good question, it’s not fair that you’re being downvoted. It’s the C preprocessor that causes a mess. Tooling for C and C++, like automatic refactorin
by klodolph 5y ago
That’s a good question, it’s not fair that you’re being downvoted.
It’s the C preprocessor that causes a mess. Tooling for C and C++, like automatic refactoring, lags behind tooling for languages like Java, C#, and Go. Refactoring tools have to deal with macros, conditionals inside #if/#else blocks, and header search paths.
In this case, the refactoring involves removing a variable from the enclosing scope of a macro invocation. The most likely way to automatically refactor it would be to write a custom check in clang-tidy.