2012-01-11 Jason Merrill <jason@redhat.com>
+ PR c++/51818
+ * mangle.c (find_substitution): A type is only a substitution
+ match if we're looking for a type.
+ (write_nested_name): Use decl_mangling_context.
+
* decl.c (decls_match): Assert that the arguments are decls.
PR c++/51613
/* NODE is a matched to a candidate if it's the same decl node or
if it's the same type. */
if (decl == candidate
- || (TYPE_P (candidate) && type && TYPE_P (type)
+ || (TYPE_P (candidate) && type && TYPE_P (node)
&& same_type_p (type, candidate))
|| NESTED_TEMPLATE_MATCH (node, candidate))
{
else
{
/* No, just use <prefix> */
- write_prefix (CP_DECL_CONTEXT (decl));
+ write_prefix (decl_mangling_context (decl));
write_unqualified_name (decl);
}
write_char ('E');
+2012-01-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/51818
+ * g++.dg/cpp0x/lambda/lambda-mangle3.C: New.
+
2012-01-11 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/array19.ad[sb]: New test.
--- /dev/null
+// PR c++/51818
+// { dg-options -std=c++0x }
+// { dg-final { scan-assembler "_ZN1AC1IN3foo3barMUlvE_EEET_" } }
+
+struct A
+{
+ template <class T> A(T) { }
+};
+
+struct foo
+{
+ A bar = []{};
+};
+
+foo f;