Closed Bug 1195154 Opened 9 years ago Closed 9 years ago

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

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: xidorn, Assigned: xidorn)

References

Details

Attachments

(1 file)

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.
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
Depends on: 1196115
Assignee: nobody → quanxunzhen
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
nigelb: The backout does not appear to have helped with the regression in bug 1196115. I think we can reland this.
No longer depends on: 1196115
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: