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

--- Comment #22 from Niall Douglas <s_gccbugzilla at nedprod dot com> 
2012-06-14 16:16:19 UTC ---
(In reply to comment #20)
> That wouldn't help if you built one object with -std=c++11 and another with
> -std=c++98 and linked them both into the same .so, you'd have the symbol, but
> wouldn't have built everything with -std=c++11
> 
> Anyway, it's the same bug, it happens when passing a std::pair between c++11
> code and c++98 code and if you make the std::pair move-ctor trivial then
> there's no crash.

You miss my point: If built under C++03, a magic symbol
__gplusplus_cplusplus_03 might be emitted; if built under C++11, a magic symbol
__gplusplus_cplusplus_11 might be emitted. You can then tell if mixed build
object files have been combined - and you can also tell if a given binary is
pure.

ld can then be patched to emit a warning if both symbols appear in the same
binary. After all, mixing C++03 and C++11 is likely bad for your health forever
into the future. Indeed, if it becomes a fatal problem for a lot of end users,
gcc may need to mangle things specially for C++11 versus C++03 code for code so
affected in order to prevent bad linking. The loss of std::pair interop between
C++03 and C++11 in my mind is pretty fatal for a lot of end users.

I can submit a wishlist issue for GCC for the above if it doesn't already
exist?

Niall

Reply via email to