public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* "massive" inline
@ 2009-09-30 20:20 Alexander Shabanov
  2009-09-30 20:31 ` Andrew Pinski
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Shabanov @ 2009-09-30 20:20 UTC (permalink / raw)
  To: gcc

Hello!

Could you please clarify whether or not g++ takes into an account
explicitly specified inline qualifier for the class member function
implemented in the class body?

I know that according to C++ standard such a function shall be
qualified as inline no matter whether "inline" qualifier specified or
not, but I still have doubts regarding gcc behavior on that (mostly
because I've seen vast amount of the production code written in this
manner).

I mean whether the code

class A
{
  inline void foo() { ... }
};

is absolutely equal to

class A
{
  void foo() { ... }
};

in *any* circumstances or not?

Thanks in advance.

-- 
Best regards,
    Alexander Shabanov

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: "massive" inline
  2009-09-30 20:20 "massive" inline Alexander Shabanov
@ 2009-09-30 20:31 ` Andrew Pinski
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Pinski @ 2009-09-30 20:31 UTC (permalink / raw)
  To: Alexander Shabanov; +Cc: gcc

On Wed, Sep 30, 2009 at 12:39 PM, Alexander Shabanov
<avshabanov@gmail.com> wrote:
> I mean whether the code
>
> class A
> {
>  inline void foo() { ... }
> };
>
> is absolutely equal to
>
> class A
> {
>  void foo() { ... }
> };
>
> in *any* circumstances or not?

They are the same unless you do -fno-default-inline and then the
second version is not marked as inline.

Thanks,
Andrew Pinski

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-30 19:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-30 20:20 "massive" inline Alexander Shabanov
2009-09-30 20:31 ` Andrew Pinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).