This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/8772: Segmentation fault on 3 lines of template code
- From: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: gcc-bugs at gcc dot gnu dot org, <zack at codesourcery dot com>, <pcarlini at unitus dot it>, <sneechy at hotmail dot com>, <gcc-gnats at gcc dot gnu dot org>
- Date: Tue, 3 Dec 2002 09:53:58 -0600 (CST)
- Subject: Re: c++/8772: Segmentation fault on 3 lines of template code
> | However, just for the record: I fail to see how this can be
> | made legal: when you write A<n>::B to denote the template
> | type, B is a template dependent type, and one would think
> | one has to write a "typename" somewhere. But then we have
> | typename A<n>::B
> | which is not the name of a type, but of a template. I don't
> | know what the standard says here, but I don't see a way to
> | make it legal in any case.
>
> This case seems to be forgotten by the standard. I think the
> following should make GCC happy.
>
> template<int n>
> struct D {
> enum {
> v = C<A<n>::template B>::v
> };
> };
>
> Note the "template" keyword in front of B.
Right, it does.
> The closest you can find in the standard is 14.2/
>
> 4
> When the name of a member template specialization appears after . or
^^^^^^^^^^^^^^
I think this is why you said it seems to have been forgotten? After all it
speaks about a specialization, which it is not in the code you posted.
If you are sure that this is an oversight, why don't you bring it up with
the ISO committee?
Thanks for the clarification
Wolfgang
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth