Menu

[Cppcheck v2.9]: [internalAstError] Syntax Error: AST broken.

2022-09-26
2022-09-26
  • Siva Ramaraju

    Siva Ramaraju - 2022-09-26

    Hello Cppcheck team.
    Greetings!

    With latest Cppcheck v2.9, it reports [internalAstError] Syntax Error: AST broken, 'libName' doesn't have a parent error for below code snippet.

    template <class libnameselectortype,="" class="" loadfntype="">
    HMODULE f(LibNameSelectorType &LibNameSelector, LoadFnType LoadFn)
    {
    HMODULE hLib {nullptr};
    auto libName = LibNameSelector.baseType();
    auto catchName = [&] (decltype(libName.name) name) { libName.name = name; return name; };
    }</class>

    -
    I think Cppcheck simply does not understand syntax as per the error message. could you please help check it.

     
  • CHR

    CHR - 2022-09-26

    Thanks for reporting, we have a ticket for this issue here: https://trac.cppcheck.net/ticket/10739

     
  • Siva Ramaraju

    Siva Ramaraju - 2022-09-26

    Thanks confirming it.
    Is it targeted for Milestone > 2.9 +

     

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.