From 403f22aae5b6e4e8f0e50b89b41a82aaf910931e Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 14 May 2018 16:08:11 -0400 Subject: Handle TYPE_HAS_LATE_RETURN_TYPE like ref-qualifier and eh spec. * tree.c (build_cp_fntype_variant): New. (build_ref_qualified_type, build_exception_variant) (strip_typedefs, cxx_copy_lang_qualifiers): Use it. (cxx_type_hash_eq, cp_check_qualified_type): Check TYPE_HAS_LATE_RETURN_TYPE. (cp_build_type_attribute_variant): Check cxx_type_hash_eq. (cp_build_qualified_type_real): No need to preserve C++ qualifiers. * class.c (build_clone): Use cxx_copy_lang_qualifiers. (adjust_clone_args): Likewise. * decl.c (grokfndecl): Add late_return_type_p parameter. Use build_cp_fntype_variant. (grokdeclarator): Pass late_return_type_p to grokfndecl. (check_function_type): Use cxx_copy_lang_qualifiers. (static_fn_type): Use cxx_copy_lang_qualifiers. * decl2.c (build_memfn_type, maybe_retrofit_in_chrg) (cp_reconstruct_complex_type, coerce_new_type, coerce_delete_type) (change_return_type): Use cxx_copy_lang_qualifiers. * mangle.c (write_type): Use cxx_copy_lang_qualifiers. * parser.c (cp_parser_lambda_declarator_opt): Represent an explicit return type on the declarator like a normal trailing return type. * pt.c (tsubst_function_type): Use build_cp_fntype_variant. (copy_default_args_to_explicit_spec): Use cxx_copy_lang_qualifiers. * typeck.c (merge_types): Use build_cp_fntype_variant. From-SVN: r260238 --- gcc/cp/mangle.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'gcc/cp/mangle.c') diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 58b3311..387990b 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -2155,11 +2155,7 @@ write_type (tree type) type = TYPE_MAIN_VARIANT (type); if (TREE_CODE (type) == FUNCTION_TYPE || TREE_CODE (type) == METHOD_TYPE) - { - type = build_ref_qualified_type (type, type_memfn_rqual (type_orig)); - type = build_exception_variant (type, - TYPE_RAISES_EXCEPTIONS (type_orig)); - } + type = cxx_copy_lang_qualifiers (type, type_orig); /* According to the C++ ABI, some library classes are passed the same as the scalar type of their single member and use the same -- cgit v1.1