This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcov coverage on template classes


Hi Nava,

>So, not in the code. Are you saying template methods are inline by default?

No.  Inline methods defined in a class declaration are inlined by default.

For example:

class Foo
{
public:
  void ThisMethodIsInlinedByDefault() { }
};

Since Foo::ThisMethodIsInlinedByDefault was declared implicitly inline -- by
virtue of being defined in the class declaration -- it is inline by default.

Same rule applies to template classes, as far as I know.

> ok, so there's no way to force the compiler to emit all methods for any
> template class that is instantiated?

Hopefully there is one-or-more -f flags that will control the code emission
that you are looking for.

> The ones I found were: -fkeep-inline-functions -fno-default-inline

Did those resolve your issue?

> are there others which I should be trying?

Perhaps.  I don't know.

> Thanks for your suggestions.

No problem.  :-)

Sincerely,
--Eljay


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]