cannot instanciate nsAutoRef<T>::swap()

RESOLVED FIXED in mozilla16

Status

()

Core
XPCOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: vicamo, Assigned: vicamo)

Tracking

unspecified
mozilla16
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

5 years ago
struct A {};

  template <>
  class nsAutoRefTraits<A>
    : public nsPointerRefTraits<A>
  {
  public:
    static void Release(A *ptr) {}
    static void AddRef(A *ptr) {}
  };

  nsCountedRef<A> a, b;
  a.swap(b);

Code above generates compile time error:

  ../../dist/include/nsAutoRef.h:189: error: no matching function for call to 'nsAutoRefBase<TestObjectA>::LocalSimpleRef::operator=(nsAutoRef<TestObjectA>* const)'
  ../../dist/include/nsAutoRef.h:491: note: candidates are: nsSimpleRef<TestObjectA>& nsSimpleRef<TestObjectA>::operator=(const nsSimpleRef<TestObjectA>&)
(Assignee)

Comment 1

5 years ago
Created attachment 639229 [details] [diff] [review]
v0
Assignee: nobody → vyang
Attachment #639229 - Flags: review?(khuey)
Comment on attachment 639229 [details] [diff] [review]
v0

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

The change to nsAutoRef.h is fine, but your test is not.  You need to use the passed/fail functions from http://mxr.mozilla.org/mozilla-central/source/xpcom/tests/TestHarness.h to get your test to work properly on our build machines.
Attachment #639229 - Flags: review?(khuey) → review-
(Assignee)

Comment 3

5 years ago
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #2)
> Comment on attachment 639229 [details] [diff] [review]
> v0
> 
> Review of attachment 639229 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> The change to nsAutoRef.h is fine, but your test is not.  You need to use
> the passed/fail functions from
> http://mxr.mozilla.org/mozilla-central/source/xpcom/tests/TestHarness.h to
> get your test to work properly on our build machines.

Thank you. I'll check what should I do then.

Comment 4

5 years ago
Try run for c1a427dbcd07 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=c1a427dbcd07
Results (out of 217 total builds):
    success: 196
    warnings: 16
    failure: 5
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/vyang@mozilla.com-c1a427dbcd07
(Assignee)

Comment 5

5 years ago
Created attachment 640175 [details] [diff] [review]
v1
Attachment #639229 - Attachment is obsolete: true
Attachment #640175 - Flags: review?(khuey)
Comment on attachment 640175 [details] [diff] [review]
v1

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

Please add a license header to TestAutoRef.cpp

r=me
Attachment #640175 - Flags: review?(khuey) → review+
(Assignee)

Comment 7

5 years ago
Created attachment 640245 [details] [diff] [review]
v2

Address review comment #6. Thanks, Kyle.
Attachment #640175 - Attachment is obsolete: true
Attachment #640245 - Flags: review+
(Assignee)

Comment 8

5 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/84623518d428
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/84623518d428
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.