This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28886] [4.1/4.2 regression] Template specialization with array rejected
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Sep 2006 01:36:56 -0000
- Subject: [Bug c++/28886] [4.1/4.2 regression] Template specialization with array rejected
- References: <bug-28886-1771@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from pinskia at gcc dot gnu dot org 2006-09-02 01:36 -------
(In reply to comment #5)
> So, that's what should be fixed.
Except that means introducing a language hook which is only to be useful in one
place.
The other way of fixing this is not to call fold if we have a MINUS_EXPR with
the 2nd operand as 1, we just use the first. Really I don't see any reason why
we should introduce a language hook when we can just strip the NON_LVALUE_EXPR
right after fold and introducing a language hook which will only help in one
specific case.
The real real way of fixing this is to move the C++ front-end's templates from
using trees and use something which is just specific to the C++ front-end and
we would not have to call fold here at all since we will just store the length
of the array instead of the "length-1".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28886