<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:hans@chromium.org" title="Hans Wennborg <hans@chromium.org>"> <span class="fn">Hans Wennborg</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WONTFIX - clang-cl doesn't accept two implicit conversions with a smart pointer pattern in the same way that MSVC does"
href="http://llvm.org/bugs/show_bug.cgi?id=20821">bug 20821</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>WONTFIX
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WONTFIX - clang-cl doesn't accept two implicit conversions with a smart pointer pattern in the same way that MSVC does"
href="http://llvm.org/bugs/show_bug.cgi?id=20821#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WONTFIX - clang-cl doesn't accept two implicit conversions with a smart pointer pattern in the same way that MSVC does"
href="http://llvm.org/bugs/show_bug.cgi?id=20821">bug 20821</a>
from <span class="vcard"><a class="email" href="mailto:hans@chromium.org" title="Hans Wennborg <hans@chromium.org>"> <span class="fn">Hans Wennborg</span></a>
</span></b>
<pre><span class="quote">> It seems like MSVC first invokes SP::operator T*() and then invokes the ctor taking the T* from it, which requires another implicit conversion from D* to B*. I don't think this is valid C++, but we may want to support it for compat with MSVC.</span >
I'm surprised that they allow that (it seems to compile with the 14 CTP too).
Unless we really can't avoid it, I don't think we should support this.
For smart pointers, I think the common thing to do is to provide templates for
converting copy constructors and assignment operators, something like:
template <typename T> SP {
...
template <typename U> SP(SP<U> other) { ... }
template <typename U> void operator=(SP<U> other);
}
I'll mark this wontfix for now.</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>