[PATCH] Old-C++ ABI inline method heuristic problem

Jason Merrill jason_merrill@redhat.com
Tue Jun 12 15:31:00 GMT 2001


>>>>> "Nathan" == Nathan Sidwell <nathan@codesourcery.com> writes:

> Ah, I see, what a pity. You are correct. I recall trying to discover
> a definition of 'used' before -- I think it may have been wrt volatile --
> but alas it is a (seemingly obvious, but unfortunately not quite)
> undefined term.

The thread this came from has been resolved, but I thought I'd point you at
the definition:

  3.2  One definition rule                               [basic.def.odr]

2 An expression is potentially evaluated unless either it is the operand
  of  the  sizeof  operator (_expr.sizeof_), or it is the operand of the
  typeid operator and does not designate an lvalue of polymorphic  class
  type (_expr.typeid_).  An object or non-overloaded function is used if
  its name appears in a  potentially-evaluated  expression.   A  virtual
  member  function is used if it is not pure.  An overloaded function is
  used if it is selected by overload resolution when referred to from  a
  potentially-evaluated  expression.   [Note: this covers calls to named
  functions (_expr.call_), operator overloading (clause  _over_),  user-
  defined conversions (_class.conv.fct_), allocation function for place-
  ment  new  (_expr.new_),  as  well   as   non-default   initialization
  (_dcl.init_).  A copy constructor is used even if the call is actually
  elided by the implementation.  ] An allocation or  deallocation  func-
  tion  for  a  class  is used by a new expression appearing in a poten-
  tially-evaluated   expression   as   specified   in   _expr.new_   and
  _class.free_.  A deallocation function for a class is used by a delete
  expression appearing in a potentially-evaluated expression  as  speci-
  fied  in  _expr.delete_  and _class.free_.  A copy-assignment function
  for a class is used by an implicitly-defined copy-assignment  function
  for another class as specified in _class.copy_.  A default constructor
  for a  class  is  used  by  default  initialization  as  specified  in
  _dcl.init_.   A  constructor  for  a  class  is  used  as specified in
  _dcl.init_.  A  destructor  for  a  class  is  used  as  specified  in
  _class.dtor_.



More information about the Gcc-patches mailing list