commit 3589139ea249533cc5ebb5ef9c38d72fc159f6fd
Author: Jason Merrill <jason@redhat.com>
Date: Tue Feb 5 14:40:56 2013 -0500
PR c++/56177
* decl.c (start_preparsed_function): Update restype if we change
decl1.
@@ -13116,6 +13116,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
DECL_CONTEXT (decl1) = DECL_CONTEXT (DECL_TI_TEMPLATE (decl1));
}
fntype = TREE_TYPE (decl1);
+ restype = TREE_TYPE (fntype);
/* If #pragma weak applies, mark the decl appropriately now.
The pragma only applies to global functions. Because
new file mode 100644
@@ -0,0 +1,5 @@
+// PR c++/56177
+// { dg-options "-std=c++1y" }
+
+auto f ();
+auto f () { return 33; }