Commit a283c407 by Jason Merrill Committed by Jason Merrill

re PR c++/56177 (ICE when used forward for 'auto f();')

	PR c++/56177
	* decl.c (start_preparsed_function): Update restype if we change
	decl1.

From-SVN: r195780
parent 29ef6cd0
2013-02-05 Jason Merrill <jason@redhat.com> 2013-02-05 Jason Merrill <jason@redhat.com>
PR c++/56177
* decl.c (start_preparsed_function): Update restype if we change
decl1.
PR c++/56208 PR c++/56208
* pt.c (fn_type_unification): Discard any access checks from * pt.c (fn_type_unification): Discard any access checks from
substituting explicit args. substituting explicit args.
......
...@@ -13116,6 +13116,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) ...@@ -13116,6 +13116,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
DECL_CONTEXT (decl1) = DECL_CONTEXT (DECL_TI_TEMPLATE (decl1)); DECL_CONTEXT (decl1) = DECL_CONTEXT (DECL_TI_TEMPLATE (decl1));
} }
fntype = TREE_TYPE (decl1); fntype = TREE_TYPE (decl1);
restype = TREE_TYPE (fntype);
/* If #pragma weak applies, mark the decl appropriately now. /* If #pragma weak applies, mark the decl appropriately now.
The pragma only applies to global functions. Because The pragma only applies to global functions. Because
......
// PR c++/56177
// { dg-options "-std=c++1y" }
auto f ();
auto f () { return 33; }
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