aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-03-21 00:04:39 -0400
committerJason Merrill <jason@gcc.gnu.org>2012-03-21 00:04:39 -0400
commitc19267cbaf0188acd862e628b72fb32e68d08d48 (patch)
treed78ec393143f330e334e0d1388fbcd7568ca8b93 /gcc/cp/init.c
parentf17dd5dad399612fb6be1ad666fdb43ff97f8418 (diff)
downloadgcc-c19267cbaf0188acd862e628b72fb32e68d08d48.zip
gcc-c19267cbaf0188acd862e628b72fb32e68d08d48.tar.gz
gcc-c19267cbaf0188acd862e628b72fb32e68d08d48.tar.bz2
mangle.c (write_type): Handle 'auto'.
gcc/cp/ * mangle.c (write_type): Handle 'auto'. * init.c (build_new): Don't do auto deduction where it might affect template mangling. libiberty/ * cp-demangle.c (cplus_demangle_type): Handle 'auto'. From-SVN: r185595
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 1b2a1ef..bcb5ab7 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -2774,7 +2774,9 @@ build_new (VEC(tree,gc) **placement, tree type, tree nelts,
if (type == error_mark_node)
return error_mark_node;
- if (nelts == NULL_TREE && VEC_length (tree, *init) == 1)
+ if (nelts == NULL_TREE && VEC_length (tree, *init) == 1
+ /* Don't do auto deduction where it might affect mangling. */
+ && (!processing_template_decl || at_function_scope_p ()))
{
tree auto_node = type_uses_auto (type);
if (auto_node)