public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13474] New: fail to compile non type argument specialization of pointer to array of int
@ 2003-12-23 5:26 gprentice at paradise dot net dot nz
2003-12-24 20:33 ` [Bug c++/13474] " pinskia at gcc dot gnu dot org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: gprentice at paradise dot net dot nz @ 2003-12-23 5:26 UTC (permalink / raw)
To: gcc-bugs
GCC gives
test1.cpp:6: could not convert template argument `&array' to `int (*)[5]'
for the following code. It compiles with VC7.1.
template< int X, int Y, int (*array_ptr)[Y] > class A {};
int array[5];
template< int X > class A<X,5,&array> { };
int main()
{
A<6,5,&array> z1;
}
--
Summary: fail to compile non type argument specialization of
pointer to array of int
Product: gcc
Version: 3.2.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gprentice at paradise dot net dot nz
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13474
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13474] fail to compile non type argument specialization of pointer to array of int
2003-12-23 5:26 [Bug c++/13474] New: fail to compile non type argument specialization of pointer to array of int gprentice at paradise dot net dot nz
@ 2003-12-24 20:33 ` pinskia at gcc dot gnu dot org
2004-01-11 1:21 ` giovannibajo at libero dot it
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-24 20:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-12-24 20:20 -------
ICC 6.0 ICEs on this.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13474
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13474] fail to compile non type argument specialization of pointer to array of int
2003-12-23 5:26 [Bug c++/13474] New: fail to compile non type argument specialization of pointer to array of int gprentice at paradise dot net dot nz
2003-12-24 20:33 ` [Bug c++/13474] " pinskia at gcc dot gnu dot org
@ 2004-01-11 1:21 ` giovannibajo at libero dot it
2004-01-11 4:15 ` giovannibajo at libero dot it
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-11 1:21 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13474] fail to compile non type argument specialization of pointer to array of int
2003-12-23 5:26 [Bug c++/13474] New: fail to compile non type argument specialization of pointer to array of int gprentice at paradise dot net dot nz
2003-12-24 20:33 ` [Bug c++/13474] " pinskia at gcc dot gnu dot org
2004-01-11 1:21 ` giovannibajo at libero dot it
@ 2004-01-11 4:15 ` giovannibajo at libero dot it
2004-01-13 1:02 ` cvs-commit at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-11 4:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-01-11 04:15 -------
Mine!
Proposed patch:
http://gcc.gnu.org/ml/gcc-patches/2004-01/msg00822.html
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |giovannibajo at gcc dot gnu
|dot org |dot org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13474
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13474] fail to compile non type argument specialization of pointer to array of int
2003-12-23 5:26 [Bug c++/13474] New: fail to compile non type argument specialization of pointer to array of int gprentice at paradise dot net dot nz
` (2 preceding siblings ...)
2004-01-11 4:15 ` giovannibajo at libero dot it
@ 2004-01-13 1:02 ` cvs-commit at gcc dot gnu dot org
2004-01-13 1:07 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-01-13 1:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-01-13 01:02 -------
Subject: Bug 13474
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: giovannibajo@gcc.gnu.org 2004-01-13 01:02:28
Modified files:
gcc/cp : ChangeLog pt.c
Log message:
PR c++/13474
* pt.c (tsubst) <INTEGER_TYPE>: Remove obsolete array index tweaking.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3874&r2=1.3875
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.812&r2=1.813
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13474
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13474] fail to compile non type argument specialization of pointer to array of int
2003-12-23 5:26 [Bug c++/13474] New: fail to compile non type argument specialization of pointer to array of int gprentice at paradise dot net dot nz
` (4 preceding siblings ...)
2004-01-13 1:07 ` cvs-commit at gcc dot gnu dot org
@ 2004-01-13 1:07 ` giovannibajo at libero dot it
2004-01-13 1:09 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-13 1:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-01-13 01:07 -------
Fixed in GCC 3.4.0. Thank you for your report!
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13474
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13474] fail to compile non type argument specialization of pointer to array of int
2003-12-23 5:26 [Bug c++/13474] New: fail to compile non type argument specialization of pointer to array of int gprentice at paradise dot net dot nz
` (3 preceding siblings ...)
2004-01-13 1:02 ` cvs-commit at gcc dot gnu dot org
@ 2004-01-13 1:07 ` cvs-commit at gcc dot gnu dot org
2004-01-13 1:07 ` giovannibajo at libero dot it
2004-01-13 1:09 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-01-13 1:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-01-13 01:07 -------
Subject: Bug 13474
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: giovannibajo@gcc.gnu.org 2004-01-13 01:07:02
Modified files:
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/template: array3.C
Log message:
PR c++/13474
* g++.dg/template/array3.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3367&r2=1.3368
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/array3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13474
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/13474] fail to compile non type argument specialization of pointer to array of int
2003-12-23 5:26 [Bug c++/13474] New: fail to compile non type argument specialization of pointer to array of int gprentice at paradise dot net dot nz
` (5 preceding siblings ...)
2004-01-13 1:07 ` giovannibajo at libero dot it
@ 2004-01-13 1:09 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-13 1:09 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13474
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-01-13 1:09 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-23 5:26 [Bug c++/13474] New: fail to compile non type argument specialization of pointer to array of int gprentice at paradise dot net dot nz
2003-12-24 20:33 ` [Bug c++/13474] " pinskia at gcc dot gnu dot org
2004-01-11 1:21 ` giovannibajo at libero dot it
2004-01-11 4:15 ` giovannibajo at libero dot it
2004-01-13 1:02 ` cvs-commit at gcc dot gnu dot org
2004-01-13 1:07 ` cvs-commit at gcc dot gnu dot org
2004-01-13 1:07 ` giovannibajo at libero dot it
2004-01-13 1:09 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).