http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53324
--- Comment #3 from dominik.stras...@onespin-solutions.com 2012-06-11 15:10:49 UTC --- I get the point. However, I could imagine that it is a quite common scenario to have a binary contributed C++ lib. Mixing debug/non-debug is impossible due to name mangling, however you can get random behavior if debug-enabled containers are returned. It took me quite a while to find out what was going wrong. Maybe some annotation for the linker could help here. I see that there's a general problem with overloading on function return values, but usually this is under the control of the user.