Commit 60067b87 by Jason Merrill Committed by Jason Merrill

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
parent e3fe9cfb
2019-02-19 Jason Merrill <jason@redhat.com> 2019-02-19 Jason Merrill <jason@redhat.com>
PR c++/87513 - 'sorry' mangling PMF template-id.
* mangle.c (write_expression): Handle SCOPE_REF to BASELINK.
2019-02-19 Jason Merrill <jason@redhat.com>
PR c++/88380 - wrong-code with flexible array and NSDMI. PR c++/88380 - wrong-code with flexible array and NSDMI.
* typeck2.c (process_init_constructor_record): Skip flexarrays. * typeck2.c (process_init_constructor_record): Skip flexarrays.
......
...@@ -3003,7 +3003,8 @@ write_expression (tree expr) ...@@ -3003,7 +3003,8 @@ write_expression (tree expr)
{ {
scope = TREE_OPERAND (expr, 0); scope = TREE_OPERAND (expr, 0);
member = TREE_OPERAND (expr, 1); member = TREE_OPERAND (expr, 1);
gcc_assert (!BASELINK_P (member)); if (BASELINK_P (member))
member = BASELINK_FUNCTIONS (member);
} }
else else
{ {
......
// PR c++/87513
// { dg-do compile { target c++11 } }
struct A { template <long> void foo (); };
template <long t> auto bar () -> decltype (&A::foo<t>);
void foo ()
{
bar<0> ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment