aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-11-13 19:06:48 -0500
committerJason Merrill <jason@gcc.gnu.org>2010-11-13 19:06:48 -0500
commit2e5748d2868d1c8d24d84fe0bcf9916cf0ffc527 (patch)
tree84b63e06c1023a70ed249614db5aad83a0de1ba7 /gcc/cp/init.c
parentd86216483294d8789d2f92168511d6508c80dbd1 (diff)
downloadgcc-2e5748d2868d1c8d24d84fe0bcf9916cf0ffc527.zip
gcc-2e5748d2868d1c8d24d84fe0bcf9916cf0ffc527.tar.gz
gcc-2e5748d2868d1c8d24d84fe0bcf9916cf0ffc527.tar.bz2
decl.c (cp_finish_decl): Use resolve_nondeduced_context for auto.
* 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. From-SVN: r166724
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 00b5d9b..670c7a5 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)