Details
-
Bug
-
Resolution: Cannot Reproduce
-
Not Evaluated
-
None
-
Qt Creator 10.0.0
-
None
Description
QtCreator marks headers as unused if the headers contain class template specializations that are actually used by the code in the file that includes the header.
// common.h template< typename T > struct parser { static void parse(T&) {} }; template< typename T > void parse(T& val) { parser<T>::parse(val); }
// specialization.h #include <vector> template< typename T > struct parser; template< typename T > struct parser< std::vector<T> > { static void parse(std::vector<T>&) {} };
// test.cpp #include <vector> #include <common.h> #include <specialization.h> // <- wrongly flagged as unused void foo() { std::vector<int> vec; parse(vec); }