[Bug libstdc++/80335] perf of copying std::optional<trivial>

sgunderson at bigfoot dot com gcc-bugzilla@gcc.gnu.org
Thu Aug 31 18:25:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80335

sgunderson at bigfoot dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sgunderson at bigfoot dot com

--- Comment #1 from sgunderson at bigfoot dot com ---
This also affects the _returning_ std::optional; since it is not trivially copy
constructible, std::optional<int> must be returned (at least on amd64) by means
of a hidden parameter instead of in registers.

Since this affects the return type ABI, it can't be changed easily
after-the-fact, so if possible, it should be fixed before C++17 support becomes
non-experimental.


More information about the Gcc-bugs mailing list