From d5f343158aef7b15bc20cb6a60650979ba674734 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Fri, 4 Sep 1998 16:35:14 +0000 Subject: [PATCH] typeinfo (type_info::type_info(const char*)): Make `explicit'. * inc/typeinfo (type_info::type_info(const char*)): Make `explicit'. From-SVN: r22235 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/inc/typeinfo | 2 +- gcc/testsuite/g++.old-deja/g++.other/typeinfo1.C | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/typeinfo1.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1138e872fb7..0beacd2e8ed 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 1998-09-04 Mark Mitchell + * inc/typeinfo (type_info::type_info(const char*)): Make + `explicit'. + * cp-tree.h (hash_tree_cons_simple): New macro. * pt.c (tsubst_arg_types): New function. Use hash_tree_cons. (coerce_template_parms): Use make_temp_vec, instead of diff --git a/gcc/cp/inc/typeinfo b/gcc/cp/inc/typeinfo index a735525b7b8..cf3b521af5e 100644 --- a/gcc/cp/inc/typeinfo +++ b/gcc/cp/inc/typeinfo @@ -17,7 +17,7 @@ private: type_info (const type_info&); protected: - type_info (const char *n): _name (n) { } + explicit type_info (const char *n): _name (n) { } const char *_name; diff --git a/gcc/testsuite/g++.old-deja/g++.other/typeinfo1.C b/gcc/testsuite/g++.old-deja/g++.other/typeinfo1.C new file mode 100644 index 00000000000..070e885fe91 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/typeinfo1.C @@ -0,0 +1,15 @@ +// Build don't link: + +#include + +struct S { + S (const char*); +}; + +void f(S s); +void f(type_info); + +void g() +{ + f("abc"); +} -- 2.30.2