This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/10585: Using typeof() for template parameters does not work (and ICEs on 3.3)
- From: giovannibajo at libero dot it
- To: gcc-gnats at gcc dot gnu dot org
- Date: 1 May 2003 18:38:41 -0000
- Subject: c++/10585: Using typeof() for template parameters does not work (and ICEs on 3.3)
- Reply-to: giovannibajo at libero dot it
>Number: 10585
>Category: c++
>Synopsis: Using typeof() for template parameters does not work (and ICEs on 3.3)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Thu May 01 18:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Giovanni Bajo
>Release: 3.3 and 3.4 (CVS 20030430)
>Organization:
>Environment:
i686-pc-cygwin
>Description:
This is basically c++/4526, but epurated.
The following snippet does not compile on the active branch (3.3) and the mainline (3.4):
------------------------------------
struct X { typedef int type; };
X x;
template <typename T> struct A {
typedef typename T::type type;
};
template <typename T> struct B {
typename A<typeof(x)>::type y;
};
template class B<int>;
------------------------------------
pr4526.cpp:9: error: no type named `type' in `struct A<__typeof (x)>'
pr4526.cpp:9: error: ISO C++ forbids declaration of `y' with no type
3.3 CVS 20030421 even ICEs with this code snippet.
Note also that this bug might be related to c++/8007.
>How-To-Repeat:
Compile the above snippet
>Fix:
No known fix.
>Release-Note:
>Audit-Trail:
>Unformatted: