[Bug c++/34397] [4.2/4.3/4.4 regression] ICE on invalid default template parameter
--- Comment #26 from paolo at gcc dot gnu dot org 2009-02-10 21:47 --- Subject: Bug 34397 Author: paolo Date: Tue Feb 10 21:47:12 2009 New Revision: 144083 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144083 Log: /cp 2009-02-10 Paolo Carlini PR c++/34397 * typeck.c (build_x_array_ref): New. * cp-tree.h: Declare it. * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF. /testsuite 2009-02-10 Paolo Carlini PR c++/34397 * g++.dg/template/crash88.C: New. * g++.dg/template/crash89.C: Likewise. Added: trunk/gcc/testsuite/g++.dg/template/crash88.C trunk/gcc/testsuite/g++.dg/template/crash89.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/pt.c trunk/gcc/cp/typeck.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34397
[Bug c++/34397] [4.2/4.3/4.4 regression] ICE on invalid default template parameter
--- Comment #25 from paolo dot carlini at oracle dot com 2009-02-10 10:03 --- Thanks. I'll try to submit something more polished along these lines... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34397
[Bug c++/34397] [4.2/4.3/4.4 regression] ICE on invalid default template parameter
--- Comment #24 from mark at codesourcery dot com 2009-02-10 06:20 --- Subject: Re: [4.2/4.3/4.4 regression] ICE on invalid default template parameter paolo dot carlini at oracle dot com wrote: > Mark, can you have a closer look to the draft patch? I'm still looking but I > don't think we can extract and commonize much code from grok_array_decl, > unless > we accept to pass from the callers an in_parser flag, or use a function > pointer, I can see only such rather ugly solutions... You may well be right. Your draft patch looks plausible. Thanks, -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34397
[Bug c++/34397] [4.2/4.3/4.4 regression] ICE on invalid default template parameter
-- paolo dot carlini at oracle dot com changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |paolo dot carlini at oracle |dot org |dot com Status|NEW |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34397
[Bug c++/34397] [4.2/4.3/4.4 regression] ICE on invalid default template parameter
--- Comment #23 from paolo dot carlini at oracle dot com 2009-02-09 17:09 --- Mark, can you have a closer look to the draft patch? I'm still looking but I don't think we can extract and commonize much code from grok_array_decl, unless we accept to pass from the callers an in_parser flag, or use a function pointer, I can see only such rather ugly solutions... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34397
[Bug c++/34397] [4.2/4.3/4.4 regression] ICE on invalid default template parameter
--- Comment #22 from paolo dot carlini at oracle dot com 2009-02-08 22:40 --- Many thanks Mark for your detailed feedback on this PR and the other one. I'll try to work along the lines you suggested. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34397
[Bug c++/34397] [4.2/4.3/4.4 regression] ICE on invalid default template parameter
--- Comment #21 from mmitchel at gcc dot gnu dot org 2009-02-08 22:35 --- Paolo -- My earlier suggestion to try grok_array_decl may indeed have been misguided. Some of the grok_* functions do more parser-style analysis than we want when processing templates. In theory, the way this ought to work is that we parse for a while, until we know what the user meant, and then call a function that actually generates code. When processing a template, we call that same underlying function after substitution. But, in practice, we may not always have organized things that tidily. In that case, the best fix is to factor out syntactic dismabiguation bits from grok_array_decl, and make a new underlying function that is called from both the parser and the template machinery. -- Mark -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34397
[Bug c++/34397] [4.2/4.3/4.4 regression] ICE on invalid default template parameter
--- Comment #20 from paolo dot carlini at oracle dot com 2009-02-05 12:48 --- Created an attachment (id=17246) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17246&action=view) draft, showing that the missing NULL_TREEs are indeed an issue -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34397
[Bug c++/34397] [4.2/4.3/4.4 regression] ICE on invalid default template parameter
--- Comment #19 from paolo dot carlini at oracle dot com 2009-02-05 12:47 --- Indeed, in my experiments the problem seems due to build_min_nt not passing NULL_TREEs as called by build_x_binary_op. The patch I'm going to attach then works, in the sense that the testcase compiles (and then an error is emitted in case of instantiation). I also tried calling directly grok_array_decl from tsubst_copy_and_build, and indeed that largely works (but note that, for some reason, the grok_* functions, called by the parser, are not called often in pt.c, many build_x_* functions instead), but there are subtle issues, like sfinae7.C failing... -- paolo dot carlini at oracle dot com changed: What|Removed |Added CC||paolo dot carlini at oracle ||dot com, mark at ||codesourcery dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34397
[Bug c++/34397] [4.2/4.3/4.4 regression] ICE on invalid default template parameter
--- Comment #18 from jsm28 at gcc dot gnu dot org 2008-07-04 22:22 --- Closing 4.1 branch. -- jsm28 at gcc dot gnu dot org changed: What|Removed |Added Summary|[4.1/4.2/4.3/4.4 regression]|[4.2/4.3/4.4 regression] ICE |ICE on invalid default |on invalid default template |template parameter |parameter Target Milestone|4.1.3 |4.2.5 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34397