diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-07-22 03:45:54 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-07-22 03:45:54 +0000 |
commit | 3e9695ffa10b3f2a6c87b0958ee0054679bf40cf (patch) | |
tree | 5b9bf059950674f5a03e1b4a7239742e7e7a30ed /gcc/cp/semantics.c | |
parent | 068632d38482621055d07d0b367e7195f173f87b (diff) |
PR c++/69223 - ICE with deduced template return type.
* semantics.c (apply_deduced_return_type): Call
complete_type_or_else before building the new RESULT_DECL.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238624 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 19daeff4a44..63063b84bfc 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -9279,6 +9279,10 @@ apply_deduced_return_type (tree fco, tree return_type) if (TREE_TYPE (result) == return_type) return; + if (!processing_template_decl && !VOID_TYPE_P (return_type) + && !complete_type_or_else (return_type, NULL_TREE)) + return; + /* We already have a DECL_RESULT from start_preparsed_function. Now we need to redo the work it and allocate_struct_function did to reflect the new type. */ @@ -9294,8 +9298,6 @@ apply_deduced_return_type (tree fco, tree return_type) if (!processing_template_decl) { - if (!VOID_TYPE_P (TREE_TYPE (result))) - complete_type_or_else (TREE_TYPE (result), NULL_TREE); bool aggr = aggregate_value_p (result, fco); #ifdef PCC_STATIC_STRUCT_RETURN cfun->returns_pcc_struct = aggr; |