c++/10615: Forgetting 'typename' in function template return type causes segmentation fault.
gccbugs@contacts.eelis.net
gccbugs@contacts.eelis.net
Sun May 4 08:36:00 GMT 2003
>Number: 10615
>Category: c++
>Synopsis: Forgetting 'typename' in function template return type causes segmentation fault.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-illegal-code
>Submitter-Id: net
>Arrival-Date: Sun May 04 02:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Eelis van der Weegen
>Release: gcc version 3.2.2
>Organization:
>Environment:
Configured with: ../gcc-3.2.2/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i386-slackware-linux --host=i386-slackware-linux
Thread model: posix
>Description:
Compiling the following code:
template <class T>
struct A
{
struct B;
typedef typename B::type t;
};
template <class T> typename A<T>::t::u f (); // no problem
template <class T> A<T>::t::u g (); // forgot typename -> KABOOM!
results in the following error:
internal error: Segmentation fault
at the indicated line.
>How-To-Repeat:
Compile the code from the description.
>Fix:
No idea.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list