If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

xpcom/tests/TestNsRefPtr.cpp(455): error C2666: 'operator !=': 3 overloads have similar conversions

RESOLVED FIXED in Firefox 43

Status

()

Core
XPCOM
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: xidorn, Assigned: xidorn)

Tracking

Trunk
mozilla43
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox43 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

Meet an error when compiling on VC14 today:
> xpcom/tests/TestNsRefPtr.cpp(455): error C2666: 'operator !=': 3 overloads have similar conversions
> obj-firefox\dist\include\mozilla/nsRefPtr.h(576): note: could be 'bool operator !=<Foo>(const nsRefPtr<Foo> &,detail::nsRefPtrZero *)'
> xpcom/tests/TestNsRefPtr.cpp(455): note: while trying to match the argument list '(nsRefPtr<Foo>, int)'
> xpcom/tests/TestNsRefPtr.cpp(457): error C2666: 'operator !=': 3 overloads have similar conversions
> obj-firefox\dist\include\mozilla/nsRefPtr.h(584): note: could be 'bool operator !=<Foo>(detail::nsRefPtrZero *,const nsRefPtr<Foo> &)'
> xpcom/tests/TestNsRefPtr.cpp(457): note: while trying to match the argument list '(int, nsRefPtr<Foo>)'
> xpcom/tests/TestNsRefPtr.cpp(459): error C2666: 'operator ==': 3 overloads have similar conversions
> obj-firefox\dist\include\mozilla/nsRefPtr.h(560): note: could be 'bool operator ==<Foo>(const nsRefPtr<Foo> &,detail::nsRefPtrZero *)'
> xpcom/tests/TestNsRefPtr.cpp(459): note: while trying to match the argument list '(nsRefPtr<Foo>, int)'
> xpcom/tests/TestNsRefPtr.cpp(461): error C2666: 'operator ==': 3 overloads have similar conversions
> obj-firefox\dist\include\mozilla/nsRefPtr.h(568): note: could be 'bool operator ==<Foo>(detail::nsRefPtrZero *,const nsRefPtr<Foo> &)'
> xpcom/tests/TestNsRefPtr.cpp(461): note: while trying to match the argument list '(int, nsRefPtr<Foo>)'
> xpcom/tests/TestNsRefPtr.cpp(504): error C2666: 'operator ==': 3 overloads have similar conversions
> obj-firefox\dist\include\mozilla/nsRefPtr.h(560): note: could be 'bool operator ==<Foo>(const nsRefPtr<Foo> &,detail::nsRefPtrZero *)'
> xpcom/tests/TestNsRefPtr.cpp(504): note: while trying to match the argument list '(nsRefPtr<Foo>, int)'

Not sure what's the best way to fix.
I'm not so certain the compiler is wrong here.. conversion to a random T* seems equally acceptable as a conversion to an nsRefPtr...
Only failing compiling on this test may indicate that we don't really use this kind of code elsewhere. Thus, I guess we can probably simply remove this test code as well as the overloads.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=221b9f682365
Created attachment 8649077 [details]
MozReview Request: Bug 1195154 - Replace operator overloads for comparing nsRefPtr to 0 with those for comparing to nullptr.

Bug 1195154 - Replace operator overloads for comparing nsRefPtr to 0 with those for comparing to nullptr.
Attachment #8649077 - Flags: review?(nfroyd)
Attachment #8649077 - Flags: review?(nfroyd) → review+
Comment on attachment 8649077 [details]
MozReview Request: Bug 1195154 - Replace operator overloads for comparing nsRefPtr to 0 with those for comparing to nullptr.

https://reviewboard.mozilla.org/r/16351/#review14715

Nice, thanks for doing this.  Can you file a followup for the same treatment of the overloads for nsCOMPtr/nsAutoPtr/nsAutoArrayPtr/nsHtml5RefPtr, please?
url:        https://hg.mozilla.org/integration/mozilla-inbound/rev/20c6f74296e23869759dbfd8cbad8456be59fbae
changeset:  20c6f74296e23869759dbfd8cbad8456be59fbae
user:       Xidorn Quan <quanxunzhen@gmail.com>
date:       Wed Aug 19 09:09:08 2015 +1000
description:
Bug 1195154 - Replace operator overloads for comparing nsRefPtr to 0 with those for comparing to nullptr. r=froydnj

Updated

2 years ago
Depends on: 1196115
https://hg.mozilla.org/mozilla-central/rev/20c6f74296e2
Assignee: nobody → quanxunzhen
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox43: affected → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla43

Comment 8

2 years ago
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/abdb239a6d4d
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Comment 9

2 years ago
nigelb: The backout does not appear to have helped with the regression in bug 1196115. I think we can reland this.

Updated

2 years ago
No longer depends on: 1196115
Relanded https://hg.mozilla.org/integration/mozilla-inbound/rev/823aa80c5ffa
https://hg.mozilla.org/mozilla-central/rev/823aa80c5ffa
Status: REOPENED → RESOLVED
Last Resolved: 2 years ago2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.