* 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'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185595
138bc75d-0d04-0410-961f-
82ee72b054a4
2012-03-20 Jason Merrill <jason@redhat.com>
+ * mangle.c (write_type): Handle 'auto'.
+ * init.c (build_new): Don't do auto deduction where it might
+ affect template mangling.
+
PR c++/52510
* decl.c (reshape_init_class): Handle repeated reshaping.
* search.c (lookup_field_1): Add sanity check.
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)
break;
case TEMPLATE_TYPE_PARM:
+ if (is_auto (type))
+ {
+ write_identifier ("Da");
+ ++is_builtin_type;
+ break;
+ }
+ /* else fall through. */
case TEMPLATE_PARM_INDEX:
write_template_param (type);
break;
+2012-03-20 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/auto32.C: New.
+
2012-03-20 Georg-Johann Lay <avr@gjlay.de>
PR testsuite/52641
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+// { dg-final { scan-assembler "_Z1fIiEDTnw_Dapifp_EET_" } }
+template <class T> auto f(T t) -> decltype (new auto(t));
+
+int main()
+{
+ f(1);
+}
+2012-03-20 Jason Merrill <jason@redhat.com>
+
+ * cp-demangle.c (cplus_demangle_type): Handle 'auto'.
+
2012-03-07 Jason Merrill <jason@redhat.com>
* cp-demangle.c (cplus_demangle_operators): Add li.
cplus_demangle_type (di), NULL);
can_subst = 1;
break;
+
+ case 'a':
+ /* auto */
+ ret = d_make_name (di, "auto", 4);
+ break;
case 'f':
/* 32-bit decimal floating point */
--format=gnu-v3
_Zli2_wPKc
operator"" _w(char const*)
+--format=gnu-v3
+_Z1fIiEDTnw_Dapifp_EET_
+decltype (new auto({parm#1})) f<int>(int)
+--format=gnu-v3
+_Z1fIiERDaRKT_S1_
+auto& f<int>(int const&, int)
#
# Ada (GNAT) tests.
#