From b25ee589af32832b873b87012214b5283a421992 Mon Sep 17 00:00:00 2001 From: jason Date: Sun, 14 Nov 2010 00:06:48 +0000 Subject: * 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 --- gcc/cp/init.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc/cp/init.c') 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) -- cgit v1.2.1