Add support for constexpr and explicit conversions on clang-cl

RESOLVED FIXED in mozilla35

Status

()

Core
MFBT
RESOLVED FIXED
4 years ago
2 years ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

(Blocks: 1 bug)

unspecified
mozilla35
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Comment hidden (empty)
(Assignee)

Comment 1

4 years ago
Created attachment 8502950 [details] [diff] [review]
Add support for constexpr and explicit conversions on clang-cl
(Assignee)

Updated

4 years ago
Assignee: nobody → ehsan.akhgari
Blocks: 752004
(Assignee)

Updated

4 years ago
Attachment #8502950 - Flags: review?(nfroyd)
Comment on attachment 8502950 [details] [diff] [review]
Add support for constexpr and explicit conversions on clang-cl

Review of attachment 8502950 [details] [diff] [review]:
-----------------------------------------------------------------

I guess clang-cl doesn't support the __attribute__ syntax for things, so we can't be clever here and just do something like:

#if defined(_MSC_VER) && !defined(__clang__) // native MSVC
...
#elif defined(__clang__) // clang or clang-cl on Windows
...
#elif defined(__GNUC__) // gcc
...
#endif

?  I guess that would shut out doing things with clang-cl's MSVC version emulation...
Attachment #8502950 - Flags: review?(nfroyd) → review+
(Assignee)

Comment 3

4 years ago
I think it actually does support __attribute__, but I'd prefer to keep as much as of the logic shared with MSVC (since it's supposed to be a drop-in replacement and all.)
https://hg.mozilla.org/mozilla-central/rev/d27ce1e75719
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
(Assignee)

Comment 5

2 years ago
In hindsight, the constexpr part of this was a stupid idea.  constexpr-ness of things can change ABI requirements, and I keep running into ABI miscompat issues when some object files are compiled with cl and some with clang-cl where the problem boils down to clang-cl choosing constexpr and MSVC 2013 not, and I'm tired of this!

I'm going to revert the constexpr part of this bug.  Sorry for being silly!
Depends on: 1277775
Depends on: 1120059
You need to log in before you can comment on or make changes to this bug.