c++/7062: Segmentation fault on type_info
philippeb@videotron.ca
philippeb@videotron.ca
Tue Jun 18 04:46:00 GMT 2002
>Number: 7062
>Category: c++
>Synopsis: Segmentation fault on type_info
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jun 17 20:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: g++
>Release: gcc version 2.95.4 20011006 (Debian prerelease)
>Organization:
>Environment:
Linux 2.2.19pre17 i686
>Description:
I've got a segmentation fault when dereferencing a type_info object at runtime.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="typeof_cpp.txt"
Content-Disposition: inline; filename="typeof_cpp.txt"
#include <iostream>
#include <typeinfo>
using namespace std;
template <typename _T>
struct i
{
static type_info const * const n;
};
template <typename _T>
type_info const * const i<_T>::n = & typeid(_T);
int main()
{
cout << i<int>::n->name() << endl;
}
More information about the Gcc-bugs
mailing list