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
+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.
{
scope = TREE_OPERAND (expr, 0);
member = TREE_OPERAND (expr, 1);
- gcc_assert (!BASELINK_P (member));
+ if (BASELINK_P (member))
+ member = BASELINK_FUNCTIONS (member);
}
else
{
--- /dev/null
+// 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> ();
+}