[cfe-dev] Old bug, not yet looked at

Casey Carter via cfe-dev cfe-dev at lists.llvm.org
Mon Feb 4 16:36:09 PST 2019


On Mon, Feb 4, 2019 at 3:22 PM Reid Kleckner via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> I see there is an update suggesting that this is an issue in the STL:
> https://bugs.llvm.org/show_bug.cgi?id=32072#c3
>
> However, I think there is still an argument to be made that clang should
> "do what MSVC does" here. I suppose it's not clear what that is, though.
>

Recentish (IIRC since roughly VS2017 15.8) versions of MSVC would diagnose
the attempt to evaluate __is_convertible_to(T, U) for an incomplete class
type T as ill-formed. Clang, IIUC, simply yields `false`. (The behavior of
a program that evaluates `std::is_convertible<T, U>` for an incomplete
class type T is formally undefined per http://eel.is/c++draft/meta#rqmts-5,
so both implementations are conforming depending on the reader's
interpretation of "undefined behavior" vs. "ill-formed with no diagnostic
required".)

Note that neither behavior allows the subject program to compile and do
what the submitter expects: changing clang to mirror the MSVC behavior
would result in the program being ill-formed with a diagnostic instead of
being ill-formed due to ODR violation. Doing as the submitter expects
requires a change to the Standard Library to avoid asking the broken
question in the first place.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190204/95869b13/attachment.html>


More information about the cfe-dev mailing list