Closed Bug 1316168 Opened 3 years ago Closed 3 years ago

clang-cl build error in nsExceptionHandler.cpp

Categories

(Toolkit :: Crash Reporting, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: dmajor, Assigned: dmajor)

References

Details

Attachments

(1 file, 1 obsolete file)

4:07.44 d:/build/msys/s/central/toolkit/crashreporter/nsExceptionHandler.cpp(526,14):  error(clang): call to constructor of 'xpstring' (aka 'basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >') is ambiguous
 4:07.44   return new xpstring(path.get(), path.Length());
 4:07.44              ^        ~~~~~~~~~~~~~~~~~~~~~~~~~

nsExceptionHandler.cpp is full of char16_t/wchar_t mismatch (search for "reinterpret_cast<wchar_t*>"), so this is nothing new.

The tricky thing about this one, though, is that path.get() is a char16ptr_t, so we have to do a yucky C-cast to trigger its operator wchar_t*().
Attached patch C-style cast (obsolete) — Splinter Review
Assignee: nobody → dmajor
Attachment #8808826 - Flags: review?(nfroyd)
Actually I guess static_cast would work too...
Attached patch static_castSplinter Review
Attachment #8808826 - Attachment is obsolete: true
Attachment #8808826 - Flags: review?(nfroyd)
Attachment #8808827 - Flags: review?(nfroyd)
Comment on attachment 8808827 [details] [diff] [review]
static_cast

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

Thanks for testing the C++ cast version!
Attachment #8808827 - Flags: review?(nfroyd) → review+
Pushed by dmajor@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/986861e6c5ce
Fix the clang-cl build in nsExceptionHandler.cpp. r=froydnj
https://hg.mozilla.org/mozilla-central/rev/986861e6c5ce
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.