This is the mail archive of the gcc-bugs@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: static inline operator generates an external symbol


> Therefore, the compiler itself must create the declaration
> regardless of using builtins or not.

Indeed. According to the C++ standard, 3.7.3, [basic.stc.dynamic]/2:

# The following allocation and deallocation functions (18.4) are
# implicitly declared in global scope in each translation unit of a
# program
#
# void* operator new(std::size_t) throw(std::bad_alloc); 
# void* operator new[](std::size_t) throw(std::bad_alloc); 
# void operator delete(void*) throw(); 
# void operator delete[](void*) throw();

It is not possible to declare those functions static in Standard C++,
period.

Regards,
Martin

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