summaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-14 00:06:48 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-14 00:06:48 +0000
commitb25ee589af32832b873b87012214b5283a421992 (patch)
tree84b63e06c1023a70ed249614db5aad83a0de1ba7 /gcc/cp/init.c
parentd2c5fba62d863d66d11ad169b96e938728878f6c (diff)
downloadgcc-b25ee589af32832b873b87012214b5283a421992.tar.gz
* decl.c (cp_finish_decl): Use resolve_nondeduced_context for auto.
* init.c (build_new): Likewise. * pt.c (tsubst_decl): Likewise. (do_auto_deduction): Likewise. (resolve_nondeduced_context): Use build_offset_ref and cp_build_addr_expr. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166724 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 00b5d9be551..670c7a51904 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -2516,8 +2516,13 @@ build_new (VEC(tree,gc) **placement, tree type, tree nelts,
if (nelts == NULL_TREE && VEC_length (tree, *init) == 1)
{
tree auto_node = type_uses_auto (type);
- if (auto_node && describable_type (VEC_index (tree, *init, 0)))
- type = do_auto_deduction (type, VEC_index (tree, *init, 0), auto_node);
+ if (auto_node)
+ {
+ tree d_init = VEC_index (tree, *init, 0);
+ d_init = resolve_nondeduced_context (d_init);
+ if (describable_type (d_init))
+ type = do_auto_deduction (type, d_init, auto_node);
+ }
}
if (processing_template_decl)