Menu

latest cppcheck: new syntax errror

Martin
2021-02-10
2021-02-11
  • Martin

    Martin - 2021-02-10

    Hi,

    the latest cppcheck creates a new syntax error.

    old commit: f48e195c31f8f7de60826036f2fc797c9e7f942c (working)
    new commit: d3d2e16137dccf9269f1f2d017606be24ab31d39 (syntax error)

    The code is:

    auto operator<<(std::ostream &s, const Pr<st> p) -> std::ostream &
    {
       return s;
    }
    
    auto foo() -> void
    {
       using Pr = d::Pr<st>;
    }
    

    The message is:
    21-02-10.cpp:1:42: error: syntax error [syntaxError]
    auto operator<<(std::ostream &s, const Pr<st> p) -> std::ostream &
    ^</st>

    Could you please check?

    Thanks,
    Martin

     
  • Robert Reif

    Robert Reif - 2021-02-10

    I'll look into it.

     
    • Robert Reif

      Robert Reif - 2021-02-10

      This will take some time to fix. This has been broken for a while. It started in 1.87 but it didn't cause a syntax error until 1.90. It's still present in 2.3. I'm not sure why it went away and came back recently during this development cycle.

       
      • Robert Reif

        Robert Reif - 2021-02-10
         
        • Robert Reif

          Robert Reif - 2021-02-11

          This turned out to be a lot easier to fix than I thought. I have a fix here: https://github.com/IOBYTE/cppcheck/tree/Martin but it will conflict with an uncommitted PR so I will wait for it to be committed first.

           

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.