aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@markmitchell.com>1998-09-04 16:35:14 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1998-09-04 16:35:14 +0000
commitd5f343158aef7b15bc20cb6a60650979ba674734 (patch)
tree985fdd13f71e521629664dca0e9c7d166b3373d3 /gcc
parent15c5edb9219bffde7d0eb2c375115271d1621436 (diff)
downloadgcc-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/ChangeLog3
-rw-r--r--gcc/cp/inc/typeinfo2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typeinfo1.C15
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");
+}