This is the mail archive of the gcc@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]

Re: Sigh. Inlining heuristics.


 flag_default_inline == 1 by default (see decl2.c)

That's sort-of epxected in C++.  In C++,

  struct S { void f() {} };

implicitly declares `f' to be `inline'.  In contrast:

  struct S { void f(); };
  void S::f() {}

does not, but `inline void S::f() {}' is exactly equivalent to the
original version.  The standard says that the first and last versions
are semantically identical.

Some people don't like this, which is what `-fno-default-inline' is
for.  That keeps the semantics of `inline' (too hairy to talk about
here), but does not actually allow the inlining.

That flag only affects member function, because the standard's
implict-inlineness only applies to members defined in their
containing class definitions.

-- 
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com


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