summaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
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 1b2a1ef15ae..bcb5ab7a23b 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)