From 75c8d6e54a14d090853b998cfd335511b1d8ae5f Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 4 Apr 2020 11:45:41 -0400 Subject: [PATCH] c++: Mangling of dependent conversions [PR91377] We skip over other conversion codes when mangling expressions, we should do the same with IMPLICIT_CONV_EXPR. gcc/cp/ChangeLog 2020-04-04 Jason Merrill PR c++/91377 * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR. --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/mangle.c | 1 + gcc/testsuite/g++.dg/abi/mangle75.C | 13 +++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 gcc/testsuite/g++.dg/abi/mangle75.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 686128a7eba..a382235d7cc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2020-04-04 Jason Merrill + + PR c++/91377 + * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR. + 2020-04-04 Patrick Palka PR c++/94205 diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 1fc78bfa753..9e39cfd8dba 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -2875,6 +2875,7 @@ write_expression (tree expr) /* Skip NOP_EXPR and CONVERT_EXPR. They can occur when (say) a pointer argument is converted (via qualification conversions) to another type. */ while (CONVERT_EXPR_CODE_P (code) + || code == IMPLICIT_CONV_EXPR || location_wrapper_p (expr) /* Parentheses aren't mangled. */ || code == PAREN_EXPR diff --git a/gcc/testsuite/g++.dg/abi/mangle75.C b/gcc/testsuite/g++.dg/abi/mangle75.C new file mode 100644 index 00000000000..f2661997a33 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/mangle75.C @@ -0,0 +1,13 @@ +// PR c++/91377 +// { dg-do compile { target c++11 } } + +struct f { + static constexpr int d = 3; + typedef int e; +}; +template struct x { }; +template using n = x; +template auto v() -> n; +void af() { v(); } + +// { dg-final { scan-assembler "_Z1vI1fE1xIXplLi0EsrT_1dEEv" } } -- 2.30.2