Menu

Spurious missingOverride?

2023-09-27
2023-09-27
  • Joris Timmermans

    I have a simple derived class definition containing the following:
    void TriangulationReport(const std::wstring& i_report) override;
    The base class has:
    virtual void TriangulationReport(const std::wstring& i_report);

    CppCheck reports:

    missingOverride (style)
    
    The function TriangulationReport overrides a function in a base class but is not marked with a override specifier.
    

    The override specifier is right there in the code, am I misinterpreting the report, or is CppCheck somehow not seeing the override spec? (I've tried with and without "virtual" in front of the override as well).

     
  • CHR

    CHR - 2023-09-27

    Please post code sufficient to reproduce the issue.

     
    • Joris Timmermans

      That's really tricky as it is a huge codebase and the CppCheck run is server-based with no direct ability for me to run it locally. I will attempt to see if I can reproduce, but I'm not even sure what might be the environmental cause of this in the code.

       
      • CHR

        CHR - 2023-09-27

        Maybe you can identify the file that is causing this, then run cppcheck on preprocessor output (-Eswitch) and start reducing from there.

         

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.