我不知道它是否只是Qt Creator的事情,或者是一些普遍的问题。事情是:
#define Foo 5
const int value = Foo; //ok, legitly highlighted
#undef Foo
const int value2 = Foo; //ok, legitly not highlighted (here on stack it is anyway, well)
工作正常,但当#define
和#undef
位于某些标题中时,它会崩溃:
标头与def(def.hpp
):
#define Foo 5
带有undef(undef.hpp
)的标头:
#undef Foo
现在举例:
#include "def.hpp"
const int value = Foo; //ok, legitly highlighted
#include "undef.hpp" // (now, Foo in the upper suddenly not higlighted)
const int value2 = Foo; //not highlighted, ok
#include "def.hpp"
const int value3 = Foo; //bad, Foo is defined but not highlighted
//(none of Foos is highlighted at this point)
我正在使用Qt Creator 5.6。有没有办法保持正确的突出显示?