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

[Bug c++/50594] Option -fwhole-program discards replaced new operator for std::string


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50594

Daniel KrÃgler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #5 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2011-10-03 13:17:11 UTC ---
I would have expected that the shown program works as expected. I'm quoting
ISO/IEC 14882:2003(E) (but N3290 seems to say the same):

1) [lib.replacement.functions] p2+3:

"2 - A C++ program may provide the definition for any of eight dynamic memory
allocation function signatures declared in header <new> (3.7.3, clause
18):[..]"

"3 - The programâs definitions are used instead of the default versions
supplied by the implementation (18.4). Such replacement occurs prior to program
startup (3.2, 3.6)."

[C++11 adds here: "The programâs definitions shall not be specified as inline."
But we have no inline problem here]

2) [lib.new.delete.single] p2 or p11:

"Replaceable: a C++ program may define a function with this function signature
that displaces the default version defined by the C++ Standard library."

Especially note that (2) says "this function signature", which does IMO not
allow to require the addition of export directives or anything else.


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