<div dir="auto"><div dir="auto">Looks like we'll have to upgrade the STL we are using to a more recent version of MSVC.<br></div><div dir="auto"><br></div><div dir="auto">I prefer the diagnostic that MSVC gives, which will be there after that upgrade. As Clang is the second compiler, the code should already be correct.</div><div dir="auto"><br></div><div dir="auto">The thing that I'm most worried about is that I as a naive user should be aware of the implementation details of std::function to either use an include or a forward declare, as I expected this is_convertable to only be evaluated when constructing that function with a callable. However, that's an issue for another forum.</div><div dir="auto"><br></div><div dir="auto">Thanks for all the effort!</div><br><br><div class="gmail_quote" dir="auto"><div dir="ltr">On Tue, Feb 5, 2019, 01:36 Casey Carter <<a href="mailto:Casey@carter.net">Casey@carter.net</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Mon, Feb 4, 2019 at 3:22 PM Reid Kleckner via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer">cfe-dev@lists.llvm.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>I see there is an update suggesting that this is an issue in the STL:</div><div><a href="https://bugs.llvm.org/show_bug.cgi?id=32072#c3" target="_blank" rel="noreferrer">https://bugs.llvm.org/show_bug.cgi?id=32072#c3</a><br></div><div><br></div><div>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.</div></div></div></blockquote><div><br></div><div>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 <a href="http://eel.is/c++draft/meta#rqmts-5" target="_blank" rel="noreferrer">http://eel.is/c++draft/meta#rqmts-5</a>, so both implementations are conforming depending on the reader's interpretation of "undefined behavior" vs. "ill-formed with no diagnostic required".)</div><div><br></div><div>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.</div></div></div></div>
</blockquote></div></div>