Greying out code based on preprocessor conditions seems to only work if the preprocessor elements are defined in the same file as the condition.
Menu Settings->Editor...->General settings->C/C++ Editor settings
Enable "Interpret #if, #elseif, #endif to grey out inactive preprocessor-code".
Add preprocessor define to test.h header file:
#define MYDEF 1
Include header and add preprocess conditional code to test.cpp file:
#include "test.h" #if MYDEF int n; #endif
Expected behaviour: "int n;" displays normally.
Actual behaviour: "int n;" is greyed out.