Menu

C++ "using" keyword not supported?

Digi
2020-07-17
2020-07-17
  • Digi

    Digi - 2020-07-17

    I'm not sure that this is a bug or whether I'm doing something wrong (not unusual, that's why I like cppcheck :)

    "using" has been around since C++11 and I've specified C++17 on the command line but I'm still getting "syntax error" from the check.

    $ cppcheck --std=c++17 -q --enable=all --inconclusive  foo.h
    foo.h:3:0: error: syntax error [syntaxError]
    using array_p = const array_t *;
    

    Where foo.h is this:

    #define ARRAY_SIZE 16
    typedef unsigned char array_t[ARRAY_SIZE];
    using array_p = const array_t *;
    

    https://en.cppreference.com/w/cpp/language/type_alias

     
  • Daniel Marjamäki

    Thanks! We support using but it seems the syntax check is too noisy here. I created ticket: https://trac.cppcheck.net/ticket/9812

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.