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
cppcheck test.cpp --no-check-headers
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/14093
Log in to post a comment.
Hello,
I got this error from cppcheck, who kindly asked me to report it:
test.cpp
test.h
Command:
cppcheck test.cpp --no-check-headers
Last edit: 7uc4s 2025-08-27
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/14093