QT Creator, syntax checking for c++11

前端 未结 4 1718
时光说笑
时光说笑 2021-01-12 06:17

How to turn off error highlighting (red wave under the code) for c++11 cycle range-based operators like that?

int myint[] = {1,2,3,4,5};
for (auto x : myint         


        
4条回答
  •  误落风尘
    2021-01-12 07:14

    I don't understand the line of reasoning in Andrew's answer. Why would customizing syntax checking make sense? The syntax is either correct given the context set by the compiler command line, or it is wrong. If it is wrong, it should be marked as such, if not, not. If correct code is marked as wrong, it is a bug, or at least unsupported feature, in the IDE, and it needs a fix, not "customization".

    Having said that, the cited example

        int myint[] = {1,2,3,4,5};
        for (auto x : myint){/**/}
    

    works fine here (fairly recent build from master branch).

    Regarding the other comment on Kate: Kate's syntax highlighting is used by Qt Creator as fallback in cases where there is no more specific syntax highlighting available for a file. In the case of C++ (98/03/11) there is a real code model used, not Kate's definitions.

提交回复
热议问题