This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17232] classes and class template specializations treated differently w.r.t. core issue #337
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Aug 2004 23:15:33 -0000
- Subject: [Bug c++/17232] classes and class template specializations treated differently w.r.t. core issue #337
- References: <20040829175551.17232.cludwig@cdc.informatik.tu-darmstadt.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From giovannibajo at libero dot it 2004-08-30 23:15 -------
Subject: Re: classes and class template specializations treated differently w.r.t. core issue #337
jason at redhat dot com wrote:
> template<typename T>
> class A {
> virtual void f() = 0;
> };
>
> A<int>(*p)[1];
>
> Is the compiler required to diagnose this? If so, simply creating an
> array type requires that the element type be instantiated.
Yes, [dcl.array]/1 tells us that it's invalid to create an array type if the
element type is abstract, and [temp.inst]/1 tells us that there has to be an
implicit instantiation whenever the completeness of the type affects the
semantic of the program (and we know that we need an instantiation to check if
the class is really abstract or not).
>I think that this is the right answer, but I also think it's worth discussing
with the
> committee.
I think the submitter was going to raise the issue on comp.std.c++, but maybe
you can raise this directly with the committee? When we get a consensus, I can
test & submit the patch I attacched to this bug.
Giovanni Bajo
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17232