<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - std::type_index equality broken with LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT=OFF"
href="https://bugs.llvm.org/show_bug.cgi?id=45549">45549</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>std::type_index equality broken with LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT=OFF
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>9.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ryan.brown@ableton.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>When using LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT=OFF, distinct classes with
the same name, each in a different TU and anonymous namespace, are considered
equal by std::type_index.
LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT=OFF is used in the libc++ shipped with
Xcode as of Xcode 11.4. The bug does not occur in Xcode 11.3.1, the previous
version. LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT was introduced in 2405bd689
for LLVM 9.0.0.
See <a href="https://gist.github.com/ryb-ableton/1805b61e2d0976de4ba04c2aa2f5992b">https://gist.github.com/ryb-ableton/1805b61e2d0976de4ba04c2aa2f5992b</a> for a
minimal test case.
May be related to <a class="bz_bug_link
bz_status_NEW "
title="NEW - IA64 ABI: RTTI name for class in anonymous namespace lacks '*', breaks dynamic_cast and type_info::operator== on GNU/Linux"
href="show_bug.cgi?id=34907">https://bugs.llvm.org/show_bug.cgi?id=34907</a>
----------------
Steps to reproduce on Linux/x86:
1. Build and install libc++ 9.0 or 10.0 by passing
-DLIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT=OFF to cmake
2. Download and extract a zip of the Gist linked above
3. Run "bash ./build_and_run"
Steps to reproduce on macOS:
1. Install and select Xcode 11.4, which uses
LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT=OFF by default
2. Download and extract a zip of the Gist linked above
3. Run "bash ./build_and_run"
Actual Output:
Assertion failed: (registry[0] != registry[1]), function main, file main.cpp,
line 13.
./run: line 4: 39942 Abort trap: 6 ./test
Failure
Expected Output:
Success</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>