summaryrefslogtreecommitdiffstats
path: root/libcxxabi
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2018-10-09 14:55:15 +0000
committerLouis Dionne <ldionne@apple.com>2018-10-09 14:55:15 +0000
commitdd1bed11d87e95cd05172fd6c1c3e7855f2ced6f (patch)
tree4f1dfdb9aaf0eac2fbf11f2c8c986db3235befa4 /libcxxabi
parent22cccffa06ad055a47e0d72c0de70a9131ed2943 (diff)
downloadbcm5719-llvm-dd1bed11d87e95cd05172fd6c1c3e7855f2ced6f.tar.gz
bcm5719-llvm-dd1bed11d87e95cd05172fd6c1c3e7855f2ced6f.zip
[NFC][unwind] Improve error message when a type has more than one RTTIs
The "dynamic_cast error 2" error can apparently happen when the same type (with RTTI) is defined in more than one translation unit, and those translation units are linked together. This is technically an ODR violation, but making the error message more obvious is still helpful. llvm-svn: 344052
Diffstat (limited to 'libcxxabi')
-rw-r--r--libcxxabi/src/private_typeinfo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libcxxabi/src/private_typeinfo.cpp b/libcxxabi/src/private_typeinfo.cpp
index 67a5a62dc80..30340a173cf 100644
--- a/libcxxabi/src/private_typeinfo.cpp
+++ b/libcxxabi/src/private_typeinfo.cpp
@@ -651,7 +651,7 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,
// We get here only if there is some kind of visibility problem
// in client code.
syslog(LOG_ERR, "dynamic_cast error 1: Both of the following type_info's "
- "should have public visibility. At least one of them is hidden. %s"
+ "should have public visibility. At least one of them is hidden. %s"
", %s.\n", static_type->name(), dynamic_type->name());
// Redo the search comparing type_info's using strcmp
info = {dst_type, static_ptr, static_type, src2dst_offset, 0};
@@ -674,7 +674,8 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,
info.path_dynamic_ptr_to_static_ptr == unknown)
{
syslog(LOG_ERR, "dynamic_cast error 2: One or more of the following type_info's "
- "has hidden visibility. They should all have public visibility. "
+ "has hidden visibility or is defined in more than one translation "
+ "unit. They should all have public visibility. "
"%s, %s, %s.\n", static_type->name(), dynamic_type->name(),
dst_type->name());
// Redo the search comparing type_info's using strcmp
OpenPOWER on IntegriCloud