From 0861bec80a0d8ff9aae4ed031e7f6869d37a3af2 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 3 Apr 2013 20:14:00 -0400 Subject: cp-demangle.c (cplus_demangle_type): Fix function quals. libiberty/ * cp-demangle.c (cplus_demangle_type): Fix function quals. (d_pointer_to_member_type): Simplify. gcc/cp/ * mangle.c (write_type): When writing a function type with function-cv-quals, don't add the unqualified type as a substitution candidate. From-SVN: r197460 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/mangle.c | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9020dad..ef38bc2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2013-04-03 Jason Merrill + + * mangle.c (write_type): When writing a function type with + function-cv-quals, don't add the unqualified type as a + substitution candidate. + 2013-04-03 Paolo Carlini PR c++/56815 diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 4e68c51..83c3e62 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -1897,8 +1897,16 @@ write_type (tree type) tree t = TYPE_MAIN_VARIANT (type); if (TREE_CODE (t) == FUNCTION_TYPE || TREE_CODE (t) == METHOD_TYPE) - t = build_ref_qualified_type (t, type_memfn_rqual (type)); - write_type (t); + { + t = build_ref_qualified_type (t, type_memfn_rqual (type)); + if (abi_version_at_least (8)) + /* Avoid adding the unqualified function type as a substitution. */ + write_function_type (t); + else + write_type (t); + } + else + write_type (t); } else if (TREE_CODE (type) == ARRAY_TYPE) /* It is important not to use the TYPE_MAIN_VARIANT of TYPE here -- cgit v1.1