diff options
author | Mark Mitchell <mark@markmitchell.com> | 1998-09-04 16:35:14 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1998-09-04 16:35:14 +0000 |
commit | d5f343158aef7b15bc20cb6a60650979ba674734 (patch) | |
tree | 985fdd13f71e521629664dca0e9c7d166b3373d3 /gcc | |
parent | 15c5edb9219bffde7d0eb2c375115271d1621436 (diff) | |
download | gcc-d5f343158aef7b15bc20cb6a60650979ba674734.zip gcc-d5f343158aef7b15bc20cb6a60650979ba674734.tar.gz gcc-d5f343158aef7b15bc20cb6a60650979ba674734.tar.bz2 |
typeinfo (type_info::type_info(const char*)): Make `explicit'.
* inc/typeinfo (type_info::type_info(const char*)): Make
`explicit'.
From-SVN: r22235
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/inc/typeinfo | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/typeinfo1.C | 15 |
3 files changed, 19 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1138e87..0beacd2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 1998-09-04 Mark Mitchell <mark@markmitchell.com> + * 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 a735525..cf3b521 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 0000000..070e885 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/typeinfo1.C @@ -0,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"); +} |