Hello Mr. Jonathan Wakely Basically, my program only creates a Base class to be inherited, and only uses the Derived1 class in the main program. What is the purpose of the D0 destructor variant that G++ generates? It is clear that the content of the ~Base() function, which is cout << "Base Destructor called\n"; , is still executed. Thank you for your support Best regards, Sy Nguyen ________________________________ From: Jonathan Wakely <jwakely.gcc@xxxxxxxxx> Sent: Thursday, March 2, 2023 11:26 PM To: Nguyen Duc Sy <sy.nguyen-duc@xxxxxxxxxxxxxx> Cc: gcc-help@xxxxxxxxxxx <gcc-help@xxxxxxxxxxx> Subject: Re: [NEED HELP][GCOV] uncoverage virtual destructor On Thu, 2 Mar 2023 at 12:43, Nguyen Duc Sy wrote: > but I don't understand why this line is uncovered: > function _ZN4BaseD0Ev called 0 returned 0% blocks executed 0% > #####: 11: virtual ~Base(){ > -: 12: cout << "Base Destructor called\n"; > #####: 13: } > > Could this be a bug in G++/Gcov? No, your program never uses the D0 destructor variant. Try: Base* b = new Base(); delete b;