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]
Other format: [Raw text]

Re: -fobey-inline (was Re: gcc and inlining)


On 19-Mar-2003, Ross Smith <r-smith at ihug dot co dot nz> wrote:
> Could you be more specific please? Reading 14.5.5 (function templates) 
> and 14.7.1 (implicit instantiation) turns up nothing relevant, as far 
> as I can see. 3.2 (one definition rule) para 3 says "Every program 
> shall contain exactly one definition of every non-inline function or 
> object that is used in that program", which seems pretty clear to me.

As Matt noted, function templates aren't functions.
The relevant text is 3.2 [basic.def.odr] paragraph 5:

   There can be more than one definition of a class type (clause
   class), enumeration type (dcl.enum), inline function with external
   linkage (dcl.fct.spec), CLASS TEMPLATE (clause temp), non-static   
   FUNCTION TEMPLATE (temp.fct), static data member of a class template
   (temp.static), MEMBER FUNCTION TEMPLATE (temp.mem.func), or template
   specialization for which some template parameters are not specified
   (temp.spec, temp.class.spec) in a program provided that each
   definition appears in a different translation unit, and provided the
   definitions satisfy the following requirements.

-- 
Fergus Henderson <fjh at cs dot mu dot oz dot au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


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