This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13474] fail to compile non type argument specialization of pointer to array of int
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jan 2004 01:21:14 -0000
- Subject: [Bug c++/13474] fail to compile non type argument specialization of pointer to array of int
- References: <20031223034549.13474.gprentice@paradise.net.nz>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From giovannibajo at libero dot it 2004-01-11 01:21 -------
>From my reading of the standard, int (*)[Y] is a deducible context, and it's
type-dependent on the previous template parameter. "&array" matches it
perfectly, and the specialization should indeed be chosen. The full testcase
(which also tests if the specialization is being selected) is the following:
-----------------------------------------------
template< int X, int Y, int (*array_ptr)[Y] >
class A;
int array[5];
template< int X > class A<X,5,&array> {};
template class A<6,5,&array>;
-----------------------------------------------
This is valid C++ to me and should be accepted. It's rejected by any GCC
version on earth (ok, on my hard disk). It crashes EDG as Andrew pointed out,
and it's accepted by MSVC71.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |rejects-valid
Last reconfirmed|0000-00-00 00:00:00 |2004-01-11 01:21:13
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13474