This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20208] New: [4.0 Regression] No array-to-pointer decay happens for template functions
- 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: 25 Feb 2005 14:48:09 -0000
- Subject: [Bug c++/20208] New: [4.0 Regression] No array-to-pointer decay happens for template functions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
At -O1 and above, the following code ICE because well, the same reason why PR 2892 fails currently
really:
extern "C" void abort();
template <typename T>
inline void *Foo (T arg) { return &arg[0]; }
int main () {
int bry[2];
if (Foo<int[2]>(bry) != bry)
abort();
}
I filed this a seperate bug because well the ICE is a regression even though fixing PR 2892 will fix this
also.
--
Summary: [4.0 Regression] No array-to-pointer decay happens for
template functions
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
OtherBugsDependingO 2892
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20208