This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15064] [3.4/3.5 Regression] typeid of template parameter gives ICE
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Apr 2004 13:05:17 -0000
- Subject: [Bug c++/15064] [3.4/3.5 Regression] typeid of template parameter gives ICE
- References: <20040422083847.15064.leif.lonnblad@thep.lu.se>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From giovannibajo at libero dot it 2004-04-23 13:05 -------
Fixed in 3.4.1 and mainline. Thank you for your report!
As for a temporary workaround, the problem comes from the use of typeid()
within an initializer expression of a variable in a template. Try using a
wrapper function, something along the lines of:
template <class T>
const std::type_info& wrapper_typeid()
{ return typeid(T); }
/* ... */
template <class T>
void dummy() {
const std::type_info& tid = wrapper_typeid<T>();
}
Untested, but should work as a workaround.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15064