commit 962ed442fc4ce39f24aeec858436a82bcc77fa35
Author: Jason Merrill <jason@redhat.com>
Date: Sat Apr 20 15:39:42 2013 +0100
* mangle.c (write_type): Mangle decltype(auto).
@@ -2019,7 +2019,10 @@ write_type (tree type)
case TEMPLATE_TYPE_PARM:
if (is_auto (type))
{
- write_identifier ("Da");
+ if (AUTO_IS_DECLTYPE (type))
+ write_identifier ("Dc");
+ else
+ write_identifier ("Da");
++is_builtin_type;
break;
}
new file mode 100644
@@ -0,0 +1,12 @@
+// Mangling for decltype(auto)
+// { dg-options "-std=c++1y" }
+
+void f();
+
+// { dg-final { scan-assembler "_Z2g1IiEDcv" } }
+template <class T> decltype(auto) g1() { return &f; }
+template decltype(auto) g1<int>();
+
+// { dg-final { scan-assembler "_Z2g2IiEDav" } }
+template <class T> auto g2() { return &f; }
+template auto g2<int>();