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)
Core
XPCOM
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.
Comment 1•9 years ago
|
||
I'm not so certain the compiler is wrong here.. conversion to a random T* seems equally acceptable as a conversion to an nsRefPtr...
Assignee | ||
Comment 2•9 years ago
|
||
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.
Assignee | ||
Comment 3•9 years ago
|
||
Assignee | ||
Comment 4•9 years ago
|
||
Bug 1195154 - Replace operator overloads for comparing nsRefPtr to 0 with those for comparing to nullptr.
Attachment #8649077 -
Flags: review?(nfroyd)
Updated•9 years ago
|
Attachment #8649077 -
Flags: review?(nfroyd) → review+
Comment 5•9 years ago
|
||
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?
Assignee | ||
Comment 6•9 years ago
|
||
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
Comment 7•9 years ago
|
||
Assignee: nobody → quanxunzhen
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Comment 8•9 years ago
|
||
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 9•9 years ago
|
||
nigelb: The backout does not appear to have helped with the regression in bug 1196115. I think we can reland this.
Status: REOPENED → RESOLVED
Closed: 9 years ago → 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•