<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 - interesting difference in do_get behavior between libc++ and other libraries."
href="https://bugs.llvm.org/show_bug.cgi?id=52297">52297</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>interesting difference in do_get behavior between libc++ and other libraries.
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>11.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Standards Issues
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>edward.vogel@hpe.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=25391" name="attach_25391" title="Small program that shows the issue.">attachment 25391</a> <a href="attachment.cgi?id=25391&action=edit" title="Small program that shows the issue.">[details]</a></span>
Small program that shows the issue.
The attached small program shows a difference in the behavior of libc++ do_get
when a class overrides the standard do_get. Here an overriding do_get for
bool types calls the base class do_get. With libc++ that call will call the
long do_get viritual function in the overriding class. Other libraries (gnu,
Visual Studio) will call the base class long do_get.
In reading the Standard, it's not clear to me who is correct. This is why I've
posted this as a standards issue.
Here is a cut/paste from a Cygwin session:
VogelEd@XLB3502Q4E ~/temp
$ clang++ -o a.out t1.cpp
VogelEd@XLB3502Q4E ~/temp
$ ./a.out
In bool do_get
Returning from bool do_get
VogelEd@XLB3502Q4E ~/temp
$ clang++ -o a.out -stdlib=libc++ t1.cpp
VogelEd@XLB3502Q4E ~/temp
$ ./a.out
In bool do_get
In long do_get
Returning from long do_get
Returning from bool do_get
The attached reproducer is a greatly reduced and modified version of one of
the runtime library tests I use to test one of our HPE runtimes.
Probably not a big deal, but this difference in behavior could cause customer
confusion.
Thank you for your time,
Ed Vogel</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>