Menu

Syntax Error on template definition

J. Berger
2024-05-28
2024-05-28
  • J. Berger

    J. Berger - 2024-05-28

    Hi there,
    I am trying to check a codebase and came across a syntax error when parsing a statement like this:

    ```cpp
    template <
    size_t I = 0, typename... ArgsT,
    std::enable_if_t<I<sizeof...(argst)>* = nullptr</sizeof...(argst)>

    SizeType _variant_helper(size_t, std::variant<argst...>&);</argst...>

    ```

    The big three compilers (Clang, MSVC and G++) called with settings for C++20, Wall and pedantic think this is perfectly fine.

    CppCheck reports a syntax error.

     
  • CHR

    CHR - 2024-05-28

    Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/12789

     

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.