This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/13474] fail to compile non type argument specialization of pointer to array of int


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]