public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/53429] New: complex::{imag,real} should be marked alwaysinline to guarantee libstdc++ binary compatibility between C++98 and C++11
@ 2012-05-21  4:03 jyasskin at gcc dot gnu.org
  2012-05-21  5:52 ` [Bug libstdc++/53429] " jyasskin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jyasskin at gcc dot gnu.org @ 2012-05-21  4:03 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53429
           Summary: complex::{imag,real} should be marked alwaysinline to
                    guarantee libstdc++ binary compatibility between C++98
                    and C++11
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jyasskin@gcc.gnu.org


The non-const overloads of std::complex::real and std::complex::imag go from
returning _Tp& to _Tp in C++98 vs C++11:
http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/include/std/complex?view=markup.
 libstdc++ includes explicit instantiations of operator<< and operator>> with
complex arguments:
http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/src/c%2B%2B98/complex_io.cc?view=markup.
These operator<< and operator>> overloads call complex::real() and
complex::imag(). If those calls are inlined (which is likely), so that no weak
definition of real() and imag() is exposed to users of the library, then I
believe all is well. However, if the compiler decides not to inline them, then
people linking libstdc++ from the other version of the language may wind up
with two conflicting weak definitions of the symbols.

I think marking them as alwaysinline would guarantee compatibility.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-05-22 12:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-21  4:03 [Bug libstdc++/53429] New: complex::{imag,real} should be marked alwaysinline to guarantee libstdc++ binary compatibility between C++98 and C++11 jyasskin at gcc dot gnu.org
2012-05-21  5:52 ` [Bug libstdc++/53429] " jyasskin at gcc dot gnu.org
2012-05-21 10:16 ` rguenth at gcc dot gnu.org
2012-05-21 15:36 ` jyasskin at gcc dot gnu.org
2012-05-21 17:47 ` paolo.carlini at oracle dot com
2012-05-22 13:00 ` [Bug libstdc++/53429] libstdc++ should guarantee not to expose complex::{imag,real} so it supports both " jyasskin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).