C++ PATCH to improve C++ function type variant handling

Jason Merrill jason@redhat.com
Mon May 14 20:15:00 GMT 2018


I haven't been able to create a testcase to demonstrate a bug, but
I've been uneasy for a while about how we blithely set
TYPE_HAS_LATE_RETURN_TYPE on function types without regard to how they
might be shared.

This patch handles that flag like TYPE_RAISES_EXCEPTIONS and the
ref-qualifier flags, and factors out that handling into a
build_cp_fntype_variant function that the existing
build_exception_variant and build_ref_qualified_type functions become
wrappers for.

I then went through and changed most of the existing uses of those
latter functions to use either the new function or
cxx_copy_lang_qualifiers.

Tested x86_64-pc-linux-gnu, applying to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: late-return.diff
Type: text/x-patch
Size: 29471 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180514/64e9f469/attachment.bin>


More information about the Gcc-patches mailing list