Menu

--no-check-header triggers internalError

7uc4s
2025-08-27
2025-08-27
  • 7uc4s

    7uc4s - 2025-08-27

    Hello,

    I got this error from cppcheck, who kindly asked me to report it:

     test.h:8:40: error: Analysis failed (variable without scope). If the code is valid then please report this failure. [internalError]
     template <typename T> A<T>::A(const T &x) : x(x) {}
                                           ^
    

    test.cpp

    #include "test.h
    

    test.h

    template <typename T> class A {
    public:
      A(const T &x);
      T x;
    };
    
    template <typename T> A<T>::A(const T &x) : x(x) {}
    

    Command:
    cppcheck test.cpp --no-check-headers

     

    Last edit: 7uc4s 2025-08-27
  • CHR

    CHR - 2025-08-27

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

     

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.