Hi, I'm trying to calculate the coverage of some template classes using gcov. However those methods which are not used, are marked as non-executable in the gcov output. I assume this is because gcc is not generating code for these methods. The following example: #include <vector> #include <iostream> using namespace std; template<class _t> class ReadIntensity { public: enum Base_Type { base_a,base_c,base_g,base_t,base_invalid }; ReadIntensity() : bases(base_count) { } /// No bounds checking! double getbase(_t position) const { return bases[position]; } /// No bounds checking! void setbase(_t position,double value) { bases[position] = value; } const static int base_count = 4; vector<double> bases; }; int main() { ReadIntensity<size_t> r; r.setbase(ReadIntensity<size_t>::base_a, 5.5); r.setbase(ReadIntensity<size_t>::base_t, 5.6); r.setbase(ReadIntensity<size_t>::base_g, 5.7); r.setbase(ReadIntensity<size_t>::base_c, 5.8); } compiled with: g++ simple.cpp -coverage -fkeep-inline-functions -fno-default-inline -O0 -lgcov -o simple generates the following output: -: 0:Source:simple.cpp -: 0:Graph:simple.gcno -: 0:Data:simple.gcda -: 0:Runs:1 -: 0:Programs:1 -: 1:#include <vector> -: 2:#include <iostream> -: 3: -: 4:using namespace std; -: 5: -: 6:template<class _t> 1: 7:class ReadIntensity { -: 8:public: -: 9: enum Base_Type { -: 10: base_a,base_c,base_g,base_t,base_invalid -: 11: }; -: 12: 1: 13: ReadIntensity() : bases(base_count) { -: 14: } -: 15: -: 16: /// No bounds checking! -: 17: double getbase(_t position) const { -: 18: return bases[position]; -: 19: } -: 20: -: 21: /// No bounds checking! 4: 22: void setbase(_t position,double value) { 4: 23: bases[position] = value; -: 24: } -: 25: -: 26: const static int base_count = 4; -: 27: vector<double> bases; -: 28:}; -: 29: 1: 30:int main() { 1: 31: ReadIntensity<size_t> r; -: 32: 1: 33: r.setbase(ReadIntensity<size_t>::base_a, 5.5); 1: 34: r.setbase(ReadIntensity<size_t>::base_t, 5.6); 1: 35: r.setbase(ReadIntensity<size_t>::base_g, 5.7); 1: 36: r.setbase(ReadIntensity<size_t>::base_c, 5.8); -: 37: 2: 38:} 1: 39:/*EOF*/ Which shows getbase marked as non-executable. Is there any way round this? gcov version: gcov (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)