template<typename U> struct X {}; template<typename T> auto f(T t) -> X<decltype(t+1)> {} template<typename T> auto g(T t) -> X<decltype(t+1)> {} Compiling with -std=c++0x gives decltype_ice.cc:4:52: internal compiler error: Segmentation fault: 11
Jason, can you have a look to this one? Thanks in advance!
Subject: Bug 40619 Author: jason Date: Sat Jul 4 04:34:03 2009 New Revision: 149223 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149223 Log: PR c++/40619 * cp-tree.h (struct lang_decl_parm): New. (struct lang_decl): Add it. (LANG_DECL_PARM_CHECK): New. (DECL_PARM_INDEX): New. * decl2.c (parm_index): Remove. * lex.c (retrofit_lang_decl): Handle parms. (cxx_dup_lang_specific_decl): Likewise. * mangle.c (write_expression): Adjust. * tree.c (cp_tree_equal): Adjust. (decl_linkage): Only check DECL_COMDAT for functions and variables. * parser.c (cp_parser_parameter_declaration_list): Set DECL_PARM_INDEX. * pt.c (iterative_hash_template_arg): Hash it. Added: trunk/gcc/testsuite/g++.dg/cpp0x/auto16.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/decl2.c trunk/gcc/cp/lex.c trunk/gcc/cp/mangle.c trunk/gcc/cp/parser.c trunk/gcc/cp/pt.c trunk/gcc/cp/tree.c trunk/gcc/testsuite/ChangeLog
Thanks again Jason.
It works. Thanks!
Subject: Bug 40619 Author: jason Date: Sat Jul 4 18:11:59 2009 New Revision: 149240 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149240 Log: PR c++/40619 * tree.c (cp_tree_equal) [PARM_DECL]: Don't check parm index. Added: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/auto16.C - copied unchanged from r149223, trunk/gcc/testsuite/g++.dg/cpp0x/auto16.C Modified: branches/gcc-4_4-branch/gcc/cp/ChangeLog branches/gcc-4_4-branch/gcc/cp/tree.c branches/gcc-4_4-branch/gcc/testsuite/g++.dg/ (props changed) branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/decltype-38655.C (props changed) Propchange: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/ ('svn:mergeinfo' added) Propchange: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/decltype-38655.C ('svn:mergeinfo' modified)
Fixed for 4.4.1.