aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-06-02 13:02:27 -0400
committerJason Merrill <jason@gcc.gnu.org>2009-06-02 13:02:27 -0400
commitccafc19b5bd8f4736a2788263aa5acd6d2b7a961 (patch)
tree9d3141836e8e09dedf86b9b0e42dcb14993d4bed /gcc/cp/decl.c
parent69596c692d784340f5a7f828cceab6176db05ff0 (diff)
downloadgcc-ccafc19b5bd8f4736a2788263aa5acd6d2b7a961.zip
gcc-ccafc19b5bd8f4736a2788263aa5acd6d2b7a961.tar.gz
gcc-ccafc19b5bd8f4736a2788263aa5acd6d2b7a961.tar.bz2
re PR c++/40306 (ICE when using auto to declare a local copy inside a member function)
PR c++/40306 PR c++/40307 * decl.c (cp_finish_decl): Handle auto deduction from (). * typeck.c (build_x_indirect_ref): Handle dereferencing an operand with dependent type that is known to be a pointer. From-SVN: r148088
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index a626a71..645ac7e 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -5531,7 +5531,9 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
TREE_TYPE (decl) = error_mark_node;
return;
}
- else if (describable_type (init))
+ if (TREE_CODE (init) == TREE_LIST)
+ init = build_x_compound_expr_from_list (init, "initializer");
+ if (describable_type (init))
{
type = TREE_TYPE (decl) = do_auto_deduction (type, init, auto_node);
if (type == error_mark_node)