This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH for typeinfo header
- To: egcs-patches at cygnus dot com
- Subject: PATCH for typeinfo header
- From: Mark Mitchell <mark at markmitchell dot com>
- Date: Fri, 4 Sep 1998 16:37:34 -0700
- Cc: Jason Merrill <jason at cygnus dot com>
- Reply-to: mark at markmitchell dot com
Believe it or not, this comes from real code.
--
Mark Mitchell mark@markmitchell.com
Mark Mitchell Consulting http://www.markmitchell.com
1998-09-04 Mark Mitchell <mark@markmitchell.com>
* inc/typeinfo (type_info::type_info(const char*)): Make
`explicit'.
Index: testsuite/g++.old-deja/g++.other/typeinfo1.C
===================================================================
RCS file: typeinfo1.C
diff -N typeinfo1.C
*** /dev/null Mon Dec 31 20:00:00 1979
--- typeinfo1.C Fri Sep 4 16:32:48 1998
***************
*** 0 ****
--- 1,15 ----
+ // Build don't link:
+
+ #include <typeinfo>
+
+ struct S {
+ S (const char*);
+ };
+
+ void f(S s);
+ void f(type_info);
+
+ void g()
+ {
+ f("abc");
+ }
Index: cp/inc/typeinfo
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/inc/typeinfo,v
retrieving revision 1.3
diff -c -p -r1.3 typeinfo
*** typeinfo 1998/08/24 02:00:27 1.3
--- typeinfo 1998/09/04 23:32:48
*************** private:
*** 17,23 ****
type_info (const type_info&);
protected:
! type_info (const char *n): _name (n) { }
const char *_name;
--- 17,23 ----
type_info (const type_info&);
protected:
! explicit type_info (const char *n): _name (n) { }
const char *_name;