aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/mangle.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2017-11-16 15:13:48 -0500
committerJason Merrill <jason@gcc.gnu.org>2017-11-16 15:13:48 -0500
commit6296cf8e099aae43c86a773f93d83a19df85d7e7 (patch)
treef602a84e280c62dd314f2a97321a94ae4ebf7d50 /gcc/cp/mangle.c
parent285346b5eba02c9a21351355de4cb7fb7d2b91ef (diff)
downloadgcc-6296cf8e099aae43c86a773f93d83a19df85d7e7.zip
gcc-6296cf8e099aae43c86a773f93d83a19df85d7e7.tar.gz
gcc-6296cf8e099aae43c86a773f93d83a19df85d7e7.tar.bz2
PR c++/79092 - non-type args of different types are different
* tree.c (cp_tree_equal): Check the type of constants. * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER when comparing to previously deduced argument. (maybe_convert_nontype_argument): New. (convert_nontype_argument): Call it. (tsubst_copy_and_build): Handle partial instantiation of IMPLICIT_CONV_EXPR. (unify): Ignore type when deducing from array bound. (dependent_type_p_r): Handle DEFERRED_NOEXCEPT. (value_dependent_expression_p): Any type-dependent expression is value-dependent. Handle IMPLICIT_CONV_EXPR. * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New. * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR. From-SVN: r254843
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r--gcc/cp/mangle.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 050055b..6d4e591 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -2836,7 +2836,7 @@ write_expression (tree expr)
while (CONVERT_EXPR_CODE_P (code)
/* Parentheses aren't mangled. */
|| code == PAREN_EXPR
- || TREE_CODE (expr) == NON_LVALUE_EXPR)
+ || code == NON_LVALUE_EXPR)
{
expr = TREE_OPERAND (expr, 0);
code = TREE_CODE (expr);
@@ -3407,6 +3407,9 @@ write_template_arg (tree node)
}
}
+ /* Strip a conversion added by convert_nontype_argument. */
+ if (TREE_CODE (node) == IMPLICIT_CONV_EXPR)
+ node = TREE_OPERAND (node, 0);
if (REFERENCE_REF_P (node))
node = TREE_OPERAND (node, 0);
if (TREE_CODE (node) == NOP_EXPR