From: Jason Merrill Date: Wed, 20 Feb 2019 18:59:18 +0000 (-0500) Subject: PR c++/87513 - 'sorry' mangling PMF template-id. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=60067b876326baff092554e5fb52e963a402e91b;p=gcc.git PR c++/87513 - 'sorry' mangling PMF template-id. Here build_offset_ref calls build_qualified_name to make a SCOPE_REF because the dependent template arguments make type_dependent_expression_p (member) true. We could probably work hard to prevent this, but it doesn't seem necessary, and it's easy to fix write_expression to handle the result. * mangle.c (write_expression): Handle SCOPE_REF to BASELINK. From-SVN: r269048 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 02e0845f1d7..dc0d4a20814 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2019-02-19 Jason Merrill + + PR c++/87513 - 'sorry' mangling PMF template-id. + * mangle.c (write_expression): Handle SCOPE_REF to BASELINK. + 2019-02-19 Jason Merrill PR c++/88380 - wrong-code with flexible array and NSDMI. diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index f550b7550db..777c4775bfd 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -3003,7 +3003,8 @@ write_expression (tree expr) { scope = TREE_OPERAND (expr, 0); member = TREE_OPERAND (expr, 1); - gcc_assert (!BASELINK_P (member)); + if (BASELINK_P (member)) + member = BASELINK_FUNCTIONS (member); } else { diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-tid1.C b/gcc/testsuite/g++.dg/cpp0x/decltype-tid1.C new file mode 100644 index 00000000000..03285022087 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype-tid1.C @@ -0,0 +1,9 @@ +// PR c++/87513 +// { dg-do compile { target c++11 } } + +struct A { template void foo (); }; +template auto bar () -> decltype (&A::foo); +void foo () +{ + bar<0> (); +}