This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/7062: Segmentation fault on type_info


>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;
}




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]