[solved] Creator doesn't underline semantic errors



  • I'm not getting "Semantic errors and warnings are underlined in olive" in the editor.

    In the following I'd expect InexistentType and inexistentMethod to render with olive-colored underline:

    int main(int argc, char *argv[])
    {
        InexistentType bla;
        bla.inexistentMethod();
        return 0;
    }
    

    Instead both words render in black with no underline. Unused variables argc and argv are correctly underlined. If I add code to define the type and the method, InexistentType turns purple while inexistentMethod remains black.

    Is this the expected behavior of Qt Creator (3.0.1, 64-bit, gcc 4.8.3, centos 7) ?

    Or could I be missing some setting or package?

    Looking at http://doc.qt.digia.com/qtcreator-2.4/creator-checking-code-syntax.html I can see this used to work (in version 2.4).


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Looks strange indeed, can you test with the latest version of Qt Creator (currently 3.4) ?


  • Moderators

    @SGaist @Andreas-J
    here is a link to the latest documentation

    It does not work in my version either Qt creator 3.1.2 on Win7 64 bit.
    Actually I cannot recall to have seen such a syntax high-lighting working.



  • Thanks. My colleague just tried on 3.4 and it's the same (i.e. no underline on undefined types or methods).

    However, he managed to get it working with the Clang code model:

    • Help -> About Plugins... -> C++ -> enable ClangCodeModel
    • Tools -> Options... -> C++ -> Code Model -> C++ -> select Clang

    He then gets red underline on undefined symbols.

    I guess I'll just have to upgrade then.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.