This is an archive of the discontinued LLVM Phabricator instance.

[clang-cl] [Sema] Do not prefer integral conversion over floating-to-integral for MS compatibility 19.28 and higher.
ClosedPublic

Authored by curdeius on Mar 31 2021, 8:44 AM.

Details

Summary

As of MSVC 19.28 (2019 Update 8), integral conversion is no longer preferred over floating-to-integral, and so MSVC is more standard conformant and will generate a compiler error on ambiguous call.
Cf. https://godbolt.org/z/E8xsdqKsb.
Initially found during the review of D99641.

Diff Detail

Event Timeline

curdeius created this revision.Mar 31 2021, 8:44 AM
curdeius requested review of this revision.Mar 31 2021, 8:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 31 2021, 8:44 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
rnk accepted this revision.Apr 1 2021, 1:49 PM

lgtm

Slowly we will peel back the layers of compatibility hacks until both compilers conform. :)

This revision is now accepted and ready to land.Apr 1 2021, 1:49 PM