Minimal example code:
struct ProgramContext{};
struct DebugContext{};
#define SOME_DEBUG_DEFINE 1
#if SOME_DEBUG_DEFINE
int fun( ProgramContext* pContext, DebugContext* pDebugContext )
#else
int fun( ProgramContext* pContext )
#endif
{
int select_this_line_and_extract_method_with_VA = 1;
(void)pContext;
#if SOME_DEBUG_DEFINE
(void)pDebugContext;
#endif
}
Selecting the select_this... line and letting VA "Extract Method" the method is reliably placed inside the #else-#endif block below the second function header, even if that #else is turned off. This works with code blocks of any size inside such a code situation, not just one line.
It should not place it inside the #if at all, much less between a function header and its body.
I searched the forums and couldn't find this bug yet.
Thank you.