This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
new ICE #122 (20000814): member function of class template
- To: gcc-bugs at gcc dot gnu dot org
- Subject: new ICE #122 (20000814): member function of class template
- From: Marco Franzen <Marco dot Franzen at Thyron dot com>
- Date: Fri, 18 Aug 2000 13:02:58 +0100
- Organization: Thyron Limited, UK
The following source code triggers ICE #122 in snapshot 20000814.
Again, this happens only if the function is defined outside the class
definition.
This did not happen (or was not detected) in 2.95.2.
===================================================
void panic (const char *, ...);
template<class C>
class SomeClass
{
public:
void f (int *p);
};
template<class C>
void
SomeClass<C>::f (int * p)
{
if (0)
panic ("problem with pointer %p",
static_cast<void*> p);
}
=====================================================
(Yes, it is syntactically wrong (missing parens around arg to static_cast).)
===================================================
GNU C++ version 2.96 20000814 (experimental) (i586-sco-sysv5uw7.1.0) compiled by GNU C version 2.96 20000814 (experimental).
voidform.cpp: In method `void SomeClass<C>::f (int *)':
voidform.cpp:16: parse error before `)'
voidform.cpp:17: Internal error #122.
voidform.cpp:17: Internal compiler error in finish_function, at
../egcs-20000814/gcc/cp/decl.c:14394
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
=====================================================
GNU C++ version 2.95.2 19991024 (release) (hppa1.1-hp-hpux10.20) compiled by GNU C version 2.95.2 19991024 (release).
voidform.cpp: In method `void SomeClass<C>::f(int *)':
voidform.cpp:16: parse error before `)'
voidform.cpp:17: confused by earlier errors, bailing out
=======================================================
[The following confidentiality statement is void, as the email is
addressed to a public list, not an individual.]
-----------------------------------------------------------------
This email is confidential and intended solely for the use of the
individual to whom it is addressed.
Any views or opinions presented are solely those of the author
and do not necessarily represent those of Thyron Limited.
If you are not the intended recipient then please be advised
that you have received this email in error and that any use,
dissemination, forwarding, printing or copying of this email
is strictly prohibited.
If you have received this email in error, please notify the
Thyron IT Administrator on +44 (0)1923 236 050 or
send an email to mail-admin@thyron.com.
Thank You